integration/common: fix mem_decoder (shadow base has been deprecated)
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 10 Feb 2020 18:40:56 +0000 (19:40 +0100)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 10 Feb 2020 18:40:56 +0000 (19:40 +0100)
litex/soc/integration/common.py

index 695e56090ff893a41619491edb1838408390c921..a5ac066ac48e2bea8fd55ed8f5975fb171421d70 100644 (file)
@@ -13,12 +13,11 @@ from migen import *
 # Helpers ----------------------------------------------------------------------------------------
 
 def mem_decoder(address, size=0x10000000):
-    address &= ~0x80000000
     size = 2**log2_int(size, False)
     assert (address & (size - 1)) == 0
     address >>= 2 # bytes to words aligned
     size    >>= 2 # bytes to words aligned
-    return lambda a: (a[log2_int(size):-1] == (address >> log2_int(size)))
+    return lambda a: (a[log2_int(size):] == (address >> log2_int(size)))
 
 def get_version(with_time=True):
     if with_time: