WB2CSR: Use CSR address_width for the wishbone bus
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 12 May 2020 11:37:36 +0000 (21:37 +1000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 12 May 2020 11:37:36 +0000 (21:37 +1000)
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>
litex/soc/interconnect/wishbone2csr.py

index b9544aad63b05d22bb076005aa6c8bbbc4b043b6..c9e307790adb876b31ed820ef6a992c658b600ea 100644 (file)
@@ -10,12 +10,12 @@ from litex.soc.interconnect import csr_bus, wishbone
 
 class WB2CSR(Module):
     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:
             bus_csr = csr_bus.Interface()
         self.csr = bus_csr
+        if bus_wishbone is None:
+            bus_wishbone = wishbone.Interface(adr_width=bus_csr.address_width)
+        self.wishbone = bus_wishbone
 
         # # #