From 86a43c9ff7141d625a92d75c1e9f5d99bb2d69ab Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Mon, 6 May 2024 14:59:17 +0200 Subject: [PATCH] integration/export: Fix get_csr_header/base_define when with_csr_base_define is set to False. --- litex/soc/integration/export.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litex/soc/integration/export.py b/litex/soc/integration/export.py index 21ac7e7fc..c443b0f62 100644 --- a/litex/soc/integration/export.py +++ b/litex/soc/integration/export.py @@ -266,7 +266,7 @@ def get_csr_header(regions, constants, csr_base=None, with_csr_base_define=True, r += "#endif\n" for name, region in regions.items(): origin = region.origin - _csr_base - base_define = not isinstance(region, MockCSRRegion) + base_define = with_csr_base_define and (not isinstance(region, MockCSRRegion)) r += "\n/* "+name+" */\n" r += f"#define CSR_{name.upper()}_BASE {_get_csr_addr(csr_base, origin, base_define)}\n" if not isinstance(region.obj, Memory):