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:
Mateusz Holenko 2019-07-11 10:13:54 +02:00
parent 005c07769b
commit a19bdd0e6a

View file

@ -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"):