From 0175f86cb21e4dac3f2b25e38830112d1b976e86 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Thu, 25 Apr 2019 18:36:47 +0200 Subject: [PATCH] soc/integration/soc_core: fix get_mem_data for json files --- litex/soc/integration/soc_core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.30.2