From fa902281aa77744b18f2cfb5ca78b9259789ea0a Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Fri, 16 Sep 2022 14:05:20 +0200 Subject: [PATCH] integration/common/get_mem_data: Allow filemane_or_regions to be None and add endianness assertion. --- litex/soc/integration/common.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/litex/soc/integration/common.py b/litex/soc/integration/common.py index 1cdb9b0fa..00e572b43 100644 --- a/litex/soc/integration/common.py +++ b/litex/soc/integration/common.py @@ -41,6 +41,12 @@ def get_mem_regions(filename_or_regions, offset): def get_mem_data(filename_or_regions, data_width=32, endianness="big", mem_size=None, offset=0): assert data_width in [32, 64] + assert endianness in ["big", "little"] + + # Return empty list if no filename or regions. + if filename_or_regions is None: + return [] + # Create memory regions. regions = get_mem_regions(filename_or_regions, offset)