summaryrefslogtreecommitdiff
path: root/tb
diff options
context:
space:
mode:
Diffstat (limited to 'tb')
-rw-r--r--tb/top/decode_test.cpp15
-rw-r--r--tb/top/fetch_test.cpp20
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)