From 5011b564c35e2a2e95347b149848dbae5e355420 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Mon, 12 Apr 2021 08:32:05 +0200 Subject: [PATCH] integration/soc: Add _ prefix to build_name when build_name starts with digit (Invalid verilog top level name). --- litex/soc/integration/soc.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/litex/soc/integration/soc.py b/litex/soc/integration/soc.py index db9c5ce9c..c5f3f4749 100644 --- a/litex/soc/integration/soc.py +++ b/litex/soc/integration/soc.py @@ -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)