From: Florent Kermarrec Date: Thu, 25 Apr 2019 16:36:47 +0000 (+0200) Subject: soc/integration/soc_core: fix get_mem_data for json files X-Git-Tag: 24jan2021_ls180~1268 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0175f86cb21e4dac3f2b25e38830112d1b976e86;p=litex.git soc/integration/soc_core: fix get_mem_data for json files --- diff --git a/litex/soc/integration/soc_core.py b/litex/soc/integration/soc_core.py index cd8eb6de..fba5ada2 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