fhdl.structure: do not permit clock domain names that start with numbers
This commit is contained in:
parent
ac2e961618
commit
bd232f3f61
|
@ -511,8 +511,10 @@ class ClockDomain:
|
||||||
self.name = tracer.get_obj_var_name(name)
|
self.name = tracer.get_obj_var_name(name)
|
||||||
if self.name is None:
|
if self.name is None:
|
||||||
raise ValueError("Cannot extract clock domain name from code, need to specify.")
|
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:]
|
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")
|
self.clk = Signal(name_override=self.name + "_clk")
|
||||||
if reset_less:
|
if reset_less:
|
||||||
self.rst = None
|
self.rst = None
|
||||||
|
|
Loading…
Reference in New Issue