diff options
| -rw-r--r-- | rtl/top/decode_test.sv | 17 | ||||
| -rw-r--r-- | rtl/top/fetch_test.sv | 6 | ||||
| -rw-r--r-- | tb/top/decode_test.cpp | 15 | ||||
| -rw-r--r-- | tb/top/fetch_test.cpp | 20 |
4 files changed, 23 insertions, 35 deletions
diff --git a/rtl/top/decode_test.sv b/rtl/top/decode_test.sv index 6aa2159..91962ea 100644 --- a/rtl/top/decode_test.sv +++ b/rtl/top/decode_test.sv @@ -4,22 +4,11 @@ module decode_test ( - input word insn, - input logic n, z, c, v, - - output datapath_decode ctrl, - output psr_decode psr_ctrl, - output branch_decode branch_ctrl, - output snd_decode snd_ctrl, - output data_decode data_ctrl, - output ldst_decode ldst_ctrl, - output mul_decode mul_ctrl, - output coproc_decode coproc_ctrl + input word insn, + output insn_decode dec ); - psr_flags flags; - assign flags = {n, z, c, v}; core_decode DUT (.*); -endmodule
\ No newline at end of file +endmodule diff --git a/rtl/top/fetch_test.sv b/rtl/top/fetch_test.sv index bdfa2c5..4ab5fd1 100644 --- a/rtl/top/fetch_test.sv +++ b/rtl/top/fetch_test.sv @@ -6,7 +6,7 @@ module fetch_test input logic clk, stall, branch, - flush, + prefetch_flush, fetched, wr_pc, input ptr branch_target, @@ -20,6 +20,6 @@ module fetch_test ); - core_fetch #(.PREFETCH_ORDER(3)) DUT (.*); + core_fetch #(.PREFETCH_ORDER(3)) DUT (.flush(), .*); -endmodule
\ No newline at end of file +endmodule diff --git a/tb/top/decode_test.cpp b/tb/top/decode_test.cpp index 09f973e..4b78535 100644 --- a/tb/top/decode_test.cpp +++ b/tb/top/decode_test.cpp @@ -77,11 +77,6 @@ int main(int argc, char** argv) { 0x20000000, }; - top.n = 0; - top.z = 0; - top.c = 0; - top.v = 0; - int clk_tick = 0; int time = 0; @@ -92,9 +87,13 @@ int main(int argc, char** argv) { top.eval(); trace.dump(time++); - std::printf("insn=0x%08x, ctrl=0x%08x\n", - rom[i], top.ctrl); - + std::printf("insn=0x%08x, dec=0x", top.insn); + for(std::size_t j = 0; j < sizeof(top.dec) / sizeof(top.dec[0]); ++j) + { + std::printf("%08x", top.dec[j]); + } + + std::puts(""); } trace.close(); diff --git a/tb/top/fetch_test.cpp b/tb/top/fetch_test.cpp index 65124ea..06768c4 100644 --- a/tb/top/fetch_test.cpp +++ b/tb/top/fetch_test.cpp @@ -16,14 +16,14 @@ int main(int argc, char** argv) { trace.open("fetch_test.vcd"); top.clk = 0; - top.stall = 0; //insn y insn_pc se detienen - top.branch = 0; //forma de flush -> instr saltan a la instr de la branch - top.flush = 0; //limpia prefetch - top.fetched = 1; //estado del fetch (ready) - top.wr_pc = 0; //cuando hay un write al pc - top.branch_target = 0; //direccion a la que se hace salto - top.wr_current = 0; //ultimo que se guardo en registros - top.fetch_data = 0x00000000; //data que se leyó al hacer fetch + top.stall = 0; //insn y insn_pc se detienen + top.branch = 0; //forma de flush -> instr saltan a la instr de la branch + top.prefetch_flush = 0; //limpia prefetch + top.fetched = 1; //estado del fetch (ready) + top.wr_pc = 0; //cuando hay un write al pc + top.branch_target = 0; //direccion a la que se hace salto + top.wr_current = 0; //ultimo que se guardo en registros + top.fetch_data = 0x00000000; //data que se leyó al hacer fetch uint32_t rom[] = { @@ -138,12 +138,12 @@ int main(int argc, char** argv) { std::printf("Se hace un flush:\n"); top.branch = 0; top.branch_target = 0; - top.flush = 1; + top.prefetch_flush = 1; } if(time == 69){ std::printf("Se termina el flush:\n"); - top.flush = 0; + top.prefetch_flush = 0; } if(time == 75) |
