Update csr_regfile.sv to fix #2373 (#2374)

This commit is contained in:
Somya Dashora 2024-07-25 13:24:13 +05:30 committed by GitHub
parent 3deb95af21
commit 1e48237a7a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2247,7 +2247,7 @@ module csr_regfile
// precedence over interrupts
if (csr_op_i inside {CSR_WRITE, CSR_SET, CSR_CLEAR, CSR_READ}) begin
if (access_priv < csr_addr.csr_decode.priv_lvl) begin
if (v_q && csr_addr.csr_decode.priv_lvl == riscv::PRIV_LVL_HS)
if (v_q && csr_addr.csr_decode.priv_lvl <= riscv::PRIV_LVL_HS)
virtual_privilege_violation = 1'b1;
else privilege_violation = 1'b1;
end