How do you test modules with IO input port of type Vec, Bundle, or composition of these?
In other words, using PeekPokeTester, how do you properly poke() a port that is of type Vec, Bundle, or more complex composition of these two types? Thanks!
The PeekPokeTester has poke methods for Bundle and Vec, but I don't think they have handling for nested versions.
From the ScalaDoc (all Chisel-related ScalaDoc can be found at https://www.chisel-lang.org/):
def poke(signal: Aggregate, value: IndexedSeq[BigInt]): Unit
def poke(signal: Bundle, map: Map[String, BigInt]): Unit
These accept types analogous to Bundle and Vec, but unfortunately it doesn't appear to be nested which isn't ideal.
You can always write special helper functions that just specify each individual field to poke, but it is not very general.
Better solution is to use the newer chisel unit test library ChiselTest. It has support for poking, peeking and expecting Bundle literals. Specifically check out the examples in ChiselTest unittest BundleLiteralsSpec.
VectorLiterals are still a work in progress in Chisel but they are easier than bundles to write more generic helper functions for.
.Lit() function working on my custom data type. Very strange and confusing.