1
0
mirror of https://github.com/olofk/serv.git synced 2026-03-10 12:18:08 +00:00

Avoid matching misa CSR as mstatus

Reads from the (unimplemented) misa register matched mstatus which
in turn caused garbage data to be written to other CSRs. Make the
matching mask slightly stricter to avoid this particular issue.
This commit is contained in:
Olof Kindgren
2024-08-22 22:14:04 +02:00
parent 1fc6e7da9b
commit 40d34d204a

View File

@@ -188,7 +188,7 @@ module serv_decode
wire co_rd_csr_en = csr_op;
wire co_csr_en = csr_op & csr_valid;
wire co_csr_mstatus_en = csr_op & !op26 & !op22;
wire co_csr_mstatus_en = csr_op & !op26 & !op22 & !op20;
wire co_csr_mie_en = csr_op & !op26 & op22 & !op20;
wire co_csr_mcause_en = csr_op & op21 & !op20;