Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to avoid multiple design elaborations in Chisel testers

Tags:

chisel

In Chisel iotesters, we pass a factory that creates a Chisel design to the tester, e.g. () => new DUT, as follows:

"Test" should "simulate" in {
  chisel3.iotesters.Driver.execute(arguments, () => new DUT) { c => new MyPeekPokeTester(c) }  should be (true)
}

If I have many tests and a large design, there's design elaboration that happens for every test resulting in a long runtime. Since for many tests, it is possibly exact same design being passed, a logical question comes up - is there a way to reuse the elaborated design (DUT.fir or DUT.v depending on the backend) in multiple tests? Given a reset is called in the beginning of every test, it shouldn't incur functional issues.

like image 262
aayupov Avatar asked Dec 29 '25 23:12

aayupov


1 Answers

I'd suggest building a PeekPokeTester that aggregates a number of testers. Something like

class MyMegaPeekPokeTester(c: MyDut) extends PeekPokeTester(c) {
  new MyPeekPokeTester1(c) &&
  new MyPeekPokeTester2(c) &&
  ...
  new MyPeekPokeTesterN(c)
}

There's various ways you could sugar this up (putting the classes into a list, calling reset between them programmatically, etc).

There's an effort to refactor and modernize the testers and this issue is under consideration. One complication is that PeekPokeTesters require access to the instance of the dut in order to provide type safe access to the IO. It is difficult to serialize or otherwise preserve this information.

like image 128
Chick Markley Avatar answered Jan 04 '26 13:01

Chick Markley



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!