Search code examples
chiseldigital-logic

How to test modules with bundle/vec input?


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!


Solution

  • 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.