lowRISC / opentitan

OpenTitan: Open source silicon root of trust
https://www.opentitan.org
Apache License 2.0
2.52k stars 752 forks source link

[dv] csr exclusion enhancement #13121

Open cindychip opened 2 years ago

cindychip commented 2 years ago

Recently we have fixed a few issues to due putting csr write exclusion to a field. Here are two solutions: 1). Return an error once we found a write exclusion is applied to the field. 2). Support csr write field exclusion - since there is no partial write, supporting this feature can be tricky. I was thinking to just write default/reset value when this field is excluded from write, but it might have some side effect.

Please let me know what you think.

jdonjdon commented 2 years ago

I think for option2, unless we implement 'partial write', it will be like patch over patch based on any exception we discover.

matutem commented 1 year ago

Any opinions on how to deal with this for M3? We may need to write unit tests that mimic csr_rw for CSRs with excluded fields. Perhaps this can be discussed in the DV meeting.

weicaiyang commented 1 year ago

Option 2 is more flexible. With option 2, we could define the usage as follows

  1. if the field shouldn't be written at lot, need to add a write exclusion at the CSR rather than the field.
  2. if a write exclusion is applied to a field, CSR tests could still write the default value to that field when testing the other fields in the same CSR.