From a19bdd0e6a0952ddaba0d6fa4c50f2fc489c7819 Mon Sep 17 00:00:00 2001 From: Mateusz Holenko Date: Thu, 11 Jul 2019 10:13:54 +0200 Subject: [PATCH] soc_core: generate extra string-based config defines C preprocessor does not allow to compare strings, so the current defines are not usable at the compile time. This adds new defines that can be ifdefed. --- litex/soc/integration/soc_core.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/litex/soc/integration/soc_core.py b/litex/soc/integration/soc_core.py index 1fd7917f..50ff64ef 100644 --- a/litex/soc/integration/soc_core.py +++ b/litex/soc/integration/soc_core.py @@ -530,6 +530,8 @@ class SoCCore(Module): self._constants.append(((name + "_" + constant.name).upper(), constant.value.value)) for name, value in sorted(self.config.items(), key=itemgetter(0)): self._constants.append(("CONFIG_" + name.upper(), value)) + if isinstance(value, str): + self._constants.append(("CONFIG_" + name.upper() + "_" + value, 1)) # Connect interrupts if hasattr(self, "cpu"): -- 2.30.2