Skip to content

Commit

Permalink
Fix reserved value in MPP (#2035)
Browse files Browse the repository at this point in the history
  • Loading branch information
Moschn committed Apr 12, 2024
1 parent 5df5a5c commit 0a160c9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions core/csr_regfile.sv
Original file line number Diff line number Diff line change
Expand Up @@ -1050,6 +1050,12 @@ module csr_regfile
if (!CVA6Cfg.RVV) begin
mstatus_d.vs = riscv::Off;
end
// If h-extension is not enabled, priv level HS is reserved
if (!CVA6Cfg.RVH) begin
if (mstatus_d.mpp == riscv::PRIV_LVL_HS) begin
mstatus_d.mpp = riscv::PRIV_LVL_U;
end
end
// this instruction has side-effects
flush_o = 1'b1;
end else begin
Expand Down Expand Up @@ -1243,6 +1249,12 @@ module csr_regfile
if (!CVA6Cfg.RVV) begin
mstatus_d.vs = riscv::Off;
end
// If h-extension is not enabled, priv level HS is reserved
if (!CVA6Cfg.RVH) begin
if (mstatus_d.mpp == riscv::PRIV_LVL_HS) begin
mstatus_d.mpp = riscv::PRIV_LVL_U;
end
end
mstatus_d.wpri3 = 9'b0;
mstatus_d.wpri1 = 1'b0;
mstatus_d.wpri2 = 1'b0;
Expand Down

0 comments on commit 0a160c9

Please sign in to comment.