Implement Verilator-compatible tracer, and use it

The ibex_tracer module implements an execution tracer, observing the
execution flow and writing a human-readable execution trace. The trace
information is coming from the RVFI signals, as specified at
https://github.com/SymbioticEDA/riscv-formal/blob/master/docs/rvfi.md.

The existing implementation was tailored for use in ModelSim and other
commercial simulators, and used SystemVerilog features which are not
supported in Verilator or Icarus Verilog, such as classes, queues and
non-standard format specifiers (e.g. the `-` specifier for right-aligned
output). Being unable to see an execution trace when using Verilator
significantly reduced productivity and its usefulness.

This commit refactors the tracer to only use SystemVerilog constructs
which are supported in Verilator. While doing so, multiple improvements
were made for correctness and style.

Major changes:

- Improve compatibility with Verilator. Remove many non-synthesizable
  SystemVerilog constructs, such as classes and queues.
  Use casez instead of casex for better Verilator support (Verilator
  doesn't support X).
- Make the decoded output of the tracer match objdump from binutils
  exactly. Doing so is beneficial for two reasons: we can easily
  cross-check the decoded output from the tracer against the disassembly
  produced by objdump (and we did that), and users don't need to get
  used to another slighly different disassembly format.
- A plusarg "+ibex_tracer_file_base=ibex_my_trace" can be used to set a
  different basename for the trace log file.

Smaller cleanups:

- Remove decoding of reg-reg loads, which were leftover from a PULP
  extension.
- Make better use of the data available on the RVFI. Pass all of RVFI
  to the tracer, and use the provided data instead of manually
  recreating it, e.g. to get register data or the jump target.
- Rename all "instr" abbreviations to "insn". "insn" is what RVFI uses
  (and we cannot change that), so for consistency we now always use this
  abbreviation across the file.

All CSR names have been imported from binutils' riscv-opc.h file, available at
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob_plain;f=include/opcode/riscv-opc.h
using this small C program:

  #include <stdio.h>

  #define STR(s) #s

  int main(int argc, char **argv) {
    printf("unique case (csr_addr)\n");
  #define DECLARE_CSR(name, csraddr) \
    printf("  12'd%d: return \"%s\";\n", csraddr, STR(name));
  #include "riscv-opc.h"
    printf("  default: return $sformatf(\"0x%%x\", csr_addr);\n");
    printf("endcase\n");
    return 0;
  }

The RISC-V compliance test suite for the RV32 I, M, and C extensions has
been executed and traced. The disassembly of all traces have been
compared against traces produced by objdump to ensure identical output.

This PR is based on work by Rahul Behl <raulbehl@gmail.com> in #280.
Thank you Rahul for providing a great starting point for this work!
This commit is contained in:
Philipp Wagner 2019-10-01 13:53:32 +01:00 committed by Philipp Wagner
parent e420688d1c
commit 74780e7e17
4 changed files with 883 additions and 627 deletions

View file

@ -5,7 +5,3 @@ Tracer
The module ``ibex_tracer`` can be used to create a log of the executed instructions.
It is used by ``ibex_core_tracing`` which forwards the signals added by :ref:`rvfi` as an input for the tracer.
.. note::
``ibex_tracer`` is not compatible with Verilator.

View file

@ -158,28 +158,33 @@ module ibex_core_tracing #(
.core_sleep_o
);
ibex_tracer
u_ibex_tracer (
.clk_i,
.rst_ni,
`ifndef VERILATOR
ibex_tracer u_ibex_tracer (
.clk_i ( clk_i ),
.rst_ni ( rst_ni ),
.hart_id_i,
.fetch_enable_i ( fetch_enable_i ),
.hart_id_i ( hart_id_i ),
.valid_i ( rvfi_valid ),
.pc_i ( rvfi_pc_rdata ),
.instr_i ( rvfi_insn ),
.rs1_value_i ( rvfi_rs1_rdata ),
.rs2_value_i ( rvfi_rs2_rdata ),
.ex_reg_addr_i ( rvfi_rd_addr ),
.ex_reg_wdata_i ( rvfi_rd_wdata ),
.ex_data_addr_i ( rvfi_mem_addr ),
.ex_data_wdata_i ( rvfi_mem_wdata ),
.ex_data_rdata_i ( rvfi_mem_rdata )
.rvfi_valid,
.rvfi_order,
.rvfi_insn,
.rvfi_trap,
.rvfi_halt,
.rvfi_intr,
.rvfi_mode,
.rvfi_rs1_addr,
.rvfi_rs2_addr,
.rvfi_rs1_rdata,
.rvfi_rs2_rdata,
.rvfi_rd_addr,
.rvfi_rd_wdata,
.rvfi_pc_rdata,
.rvfi_pc_wdata,
.rvfi_mem_addr,
.rvfi_mem_rmask,
.rvfi_mem_wmask,
.rvfi_mem_rdata,
.rvfi_mem_wdata
);
`else
// ibex_tracer uses language constructs which Verilator doesn't understand.
`endif
endmodule

File diff suppressed because it is too large Load diff

View file

@ -11,100 +11,104 @@ parameter logic [1:0] OPCODE_C1 = 2'b01;
parameter logic [1:0] OPCODE_C2 = 2'b10;
// instruction masks (for tracer)
parameter logic [31:0] INSTR_LUI = { 25'b?, {OPCODE_LUI } };
parameter logic [31:0] INSTR_AUIPC = { 25'b?, {OPCODE_AUIPC} };
parameter logic [31:0] INSTR_JAL = { 25'b?, {OPCODE_JAL } };
parameter logic [31:0] INSTR_JALR = { 17'b?, 3'b000, 5'b?, {OPCODE_JALR } };
parameter logic [31:0] INSN_LUI = { 25'b?, {OPCODE_LUI } };
parameter logic [31:0] INSN_AUIPC = { 25'b?, {OPCODE_AUIPC} };
parameter logic [31:0] INSN_JAL = { 25'b?, {OPCODE_JAL } };
parameter logic [31:0] INSN_JALR = { 17'b?, 3'b000, 5'b?, {OPCODE_JALR } };
// BRANCH
parameter logic [31:0] INSTR_BEQ = { 17'b?, 3'b000, 5'b?, {OPCODE_BRANCH} };
parameter logic [31:0] INSTR_BNE = { 17'b?, 3'b001, 5'b?, {OPCODE_BRANCH} };
parameter logic [31:0] INSTR_BLT = { 17'b?, 3'b100, 5'b?, {OPCODE_BRANCH} };
parameter logic [31:0] INSTR_BGE = { 17'b?, 3'b101, 5'b?, {OPCODE_BRANCH} };
parameter logic [31:0] INSTR_BLTU = { 17'b?, 3'b110, 5'b?, {OPCODE_BRANCH} };
parameter logic [31:0] INSTR_BGEU = { 17'b?, 3'b111, 5'b?, {OPCODE_BRANCH} };
parameter logic [31:0] INSTR_BALL = { 17'b?, 3'b010, 5'b?, {OPCODE_BRANCH} };
parameter logic [31:0] INSN_BEQ = { 17'b?, 3'b000, 5'b?, {OPCODE_BRANCH} };
parameter logic [31:0] INSN_BNE = { 17'b?, 3'b001, 5'b?, {OPCODE_BRANCH} };
parameter logic [31:0] INSN_BLT = { 17'b?, 3'b100, 5'b?, {OPCODE_BRANCH} };
parameter logic [31:0] INSN_BGE = { 17'b?, 3'b101, 5'b?, {OPCODE_BRANCH} };
parameter logic [31:0] INSN_BLTU = { 17'b?, 3'b110, 5'b?, {OPCODE_BRANCH} };
parameter logic [31:0] INSN_BGEU = { 17'b?, 3'b111, 5'b?, {OPCODE_BRANCH} };
parameter logic [31:0] INSN_BALL = { 17'b?, 3'b010, 5'b?, {OPCODE_BRANCH} };
// OPIMM
parameter logic [31:0] INSTR_ADDI = { 17'b?, 3'b000, 5'b?, {OPCODE_OP_IMM} };
parameter logic [31:0] INSTR_SLTI = { 17'b?, 3'b010, 5'b?, {OPCODE_OP_IMM} };
parameter logic [31:0] INSTR_SLTIU = { 17'b?, 3'b011, 5'b?, {OPCODE_OP_IMM} };
parameter logic [31:0] INSTR_XORI = { 17'b?, 3'b100, 5'b?, {OPCODE_OP_IMM} };
parameter logic [31:0] INSTR_ORI = { 17'b?, 3'b110, 5'b?, {OPCODE_OP_IMM} };
parameter logic [31:0] INSTR_ANDI = { 17'b?, 3'b111, 5'b?, {OPCODE_OP_IMM} };
parameter logic [31:0] INSTR_SLLI = { 7'b0000000, 10'b?, 3'b001, 5'b?, {OPCODE_OP_IMM} };
parameter logic [31:0] INSTR_SRLI = { 7'b0000000, 10'b?, 3'b101, 5'b?, {OPCODE_OP_IMM} };
parameter logic [31:0] INSTR_SRAI = { 7'b0100000, 10'b?, 3'b101, 5'b?, {OPCODE_OP_IMM} };
parameter logic [31:0] INSN_ADDI = { 17'b?, 3'b000, 5'b?, {OPCODE_OP_IMM} };
parameter logic [31:0] INSN_SLTI = { 17'b?, 3'b010, 5'b?, {OPCODE_OP_IMM} };
parameter logic [31:0] INSN_SLTIU = { 17'b?, 3'b011, 5'b?, {OPCODE_OP_IMM} };
parameter logic [31:0] INSN_XORI = { 17'b?, 3'b100, 5'b?, {OPCODE_OP_IMM} };
parameter logic [31:0] INSN_ORI = { 17'b?, 3'b110, 5'b?, {OPCODE_OP_IMM} };
parameter logic [31:0] INSN_ANDI = { 17'b?, 3'b111, 5'b?, {OPCODE_OP_IMM} };
parameter logic [31:0] INSN_SLLI = { 7'b0000000, 10'b?, 3'b001, 5'b?, {OPCODE_OP_IMM} };
parameter logic [31:0] INSN_SRLI = { 7'b0000000, 10'b?, 3'b101, 5'b?, {OPCODE_OP_IMM} };
parameter logic [31:0] INSN_SRAI = { 7'b0100000, 10'b?, 3'b101, 5'b?, {OPCODE_OP_IMM} };
// OP
parameter logic [31:0] INSTR_ADD = { 7'b0000000, 10'b?, 3'b000, 5'b?, {OPCODE_OP} };
parameter logic [31:0] INSTR_SUB = { 7'b0100000, 10'b?, 3'b000, 5'b?, {OPCODE_OP} };
parameter logic [31:0] INSTR_SLL = { 7'b0000000, 10'b?, 3'b001, 5'b?, {OPCODE_OP} };
parameter logic [31:0] INSTR_SLT = { 7'b0000000, 10'b?, 3'b010, 5'b?, {OPCODE_OP} };
parameter logic [31:0] INSTR_SLTU = { 7'b0000000, 10'b?, 3'b011, 5'b?, {OPCODE_OP} };
parameter logic [31:0] INSTR_XOR = { 7'b0000000, 10'b?, 3'b100, 5'b?, {OPCODE_OP} };
parameter logic [31:0] INSTR_SRL = { 7'b0000000, 10'b?, 3'b101, 5'b?, {OPCODE_OP} };
parameter logic [31:0] INSTR_SRA = { 7'b0100000, 10'b?, 3'b101, 5'b?, {OPCODE_OP} };
parameter logic [31:0] INSTR_OR = { 7'b0000000, 10'b?, 3'b110, 5'b?, {OPCODE_OP} };
parameter logic [31:0] INSTR_AND = { 7'b0000000, 10'b?, 3'b111, 5'b?, {OPCODE_OP} };
parameter logic [31:0] INSN_ADD = { 7'b0000000, 10'b?, 3'b000, 5'b?, {OPCODE_OP} };
parameter logic [31:0] INSN_SUB = { 7'b0100000, 10'b?, 3'b000, 5'b?, {OPCODE_OP} };
parameter logic [31:0] INSN_SLL = { 7'b0000000, 10'b?, 3'b001, 5'b?, {OPCODE_OP} };
parameter logic [31:0] INSN_SLT = { 7'b0000000, 10'b?, 3'b010, 5'b?, {OPCODE_OP} };
parameter logic [31:0] INSN_SLTU = { 7'b0000000, 10'b?, 3'b011, 5'b?, {OPCODE_OP} };
parameter logic [31:0] INSN_XOR = { 7'b0000000, 10'b?, 3'b100, 5'b?, {OPCODE_OP} };
parameter logic [31:0] INSN_SRL = { 7'b0000000, 10'b?, 3'b101, 5'b?, {OPCODE_OP} };
parameter logic [31:0] INSN_SRA = { 7'b0100000, 10'b?, 3'b101, 5'b?, {OPCODE_OP} };
parameter logic [31:0] INSN_OR = { 7'b0000000, 10'b?, 3'b110, 5'b?, {OPCODE_OP} };
parameter logic [31:0] INSN_AND = { 7'b0000000, 10'b?, 3'b111, 5'b?, {OPCODE_OP} };
// SYSTEM
parameter logic [31:0] INSTR_CSRRW = { 17'b?, 3'b001, 5'b?, {OPCODE_SYSTEM} };
parameter logic [31:0] INSTR_CSRRS = { 17'b?, 3'b010, 5'b?, {OPCODE_SYSTEM} };
parameter logic [31:0] INSTR_CSRRC = { 17'b?, 3'b011, 5'b?, {OPCODE_SYSTEM} };
parameter logic [31:0] INSTR_CSRRWI = { 17'b?, 3'b101, 5'b?, {OPCODE_SYSTEM} };
parameter logic [31:0] INSTR_CSRRSI = { 17'b?, 3'b110, 5'b?, {OPCODE_SYSTEM} };
parameter logic [31:0] INSTR_CSRRCI = { 17'b?, 3'b111, 5'b?, {OPCODE_SYSTEM} };
parameter logic [31:0] INSTR_ECALL = { 12'b000000000000, 13'b0, {OPCODE_SYSTEM} };
parameter logic [31:0] INSTR_EBREAK = { 12'b000000000001, 13'b0, {OPCODE_SYSTEM} };
parameter logic [31:0] INSTR_MRET = { 12'b001100000010, 13'b0, {OPCODE_SYSTEM} };
parameter logic [31:0] INSTR_DRET = { 12'b011110110010, 13'b0, {OPCODE_SYSTEM} };
parameter logic [31:0] INSTR_WFI = { 12'b000100000101, 13'b0, {OPCODE_SYSTEM} };
parameter logic [31:0] INSN_CSRRW = { 17'b?, 3'b001, 5'b?, {OPCODE_SYSTEM} };
parameter logic [31:0] INSN_CSRRS = { 17'b?, 3'b010, 5'b?, {OPCODE_SYSTEM} };
parameter logic [31:0] INSN_CSRRC = { 17'b?, 3'b011, 5'b?, {OPCODE_SYSTEM} };
parameter logic [31:0] INSN_CSRRWI = { 17'b?, 3'b101, 5'b?, {OPCODE_SYSTEM} };
parameter logic [31:0] INSN_CSRRSI = { 17'b?, 3'b110, 5'b?, {OPCODE_SYSTEM} };
parameter logic [31:0] INSN_CSRRCI = { 17'b?, 3'b111, 5'b?, {OPCODE_SYSTEM} };
parameter logic [31:0] INSN_ECALL = { 12'b000000000000, 13'b0, {OPCODE_SYSTEM} };
parameter logic [31:0] INSN_EBREAK = { 12'b000000000001, 13'b0, {OPCODE_SYSTEM} };
parameter logic [31:0] INSN_MRET = { 12'b001100000010, 13'b0, {OPCODE_SYSTEM} };
parameter logic [31:0] INSN_DRET = { 12'b011110110010, 13'b0, {OPCODE_SYSTEM} };
parameter logic [31:0] INSN_WFI = { 12'b000100000101, 13'b0, {OPCODE_SYSTEM} };
// RV32M
parameter logic [31:0] INSTR_DIV = { 7'b0000001, 10'b?, 3'b100, 5'b?, {OPCODE_OP} };
parameter logic [31:0] INSTR_DIVU = { 7'b0000001, 10'b?, 3'b101, 5'b?, {OPCODE_OP} };
parameter logic [31:0] INSTR_REM = { 7'b0000001, 10'b?, 3'b110, 5'b?, {OPCODE_OP} };
parameter logic [31:0] INSTR_REMU = { 7'b0000001, 10'b?, 3'b111, 5'b?, {OPCODE_OP} };
parameter logic [31:0] INSTR_PMUL = { 7'b0000001, 10'b?, 3'b000, 5'b?, {OPCODE_OP} };
parameter logic [31:0] INSTR_PMUH = { 7'b0000001, 10'b?, 3'b001, 5'b?, {OPCODE_OP} };
parameter logic [31:0] INSTR_PMULHSU = { 7'b0000001, 10'b?, 3'b010, 5'b?, {OPCODE_OP} };
parameter logic [31:0] INSTR_PMULHU = { 7'b0000001, 10'b?, 3'b011, 5'b?, {OPCODE_OP} };
parameter logic [31:0] INSN_DIV = { 7'b0000001, 10'b?, 3'b100, 5'b?, {OPCODE_OP} };
parameter logic [31:0] INSN_DIVU = { 7'b0000001, 10'b?, 3'b101, 5'b?, {OPCODE_OP} };
parameter logic [31:0] INSN_REM = { 7'b0000001, 10'b?, 3'b110, 5'b?, {OPCODE_OP} };
parameter logic [31:0] INSN_REMU = { 7'b0000001, 10'b?, 3'b111, 5'b?, {OPCODE_OP} };
parameter logic [31:0] INSN_PMUL = { 7'b0000001, 10'b?, 3'b000, 5'b?, {OPCODE_OP} };
parameter logic [31:0] INSN_PMUH = { 7'b0000001, 10'b?, 3'b001, 5'b?, {OPCODE_OP} };
parameter logic [31:0] INSN_PMULHSU = { 7'b0000001, 10'b?, 3'b010, 5'b?, {OPCODE_OP} };
parameter logic [31:0] INSN_PMULHU = { 7'b0000001, 10'b?, 3'b011, 5'b?, {OPCODE_OP} };
// LOAD & STORE
parameter logic [31:0] INSTR_LOAD = {25'b?, {OPCODE_LOAD } };
parameter logic [31:0] INSTR_STORE = {25'b?, {OPCODE_STORE} };
parameter logic [31:0] INSN_LOAD = {25'b?, {OPCODE_LOAD } };
parameter logic [31:0] INSN_STORE = {25'b?, {OPCODE_STORE} };
// MISC-MEM
parameter logic [31:0] INSTR_FENCE = { 17'b?, 3'b000, 5'b?, {OPCODE_MISC_MEM} };
parameter logic [31:0] INSN_FENCE = { 17'b?, 3'b000, 5'b?, {OPCODE_MISC_MEM} };
parameter logic [31:0] INSN_FENCEI = { 17'b0, 3'b001, 5'b0, {OPCODE_MISC_MEM} };
// Compressed Instructions
// C0
parameter logic [15:0] INSTR_CADDI4SPN = { 3'b000, 11'b?, {OPCODE_C0} };
parameter logic [15:0] INSTR_CLW = { 3'b010, 11'b?, {OPCODE_C0} };
parameter logic [15:0] INSTR_CSW = { 3'b110, 11'b?, {OPCODE_C0} };
parameter logic [15:0] INSN_CADDI4SPN = { 3'b000, 11'b?, {OPCODE_C0} };
parameter logic [15:0] INSN_CLW = { 3'b010, 11'b?, {OPCODE_C0} };
parameter logic [15:0] INSN_CSW = { 3'b110, 11'b?, {OPCODE_C0} };
// C1
parameter logic [15:0] INSTR_CADDI = { 3'b000, 11'b?, {OPCODE_C1} };
parameter logic [15:0] INSTR_CJAL = { 3'b001, 11'b?, {OPCODE_C1} };
parameter logic [15:0] INSTR_CJ = { 3'b101, 11'b?, {OPCODE_C1} };
parameter logic [15:0] INSTR_CLI = { 3'b010, 11'b?, {OPCODE_C1} };
parameter logic [15:0] INSTR_CLUI = { 3'b011, 11'b?, {OPCODE_C1} };
parameter logic [15:0] INSTR_CBEQZ = { 3'b110, 11'b?, {OPCODE_C1} };
parameter logic [15:0] INSTR_CBNEZ = { 3'b111, 11'b?, {OPCODE_C1} };
parameter logic [15:0] INSTR_CSRLI = { 3'b100, 1'b?, 2'b00, 8'b?, {OPCODE_C1} };
parameter logic [15:0] INSTR_CSRAI = { 3'b100, 1'b?, 2'b01, 8'b?, {OPCODE_C1} };
parameter logic [15:0] INSTR_CANDI = { 3'b100, 1'b?, 2'b10, 8'b?, {OPCODE_C1} };
parameter logic [15:0] INSTR_CSUB = { 3'b100, 1'b0, 2'b11, 3'b?, 2'b00, 3'b?, {OPCODE_C1} };
parameter logic [15:0] INSTR_CXOR = { 3'b100, 1'b0, 2'b11, 3'b?, 2'b01, 3'b?, {OPCODE_C1} };
parameter logic [15:0] INSTR_COR = { 3'b100, 1'b0, 2'b11, 3'b?, 2'b10, 3'b?, {OPCODE_C1} };
parameter logic [15:0] INSTR_CAND = { 3'b100, 1'b0, 2'b11, 3'b?, 2'b11, 3'b?, {OPCODE_C1} };
parameter logic [15:0] INSN_CADDI = { 3'b000, 11'b?, {OPCODE_C1} };
parameter logic [15:0] INSN_CJAL = { 3'b001, 11'b?, {OPCODE_C1} };
parameter logic [15:0] INSN_CJ = { 3'b101, 11'b?, {OPCODE_C1} };
parameter logic [15:0] INSN_CLI = { 3'b010, 11'b?, {OPCODE_C1} };
parameter logic [15:0] INSN_CLUI = { 3'b011, 11'b?, {OPCODE_C1} };
parameter logic [15:0] INSN_CBEQZ = { 3'b110, 11'b?, {OPCODE_C1} };
parameter logic [15:0] INSN_CBNEZ = { 3'b111, 11'b?, {OPCODE_C1} };
parameter logic [15:0] INSN_CSRLI = { 3'b100, 1'b?, 2'b00, 8'b?, {OPCODE_C1} };
parameter logic [15:0] INSN_CSRAI = { 3'b100, 1'b?, 2'b01, 8'b?, {OPCODE_C1} };
parameter logic [15:0] INSN_CANDI = { 3'b100, 1'b?, 2'b10, 8'b?, {OPCODE_C1} };
parameter logic [15:0] INSN_CSUB = { 3'b100, 1'b0, 2'b11, 3'b?, 2'b00, 3'b?, {OPCODE_C1} };
parameter logic [15:0] INSN_CXOR = { 3'b100, 1'b0, 2'b11, 3'b?, 2'b01, 3'b?, {OPCODE_C1} };
parameter logic [15:0] INSN_COR = { 3'b100, 1'b0, 2'b11, 3'b?, 2'b10, 3'b?, {OPCODE_C1} };
parameter logic [15:0] INSN_CAND = { 3'b100, 1'b0, 2'b11, 3'b?, 2'b11, 3'b?, {OPCODE_C1} };
// C2
parameter logic [15:0] INSTR_CSLLI = { 3'b000, 11'b?, {OPCODE_C2} };
parameter logic [15:0] INSTR_CLWSP = { 3'b010, 11'b?, {OPCODE_C2} };
parameter logic [15:0] INSTR_SWSP = { 3'b110, 11'b?, {OPCODE_C2} };
parameter logic [15:0] INSTR_CMV = { 3'b100, 1'b0, 10'b?, {OPCODE_C2} };
parameter logic [15:0] INSTR_CADD = { 3'b100, 1'b1, 10'b?, {OPCODE_C2} };
parameter logic [15:0] INSTR_CEBREAK = { 3'b100, 1'b1, 5'b0, 5'b0, {OPCODE_C2} };
parameter logic [15:0] INSTR_CJR = { 3'b100, 1'b0, 5'b?, 5'b0, {OPCODE_C2} };
parameter logic [15:0] INSTR_CJALR = { 3'b100, 1'b1, 5'b?, 5'b0, {OPCODE_C2} };
parameter logic [15:0] INSN_CSLLI = { 3'b000, 11'b?, {OPCODE_C2} };
parameter logic [15:0] INSN_CLWSP = { 3'b010, 11'b?, {OPCODE_C2} };
parameter logic [15:0] INSN_SWSP = { 3'b110, 11'b?, {OPCODE_C2} };
parameter logic [15:0] INSN_CMV = { 3'b100, 1'b0, 10'b?, {OPCODE_C2} };
parameter logic [15:0] INSN_CADD = { 3'b100, 1'b1, 10'b?, {OPCODE_C2} };
parameter logic [15:0] INSN_CEBREAK = { 3'b100, 1'b1, 5'b0, 5'b0, {OPCODE_C2} };
parameter logic [15:0] INSN_CJR = { 3'b100, 1'b0, 5'b?, 5'b0, {OPCODE_C2} };
parameter logic [15:0] INSN_CJALR = { 3'b100, 1'b1, 5'b?, 5'b0, {OPCODE_C2} };
endpackage