diff options
author | Wojciech Kosior <kwojtus@protonmail.com> | 2020-10-06 18:48:26 +0200 |
---|---|---|
committer | Wojciech Kosior <kwojtus@protonmail.com> | 2020-10-06 18:48:26 +0200 |
commit | f0cd9e4e8bc1e1b109fff627c75527ee7195c82e (patch) | |
tree | 19864a48e0f92746271f1af0213c5452923beb81 | |
parent | 797b5825d2179e3bab22643a6873dc29800e79eb (diff) | |
download | AGH-engineering-thesis-f0cd9e4e8bc1e1b109fff627c75527ee7195c82e.tar.gz AGH-engineering-thesis-f0cd9e4e8bc1e1b109fff627c75527ee7195c82e.zip |
add some debugging facility inside the cpu
-rw-r--r-- | design/stack_machine.v | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/design/stack_machine.v b/design/stack_machine.v index 687168a..e6030e4 100644 --- a/design/stack_machine.v +++ b/design/stack_machine.v @@ -655,6 +655,42 @@ module stack_machine_new r1 <= r0; `SET_PC(r1); end + + if (first_execution_tick) begin + `DBG(("r0: %x r1: %x", r0, r1)); + `DBG(("CPU: Executing %0s instruction", + store ? "store (kind?)" : + load ? "load (kind?)" : + instr_halt ? "halt" : + instr_nop ? "nop" : + instr_swap ? "swap" : + instr_set_sp ? "set_sp" : + instr_jump ? "jump" : + instr_add_sp ? "add_sp" : + instr_tee ? "tee" : + instr_get_frame ? "get_frame" : + instr_const ? "const" : + instr_call ? "call" : + instr_add ? "add" : + instr_sub ? "sub" : + instr_udiv ? "udiv" : + instr_mul ? "mul" : + instr_drop ? "drop" : + instr_eq ? "eq" : + instr_lt ? "lt" : + instr_ult ? "ult" : + instr_le ? "le" : + instr_ule ? "ule" : + instr_gt ? "gt" : + instr_ugt ? "ugt" : + instr_ge ? "ge" : + instr_uge ? "uge" : + instr_ret ? "ret" : + instr_cond_jump ? "cond_jump" : + instr_cond_jump_n ? "cond_jump_n" : + set_im ? "im" : + "unknown")); + end // if (first_execution_tick) end // case: STEP_EXECUTING endcase // case (step) end // else: !if(RST_I) |