Add constants to SVD export
This commit is contained in:
parent
7513460572
commit
251cea5647
|
@ -463,8 +463,9 @@ def get_csr_svd(soc, vendor="litex", name="soc", description=None):
|
||||||
svd.append(' </interrupt>')
|
svd.append(' </interrupt>')
|
||||||
svd.append(' </peripheral>')
|
svd.append(' </peripheral>')
|
||||||
svd.append(' </peripherals>')
|
svd.append(' </peripherals>')
|
||||||
|
svd.append(' <vendorExtensions>')
|
||||||
|
|
||||||
if len(soc.mem_regions) > 0:
|
if len(soc.mem_regions) > 0:
|
||||||
svd.append(' <vendorExtensions>')
|
|
||||||
svd.append(' <memoryRegions>')
|
svd.append(' <memoryRegions>')
|
||||||
for region_name, region in soc.mem_regions.items():
|
for region_name, region in soc.mem_regions.items():
|
||||||
svd.append(' <memoryRegion>')
|
svd.append(' <memoryRegion>')
|
||||||
|
@ -473,7 +474,13 @@ def get_csr_svd(soc, vendor="litex", name="soc", description=None):
|
||||||
svd.append(' <size>0x{:08X}</size>'.format(region.size))
|
svd.append(' <size>0x{:08X}</size>'.format(region.size))
|
||||||
svd.append(' </memoryRegion>')
|
svd.append(' </memoryRegion>')
|
||||||
svd.append(' </memoryRegions>')
|
svd.append(' </memoryRegions>')
|
||||||
svd.append(' </vendorExtensions>')
|
|
||||||
|
svd.append(' <constants>')
|
||||||
|
for name, value in soc.constants.items():
|
||||||
|
svd.append(' <constant name="{}" value="{}" />'.format(name, value))
|
||||||
|
svd.append(' </constants>')
|
||||||
|
|
||||||
|
svd.append(' </vendorExtensions>')
|
||||||
svd.append('</device>')
|
svd.append('</device>')
|
||||||
return "\n".join(svd)
|
return "\n".join(svd)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue