From: Robert Jordens Date: Sun, 17 Aug 2014 20:56:33 +0000 (-0600) Subject: fhdl.structure: do not permit clock domain names that start with numbers X-Git-Tag: 24jan2021_ls180~2099^2~317 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bd232f3f61b21c3b38dd0c6b6e1e4c507d18471e;p=litex.git fhdl.structure: do not permit clock domain names that start with numbers --- diff --git a/migen/fhdl/structure.py b/migen/fhdl/structure.py index 4525266e..09342f54 100644 --- a/migen/fhdl/structure.py +++ b/migen/fhdl/structure.py @@ -511,8 +511,10 @@ class ClockDomain: self.name = tracer.get_obj_var_name(name) if self.name is None: raise ValueError("Cannot extract clock domain name from code, need to specify.") - if len(self.name) > 3 and self.name[:3] == "cd_": + if self.name.startswith("cd_"): self.name = self.name[3:] + if self.name[0].isdigit(): + raise ValueError("Clock domain name cannot start with a number.") self.clk = Signal(name_override=self.name + "_clk") if reset_less: self.rst = None