Fix the backup memory port on multiple-channel configs
The backup memory port doesn't work on multi-channel configurations, it just screws up the Nasti tag bits. This patch always instantiates a single-channel backup memory port, which relies on the memory channel selector to only enable a single memory channel when the backup memory port is enabled. There are some assertions to make sure this happens, as otherwise memory gets silently corrupted. While this is a bit of a hack, the backup memory port will be going away soon so I don't want to spend a whole lot of time fixing it. The generated hardware is actually very similar: we used to elaborate a Nasti arbiter inside the backup memory support, now there's one outside of it instead.
This commit is contained in:
parent
7c0c48fac4
commit
7319f430d0
@ -334,6 +334,13 @@ class OuterMemorySystem(implicit val p: Parameters) extends Module with HasTopLe
|
||||
if(p(UseBackupMemoryPort)) {
|
||||
VLSIUtils.doOuterMemorySystemSerdes(
|
||||
mem_channels, io.mem, io.mem_backup, io.mem_backup_en,
|
||||
nMemChannels, htifW, p(CacheBlockOffsetBits))
|
||||
1, htifW, p(CacheBlockOffsetBits))
|
||||
for (i <- 1 until nMemChannels) { io.mem(i) <> mem_channels(i) }
|
||||
assert(!Vec(mem_channels.map{ io => io.r.valid }).toBits.orR ||
|
||||
!io.mem_backup_en ||
|
||||
Vec(channelConfigs.map{i => UInt(i)})(io.memory_channel_mux_select) === UInt(1),
|
||||
"Backup memory port only works when 1 memory channel is enabled")
|
||||
Predef.assert(channelConfigs.sortWith(_ < _)(0) == 1,
|
||||
"Backup memory port requires a single memory port mux config")
|
||||
} else { io.mem <> mem_channels }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user