Allow some External Interrupts to come from Periphery
This commit is contained in:
parent
8ff739d3fa
commit
428eed79a1
@ -115,7 +115,10 @@ class BasePlatformConfig extends Config (
|
||||
idBits = Dump("MEM_ID_BITS", site(MIFTagBits)))
|
||||
}
|
||||
case BuildCoreplex => (p: Parameters) => Module(new DefaultCoreplex(p))
|
||||
case NExtInterrupts => 2
|
||||
case NExtTopInterrupts => 2
|
||||
case NExtPeripheryInterrupts => 0
|
||||
// Note that PLIC asserts that this is > 0.
|
||||
case NExtInterrupts => site(NExtTopInterrupts) + site(NExtPeripheryInterrupts)
|
||||
case AsyncDebugBus => false
|
||||
case IncludeJtagDTM => false
|
||||
case AsyncMMIOChannels => false
|
||||
@ -262,9 +265,11 @@ class WithTestRAM extends Config(
|
||||
def builder(
|
||||
mmioPorts: HashMap[String, ClientUncachedTileLinkIO],
|
||||
clientPorts: Seq[ClientUncachedTileLinkIO],
|
||||
interrupts: Seq[Bool],
|
||||
extra: Bundle, p: Parameters) {
|
||||
val testram = Module(new TileLinkTestRAM(ramSize)(p))
|
||||
testram.io <> mmioPorts("testram")
|
||||
interrupts.foreach(x => x := Bool(false))
|
||||
}
|
||||
}
|
||||
new TestRAMDevice
|
||||
|
@ -23,12 +23,14 @@ abstract class DeviceBlock {
|
||||
* Use the names specified in addrMapEntries to get
|
||||
* the mmio port for each device.
|
||||
* @param clientPorts All the client ports available for the devices
|
||||
* @param interrupts External interrupts from Periphery to Coreplex
|
||||
* @param extra The extra top-level IO bundle
|
||||
* @param p The CDE parameters for the devices
|
||||
*/
|
||||
def builder(
|
||||
mmioPorts: HashMap[String, ClientUncachedTileLinkIO],
|
||||
clientPorts: Seq[ClientUncachedTileLinkIO],
|
||||
interrupts : Seq[Bool],
|
||||
extra: Bundle, p: Parameters): Unit
|
||||
|
||||
/**
|
||||
@ -55,5 +57,6 @@ class EmptyDeviceBlock extends DeviceBlock {
|
||||
def builder(
|
||||
mmioPorts: HashMap[String, ClientUncachedTileLinkIO],
|
||||
clientPorts: Seq[ClientUncachedTileLinkIO],
|
||||
interrupts : Seq[Bool],
|
||||
extra: Bundle, p: Parameters) {}
|
||||
}
|
||||
|
@ -47,6 +47,11 @@ case object BuildCoreplex extends Field[Parameters => Coreplex]
|
||||
case object ConnectExtraPorts extends Field[(Bundle, Bundle, Parameters) => Unit]
|
||||
/** Specifies the size of external memory */
|
||||
case object ExtMemSize extends Field[Long]
|
||||
/** Specifies the actual sorce of External Interrupts as Top and Periphery.
|
||||
* NExtInterrupts = NExtTopInterrupts + NExtPeripheryInterrupts
|
||||
**/
|
||||
case object NExtTopInterrupts extends Field[Int]
|
||||
case object NExtPeripheryInterrupts extends Field[Int]
|
||||
|
||||
/** Utility trait for quick access to some relevant parameters */
|
||||
trait HasTopLevelParameters {
|
||||
@ -79,7 +84,7 @@ class TopIO(implicit p: Parameters) extends BasicTopIO()(p) {
|
||||
val mem_axi = Vec(nMemAXIChannels, new NastiIO)
|
||||
val mem_ahb = Vec(nMemAHBChannels, new HastiMasterIO)
|
||||
val mem_tl = Vec(nMemTLChannels, new ClientUncachedTileLinkIO()(outermostParams))
|
||||
val interrupts = Vec(p(NExtInterrupts), Bool()).asInput
|
||||
val interrupts = Vec(p(NExtTopInterrupts), Bool()).asInput
|
||||
val bus_clk = if (p(AsyncBusChannels)) Some(Vec(p(NExtBusAXIChannels), Clock(INPUT))) else None
|
||||
val bus_rst = if (p(AsyncBusChannels)) Some(Vec(p(NExtBusAXIChannels), Bool (INPUT))) else None
|
||||
val bus_axi = Vec(p(NExtBusAXIChannels), new NastiIO).flip
|
||||
@ -181,7 +186,11 @@ class Top(topParams: Parameters) extends Module with HasTopLevelParameters {
|
||||
asyncAxiFrom(io.bus_clk.get, io.bus_rst.get, io.bus_axi)
|
||||
else io.bus_axi)
|
||||
|
||||
coreplex.io.interrupts <> io.interrupts
|
||||
// This places the Periphery Interrupts at Bits [0...]
|
||||
// Top-level interrupts are at the higher Bits.
|
||||
// This may have some implications for prioritization of the interrupts,
|
||||
// but PLIC could do some internal swizzling in the future.
|
||||
coreplex.io.interrupts <> (periphery.io.interrupts ++ io.interrupts)
|
||||
|
||||
io.extra <> periphery.io.extra
|
||||
p(ConnectExtraPorts)(io.extra, coreplex.io.extra, p)
|
||||
@ -200,6 +209,7 @@ class Periphery(implicit val p: Parameters) extends Module
|
||||
val mmio_axi = Vec(p(NExtMMIOAXIChannels), new NastiIO)
|
||||
val mmio_ahb = Vec(p(NExtMMIOAHBChannels), new HastiMasterIO)
|
||||
val mmio_tl = Vec(p(NExtMMIOTLChannels), new ClientUncachedTileLinkIO()(outermostMMIOParams))
|
||||
val interrupts = Vec(p(NExtPeripheryInterrupts), Bool()).asOutput
|
||||
val extra = p(ExtraTopPorts)(p)
|
||||
}
|
||||
|
||||
@ -255,7 +265,8 @@ class Periphery(implicit val p: Parameters) extends Module
|
||||
case OuterTLId => "L1toL2" // Device client port
|
||||
})
|
||||
|
||||
extraDevices.builder(deviceMMIO.result(), deviceClients, io.extra, buildParams)
|
||||
extraDevices.builder(deviceMMIO.result(), deviceClients,
|
||||
io.interrupts, io.extra, buildParams)
|
||||
|
||||
val ext = p(ExtMMIOPorts).map(
|
||||
port => TileLinkWidthAdapter(mmioNetwork.port(port.name), "MMIO_Outermost"))
|
||||
|
@ -191,10 +191,12 @@ class WithBusMasterTest extends Config(
|
||||
def builder(
|
||||
mmioPorts: HashMap[String, ClientUncachedTileLinkIO],
|
||||
clientPorts: Seq[ClientUncachedTileLinkIO],
|
||||
interrupts : Seq[Bool],
|
||||
extra: Bundle, p: Parameters) {
|
||||
val busmaster = Module(new ExampleBusMaster()(p))
|
||||
busmaster.io.mmio <> mmioPorts("busmaster")
|
||||
clientPorts.head <> busmaster.io.mem
|
||||
interrupts.foreach(x => x := Bool(false))
|
||||
}
|
||||
}
|
||||
new BusMasterDevice
|
||||
|
Loading…
Reference in New Issue
Block a user