Skip to content

dv: enable read-only CSRs in csr_description.yaml - #2481

Open
Talha-Dmr wants to merge 1 commit into
lowRISC:masterfrom
Talha-Dmr:fix/csr-readonly-fields
Open

dv: enable read-only CSRs in csr_description.yaml#2481
Talha-Dmr wants to merge 1 commit into
lowRISC:masterfrom
Talha-Dmr:fix/csr-readonly-fields

Conversation

@Talha-Dmr

Copy link
Copy Markdown

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.

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>
@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@Talha-Dmr
Talha-Dmr marked this pull request as ready for review August 27, 2026 19:51
@Talha-Dmr

Copy link
Copy Markdown
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant