bus/lasmibus/Crossbar: support cba_shift=0
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Tue, 11 Jun 2013 16:15:49 +0000 (18:15 +0200)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Tue, 11 Jun 2013 16:15:49 +0000 (18:15 +0200)
migen/bus/lasmibus.py

index 18259d29c014e065f0f151172dbe8ead642171b8..201a9f714731441ff40b217e710f6b5d4fc6b532 100644 (file)
@@ -133,7 +133,10 @@ class Crossbar(Module):
                        cba_upper = cba_shift + controller_bits + bank_bits
                        self.comb += cba.eq(master.adr[cba_shift:cba_upper])
                        if cba_shift < rca_bits:
-                               self.comb += rca.eq(Cat(master.adr[:cba_shift], master.adr[cba_upper:]))
+                               if cba_shift:
+                                       self.comb += rca.eq(Cat(master.adr[:cba_shift], master.adr[cba_upper:]))
+                               else:
+                                       self.comb += rca.eq(master.adr[cba_upper:])
                        else:
                                self.comb += rca.eq(master.adr[:cba_shift])