1
0

Add TileId parameter, generalizing GroundTestId

This usually shouldn't be used in Tiles that are meant to be P&R'd once
and multiply instantiated, as their RTL would no longer be homogeneous.
However, it is useful for conditionalizing RTL generation for
heterogeneous tiles.
This commit is contained in:
Andrew Waterman 2016-09-02 00:05:40 -07:00
parent 4a7972be31
commit c05ba1e864
10 changed files with 15 additions and 13 deletions

View File

@ -94,8 +94,9 @@ class BaseCoreplexConfig extends Config (
TestGeneration.addSuites(rvi.map(_("p"))) TestGeneration.addSuites(rvi.map(_("p")))
TestGeneration.addSuites((if(site(UseVM)) List("v") else List()).flatMap(env => rvu.map(_(env)))) TestGeneration.addSuites((if(site(UseVM)) List("v") else List()).flatMap(env => rvu.map(_(env))))
TestGeneration.addSuite(benchmarks) TestGeneration.addSuite(benchmarks)
List.fill(site(NTiles)){ (r: Bool, p: Parameters) => List.tabulate(site(NTiles)){ i => (r: Bool, p: Parameters) =>
Module(new RocketTile(resetSignal = r)(p.alterPartial({ Module(new RocketTile(resetSignal = r)(p.alterPartial({
case TileId => i
case TLId => "L1toL2" case TLId => "L1toL2"
case NUncachedTileLinkPorts => 1 + site(RoccNMemChannels) case NUncachedTileLinkPorts => 1 + site(RoccNMemChannels)
}))) })))

View File

@ -2,6 +2,7 @@ package coreplex
import Chisel._ import Chisel._
import cde.{Parameters, Field} import cde.{Parameters, Field}
import rocket.TileId
import groundtest._ import groundtest._
import uncore.tilelink._ import uncore.tilelink._
import uncore.agents._ import uncore.agents._
@ -19,7 +20,7 @@ class DirectGroundTestCoreplex(topParams: Parameters) extends Coreplex()(topPara
require(nTiles == 1) require(nTiles == 1)
val test = p(BuildGroundTest)(outermostParams.alterPartial({ val test = p(BuildGroundTest)(outermostParams.alterPartial({
case GroundTestId => 0 case TileId => 0
case CacheName => "L1D" case CacheName => "L1D"
})) }))
require(test.io.cache.size == 0) require(test.io.cache.size == 0)

View File

@ -158,10 +158,9 @@ class WithPCIeMockupTest extends Config(
maxRequests = 128, maxRequests = 128,
startAddress = site(GlobalAddrMap)("mem").start) startAddress = site(GlobalAddrMap)("mem").start)
case BuildGroundTest => case BuildGroundTest =>
(p: Parameters) => { (p: Parameters) => p(TileId) match {
val id = p(GroundTestId) case 0 => Module(new GeneratorTest()(p))
if (id == 0) Module(new GeneratorTest()(p)) case 1 => Module(new NastiConverterTest()(p))
else Module(new NastiConverterTest()(p))
} }
case _ => throw new CDEMatchError case _ => throw new CDEMatchError
}) })

View File

