From: Mateusz Holenko Date: Thu, 11 Jul 2019 08:13:54 +0000 (+0200) Subject: soc_core: generate extra string-based config defines X-Git-Tag: 24jan2021_ls180~1091^2~1 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a19bdd0e6a0952ddaba0d6fa4c50f2fc489c7819;p=litex.git 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. --- 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"):