WB2CSR: Use CSR address_width for the wishbone bus

Currently, we create a wishbone interface with the default address
width (30 bits) for the bridge. Instead, create an interface that
has the same number of address bits as the CSR bus.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:
Benjamin Herrenschmidt 2020-05-12 21:37:36 +10:00
parent 520c17e96d
commit f628ff6b47
1 changed files with 3 additions and 3 deletions

View File

@ -10,12 +10,12 @@ from litex.soc.interconnect import csr_bus, wishbone
class WB2CSR(Module): class WB2CSR(Module):
def __init__(self, bus_wishbone=None, bus_csr=None): def __init__(self, bus_wishbone=None, bus_csr=None):
if bus_wishbone is None:
bus_wishbone = wishbone.Interface()
self.wishbone = bus_wishbone
if bus_csr is None: if bus_csr is None:
bus_csr = csr_bus.Interface() bus_csr = csr_bus.Interface()
self.csr = bus_csr self.csr = bus_csr
if bus_wishbone is None:
bus_wishbone = wishbone.Interface(adr_width=bus_csr.address_width)
self.wishbone = bus_wishbone
# # # # # #