chiseltest
chiseltest copied to clipboard
Testing single compilation units
One long-standing issue with the workflow with chisel-testers was that we always re-ran the chisel generator. Ideally, you'd be able to re-run all your unit tests on your top level design. We had some workarounds for this (e.g. saving the peeks/expects and generating a verilog testbench that checked the original behavior was precisely reproduced), but they weren't great.
I think the fundamental issue is that we want to be able to introspect on the module. Is there a good way to retain scala objects used to produce a circuit so it can be reused after a compilation run?
Some use cases:
- You have a unit test that you want to run post-synthesis
- You have a unit that interacts with the outside world in some way (e.g. BoringUtils) that doesn't work without building the larger system. You want to test that unit but you need to build the whole system
- You have a unit that firrtl does things to when you insert it into the larger system, e.g. DCE or constprop. You want to test it in the form it appears when you tape it out (or get information that your test is poking something that firrtl has made constant or peeking something that was removed.