rocketchip: rename identically names devices with _%d (#340)
* rocketchip: rename identically names devices with _%d If you connect two devices with the same name in TL2 (totally ok there), when they get put into the TL1 addrmap, one gets silently overwritten. This renames the second occurance as _1, third as _2, and so on... * junctions: blow if duplicates add to addrmap
This commit is contained in:
parent
77a0f76289
commit
14cd39e045
@ -75,6 +75,8 @@ class AddrMap(
|
|||||||
var prot = 0
|
var prot = 0
|
||||||
var cacheable = true
|
var cacheable = true
|
||||||
for (AddrMapEntry(name, r) <- entriesIn) {
|
for (AddrMapEntry(name, r) <- entriesIn) {
|
||||||
|
require (!mapping.contains(name))
|
||||||
|
|
||||||
if (r.start != 0) {
|
if (r.start != 0) {
|
||||||
base = r.start
|
base = r.start
|
||||||
} else {
|
} else {
|
||||||
|
@ -83,7 +83,12 @@ object GenerateGlobalAddrMap {
|
|||||||
}
|
}
|
||||||
}.flatten
|
}.flatten
|
||||||
|
|
||||||
lazy val tl2AddrMap = new AddrMap(tl2Devices, collapse = true)
|
lazy val uniquelyNamedTL2Devices =
|
||||||
|
tl2Devices.groupBy(_.name).values.map(_.zipWithIndex.map {
|
||||||
|
case (e, i) => if (i == 0) e else e.copy(name = e.name + "_" + i)
|
||||||
|
}).flatten.toList
|
||||||
|
|
||||||
|
lazy val tl2AddrMap = new AddrMap(uniquelyNamedTL2Devices, collapse = true)
|
||||||
lazy val pBusIOAddrMap = new AddrMap(AddrMapEntry("TL2", tl2AddrMap) +: (p(ExtMMIOPorts) ++ pDevicesEntries), collapse = true)
|
lazy val pBusIOAddrMap = new AddrMap(AddrMapEntry("TL2", tl2AddrMap) +: (p(ExtMMIOPorts) ++ pDevicesEntries), collapse = true)
|
||||||
|
|
||||||
val memBase = 0x80000000L
|
val memBase = 0x80000000L
|
||||||
|
Loading…
Reference in New Issue
Block a user