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

Compat submodules always give "Elaboratable created but never used" traceback #85

Closed
tdaede opened this issue Jun 4, 2019 · 1 comment
Labels
Milestone

Comments

@tdaede
Copy link

tdaede commented Jun 4, 2019

Testcase:

#!/usr/bin/env python3
from nmigen import *
from nmigen.compat import *

class Compat2(Module):
    pass

class Compat(Module):
    def __init__(self):
        self.submodules += Compat2()

if __name__ == "__main__":
    m = Compat()
    f = Fragment.get(m, platform=None)

Output:

./testcase.py:10: DeprecationWarning: instead of `self.submodules +=`, use `m.submodules +=`
  self.submodules += Compat2()
Elaboratable created but never used
Traceback (most recent call last):
  File "./testcase.py", line 13, in <module>
    m = Compat()
  File "./testcase.py", line 10, in __init__
    self.submodules += Compat2()
@whitequark whitequark added the bug label Jun 4, 2019
@whitequark
Copy link
Contributor

Fixed in 537d918.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants