Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cv32e40s/dev -> master #2257

Open
wants to merge 1,617 commits into
base: master
Choose a base branch
from

Conversation

silabs-hfegran
Copy link
Contributor

No description provided.

silabs-hfegran and others added 30 commits June 29, 2023 13:25
Signed-off-by: Henrik Fegran <[email protected]>
…mtvt_fields

fixed struct mtvt_t to work with small id widths
…sion_script_noiss_fix

Updated regression scripts to fix issues with --iss 0
…_b_abs_cfg

Removed b_ext_abs cfg from b-ext test in full regression
use hash=709bec4 instead of main in clonetb
Signed-off-by: Kristine Dosvik <[email protected]>
Signed-off-by: Ingrid Haahjem <[email protected]>
…_updates

Added Zc* instructions to disassembler
silabs-robin and others added 17 commits October 18, 2023 16:59
Signed-off-by: Robin Pedersen <[email protected]>
Signed-off-by: Robin Pedersen <[email protected]>
…coder_fix

Added compressed csr-representation to isa decoder
… to fix ISS coverage issue

Signed-off-by: Henrik Fegran <[email protected]>
…flag

Added flag to prevent xcelium from searching for cds.lib/hdl.var
…st_updates

Updated wfe test to work correctly without user-mode/PMP, added flags…
@MikeOpenHWGroup
Copy link
Member

Thanks for opennng this PR @silabs-hfegran. At this point, the merge conflicts don't look too bad:

$ git merge silabs-hfegran/cv32e40s/dev
Auto-merging bin/ci_check
Auto-merging cv32e40p/sim/ExternalRepos.mk
CONFLICT (modify/delete): cva6/tb/uvmt/uvmt_cva6_dut_wrap.sv deleted in HEAD and modified in silabs-hfegran/cv32e40s/dev.  Version silabs-hfegran/cv32e40s/dev of cva6/tb/uvmt/uvmt_cva6_dut_wrap.sv left in tree.
CONFLICT (modify/delete): cva6/tb/uvmt/uvmt_cva6_tb.sv deleted in HEAD and modified in silabs-hfegran/cv32e40s/dev.  Version silabs-hfegran/cv32e40s/dev of cva6/tb/uvmt/uvmt_cva6_tb.sv left in tree.
Auto-merging lib/uvm_agents/uvma_isacov/uvma_isacov_mon.sv
CONFLICT (content): Merge conflict in lib/uvm_agents/uvma_isacov/uvma_isacov_mon.sv
Auto-merging lib/uvm_agents/uvma_obi_memory/src/comps/uvma_obi_memory_cov_model.sv
Auto-merging lib/uvm_agents/uvma_rvfi/uvma_rvfi_instr_mon.sv
Auto-merging mk/Common.mk
Automatic merge failed; fix conflicts and then commit the result.

So, "only" three conflicts. I'll take a look and report back.

@silabs-hfegran
Copy link
Contributor Author

silabs-hfegran commented Oct 23, 2023

Thanks for opennng this PR @silabs-hfegran. At this point, the merge conflicts don't look too bad:

$ git merge silabs-hfegran/cv32e40s/dev
Auto-merging bin/ci_check
Auto-merging cv32e40p/sim/ExternalRepos.mk
CONFLICT (modify/delete): cva6/tb/uvmt/uvmt_cva6_dut_wrap.sv deleted in HEAD and modified in silabs-hfegran/cv32e40s/dev.  Version silabs-hfegran/cv32e40s/dev of cva6/tb/uvmt/uvmt_cva6_dut_wrap.sv left in tree.
CONFLICT (modify/delete): cva6/tb/uvmt/uvmt_cva6_tb.sv deleted in HEAD and modified in silabs-hfegran/cv32e40s/dev.  Version silabs-hfegran/cv32e40s/dev of cva6/tb/uvmt/uvmt_cva6_tb.sv left in tree.
Auto-merging lib/uvm_agents/uvma_isacov/uvma_isacov_mon.sv
CONFLICT (content): Merge conflict in lib/uvm_agents/uvma_isacov/uvma_isacov_mon.sv
Auto-merging lib/uvm_agents/uvma_obi_memory/src/comps/uvma_obi_memory_cov_model.sv
Auto-merging lib/uvm_agents/uvma_rvfi/uvma_rvfi_instr_mon.sv
Auto-merging mk/Common.mk
Automatic merge failed; fix conflicts and then commit the result.

