mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
integration/common/get_mem_data: Allow filemane_or_regions to be None and add endianness assertion.
This commit is contained in:
parent
d36f98bf45
commit
fa902281aa
1 changed files with 6 additions and 0 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue