diff --git a/litex/soc/integration/common.py b/litex/soc/integration/common.py index 695e56090..a5ac066ac 100644 --- a/litex/soc/integration/common.py +++ b/litex/soc/integration/common.py @@ -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: