2016-09-15 22:04:01 +02:00
|
|
|
package groundtest
|
|
|
|
|
|
|
|
import Chisel._
|
2016-11-11 22:07:45 +01:00
|
|
|
import cde.Parameters
|
|
|
|
import diplomacy._
|
2016-09-22 01:54:35 +02:00
|
|
|
import coreplex._
|
2016-11-11 22:07:45 +01:00
|
|
|
import uncore.devices.NTiles
|
|
|
|
import rocket.TileId
|
|
|
|
import uncore.tilelink.TLId
|
2016-09-15 22:04:01 +02:00
|
|
|
|
2016-10-28 00:34:37 +02:00
|
|
|
class GroundTestCoreplex(implicit p: Parameters) extends BaseCoreplex
|
2016-11-04 05:31:26 +01:00
|
|
|
with BroadcastL2
|
2016-10-28 00:34:37 +02:00
|
|
|
with DirectConnection {
|
2016-11-11 22:07:45 +01:00
|
|
|
val tiles = (0 until p(NTiles)).map { i =>
|
|
|
|
LazyModule(new GroundTestTile()(p.alterPartial({
|
|
|
|
case TLId => "L1toL2"
|
|
|
|
case TileId => i
|
|
|
|
})))
|
|
|
|
}
|
2016-10-29 12:30:49 +02:00
|
|
|
override lazy val module = new GroundTestCoreplexModule(this, () => new GroundTestCoreplexBundle(this))
|
2016-09-22 01:54:35 +02:00
|
|
|
}
|
|
|
|
|
2016-10-29 12:30:49 +02:00
|
|
|
class GroundTestCoreplexBundle[+L <: GroundTestCoreplex](_outer: L) extends BaseCoreplexBundle(_outer)
|
2016-09-22 01:54:35 +02:00
|
|
|
|
2016-10-29 12:30:49 +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 {
|
2016-11-11 22:07:45 +01:00
|
|
|
io.success := outer.tiles.flatMap(_.module.io.elements get "success").map(_.asInstanceOf[Bool]).reduce(_&&_)
|
2016-09-15 22:04:01 +02:00
|
|
|
}
|