summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2022-10-31 14:15:30 -0600
committerAlejandro Soto <alejandro@34project.org>2022-10-31 14:39:28 -0600
commite794cecaa4779ed884589a67f6cba3cd712e4b14 (patch)
tree01adf7e66ccd865c862397ff5836540815c93d7d
parentb03f8211d13519ce0c2b53572be1b65cbb39056c (diff)
Display undefined instruction messages in simulation
-rw-r--r--rtl/core/control/control.sv9
1 files changed, 9 insertions, 0 deletions
diff --git a/rtl/core/control/control.sv b/rtl/core/control/control.sv
index 059cb2d..c1ac5a1 100644
--- a/rtl/core/control/control.sv
+++ b/rtl/core/control/control.sv
@@ -19,6 +19,10 @@ module core_control
mem_ready,
input word mem_data_rd,
+`ifdef VERILATOR
+ input word insn,
+`endif
+
output logic stall,
branch,
writeback,
@@ -154,6 +158,11 @@ module core_control
writeback <= final_writeback;
undefined <= dec.undefined;
+`ifdef VERILATOR
+ if(dec.undefined)
+ $display("[core] undefined insn: [0x%08x] %08x", fetch_insn_pc << 2, insn);
+`endif
+
rd <= final_rd;
pc <= fetch_insn_pc;
pc_visible <= next_pc_visible;