projects
/
litex.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ac2e961
)
fhdl.structure: do not permit clock domain names that start with numbers
author
Robert Jordens
<jordens@gmail.com>
Sun, 17 Aug 2014 20:56:33 +0000
(14:56 -0600)
committer
Sebastien Bourdeauducq
<sb@m-labs.hk>
Mon, 18 Aug 2014 03:01:56 +0000
(11:01 +0800)
migen/fhdl/structure.py
patch
|
blob
|
history
diff --git
a/migen/fhdl/structure.py
b/migen/fhdl/structure.py
index 4525266e6134b826ab0486a590f4ecd4f95abd0d..09342f544529eeeaf4bf4605233b3554bc85bb60 100644
(file)
--- 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