@ -190,7 +190,7 @@ class HellaCacheGenerator(id: Int)
class GeneratorTest(implicit p: Parameters) class GeneratorTest(implicit p: Parameters)
extends GroundTest()(p) with HasGeneratorParameters { extends GroundTest()(p) with HasGeneratorParameters {
val idStart = p(GroundTestKey).take(tileId) val idStart = p(GroundTestKey).take(p(TileId))
.map(settings => settings.cached + settings.uncached) .map(settings => settings.cached + settings.uncached)
.foldLeft(0)(_ + _) .foldLeft(0)(_ + _)

View File

@ -4,6 +4,7 @@ import Chisel._
import uncore.tilelink._ import uncore.tilelink._
import uncore.converters._ import uncore.converters._
import junctions._ import junctions._
import rocket.TileId
import cde.Parameters import cde.Parameters
class NastiGenerator(id: Int)(implicit val p: Parameters) extends Module class NastiGenerator(id: Int)(implicit val p: Parameters) extends Module
@ -107,7 +108,7 @@ class NastiConverterTest(implicit p: Parameters) extends GroundTest()(p)
with HasNastiParameters { with HasNastiParameters {
require(tileSettings.uncached == 1 && tileSettings.cached == 0) require(tileSettings.uncached == 1 && tileSettings.cached == 0)
val genId = p(GroundTestKey).take(tileId) val genId = p(GroundTestKey).take(p(TileId))
.map(settings => settings.cached + settings.uncached) .map(settings => settings.cached + settings.uncached)
.foldLeft(0)(_ + _) .foldLeft(0)(_ + _)

View File

@ -13,7 +13,6 @@ case object BuildGroundTest extends Field[Parameters => GroundTest]
case class GroundTestTileSettings( case class GroundTestTileSettings(
uncached: Int = 0, cached: Int = 0, ptw: Int = 0, maxXacts: Int = 1) uncached: Int = 0, cached: Int = 0, ptw: Int = 0, maxXacts: Int = 1)
case object GroundTestKey extends Field[Seq[GroundTestTileSettings]] case object GroundTestKey extends Field[Seq[GroundTestTileSettings]]
case object GroundTestId extends Field[Int]
trait HasGroundTestConstants { trait HasGroundTestConstants {
val timeoutCodeBits = 4 val timeoutCodeBits = 4
@ -22,8 +21,7 @@ trait HasGroundTestConstants {
trait HasGroundTestParameters extends HasAddrMapParameters { trait HasGroundTestParameters extends HasAddrMapParameters {
implicit val p: Parameters implicit val p: Parameters
val tileId = p(GroundTestId) val tileSettings = p(GroundTestKey)(p(TileId))
val tileSettings = p(GroundTestKey)(tileId)
val nUncached = tileSettings.uncached val nUncached = tileSettings.uncached
val nCached = tileSettings.cached val nCached = tileSettings.cached
val nPTW = tileSettings.ptw val nPTW = tileSettings.ptw

View File

@ -613,7 +613,7 @@ class GroundTestTraceGenerator(implicit p: Parameters)
require(io.mem.size <= 1) require(io.mem.size <= 1)
require(io.cache.size == 1) require(io.cache.size == 1)
val traceGen = Module(new TraceGenerator(p(GroundTestId))) val traceGen = Module(new TraceGenerator(p(TileId)))
io.cache.head <> traceGen.io.mem io.cache.head <> traceGen.io.mem
if (io.mem.size == 1) { if (io.mem.size == 1) {

View File

@ -71,6 +71,7 @@ trait HasCoreParameters extends HasAddrMapParameters {
val coreMaxAddrBits = paddrBits max vaddrBitsExtended val coreMaxAddrBits = paddrBits max vaddrBitsExtended
val nCustomMrwCsrs = p(NCustomMRWCSRs) val nCustomMrwCsrs = p(NCustomMRWCSRs)
val nCores = p(NTiles) val nCores = p(NTiles)
val tileId = p(TileId)
// fetchWidth doubled, but coreInstBytes halved, for RVC // fetchWidth doubled, but coreInstBytes halved, for RVC
val decodeWidth = fetchWidth / (if (usingCompressed) 2 else 1) val decodeWidth = fetchWidth / (if (usingCompressed) 2 else 1)

View File

@ -12,6 +12,7 @@ import cde.{Parameters, Field}
case object BuildRoCC extends Field[Seq[RoccParameters]] case object BuildRoCC extends Field[Seq[RoccParameters]]
case object NCachedTileLinkPorts extends Field[Int] case object NCachedTileLinkPorts extends Field[Int]
case object NUncachedTileLinkPorts extends Field[Int] case object NUncachedTileLinkPorts extends Field[Int]
case object TileId extends Field[Int]
case class RoccParameters( case class RoccParameters(
opcodes: OpcodeSet, opcodes: OpcodeSet,

View File

@ -72,7 +72,7 @@ class WithGroundTest extends Config(
(r: Bool, p: Parameters) => { (r: Bool, p: Parameters) => {
Module(new GroundTestTile(resetSignal = r)(p.alterPartial({ Module(new GroundTestTile(resetSignal = r)(p.alterPartial({
case TLId => "L1toL2" case TLId => "L1toL2"
case GroundTestId => i case TileId => i
case NCachedTileLinkPorts => if(tileSettings.cached > 0) 1 else 0 case NCachedTileLinkPorts => if(tileSettings.cached > 0) 1 else 0
case NUncachedTileLinkPorts => tileSettings.uncached case NUncachedTileLinkPorts => tileSettings.uncached
}))) })))