class ChiselTopTester(c: ChiselTop) extends PeekPokeTester(c) { }
Adding a wrapper class around the LazyModule instance solves the problem.
class ChiselTopTest extends ChiselFlatSpec { class ChiselTopTester(c: ChiselTopWrapper) extends PeekPokeTester(c) { println("Hello World!") } // hint from: https://github.com/ucb-bar/rocket-chip/issues/359 class ChiselTopWrapper(p: Parameters) extends Module { val top = Module(LazyModule(new ChiselTop()(p)).module) val io = top.io.cloneType io <> top.io } implicit val p: Parameters = new BlankConfig chisel3.iotesters.Driver(() => new ChiselTopWrapper(p)) { c => new ChiselTopTester(c) } }
In other news, my Scala skills are improving...
No comments:
Post a Comment