diff --git a/litex/soc/integration/soc_core.py b/litex/soc/integration/soc_core.py index cd8eb6de3..fba5ada2c 100644 --- a/litex/soc/integration/soc_core.py +++ b/litex/soc/integration/soc_core.py @@ -70,9 +70,9 @@ def get_mem_data(filename, endianness="big", mem_size=None): for i in range(len(w), 4): w += b'\x00' if endianness == "little": - data[i] = struct.unpack("I", w)[0] + data[int(base, 16)//4 + i] = struct.unpack(">I", w)[0] i += 1 return data