Clear LSB of immediate for BRANCH and JAL ops True for BRANCH and JAL False for JALR/LOAD/STORE/OP/OPIMM?
co_cond_branch
wire
Conditional branch True for BRANCH False for JAL/JALR
co_ctrl_utype
wire
co_ctrl_jal_or_jalr
wire
co_ctrl_pc_rel
wire
PC-relative operations True for jal, b* auipc False for jalr, lui
co_rd_op
wire
Write to RD True for OP-IMM, AUIPC, OP, LUI, SYSTEM, JALR, JAL, LOAD False for STORE, BRANCH, MISC-MEM
co_sh_right
wire
funct3
co_bne_or_bge
wire
csr_op
wire
Matches system ops except eceall/ebreak/mret
co_ebreak
wire
op20
co_ctrl_mret
wire
opcode & funct3 & op21
co_e_op
wire
Matches system opcodes except CSR accesses (funct3 == 0) and mret (!op21)
co_bufreg_sh_signed
wire
opcode & funct3 & imm30
co_alu_sub
wire
True for sub, b, slt False for add* op opcode f3 i30 b* 11000 xxx x t addi 00100 000 x f slt* 0x100 01x x t add 01100 000 0 f sub 01100 000 1 t */
csr_valid
wire
Bits 26, 22, 21 and 20 are enough to uniquely identify the eight supported CSR regs mtvec, mscratch, mepc and mtval are stored externally (normally in the RF) and are treated differently from mstatus, mie and mcause which are stored in serv_csr. The former get a 2-bit address as seen below while the latter get a one-hot enable signal each. Hex
co_rd_csr_en
wire
co_csr_en
wire
co_csr_mstatus_en
wire
co_csr_mie_en
wire
co_csr_mcause_en
wire
co_csr_source
wire [1:0]
co_csr_d_sel
wire
co_csr_imm_en
wire
co_csr_addr
wire [1:0]
co_alu_cmp_eq
wire
co_alu_cmp_sig
wire
co_mem_cmd
wire
co_mem_signed
wire
co_mem_half
wire
co_alu_bool_op
wire [1:0]
co_immdec_ctrl
wire [3:0]
co_immdec_en
wire [3:0]
co_alu_rd_sel
wire [2:0]
B S
co_op_b_source
wire
Bool 0 (OP_B_SOURCE_IMM) when OPIMM 1 (OP_B_SOURCE_RS2) when BRANCH or OP