diff options
| author | Alejandro Soto <alejandro@34project.org> | 2022-11-09 00:10:50 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2022-11-09 00:10:50 -0600 |
| commit | 9965c5ef7abfbafebeb1afaed6d20cd0f38e0200 (patch) | |
| tree | 8e8668fafde7cc27a3a3ff7f9be97a5deeb9c6fc /tb/top | |
| parent | 1ea0519a2b6b81e0ba324cd69f8785735e7cbef5 (diff) | |
Update fetch, decode testbenches
Diffstat (limited to '')
| -rw-r--r-- | tb/top/decode_test.cpp | 15 | ||||
| -rw-r--r-- | tb/top/fetch_test.cpp | 20 |
2 files changed, 17 insertions, 18 deletions
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) |
