When developing components (Modules) that are a part of a RoCC accelerator, I want to add unit tests to verify the behavior/functionality of the module.
However, a module that requires implicit Parameters that are provided by a Config is giving me trouble. A backtrace is provided below.
should Test description *** FAILED ***
[info] java.lang.IllegalArgumentException: requirement failed: Key TileKey is not defined in Parameters
[info] at ... ()
[info] at chipsalliance.rocketchip.config$View.apply(Config.scala:28)
[info] at chipsalliance.rocketchip.config$View.apply(Config.scala:25)
[info] at freechips.rocketchip.tile.HasNonDiplomaticTileParameters.tileParams(BaseTile.scala:45)
[info] at freechips.rocketchip.tile.HasNonDiplomaticTileParameters.tileParams$(BaseTile.scala:45)
[info] at freechips.rocketchip.tile.CoreBundle.tileParams(Core.scala:133)
[info] at freechips.rocketchip.tile.HasCoreParameters.$init$(Core.scala:70)
[info] at freechips.rocketchip.tile.CoreBundle.<init>(Core.scala:133)
[info] at freechips.rocketchip.tile.RoCCCommand.<init>(LazyRoCC.scala:29)
[info] at vcoderocc.ControlUnit$$anon$1$$anon$2.$anonfun$cmd$2(Ctrl.scala:12)
I can even add a new class that extends Config and it is not recognized.
class TileKeyTestConfig extends Config((site, here, up) => {
case freechips.rocketchip.tile.TileKey => null
})
class VCodeTestConfig extends Config(
new vcoderocc.WithVCodeAccel ++
new TileKeyTestConfig ++
new freechips.rocketchip.subsystem.With1TinyCore() ++
new freechips.rocketchip.system.DefaultConfig)
What am I missing to get Parameters working to actually test the component?