So, "only" three conflicts. I'll take a look and report back.

Two deleted files, and one actual conflict - shouldn't be too hard to fix, but my first attempt failed to run hello-world.

Signed-off-by: Henrik Fegran <[email protected]>
@silabs-hfegran
Copy link
Contributor Author

Merge conflicts should be OK now, runs hello world, but I will need some time to run a larger regression

@MikeOpenHWGroup
Copy link
Member

Update on the three conflicts. The first two are easy: the cva6 directory has been deleted from CORE-V-VERIF, so cva6/tb/uvmt/uvmt_cva6_dut_wrap.sv and cva6/tb/uvmt/uvmt_cva6_tb.sv can safely be deleted here.

The last one, lib/uvm_agents/uvma_isacov/uvma_isacov_mon.sv is more challenging. Below is a snipit of the conflict. I believe we want to deleted the HEAD section (everything between <<<<<<< HEAD and =======) and keep silabs-hfegran/cv32e40s/dev (everything from ======= and >>>>>>> silabs-hfegran/cv32e40s/dev).

Comments?

<<<<<<< HEAD
  // Disassemble the instruction using Spike (via DPI)
  if (mon_trn.instr.ext == C_EXT) begin
    mon_trn.instr.rs1     = dasm_rvc_rs1(instr);
    mon_trn.instr.rs2     = dasm_rvc_rs2(instr);
    mon_trn.instr.rd      = dasm_rvc_rd(instr);
    mon_trn.instr.c_rdrs1 = dasm_rvc_rd(instr);
    mon_trn.instr.c_rd    = mon_trn.instr.decode_rd_c(instr);
    mon_trn.instr.c_rs1   = mon_trn.instr.decode_rs1_c(instr);
    mon_trn.instr.c_rs2   = mon_trn.instr.decode_rs2_c(instr);
  end
  else begin
    mon_trn.instr.rs1  = dasm_rs1(instr);
    mon_trn.instr.rs2  = dasm_rs2(instr);
    mon_trn.instr.rd   = dasm_rd(instr);
    mon_trn.instr.immi = dasm_i_imm(instr);
    mon_trn.instr.imms = dasm_s_imm(instr);
    mon_trn.instr.immb = dasm_sb_imm(instr) >> 1;  // Because dasm gives [12:0], not [12: 1]
    mon_trn.instr.immu = dasm_u_imm(instr) >> 12;  // Because dasm gives [31:0], not [31:12]
    mon_trn.instr.immj = dasm_uj_imm(instr) >> 1;  // Because dasm gives [20:0], not [20: 1]
