From 251cea564744b144785072f5a09c466379695f3c Mon Sep 17 00:00:00 2001 From: Robert Wilbrandt Date: Sat, 20 Feb 2021 21:16:45 +0100 Subject: [PATCH] Add constants to SVD export --- litex/soc/integration/export.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/litex/soc/integration/export.py b/litex/soc/integration/export.py index f56dcd907..9e515796d 100644 --- a/litex/soc/integration/export.py +++ b/litex/soc/integration/export.py @@ -463,8 +463,9 @@ def get_csr_svd(soc, vendor="litex", name="soc", description=None): svd.append(' ') svd.append(' ') svd.append(' ') + svd.append(' ') + if len(soc.mem_regions) > 0: - svd.append(' ') svd.append(' ') for region_name, region in soc.mem_regions.items(): svd.append(' ') @@ -473,7 +474,13 @@ def get_csr_svd(soc, vendor="litex", name="soc", description=None): svd.append(' 0x{:08X}'.format(region.size)) svd.append(' ') svd.append(' ') - svd.append(' ') + + svd.append(' ') + for name, value in soc.constants.items(): + svd.append(' '.format(name, value)) + svd.append(' ') + + svd.append(' ') svd.append('') return "\n".join(svd)