Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad error message for duplicate ClockDomain #385

Closed
rroohhh opened this issue May 12, 2020 · 0 comments
Closed

Bad error message for duplicate ClockDomain #385

rroohhh opened this issue May 12, 2020 · 0 comments
Labels
Milestone

Comments

@rroohhh
Copy link
Contributor

rroohhh commented May 12, 2020

Adding a ClockDomain with the same name multiple times gives a bad error message. This example:

from nmigen import *
from nmigen.back.verilog import convert

m = Module()
m.domains += ClockDomain("a")
m.domains += ClockDomain("a")

convert(m)

produces this output:

  File "a.py", line 8, in <module>
    convert(m)
  File "/home/robin/.guix-profile/lib/python3.7/site-packages/nmigen/back/verilog.py", line 86, in convert
    rtlil_text = rtlil.convert(*args, **kwargs)
  File "/home/robin/.guix-profile/lib/python3.7/site-packages/nmigen/back/rtlil.py", line 1039, in convert
    fragment = ir.Fragment.get(elaboratable, platform).prepare(**kwargs)
  File "/home/robin/.guix-profile/lib/python3.7/site-packages/nmigen/hdl/ir.py", line 39, in get
    obj = obj.elaborate(platform)
  File "/home/robin/.guix-profile/lib/python3.7/site-packages/nmigen/hdl/dsl.py", line 544, in elaborate
    fragment.add_domains(self._domains)
  File "/home/robin/.guix-profile/lib/python3.7/site-packages/nmigen/hdl/ir.py", line 117, in add_domains
    assert domain.name not in self.domains
AssertionError
@whitequark whitequark added the bug label May 12, 2020
@whitequark whitequark added this to the 0.3 milestone May 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants