1
0

tilelink2: do not depend on obsolete TL1 configuration

This commit is contained in:
Wesley W. Terpstra 2016-11-17 14:07:53 -08:00
parent 8a0ecdaaad
commit dfc3a0dafb
6 changed files with 25 additions and 14 deletions

View File

@ -14,6 +14,11 @@ import uncore.converters._
import rocket._ import rocket._
import util._ import util._
/** Widths of various points in the SoC */
case class TLBusConfig(beatBytes: Int)
case object CBusConfig extends Field[TLBusConfig]
case object L1toL2Config extends Field[TLBusConfig]
/** Number of memory channels */ /** Number of memory channels */
case object NMemoryChannels extends Field[Int] case object NMemoryChannels extends Field[Int]
/** Number of banks per memory channel */ /** Number of banks per memory channel */
@ -25,6 +30,8 @@ case object BootROMFile extends Field[String]
trait HasCoreplexParameters { trait HasCoreplexParameters {
implicit val p: Parameters implicit val p: Parameters
lazy val cbusConfig = p(CBusConfig)
lazy val l1tol2Config = p(L1toL2Config)
lazy val nBanksPerMemChannel = p(NBanksPerMemoryChannel) lazy val nBanksPerMemChannel = p(NBanksPerMemoryChannel)
lazy val innerParams = p.alterPartial({ case TLId => "L1toL2" }) lazy val innerParams = p.alterPartial({ case TLId => "L1toL2" })
lazy val outerMemParams = p.alterPartial({ case TLId => "L2toMC" }) lazy val outerMemParams = p.alterPartial({ case TLId => "L2toMC" })
@ -51,11 +58,11 @@ trait CoreplexNetwork extends HasCoreplexParameters {
val module: CoreplexNetworkModule val module: CoreplexNetworkModule
val l1tol2 = LazyModule(new TLXbar) val l1tol2 = LazyModule(new TLXbar)
val l1tol2_beatBytes = p(TLKey("L2toMMIO")).dataBitsPerBeat/8 val l1tol2_beatBytes = l1tol2Config.beatBytes
val l1tol2_lineBytes = p(CacheBlockBytes) val l1tol2_lineBytes = p(CacheBlockBytes)
val cbus = LazyModule(new TLXbar) val cbus = LazyModule(new TLXbar)
val cbus_beatBytes = p(XLen)/8 val cbus_beatBytes = cbusConfig.beatBytes
val cbus_lineBytes = l1tol2_lineBytes val cbus_lineBytes = l1tol2_lineBytes
val intBar = LazyModule(new IntXbar) val intBar = LazyModule(new IntXbar)

View File

@ -92,6 +92,8 @@ class BaseCoreplexConfig extends Config (
case LNEndpoints => site(TLKey(site(TLId))).nManagers + site(TLKey(site(TLId))).nClients case LNEndpoints => site(TLKey(site(TLId))).nManagers + site(TLKey(site(TLId))).nClients
case LNHeaderBits => log2Ceil(site(TLKey(site(TLId))).nManagers) + case LNHeaderBits => log2Ceil(site(TLKey(site(TLId))).nManagers) +
log2Up(site(TLKey(site(TLId))).nClients) log2Up(site(TLKey(site(TLId))).nClients)
case CBusConfig => TLBusConfig(beatBytes = site(XLen)/8)
case L1toL2Config => TLBusConfig(beatBytes = site(XLen)/8) // increase for more PCIe bandwidth
case TLKey("L1toL2") => { case TLKey("L1toL2") => {
val useMEI = site(NTiles) <= 1 val useMEI = site(NTiles) <= 1
TileLinkParameters( TileLinkParameters(

View File

@ -49,8 +49,8 @@ trait TopNetwork extends HasPeripheryParameters {
val intBus = LazyModule(new IntXbar) val intBus = LazyModule(new IntXbar)
peripheryBus.node := peripheryBus.node :=
TLWidthWidget(p(SOCBusKey).beatBytes)( TLWidthWidget(socBusConfig.beatBytes)(
TLAtomicAutomata(arithmetic = p(PeripheryBusKey).arithAMO)( TLAtomicAutomata(arithmetic = peripheryBusArithmetic)(
socBus.node)) socBus.node))
var coreplexMem = Seq[TLOutwardNode]() var coreplexMem = Seq[TLOutwardNode]()

View File

@ -41,8 +41,9 @@ class BasePlatformConfig extends Config(
case TLKey("MMIOtoEdge") => case TLKey("MMIOtoEdge") =>
site(TLKey("L2toMMIO")).copy(dataBeats = edgeDataBeats) site(TLKey("L2toMMIO")).copy(dataBeats = edgeDataBeats)
case NExtTopInterrupts => 2 case NExtTopInterrupts => 2
case SOCBusKey => SOCBusConfig(beatBytes = site(TLKey("L2toMMIO")).dataBitsPerBeat/8) case SOCBusConfig => site(L1toL2Config)
case PeripheryBusKey => PeripheryBusConfig(arithAMO = true, beatBytes = 4) case PeripheryBusConfig => TLBusConfig(beatBytes = 4)
case PeripheryBusArithmetic => true
// Note that PLIC asserts that this is > 0. // Note that PLIC asserts that this is > 0.
case AsyncDebugBus => false case AsyncDebugBus => false
case IncludeJtagDTM => false case IncludeJtagDTM => false
@ -177,13 +178,13 @@ class WithJtagDTM extends Config (
class WithNoPeripheryArithAMO extends Config ( class WithNoPeripheryArithAMO extends Config (
(pname, site, here) => pname match { (pname, site, here) => pname match {
case PeripheryBusKey => PeripheryBusConfig(arithAMO = false, beatBytes = 4) case PeripheryBusArithmetic => false
} }
) )
class With64BitPeriphery extends Config ( class With64BitPeriphery extends Config (
(pname, site, here) => pname match { (pname, site, here) => pname match {
case PeripheryBusKey => PeripheryBusConfig(arithAMO = true, beatBytes = 8) case PeripheryBusConfig => TLBusConfig(beatBytes = 8)
} }
) )

View File

@ -46,11 +46,10 @@ case object NExtTopInterrupts extends Field[Int]
/** Source of RTC. First bundle is TopIO.extra, Second bundle is periphery.io.extra **/ /** Source of RTC. First bundle is TopIO.extra, Second bundle is periphery.io.extra **/
case object RTCPeriod extends Field[Int] case object RTCPeriod extends Field[Int]
/* Specifies the periphery bus configuration */ /* Specifies the periphery bus configuration */
case class PeripheryBusConfig(arithAMO: Boolean, beatBytes: Int = 4) case object PeripheryBusConfig extends Field[TLBusConfig]
case object PeripheryBusKey extends Field[PeripheryBusConfig] case object PeripheryBusArithmetic extends Field[Boolean]
/* Specifies the SOC-bus configuration */ /* Specifies the SOC-bus configuration */
case class SOCBusConfig(beatBytes: Int = 4) case object SOCBusConfig extends Field[TLBusConfig]
case object SOCBusKey extends Field[SOCBusConfig]
/* Specifies the data and id width at the chip boundary */ /* Specifies the data and id width at the chip boundary */
case object EdgeDataBits extends Field[Int] case object EdgeDataBits extends Field[Int]
@ -88,9 +87,10 @@ trait HasPeripheryParameters {
lazy val nMemTLChannels = if (tMemChannels == BusType.TL) nMemChannels else 0 lazy val nMemTLChannels = if (tMemChannels == BusType.TL) nMemChannels else 0
lazy val edgeSlaveParams = p.alterPartial({ case TLId => "EdgetoSlave" }) lazy val edgeSlaveParams = p.alterPartial({ case TLId => "EdgetoSlave" })
lazy val edgeMemParams = p.alterPartial({ case TLId => "MCtoEdge" }) lazy val edgeMemParams = p.alterPartial({ case TLId => "MCtoEdge" })
lazy val peripheryBusConfig = p(PeripheryBusKey) lazy val peripheryBusConfig = p(PeripheryBusConfig)
lazy val socBusConfig = p(SOCBusKey) lazy val socBusConfig = p(SOCBusConfig)
lazy val cacheBlockBytes = p(CacheBlockBytes) lazy val cacheBlockBytes = p(CacheBlockBytes)
lazy val peripheryBusArithmetic = p(PeripheryBusArithmetic)
} }
///// /////

View File

@ -55,6 +55,7 @@ class TLXbar(policy: TLArbiter.Policy = TLArbiter.lowestIndexFirst) extends Lazy
minLatency = seq.map(_.minLatency).min, minLatency = seq.map(_.minLatency).min,
endSinkId = outputIdRanges.map(_.end).max, endSinkId = outputIdRanges.map(_.end).max,
managers = ManagerUnification(seq.flatMap { port => managers = ManagerUnification(seq.flatMap { port =>
// println(s"${port.managers.map(_.name)} ${port.beatBytes} vs ${seq(0).managers.map(_.name)} ${seq(0).beatBytes}")
require (port.beatBytes == seq(0).beatBytes) require (port.beatBytes == seq(0).beatBytes)
val fifoIdMapper = fifoIdFactory() val fifoIdMapper = fifoIdFactory()
port.managers map { manager => manager.copy( port.managers map { manager => manager.copy(