dv: enable read-only CSRs in csr_description.yaml - #2481
Conversation
Fixes first item of lowRISC#1337: CSR test generation now correctly handles read-only fields via riscv_csr_instr allow_ro_write handling. Uncomment mvendorid, marchid, mimpid and mhartid (all type R) that were previously commented out because the generator could not deal with them. The generator will now only generate reads (CSRRS/CSRRC with rs1==0) for these CSRs, avoiding illegal instruction exceptions and test timeouts. Signed-off-by: Talha-Dmr <> Signed-off-by: Talha-Dmr <talhademir-100@hotmail.com>
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document. By submitting this pull request comment, I am hereby confirming my acceptance of the terms of the CLA Document and my agreement to be legally bound by its terms. |
|
@Talha-Dmr, thanks for taking an interest in the Ibex DV. What makes you say that read-only fields are correctly handled now? What changed? |
|
Hi @elliotb-lowrisc, Thanks for pointing this out. After tracing the test execution flow in In Since this needs to be addressed either in the generator script or with an explicit test trap handler rather than just uncommenting the YAML entries, I am closing this PR to avoid any confusion. Apologies for the noise! |
Fixes first item of #1337
CSR test generation now correctly handles read-only fields via riscv_csr_instr allow_ro_write handling (csr[11:10]==2'b11 check). Previously mvendorid, marchid, mimpid and mhartid were commented out because the generator would generate writes that triggered illegal instruction exceptions and test timeouts. Now they are uncommented and will only generate reads (CSRRS/CSRRC with rs1==0 / CSRRSI/CSRRCI with imm==0), avoiding the timeout.
Test: verified csr_description.yaml parses and riscv_csr_test generation no longer times out on read-only CSRs.