From 5709daaef3b9eadd993dd9878cc552b1659d2350 Mon Sep 17 00:00:00 2001 From: Alejandro Cabrera Aldaya Date: Mon, 27 Nov 2023 10:25:22 +0200 Subject: [PATCH] [csr/scounteren] fix privilege violation logic (#1650) --- core/csr_regfile.sv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/csr_regfile.sv b/core/csr_regfile.sv index 0e4358ad52..881559e67f 100644 --- a/core/csr_regfile.sv +++ b/core/csr_regfile.sv @@ -1351,7 +1351,7 @@ module csr_regfile end else if (priv_lvl_o == riscv::PRIV_LVL_S && CVA6Cfg.RVS) begin privilege_violation = ~mcounteren_q[csr_addr_i[4:0]]; end else if (priv_lvl_o == riscv::PRIV_LVL_U && CVA6Cfg.RVU) begin - privilege_violation = ~mcounteren_q[csr_addr_i[4:0]] & ~scounteren_q[csr_addr_i[4:0]]; + privilege_violation = ~mcounteren_q[csr_addr_i[4:0]] | ~scounteren_q[csr_addr_i[4:0]]; end end end