Skip to content

Commit

Permalink
Merge pull request openhwgroup#2068 from silabs-inhaahje/disassembler…
Browse files Browse the repository at this point in the history
…_updates

Both rd and rs1 get value of rd_rs1 in build_asm
  • Loading branch information
silabs-hfegran authored Jul 21, 2023
2 parents d28dd1d + 90d91c3 commit a32459e
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 39 deletions.
18 changes: 15 additions & 3 deletions lib/support/isa_support.sv
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,6 @@
FUNCT3_REMU = 3'b111
} m_minor_opcode_e;


typedef enum logic [4:0] {
FUNCT5_C_ZEXTB = 5'b11000,
FUNCT5_C_SEXTB = 5'b11001,
Expand Down Expand Up @@ -1271,7 +1270,6 @@

if(check_if_hint(name, format, instr)) begin
asm.is_hint = 1;
return asm;
end

casex (format)
Expand Down Expand Up @@ -1407,9 +1405,11 @@
asm.imm.valid = 0;
end else if (name inside { C_MV }) begin
asm.rd.gpr = instr.compressed.format.cr.rd_rs1.gpr;
asm.rs1.gpr = instr.compressed.format.cr.rd_rs1.gpr;
asm.rs2.gpr = instr.compressed.format.cr.rs2.gpr;
asm.rd.valid = 1;
asm.rs2.valid = 1;
asm.rs1.valid = 1;
end else if (name inside { C_ADD }) begin
asm.rd.gpr = instr.compressed.format.cr.rd_rs1.gpr;
asm.rs1.gpr = instr.compressed.format.cr.rd_rs1.gpr;
Expand All @@ -1425,7 +1425,19 @@
end
end
CI_TYPE: begin
if (name inside { C_LI, C_NOP, C_ADDI }) begin
if (name inside { C_NOP, C_ADDI }) begin
asm.rd.gpr = instr.compressed.format.ci.rd_rs1.gpr;
asm.rs1.gpr = instr.compressed.format.ci.rd_rs1.gpr;
asm.imm.imm_raw = { instr.compressed.format.ci.imm_12, instr.compressed.format.ci.imm_6_2 };
asm.imm.imm_raw_sorted = { instr.compressed.format.ci.imm_12, instr.compressed.format.ci.imm_6_2 };
asm.imm.imm_type = IMM;
asm.imm.width = 6;
asm.imm.sign_ext = 1;
asm.imm.imm_value = get_imm_value_ci({ instr.compressed.format.ci.imm_12, instr.compressed.format.ci.imm_6_2 });
asm.rd.valid = 1;
asm.rs1.valid = 1;
asm.imm.valid = 1;
end else if (name == C_LI) begin
asm.rd.gpr = instr.compressed.format.ci.rd_rs1.gpr;
asm.imm.imm_raw = { instr.compressed.format.ci.imm_12, instr.compressed.format.ci.imm_6_2 };
asm.imm.imm_raw_sorted = { instr.compressed.format.ci.imm_12, instr.compressed.format.ci.imm_6_2 };
Expand Down
72 changes: 36 additions & 36 deletions lib/uvm_agents/uvma_rvfi/uvma_rvfi_instr_if.sv
Original file line number Diff line number Diff line change
Expand Up @@ -296,42 +296,42 @@ interface uvma_rvfi_instr_if_t

// assigning signal aliases to helper functions
always_comb begin
instr_asm <= decode_instr(rvfi_insn);

is_dret <= is_dret_f();
is_mret <= is_mret_f();
is_uret <= is_uret_f();
is_wfi <= is_wfi_f();
is_wfe <= is_wfe_f();
is_ebreak <= is_ebreak_f();
is_ebreak_compr <= is_ebreak_compr_f();
is_ebreak_noncompr <= is_ebreak_noncompr_f();
is_ecall <= is_ecall_f();
is_branch <= is_branch_f();
is_div <= is_div_f();
is_rem <= is_rem_f();
is_cslli <= is_cslli_f();
is_nmi <= is_nmi_f();
is_compressed <= is_compressed_f();
is_dbg_trg <= is_dbg_trg_f();
is_mmode <= is_mmode_f();
is_not_mmode <= is_not_mmode_f();
is_umode <= is_umode_f();
is_not_umode <= is_not_umode_f();
is_pma_instr_fault <= is_pma_instr_fault_f();
is_instr_bus_valid <= is_instr_bus_valid_f();
is_pushpop <= is_pushpop_f();
is_split_datatrans_actual <= is_split_datatrans_actual_f();
is_split_datatrans_intended <= is_split_datatrans_intended_f();
is_mem_act <= is_mem_act_f();
is_tablejump_raw <= is_tablejump_raw_f();
is_pma_fault <= is_pma_fault_f();
is_fencefencei <= is_fencefencei_f();
rvfi_mem_addr_word0highbyte <= rvfi_mem_addr_word0highbyte_f();
rvfi_mem_rmask_intended <= rvfi_mem_rmask_intended_f();
rvfi_mem_wmask_intended <= rvfi_mem_wmask_intended_f();
is_deprioritized_load_acc_fault <= is_deprioritized_exception_f({21'd 0, EXC_CAUSE_LOAD_ACC_FAULT});
is_deprioritized_store_acc_fault <= is_deprioritized_exception_f({21'd 0, EXC_CAUSE_STORE_ACC_FAULT});
instr_asm = decode_instr(rvfi_insn);

is_dret = is_dret_f();
is_mret = is_mret_f();
is_uret = is_uret_f();
is_wfi = is_wfi_f();
is_wfe = is_wfe_f();
is_ebreak = is_ebreak_f();
is_ebreak_compr = is_ebreak_compr_f();
is_ebreak_noncompr = is_ebreak_noncompr_f();
is_ecall = is_ecall_f();
is_branch = is_branch_f();
is_div = is_div_f();
is_rem = is_rem_f();
is_cslli = is_cslli_f();
is_nmi = is_nmi_f();
is_compressed = is_compressed_f();
is_dbg_trg = is_dbg_trg_f();
is_mmode = is_mmode_f();
is_not_mmode = is_not_mmode_f();
is_umode = is_umode_f();
is_not_umode = is_not_umode_f();
is_pma_instr_fault = is_pma_instr_fault_f();
is_instr_bus_valid = is_instr_bus_valid_f();
is_pushpop = is_pushpop_f();
is_split_datatrans_actual = is_split_datatrans_actual_f();
is_split_datatrans_intended = is_split_datatrans_intended_f();
is_mem_act = is_mem_act_f();
is_tablejump_raw = is_tablejump_raw_f();
is_pma_fault = is_pma_fault_f();
is_fencefencei = is_fencefencei_f();
rvfi_mem_addr_word0highbyte = rvfi_mem_addr_word0highbyte_f();
rvfi_mem_rmask_intended = rvfi_mem_rmask_intended_f();
rvfi_mem_wmask_intended = rvfi_mem_wmask_intended_f();
is_deprioritized_load_acc_fault = is_deprioritized_exception_f({21'd 0, EXC_CAUSE_LOAD_ACC_FAULT});
is_deprioritized_store_acc_fault = is_deprioritized_exception_f({21'd 0, EXC_CAUSE_STORE_ACC_FAULT});
end

always_comb begin
Expand Down

0 comments on commit a32459e

Please sign in to comment.