=======
    //Disassemble the instruction using Spike (via DPI)
    if (mon_trn.instr.ext == C_EXT) begin
      mon_trn.instr.rs1     = dasm_rvc_rs1(instr);
      mon_trn.instr.rs2     = dasm_rvc_rs2(instr);
      mon_trn.instr.rd      = dasm_rvc_rd(instr);
      mon_trn.instr.c_rdrs1 = dasm_rvc_rd(instr);
      mon_trn.instr.c_rdp   = dasm_rvc_rs1s(instr);
      mon_trn.instr.c_rs1s  = dasm_rvc_rs1s(instr);
      mon_trn.instr.c_rs2s  = dasm_rvc_rs2s(instr);
    end
    else begin
      mon_trn.instr.rs1  = dasm_rs1(instr);
      mon_trn.instr.rs2  = dasm_rs2(instr);
      mon_trn.instr.rd   = dasm_rd(instr);
      mon_trn.instr.immi = dasm_i_imm(instr);
      mon_trn.instr.imms = dasm_s_imm(instr);
      mon_trn.instr.immb = dasm_sb_imm(instr) >> 1;  // Because dasm gives [12:0], not [12: 1]
      mon_trn.instr.immu = dasm_u_imm(instr) >> 12;  // Because dasm gives [31:0], not [31:12]
      mon_trn.instr.immj = dasm_uj_imm(instr) >> 1;  // Because dasm gives [20:0], not [20: 1]
    end

    // Make instructions as illegal,
    // 1. If a CSR instruction is not targeted to a valid CSR
    if (mon_trn.instr.group == CSR_GROUP) begin
      mon_trn.instr.csr_val = dasm_csr(instr);
      if (!$cast(mon_trn.instr.csr, mon_trn.instr.csr_val) ||
           cfg.core_cfg.unsupported_csr_mask[mon_trn.instr.csr_val]) begin
        mon_trn.instr.illegal = 1;
      end
    end

  end else if (cfg.decoder == ISA_SUPPORT) begin
    // Attempt to decode instruction with isa_support

    // TODO: silabs-hefegran, isa decoder representation changed for compressed 'rx registers,
    // we supply the old (non-translated) value to avoid having to rewrite that logic now, which
    // might also interfere with the spike implementation.
    // the "get_rx"-functions should no longer be needed if we supply the translated values to
    // the coverage model.
    mon_trn.instr.c_rdrs1 = instr_asm.rd.valid_gpr_rvc  ? instr_asm.rd.gpr_rvc  : instr_asm.rd.gpr;
    mon_trn.instr.c_rdp   = instr_asm.rd.valid_gpr_rvc  ? instr_asm.rd.gpr_rvc  : instr_asm.rd.gpr;
    mon_trn.instr.c_rs1s  = instr_asm.rs1.valid_gpr_rvc ? instr_asm.rs1.gpr_rvc : instr_asm.rs1.gpr;
    mon_trn.instr.c_rs2s  = instr_asm.rs2.valid_gpr_rvc ? instr_asm.rs2.gpr_rvc : instr_asm.rs2.gpr;
    mon_trn.instr.rs1     = instr_asm.rs1.valid_gpr_rvc ? instr_asm.rs1.gpr_rvc : instr_asm.rs1.gpr;
    mon_trn.instr.rs2     = instr_asm.rs2.valid_gpr_rvc ? instr_asm.rs2.gpr_rvc : instr_asm.rs1.gpr;
    mon_trn.instr.rd      = instr_asm.rd.valid_gpr_rvc  ? instr_asm.rd.gpr_rvc  : instr_asm.rd.gpr;
    mon_trn.instr.immi    = instr_asm.imm.imm_raw_sorted;
    mon_trn.instr.imms    = instr_asm.imm.imm_raw_sorted;
    mon_trn.instr.immb    = instr_asm.imm.imm_raw_sorted;
    mon_trn.instr.immu    = instr_asm.imm.imm_raw_sorted;
    mon_trn.instr.immj    = instr_asm.imm.imm_raw_sorted;

    // Make instructions as illegal,
    // 1. If a CSR instruction is not targeted to a valid CSR
    if (mon_trn.instr.group == CSR_GROUP) begin
      mon_trn.instr.csr_val = instr_asm.csr.address;
      if (!$cast(mon_trn.instr.csr, mon_trn.instr.csr_val) ||
           cfg.core_cfg.unsupported_csr_mask[mon_trn.instr.csr_val]) begin
        mon_trn.instr.illegal = 1;
      end
    end
>>>>>>> silabs-hfegran/cv32e40s/dev
  end

@silabs-hfegran
Copy link
Contributor Author

Update on the three conflicts. The first two are easy: the cva6 directory has been deleted from CORE-V-VERIF, so cva6/tb/uvmt/uvmt_cva6_dut_wrap.sv and cva6/tb/uvmt/uvmt_cva6_tb.sv can safely be deleted here.

The last one, lib/uvm_agents/uvma_isacov/uvma_isacov_mon.sv is more challenging. Below is a snipit of the conflict. I believe we want to deleted the HEAD section (everything between <<<<<<< HEAD and =======) and keep silabs-hfegran/cv32e40s/dev (everything from ======= and >>>>>>> silabs-hfegran/cv32e40s/dev).

Comments?

Close, there are some changes from HEAD that needs to be included, for example this part:

    mon_trn.instr.c_rd    = mon_trn.instr.decode_rd_c(instr);
    mon_trn.instr.c_rs1   = mon_trn.instr.decode_rs1_c(instr);
    mon_trn.instr.c_rs2   = mon_trn.instr.decode_rs2_c(instr);

There are also a couple of naming changes where rdp, rs1s and rs2s are renamed to rd, rs1 and rs2 respectively. c.f. my latest fix. I ran this through full regressions overnight and it appears to give me more or less same results as for the 40s/dev branch, additionally isacov coverage looks as expected. I will go ahead and convert this to a proper PR as it looks good from our point of view.

@silabs-hfegran
Copy link
Contributor Author

@MikeOpenHWGroup: Are we waiting for someone/something before merging this?

@MikeOpenHWGroup
Copy link
Member

@MikeOpenHWGroup: Are we waiting for someone/something before merging this?

I had the same question this morning. :-) I'm running a few tests and will approve (or not) based on their outcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants