hdl.dsl: reject name mismatch in m.domains.<name> +=.
This would violate invariants later in the elaboration process. Fixes #282.
This commit is contained in:
parent
86b57fe6b6
commit
3df429703c
2 changed files with 10 additions and 0 deletions
|
|
@ -118,6 +118,10 @@ class _ModuleBuilderDomainSet:
|
|||
if not isinstance(domain, ClockDomain):
|
||||
raise TypeError("Only clock domains may be added to `m.domains`, not {!r}"
|
||||
.format(domain))
|
||||
if domain.name != name:
|
||||
raise NameError("Clock domain name {!r} must match name in `m.domains.{} += ...` "
|
||||
"syntax"
|
||||
.format(domain.name, name))
|
||||
self._builder._add_domain(domain)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue