csr/sram: fix reads on high addresses when word_bits != 0
This commit is contained in:
parent
e5e3492afe
commit
85813b3b58
|
@ -107,10 +107,10 @@ class SRAM(Module):
|
|||
]
|
||||
|
||||
if self._page is None:
|
||||
self.comb += port.adr.eq(self.bus.adr[word_bits:flen(port.adr)])
|
||||
self.comb += port.adr.eq(self.bus.adr[word_bits:word_bits+flen(port.adr)])
|
||||
else:
|
||||
pv = self._page.storage
|
||||
self.comb += port.adr.eq(Cat(self.bus.adr[word_bits:flen(port.adr)-flen(pv)], pv))
|
||||
self.comb += port.adr.eq(Cat(self.bus.adr[word_bits:word_bits+flen(port.adr)-flen(pv)], pv))
|
||||
|
||||
def get_csrs(self):
|
||||
if self._page is None:
|
||||
|
|
Loading…
Reference in New Issue