mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
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.
This commit is contained in:
parent
005c07769b
commit
a19bdd0e6a
1 changed files with 2 additions and 0 deletions
|
@ -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"):
|
||||
|
|
Loading…
Reference in a new issue