rocketchip: rename some periphery ports
This commit is contained in:
@ -37,16 +37,17 @@ case object ZeroConfig extends Field[ZeroConfig]
|
||||
/** Utility trait for quick access to some relevant parameters */
|
||||
trait HasPeripheryParameters {
|
||||
implicit val p: Parameters
|
||||
lazy val peripheryBusConfig = p(PeripheryBusConfig)
|
||||
lazy val socBusConfig = p(SOCBusConfig)
|
||||
lazy val cacheBlockBytes = p(CacheBlockBytes)
|
||||
lazy val peripheryBusArithmetic = p(PeripheryBusArithmetic)
|
||||
def peripheryBusConfig = p(PeripheryBusConfig)
|
||||
def socBusConfig = p(SOCBusConfig)
|
||||
def cacheBlockBytes = p(CacheBlockBytes)
|
||||
def peripheryBusArithmetic = p(PeripheryBusArithmetic)
|
||||
def nMemoryChannels = p(coreplex.BankedL2Config).nMemoryChannels
|
||||
}
|
||||
|
||||
/////
|
||||
|
||||
trait PeripheryExtInterrupts {
|
||||
this: TopNetwork =>
|
||||
this: HasTopLevelNetworks =>
|
||||
|
||||
val nExtInterrupts = p(NExtTopInterrupts)
|
||||
val extInterrupts = IntInternalInputNode(nExtInterrupts)
|
||||
@ -57,14 +58,14 @@ trait PeripheryExtInterrupts {
|
||||
}
|
||||
|
||||
trait PeripheryExtInterruptsBundle {
|
||||
this: TopNetworkBundle {
|
||||
this: HasTopLevelNetworksBundle {
|
||||
val outer: PeripheryExtInterrupts
|
||||
} =>
|
||||
val interrupts = UInt(INPUT, width = outer.nExtInterrupts)
|
||||
}
|
||||
|
||||
trait PeripheryExtInterruptsModule {
|
||||
this: TopNetworkModule {
|
||||
this: HasTopLevelNetworksModule {
|
||||
val outer: PeripheryExtInterrupts
|
||||
val io: PeripheryExtInterruptsBundle
|
||||
} =>
|
||||
@ -74,7 +75,7 @@ trait PeripheryExtInterruptsModule {
|
||||
/////
|
||||
|
||||
trait PeripheryMasterAXI4Mem {
|
||||
this: TopNetwork =>
|
||||
this: HasTopLevelNetworks =>
|
||||
val module: PeripheryMasterAXI4MemModule
|
||||
|
||||
private val config = p(ExtMem)
|
||||
@ -107,14 +108,14 @@ trait PeripheryMasterAXI4Mem {
|
||||
}
|
||||
|
||||
trait PeripheryMasterAXI4MemBundle {
|
||||
this: TopNetworkBundle {
|
||||
this: HasTopLevelNetworksBundle {
|
||||
val outer: PeripheryMasterAXI4Mem
|
||||
} =>
|
||||
val mem_axi4 = outer.mem_axi4.bundleOut
|
||||
}
|
||||
|
||||
trait PeripheryMasterAXI4MemModule {
|
||||
this: TopNetworkModule {
|
||||
this: HasTopLevelNetworksModule {
|
||||
val outer: PeripheryMasterAXI4Mem
|
||||
val io: PeripheryMasterAXI4MemBundle
|
||||
} =>
|
||||
@ -123,7 +124,7 @@ trait PeripheryMasterAXI4MemModule {
|
||||
/////
|
||||
|
||||
trait PeripheryZero {
|
||||
this: TopNetwork =>
|
||||
this: HasTopLevelNetworks =>
|
||||
val module: PeripheryZeroModule
|
||||
|
||||
private val config = p(ZeroConfig)
|
||||
@ -138,13 +139,13 @@ trait PeripheryZero {
|
||||
}
|
||||
|
||||
trait PeripheryZeroBundle {
|
||||
this: TopNetworkBundle {
|
||||
this: HasTopLevelNetworksBundle {
|
||||
val outer: PeripheryZero
|
||||
} =>
|
||||
}
|
||||
|
||||
trait PeripheryZeroModule {
|
||||
this: TopNetworkModule {
|
||||
this: HasTopLevelNetworksModule {
|
||||
val outer: PeripheryZero
|
||||
val io: PeripheryZeroBundle
|
||||
} =>
|
||||
@ -154,7 +155,7 @@ trait PeripheryZeroModule {
|
||||
|
||||
// PeripheryMasterAXI4MMIO is an example, make your own cake pattern like this one.
|
||||
trait PeripheryMasterAXI4MMIO {
|
||||
this: TopNetwork =>
|
||||
this: HasTopLevelNetworks =>
|
||||
|
||||
private val config = p(ExtBus)
|
||||
val mmio_axi4 = AXI4BlindOutputNode(Seq(AXI4SlavePortParameters(
|
||||
@ -175,14 +176,14 @@ trait PeripheryMasterAXI4MMIO {
|
||||
}
|
||||
|
||||
trait PeripheryMasterAXI4MMIOBundle {
|
||||
this: TopNetworkBundle {
|
||||
this: HasTopLevelNetworksBundle {
|
||||
val outer: PeripheryMasterAXI4MMIO
|
||||
} =>
|
||||
val mmio_axi4 = outer.mmio_axi4.bundleOut
|
||||
}
|
||||
|
||||
trait PeripheryMasterAXI4MMIOModule {
|
||||
this: TopNetworkModule {
|
||||
this: HasTopLevelNetworksModule {
|
||||
val outer: PeripheryMasterAXI4MMIO
|
||||
val io: PeripheryMasterAXI4MMIOBundle
|
||||
} =>
|
||||
@ -192,26 +193,26 @@ trait PeripheryMasterAXI4MMIOModule {
|
||||
/////
|
||||
|
||||
// PeripherySlaveAXI4 is an example, make your own cake pattern like this one.
|
||||
trait PeripherySlaveAXI4 extends TopNetwork {
|
||||
trait PeripherySlaveAXI4 extends HasTopLevelNetworks {
|
||||
private val config = p(ExtIn)
|
||||
val l2_axi4 = AXI4BlindInputNode(Seq(AXI4MasterPortParameters(
|
||||
val l2FrontendAXI4Node = AXI4BlindInputNode(Seq(AXI4MasterPortParameters(
|
||||
masters = Seq(AXI4MasterParameters(
|
||||
id = IdRange(0, 1 << config.idBits))))))
|
||||
|
||||
l2.node :=
|
||||
l2FrontendBus.node :=
|
||||
TLSourceShrinker(1 << config.sourceBits)(
|
||||
TLWidthWidget(config.beatBytes)(
|
||||
AXI4ToTL()(
|
||||
AXI4Fragmenter()(
|
||||
l2_axi4))))
|
||||
l2FrontendAXI4Node))))
|
||||
}
|
||||
|
||||
trait PeripherySlaveAXI4Bundle extends TopNetworkBundle {
|
||||
trait PeripherySlaveAXI4Bundle extends HasTopLevelNetworksBundle {
|
||||
val outer: PeripherySlaveAXI4
|
||||
val l2_axi4 = outer.l2_axi4.bundleIn
|
||||
val l2_frontend_bus_axi4 = outer.l2FrontendAXI4Node.bundleIn
|
||||
}
|
||||
|
||||
trait PeripherySlaveAXI4Module extends TopNetworkModule {
|
||||
trait PeripherySlaveAXI4Module extends HasTopLevelNetworksModule {
|
||||
val outer: PeripherySlaveAXI4
|
||||
val io: PeripherySlaveAXI4Bundle
|
||||
// nothing to do
|
||||
@ -221,7 +222,7 @@ trait PeripherySlaveAXI4Module extends TopNetworkModule {
|
||||
|
||||
// Add an external TL-UL slave
|
||||
trait PeripheryMasterTLMMIO {
|
||||
this: TopNetwork =>
|
||||
this: HasTopLevelNetworks =>
|
||||
|
||||
private val config = p(ExtBus)
|
||||
val mmio_tl = TLBlindOutputNode(Seq(TLManagerPortParameters(
|
||||
@ -241,14 +242,14 @@ trait PeripheryMasterTLMMIO {
|
||||
}
|
||||
|
||||
trait PeripheryMasterTLMMIOBundle {
|
||||
this: TopNetworkBundle {
|
||||
this: HasTopLevelNetworksBundle {
|
||||
val outer: PeripheryMasterTLMMIO
|
||||
} =>
|
||||
val mmio_tl = outer.mmio_tl.bundleOut
|
||||
}
|
||||
|
||||
trait PeripheryMasterTLMMIOModule {
|
||||
this: TopNetworkModule {
|
||||
this: HasTopLevelNetworksModule {
|
||||
val outer: PeripheryMasterTLMMIO
|
||||
val io: PeripheryMasterTLMMIOBundle
|
||||
} =>
|
||||
@ -258,24 +259,24 @@ trait PeripheryMasterTLMMIOModule {
|
||||
/////
|
||||
|
||||
// NOTE: this port is NOT allowed to issue Acquires
|
||||
trait PeripherySlaveTL extends TopNetwork {
|
||||
trait PeripherySlaveTL extends HasTopLevelNetworks {
|
||||
private val config = p(ExtIn)
|
||||
val l2_tl = TLBlindInputNode(Seq(TLClientPortParameters(
|
||||
val l2FrontendTLNode = TLBlindInputNode(Seq(TLClientPortParameters(
|
||||
clients = Seq(TLClientParameters(
|
||||
sourceId = IdRange(0, 1 << config.idBits))))))
|
||||
|
||||
l2.node :=
|
||||
l2FrontendBus.node :=
|
||||
TLSourceShrinker(1 << config.sourceBits)(
|
||||
TLWidthWidget(config.beatBytes)(
|
||||
l2_tl))
|
||||
l2FrontendTLNode))
|
||||
}
|
||||
|
||||
trait PeripherySlaveTLBundle extends TopNetworkBundle {
|
||||
trait PeripherySlaveTLBundle extends HasTopLevelNetworksBundle {
|
||||
val outer: PeripherySlaveTL
|
||||
val l2_tl = outer.l2_tl.bundleIn
|
||||
val l2_frontend_bus_tl = outer.l2FrontendTLNode.bundleIn
|
||||
}
|
||||
|
||||
trait PeripherySlaveTLModule extends TopNetworkModule {
|
||||
trait PeripherySlaveTLModule extends HasTopLevelNetworksModule {
|
||||
val outer: PeripherySlaveTL
|
||||
val io: PeripherySlaveTLBundle
|
||||
// nothing to do
|
||||
@ -284,7 +285,7 @@ trait PeripherySlaveTLModule extends TopNetworkModule {
|
||||
/////
|
||||
|
||||
trait PeripheryBootROM {
|
||||
this: TopNetwork =>
|
||||
this: HasTopLevelNetworks =>
|
||||
val coreplex: CoreplexRISCVPlatform
|
||||
|
||||
private val bootrom_address = 0x1000
|
||||
@ -295,13 +296,13 @@ trait PeripheryBootROM {
|
||||
}
|
||||
|
||||
trait PeripheryBootROMBundle {
|
||||
this: TopNetworkBundle {
|
||||
this: HasTopLevelNetworksBundle {
|
||||
val outer: PeripheryBootROM
|
||||
} =>
|
||||
}
|
||||
|
||||
trait PeripheryBootROMModule {
|
||||
this: TopNetworkModule {
|
||||
this: HasTopLevelNetworksModule {
|
||||
val outer: PeripheryBootROM
|
||||
val io: PeripheryBootROMBundle
|
||||
} =>
|
||||
@ -310,20 +311,20 @@ trait PeripheryBootROMModule {
|
||||
/////
|
||||
|
||||
trait PeripheryTestRAM {
|
||||
this: TopNetwork =>
|
||||
this: HasTopLevelNetworks =>
|
||||
|
||||
val testram = LazyModule(new TLRAM(AddressSet(0x52000000, 0xfff), true, peripheryBusConfig.beatBytes))
|
||||
testram.node := TLFragmenter(peripheryBusConfig.beatBytes, cacheBlockBytes)(peripheryBus.node)
|
||||
}
|
||||
|
||||
trait PeripheryTestRAMBundle {
|
||||
this: TopNetworkBundle {
|
||||
this: HasTopLevelNetworksBundle {
|
||||
val outer: PeripheryTestRAM
|
||||
} =>
|
||||
}
|
||||
|
||||
trait PeripheryTestRAMModule {
|
||||
this: TopNetworkModule {
|
||||
this: HasTopLevelNetworksModule {
|
||||
val outer: PeripheryTestRAM
|
||||
val io: PeripheryTestRAMBundle
|
||||
} =>
|
||||
@ -332,19 +333,19 @@ trait PeripheryTestRAMModule {
|
||||
/////
|
||||
|
||||
trait PeripheryTestBusMaster {
|
||||
this: TopNetwork =>
|
||||
this: HasTopLevelNetworks =>
|
||||
val fuzzer = LazyModule(new TLFuzzer(5000))
|
||||
peripheryBus.node := fuzzer.node
|
||||
}
|
||||
|
||||
trait PeripheryTestBusMasterBundle {
|
||||
this: TopNetworkBundle {
|
||||
this: HasTopLevelNetworksBundle {
|
||||
val outer: PeripheryTestBusMaster
|
||||
} =>
|
||||
}
|
||||
|
||||
trait PeripheryTestBusMasterModule {
|
||||
this: TopNetworkModule {
|
||||
this: HasTopLevelNetworksModule {
|
||||
val outer: PeripheryTestBusMaster
|
||||
val io: PeripheryTestBusMasterBundle
|
||||
} =>
|
||||
|
Reference in New Issue
Block a user