Skip to content

Commit

Permalink
Fix MIE CSR described in #2004 and #2008 Github issue (#2017)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanRochCoulon committed Apr 8, 2024
1 parent 90d780e commit f4ec364
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .gitlab-ci/expected_synth.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cv32a6_embedded:
gates: 110738
gates: 110095
cv32a65x:
gates: 110129
gates: 109555
22 changes: 15 additions & 7 deletions core/csr_regfile.sv
Original file line number Diff line number Diff line change
Expand Up @@ -1306,12 +1306,18 @@ module csr_regfile
| CVA6Cfg.XLEN'(riscv::MIP_MTIP)
| CVA6Cfg.XLEN'(riscv::MIP_MEIP);
end else begin
mask = CVA6Cfg.XLEN'(riscv::MIP_SSIP)
| CVA6Cfg.XLEN'(riscv::MIP_STIP)
| CVA6Cfg.XLEN'(riscv::MIP_SEIP)
| CVA6Cfg.XLEN'(riscv::MIP_MSIP)
| CVA6Cfg.XLEN'(riscv::MIP_MTIP)
| CVA6Cfg.XLEN'(riscv::MIP_MEIP);
if (CVA6Cfg.RVS) begin
mask = CVA6Cfg.XLEN'(riscv::MIP_SSIP)
| CVA6Cfg.XLEN'(riscv::MIP_STIP)
| CVA6Cfg.XLEN'(riscv::MIP_SEIP)
| CVA6Cfg.XLEN'(riscv::MIP_MSIP)
| CVA6Cfg.XLEN'(riscv::MIP_MTIP)
| CVA6Cfg.XLEN'(riscv::MIP_MEIP);
end else begin
mask = CVA6Cfg.XLEN'(riscv::MIP_MSIP)
| CVA6Cfg.XLEN'(riscv::MIP_MTIP)
| CVA6Cfg.XLEN'(riscv::MIP_MEIP);
end
end
mie_d = (mie_q & ~mask) | (csr_wdata & mask); // we only support supervisor and M-mode interrupts
end
Expand Down Expand Up @@ -1346,10 +1352,12 @@ module csr_regfile
| CVA6Cfg.XLEN'(riscv::MIP_STIP)
| CVA6Cfg.XLEN'(riscv::MIP_SEIP)
| CVA6Cfg.XLEN'(riscv::MIP_VSSIP);
end else begin
end else if (CVA6Cfg.RVS) begin
mask = CVA6Cfg.XLEN'(riscv::MIP_SSIP)
| CVA6Cfg.XLEN'(riscv::MIP_STIP)
| CVA6Cfg.XLEN'(riscv::MIP_SEIP);
end else begin
mask = '0;
end
mip_d = (mip_q & ~mask) | (csr_wdata & mask);
end
Expand Down

0 comments on commit f4ec364

Please sign in to comment.