2016-11-28 01:16:37 +01:00
|
|
|
// See LICENSE.SiFive for license details.
|
|
|
|
|
2016-09-15 22:04:01 +02:00
|
|
|
package groundtest
|
|
|
|
|
|
|
|
import Chisel._
|
2016-11-18 23:05:14 +01:00
|
|
|
import config._
|
2016-11-11 22:07:45 +01:00
|
|
|
import diplomacy._
|
2016-09-22 01:54:35 +02:00
|
|
|
import coreplex._
|
2017-01-17 03:24:08 +01:00
|
|
|
import rocket._
|
2017-02-09 22:59:09 +01:00
|
|
|
import tile._
|
2017-01-17 03:24:08 +01:00
|
|
|
import uncore.agents._
|
|
|
|
import uncore.coherence._
|
|
|
|
import uncore.devices._
|
|
|
|
import uncore.tilelink._
|
2016-11-17 02:05:53 +01:00
|
|
|
import uncore.tilelink2._
|
2017-01-17 03:24:08 +01:00
|
|
|
import uncore.util._
|
|
|
|
import scala.math.max
|
2016-09-15 22:04:01 +02:00
|
|
|
|
2016-11-22 19:53:44 +01:00
|
|
|
case object TileId extends Field[Int]
|
|
|
|
|
2016-11-18 02:26:49 +01:00
|
|
|
class GroundTestCoreplex(implicit p: Parameters) extends BaseCoreplex {
|
2016-11-16 03:27:52 +01:00
|
|
|
val tiles = List.tabulate(p(NTiles)) { i =>
|
2017-01-17 03:24:08 +01:00
|
|
|
LazyModule(new GroundTestTile()(p.alter { (site, here, up) => {
|
2016-11-11 22:07:45 +01:00
|
|
|
case TileId => i
|
2017-01-17 03:24:08 +01:00
|
|
|
case CacheBlockOffsetBits => log2Up(site(CacheBlockBytes))
|
|
|
|
case AmoAluOperandBits => site(XLen)
|
|
|
|
case SharedMemoryTLEdge => l1tol2.node.edgesIn(0)
|
|
|
|
case TLId => "L1toL2"
|
|
|
|
case TLKey("L1toL2") =>
|
|
|
|
TileLinkParameters(
|
|
|
|
coherencePolicy = new MESICoherence(new NullRepresentation(site(NTiles))),
|
|
|
|
nManagers = site(BankedL2Config).nBanks + 1,
|
|
|
|
nCachingClients = 1,
|
|
|
|
nCachelessClients = 1,
|
2017-02-09 22:59:09 +01:00
|
|
|
maxClientXacts = site(GroundTestKey).map(_.maxXacts).reduce(max(_, _)),
|
2017-01-17 03:24:08 +01:00
|
|
|
maxClientsPerPort = site(GroundTestKey).map(_.uncached).sum,
|
|
|
|
maxManagerXacts = 8,
|
|
|
|
dataBeats = (8 * site(CacheBlockBytes)) / site(XLen),
|
|
|
|
dataBits = site(CacheBlockBytes)*8)
|
|
|
|
}}))
|
2016-11-11 22:07:45 +01:00
|
|
|
}
|
2017-01-17 03:24:08 +01:00
|
|
|
|
2017-02-09 22:59:09 +01:00
|
|
|
tiles.foreach { l1tol2.node :=* _.masterNode }
|
2016-11-17 02:05:53 +01:00
|
|
|
|
2016-11-17 03:42:56 +01:00
|
|
|
val cbusRAM = LazyModule(new TLRAM(AddressSet(testRamAddr, 0xffff), false, cbus_beatBytes))
|
2016-11-17 02:05:53 +01:00
|
|
|
cbusRAM.node := TLFragmenter(cbus_beatBytes, cbus_lineBytes)(cbus.node)
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2017-02-09 22:59:09 +01:00
|
|
|
class GroundTestCoreplexBundle[+L <: GroundTestCoreplex](_outer: L) extends BaseCoreplexBundle(_outer) {
|
2016-11-16 03:27:52 +01:00
|
|
|
val success = Bool(OUTPUT)
|
|
|
|
}
|
2016-09-22 01:54:35 +02:00
|
|
|
|
2016-11-16 03:27:52 +01:00
|
|
|
class GroundTestCoreplexModule[+L <: GroundTestCoreplex, +B <: GroundTestCoreplexBundle[L]](_outer: L, _io: () => B) extends BaseCoreplexModule(_outer, _io) {
|
|
|
|
io.success := outer.tiles.map(_.module.io.success).reduce(_&&_)
|
2016-09-15 22:04:01 +02:00
|
|
|
}
|