Skip to content

Commit

Permalink
config: create and use config alterations WithJustOneBus, WithIncoher…
Browse files Browse the repository at this point in the history
…entTopology, WithCoherentTopology
  • Loading branch information
hcook committed Mar 11, 2020
1 parent 8b2aa28 commit 1a97b46
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 7 deletions.
29 changes: 25 additions & 4 deletions src/main/scala/subsystem/Configs.scala
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,39 @@ class BaseSubsystemConfig extends Config ((site, here, up) => {
case DebugModuleKey => Some(DefaultDebugModuleParams(site(XLen)))
case CLINTKey => Some(CLINTParams())
case PLICKey => Some(PLICParams())
})

/* Composable partial function Configs to set individual parameters */

class WithJustOneBus extends Config((site, here, up) => {
case TLNetworkTopologyLocated("InSubsystem") => List(
JustOneBusTopologyParams(sbus = site(SystemBusKey))
)
})

class WithIncoherentBusTopology extends Config((site, here, up) => {
case TLNetworkTopologyLocated("InSubsystem") => List(
JustOneBusTopologyParams(sbus = site(SystemBusKey)),
HierarchicalBusTopologyParams(
sbus = site(SystemBusKey),
pbus = site(PeripheryBusKey),
fbus = site(FrontBusKey),
mbus = site(MemoryBusKey),
cbus = site(ControlBusKey),
l2 = site(BankedL2Key),
xTypes = SubsystemCrossingParams()))
})

/* Composable partial function Configs to set individual parameters */
class WithCoherentBusTopology extends Config((site, here, up) => {
case TLNetworkTopologyLocated("InSubsystem") => List(
JustOneBusTopologyParams(sbus = site(SystemBusKey)),
HierarchicalBusTopologyParams(
pbus = site(PeripheryBusKey),
fbus = site(FrontBusKey),
cbus = site(ControlBusKey),
xTypes = SubsystemCrossingParams()),
CoherentBusTopologyParams(
sbus = site(SystemBusKey),
mbus = site(MemoryBusKey),
l2 = site(BankedL2Key)))
})

class WithNBigCores(n: Int) extends Config((site, here, up) => {
case RocketTilesKey => {
Expand Down
8 changes: 5 additions & 3 deletions src/main/scala/system/Configs.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ class BaseConfig extends Config(
new BaseSubsystemConfig()
)

class DefaultConfig extends Config(new WithNBigCores(1) ++ new BaseConfig)
class DefaultConfig extends Config(new WithNBigCores(1) ++ new WithCoherentBusTopology ++ new BaseConfig)

class DefaultBufferlessConfig extends Config(new WithBufferlessBroadcastHub ++ new DefaultConfig)
class DefaultSmallConfig extends Config(new WithNSmallCores(1) ++ new BaseConfig)
class DefaultSmallConfig extends Config(new WithNSmallCores(1) ++ new WithCoherentBusTopology ++ new BaseConfig)
class DefaultRV32Config extends Config(new WithRV32 ++ new DefaultConfig)

class DualBankConfig extends Config(new WithNBanks(2) ++ new DefaultConfig)
class DualCoreConfig extends Config( new WithNBigCores(2) ++ new BaseConfig)
class DualCoreConfig extends Config(new WithNBigCores(2) ++ new WithCoherentBusTopology ++ new BaseConfig)
class DualChannelConfig extends Config(new WithNMemoryChannels(2) ++ new DefaultConfig)
class EightChannelConfig extends Config(new WithNMemoryChannels(8) ++ new DefaultConfig)

Expand All @@ -54,6 +54,7 @@ class TinyConfig extends Config(
new WithNMemoryChannels(0) ++
new WithNBanks(0) ++
new With1TinyCore ++
new WithIncoherentBusTopology ++
new BaseConfig)

class MemPortOnlyConfig extends Config(
Expand All @@ -69,6 +70,7 @@ class MMIOPortOnlyConfig extends Config(
new WithNBanks(0) ++
new WithIncoherentTiles ++
new WithScratchpadsOnly ++
new WithIncoherentBusTopology ++
new DefaultConfig
)

Expand Down

0 comments on commit 1a97b46

Please sign in to comment.