1
0
rocket-chip/src/main/scala/groundtest/Coreplex.scala

29 lines
972 B
Scala
Raw Normal View History

package groundtest
import Chisel._
import cde.Parameters
import diplomacy._
2016-09-22 01:54:35 +02:00
import coreplex._
import uncore.devices.NTiles
import rocket.TileId
import uncore.tilelink.TLId
2016-10-28 00:34:37 +02:00
class GroundTestCoreplex(implicit p: Parameters) extends BaseCoreplex
with BroadcastL2
2016-10-28 00:34:37 +02:00
with DirectConnection {
val tiles = (0 until p(NTiles)).map { i =>
LazyModule(new GroundTestTile()(p.alterPartial({
case TLId => "L1toL2"
case TileId => i
})))
}
override lazy val module = new GroundTestCoreplexModule(this, () => new GroundTestCoreplexBundle(this))
2016-09-22 01:54:35 +02:00
}
class GroundTestCoreplexBundle[+L <: GroundTestCoreplex](_outer: L) extends BaseCoreplexBundle(_outer)
2016-09-22 01:54:35 +02:00
class GroundTestCoreplexModule[+L <: GroundTestCoreplex, +B <: GroundTestCoreplexBundle[L]](_outer: L, _io: () => B) extends BaseCoreplexModule(_outer, _io)
2016-10-28 00:34:37 +02:00
with DirectConnectionModule {
io.success := outer.tiles.flatMap(_.module.io.elements get "success").map(_.asInstanceOf[Bool]).reduce(_&&_)
}