Move TL mem switch frag to CY | Add require to not have TL/AXI backing mem

This commit is contained in:
abejgonzalez
2020-11-23 16:58:34 -08:00
parent 8f6de22e72
commit f1fdab5bd3
3 changed files with 10 additions and 6 deletions

View File

@@ -181,6 +181,11 @@ class WithTLSerialLocation(masterWhere: TLBusWrapperLocation, slaveWhere: TLBusW
case SerialTLAttachKey => up(SerialTLAttachKey, site).copy(masterWhere = masterWhere, slaveWhere = slaveWhere)
})
class WithTLBackingMemory extends Config((site, here, up) => {
case ExtMem => None // disable AXI backing memory
case ExtTLMem => up(ExtMem, site) // enable TL backing memory
})
class WithTileFrequency(fMHz: Double) extends ClockNameContainsAssignment("core", fMHz)
class WithPeripheryBusFrequencyAsDefault extends Config((site, here, up) => {

View File

@@ -51,6 +51,10 @@ case object ExtTLMem extends Field[Option[MemoryPortParams]](None)
/** Adds a port to the system intended to master an TL DRAM controller. */
trait CanHaveMasterTLMemPort { this: BaseSubsystem =>
require(!(p(ExtTLMem).nonEmpty && p(ExtMem).nonEmpty),
"Can only have 1 backing memory port. Use ExtTLMem for a TL memory port or ExtMem for an AXI memory port.")
private val memPortParamsOpt = p(ExtTLMem)
private val portName = "tl_mem"
private val device = new MemoryDevice