integration/soc: Add _ prefix to build_name when build_name starts with digit (Invalid verilog top level name).

This commit is contained in:
Florent Kermarrec 2021-04-12 08:32:05 +02:00
parent 15cf4d75e9
commit 5011b564c3
1 changed files with 2 additions and 0 deletions

View File

@ -1092,6 +1092,8 @@ class SoC(Module):
# SoC build ------------------------------------------------------------------------------------
def build(self, *args, **kwargs):
self.build_name = kwargs.pop("build_name", self.platform.name)
if self.build_name[0].isdigit():
self.build_name = f"_{self.build_name}"
kwargs.update({"build_name": self.build_name})
return self.platform.build(self, *args, **kwargs)