soc/add_cpu: Add CPU_NAME constant.

This commit is contained in:
Florent Kermarrec 2024-03-08 18:51:26 +01:00
parent 94e644ba92
commit 49f12ea297
1 changed files with 1 additions and 0 deletions

View File

@ -1252,6 +1252,7 @@ class SoC(LiteXModule, SoCCoreCompat):
# Add constants. # Add constants.
self.add_config(f"CPU_TYPE_{name}") self.add_config(f"CPU_TYPE_{name}")
self.add_config(f"CPU_VARIANT_{str(variant.split('+')[0])}") self.add_config(f"CPU_VARIANT_{str(variant.split('+')[0])}")
self.add_config("CPU_NAME", getattr(self.cpu, "name", "Unknown"))
self.add_config("CPU_HUMAN_NAME", getattr(self.cpu, "human_name", "Unknown")) self.add_config("CPU_HUMAN_NAME", getattr(self.cpu, "human_name", "Unknown"))
if hasattr(self.cpu, "nop"): if hasattr(self.cpu, "nop"):
self.add_config("CPU_NOP", self.cpu.nop) self.add_config("CPU_NOP", self.cpu.nop)