fix config string generation for extra devices
This commit is contained in:
parent
647dbefd9b
commit
e0ae039235
@ -94,12 +94,12 @@ class BasePlatformConfig extends Config (
|
|||||||
res append " };\n"
|
res append " };\n"
|
||||||
res append " };\n"
|
res append " };\n"
|
||||||
}
|
}
|
||||||
|
res append "};\n"
|
||||||
for (device <- site(ExtraDevices)) {
|
for (device <- site(ExtraDevices)) {
|
||||||
val deviceName = device.addrMapEntry.name
|
val deviceName = device.addrMapEntry.name
|
||||||
val deviceRegion = addrMap("io:ext:" + deviceName)
|
val deviceRegion = addrMap("io:ext:" + deviceName)
|
||||||
res.append(device.makeConfigString(deviceRegion))
|
res.append(device.makeConfigString(deviceRegion))
|
||||||
}
|
}
|
||||||
res append "};\n"
|
|
||||||
res append '\u0000'
|
res append '\u0000'
|
||||||
res.toString.getBytes
|
res.toString.getBytes
|
||||||
}
|
}
|
||||||
|
@ -12,9 +12,9 @@ abstract class Device {
|
|||||||
def builder(port: ClientUncachedTileLinkIO, extra: Bundle, p: Parameters): Unit
|
def builder(port: ClientUncachedTileLinkIO, extra: Bundle, p: Parameters): Unit
|
||||||
def addrMapEntry: AddrMapEntry
|
def addrMapEntry: AddrMapEntry
|
||||||
def makeConfigString(region: MemRegion): String = {
|
def makeConfigString(region: MemRegion): String = {
|
||||||
s" ${addrMapEntry.name} {\n" +
|
s"${addrMapEntry.name} {\n" +
|
||||||
s" addr 0x${region.start.toString(16)};\n" +
|
s" addr 0x${region.start.toString(16)};\n" +
|
||||||
s" size 0x${region.size.toString(16)}; \n" +
|
s" size 0x${region.size.toString(16)}; \n" +
|
||||||
" }\n"
|
"}\n"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user