I have a multicore rocket-chip system. However I'd like one of those rocket tiles to be asynchronous from the rest.
We're trying to do that with the following:
class WithTilesCrossing extends Config((site, here, up) => {
case RocketCrossingKey => site(RocketTilesKey).head.hartId match {
case 2 => up(RocketCrossingKey) map { r =>
r.copy(crossingType = AsynchronousCrossing(),
master = TileMasterPortParams())}
case _ => up(RocketCrossingKey) map { r =>
r.copy(crossingType = SynchronousCrossing(BufferParams(1)),
master = TileMasterPortParams())}
}
})
So that is the hart with hartId = 2
should be async, the rest should be synchronous.
The above, when added to our config, doesn't appear to do anything.
However, if I use the WithAsynchronousRocketTiles
from src/main/scala/subsystem/Config.scala
then I get all of the tiles converted to async.
So, how would I do just a single tile?
Update based on Jack's suggestion:
Trying that code straight up gave:
[error] Config.scala:189:16: not found: value crossingType
[error] r.copy(crossingType = AsynchronousCrossing(),
[error] ^
[error] Config.scala:190:11: not found: value master
[error] master = TileMasterPortParams())
[error] ^
[error] Config.scala:192:16: not found: value crossingType
[error] r.copy(crossingType = SynchronousCrossing(BufferParams(1)),
[error] ^
[error] Config.scala:193:11: not found: value master
[error] master = TileMasterPortParams())
[error] ^
[error] four errors found
Which is surprising. So I thought I might need to do the up()
thing and tried this:
case RocketCrossingKey => site(RocketTilesKey).map { r =>
r.hartId match {
case 2 => up(RocketCrossingKey) map { k => k.copy(crossingType = AsynchronousCrossing(), master = TileMasterPortParams()) }
case _ => up(RocketCrossingKey) map { k => k.copy(crossingType = SynchronousCrossing(BufferParams(1)), master = TileMasterPortParams()) }
}
}
However that results in an elab error:
[error] Caused by: java.lang.ClassCastException: scala.collection.immutable.$colon$colon cannot be cast to freechips.rocketchip.subsystem.RocketCrossingParams
[error] at freechips.rocketchip.subsystem.HasRocketTiles.$anonfun$rocketTiles$1(RocketSubsystem.scala:41)
[error] at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:234)
[error] at scala.collection.immutable.List.foreach(List.scala:389)
[error] at scala.collection.TraversableLike.map(TraversableLike.scala:234)
[error] at scala.collection.TraversableLike.map$(TraversableLike.scala:227)
[error] at scala.collection.immutable.List.map(List.scala:295)
[error] at freechips.rocketchip.subsystem.HasRocketTiles.$init$(RocketSubsystem.scala:41)
[error] at freechips.rocketchip.subsystem.RocketSubsystem.<init>(RocketSubsystem.scala:70)
So still stuck on how to modify this original RocketCrossingParams
on a per-tile basis and return it.