[enhancement] Allow (opt-in?) access to state element values for testing/DV purposes
- Dominant language
- C++
- Stars
- 1.9k
- Forks
- 283
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 135
Description
### What's hard to do? (limit 100 words)
For DV/testing it is often useful to either directly examine the current state of a proc (ie what its state elements currently hold) or to force a proc into a particularly interesting state (by writing specific values into the state elements). Both optimization and block conversion make this quite difficult to do at all and almost impossible to do in a principled way resilient to design changes.
### Current best alternative workaround (limit 100 words)
One can manually add in get/set channels around the read and write of state elements and tie them off when not needed.
### Your view of the "best case XLS enhancement" (limit 100 words)
A dslx (or ir_convert) annotation that marks a particular state element or proc as wanting to expose the state to external users that inserts the appropriate code to make the set/get accessible.
EG:
`#[testing_readable]` or `#[testing_read_write]`
Ideally it will do this in a way with no/minimal optimization penalty. Ideally we could have something like if a set is to an unreachable state an assert is triggered. Alternatively we could just create this feature with the understanding that it will drastically inhibit optimization around the state elements.
How exactly one interacts with and requests the value of or an update to these backdoors will require design work.
Contributor guide
Assessment
This issue has not been assessed yet.