integration/common/get_mem_data: Allow filemane_or_regions to be None and add endianness assertion.

This commit is contained in:
Florent Kermarrec 2022-09-16 14:05:20 +02:00
parent d36f98bf45
commit fa902281aa

View file

@ -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)