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 #92

Closed
nmigen-issue-migration opened this issue Jun 4, 2019 · 1 comment
Labels
Milestone

Comments

@nmigen-issue-migration
Copy link

Issue by tdaede
Tuesday Jun 04, 2019 at 13:01 GMT
Originally opened as m-labs/nmigen#85


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()
@nmigen-issue-migration
Copy link
Author

Comment by whitequark
Tuesday Jun 04, 2019 at 13:16 GMT


Fixed in 537d918.

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

1 participant