mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
scripts/hwdef-parse: add memory view for each instance
This commit is contained in:
parent
f5a3c8c712
commit
4db0a98082
1 changed files with 20 additions and 0 deletions
|
@ -86,6 +86,9 @@ def vlnv_match(vlnv, whitelist):
|
|||
|
||||
return False
|
||||
|
||||
def remove_prefix(text, prefix):
|
||||
return text[text.startswith(prefix) and len(prefix):]
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
print('Usage: {} path/to/*.hwdef'.format(sys.argv[0]))
|
||||
print(' {} path/to/*.xml'.format(sys.argv[0]))
|
||||
|
@ -122,6 +125,23 @@ for module in modules:
|
|||
'vlnv' : vlnv
|
||||
}
|
||||
|
||||
# populate memory view
|
||||
mmap = module.find('.//MEMORYMAP')
|
||||
if not mmap:
|
||||
continue
|
||||
|
||||
mem = ips[instance].setdefault('memory-view', {})
|
||||
for mrange in mmap:
|
||||
mem_interface = remove_prefix(mrange.get('MASTERBUSINTERFACE'), 'M_AXI_')
|
||||
mem_instance = mrange.get('INSTANCE')
|
||||
|
||||
entry = mem.setdefault(mem_interface, {}).setdefault(mem_instance, {})
|
||||
|
||||
entry['baseaddr'] = int(mrange.get('BASEVALUE'), 16);
|
||||
entry['highaddr'] = int(mrange.get('HIGHVALUE'), 16);
|
||||
|
||||
|
||||
|
||||
# find PCI-e module to extract memory map
|
||||
pcie = root.find('.//MODULE[@MODTYPE="axi_pcie"]')
|
||||
mmap = pcie.find('.//MEMORYMAP')
|
||||
|
|
Loading…
Add table
Reference in a new issue