soc/integration/soc_core: fix get_mem_data for json files

This commit is contained in:
Florent Kermarrec 2019-04-25 18:36:47 +02:00
parent 4443b5075b
commit 0175f86cb2
1 changed files with 2 additions and 2 deletions

View File

@ -70,9 +70,9 @@ def get_mem_data(filename, endianness="big", mem_size=None):
for i in range(len(w), 4): for i in range(len(w), 4):
w += b'\x00' w += b'\x00'
if endianness == "little": if endianness == "little":
data[i] = struct.unpack("<I", w)[0] data[int(base, 16)//4 + i] = struct.unpack("<I", w)[0]
else: else:
data[i] = struct.unpack(">I", w)[0] data[int(base, 16)//4 + i] = struct.unpack(">I", w)[0]
i += 1 i += 1
return data return data