-
Notifications
You must be signed in to change notification settings - Fork 58
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
AssertionError domain.name not in self.domains #307
Comments
Not sure if this is the correct fix, but this seems to work for me : diff --git a/nmigen/hdl/ir.py b/nmigen/hdl/ir.py
index 26dec85..2b8b74c 100644
--- a/nmigen/hdl/ir.py
+++ b/nmigen/hdl/ir.py
@@ -142,7 +142,7 @@ class Fragment:
def add_domains(self, *domains):
for domain in flatten(domains):
assert isinstance(domain, ClockDomain)
- assert domain.name not in self.domains
+ assert (domain.name not in self.domains) or (self.domains[domain.name] == domain)
self.domains[domain.name] = domain
def iter_domains(self):
|
Likely not the correct fix, but an acceptable workaround. |
Fixed in my fork. |
sbourdeauducq
pushed a commit
that referenced
this issue
Feb 2, 2020
Since commit 7257c20, platform code calls create_missing_domains() before _propagate_domains_up() (as a part of prepare() call). Since commit a7be3b4, without a platform, create_missing_domains() is calle after _propagate_domains_up(); because of that, it adds the missing domain to the fragment. When platform code then calls prepare() again, this causes an assertion failure. The true intent behind the platform code being written this way is that it *overrides* a part of prepare()'s mechanism. Because it was not changed when prepare() was modified in 7257c20, the override, which happened to work by coincidence, stopped working. This is now fixed by inlining the relevant parts of Fragment.prepare() into Platform.prepare(). This is not a great solution, but given the amount of breakage this causes (no platform-using code works), it is acceptable for now. Fixes #307.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since a7be3b4, this code fails :
Code :
Error :
The text was updated successfully, but these errors were encountered: