core-v-verif icon indicating copy to clipboard operation
core-v-verif copied to clipboard

Update CSR-access test

Open silabs-hfegran opened this issue 2 years ago • 2 comments

cv32e40s_csr_template.yaml was updated in #1328, this issue serves as a remainder to generate a new test-section for the csr_access_test. (Test is automatically generated with some minor hand-modified sections)

silabs-hfegran avatar Jul 07 '22 06:07 silabs-hfegran

csr_access_test script (from riscv-dv) does not support our interpretation of WARL - all bits in WARL-defined register fields are assumed fully RW by the test generator.

One example: write: 0x5a5a_5a5a to mstatus, reads back: 0x0020_0080, while test generator expects 0x0020_1880 to be read back due to the WARL definition.

silabs-hfegran avatar Jul 11 '22 12:07 silabs-hfegran

Yes, WARL is a software concept that makes sense for ABI users, but not for RTL developers and verifiers. I had though that declaring fields RW (not WARL) would resolve this issue. If this is not the case, we should consider modifying/extending the test generator to fix the problem.

MikeOpenHWGroup avatar Jul 11 '22 16:07 MikeOpenHWGroup

This is resolved

silabs-hfegran avatar Jan 11 '24 13:01 silabs-hfegran

Hi @silabs-hfegran, how was this issue resolved? Was a modification of the CSR test-generator required? If so, can you point to the associated PR? Thanks.

MikeOpenHWGroup avatar Jan 11 '24 17:01 MikeOpenHWGroup

https://github.com/silabs-hfegran/riscv-dv/commit/0b707d80452d2f7dcf68012645fc4ae6bbae2f1c (This is also present on upstream riscv-dv), there is a "legalize-warl"-functionality added to the script, that enables one to define the warl-behavior of a register with python in the yaml definition file.

silabs-hfegran avatar Jan 12 '24 10:01 silabs-hfegran