From 67425b0f19e8d5a073cb68e8a2e85f37c57500db Mon Sep 17 00:00:00 2001 From: Sven Stucki Date: Mon, 24 Aug 2015 03:06:11 +0200 Subject: [PATCH] Fix LUI/AUIPC output of tracer --- riscv_core.sv | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/riscv_core.sv b/riscv_core.sv index f2a56ae0..f2411a6a 100644 --- a/riscv_core.sv +++ b/riscv_core.sv @@ -820,8 +820,8 @@ module riscv_core // Regular opcodes `INSTR_CUSTOM0: printMnemonic("CUSTOM0"); `INSTR_CUSTOM1: printMnemonic("CUSTOM1"); - `INSTR_LUI: printIInstr("LUI"); - `INSTR_AUIPC: printIInstr("AUIPC"); + `INSTR_LUI: printUInstr("LUI"); + `INSTR_AUIPC: printUInstr("AUIPC"); `INSTR_JAL: printUJInstr("JAL"); `INSTR_JALR: printIInstr("JALR"); // BRANCH @@ -915,6 +915,14 @@ module riscv_core end endfunction // printMnemonic + function void printUInstr(input string mnemonic); + begin + riscv_core.mnemonic = mnemonic; + imm = id_stage_i.imm_u_type; + $fdisplay(f, "%s\tx%0d, 0x%h (imm)", mnemonic, rd, imm); + end + endfunction // printUInstr + function void printRInstr(input string mnemonic); begin riscv_core.mnemonic = mnemonic;