chiseltest icon indicating copy to clipboard operation
chiseltest copied to clipboard

Testing single compilation units

Open grebe opened this issue 5 years ago • 1 comments

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?

grebe avatar Apr 19 '19 20:04 grebe

Some use cases:

  1. You have a unit test that you want to run post-synthesis
  2. 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
  3. 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.

grebe avatar Apr 19 '19 21:04 grebe