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

Tristate elaborate #68

Closed
osterwood opened this issue May 19, 2019 · 3 comments
Closed

Tristate elaborate #68

osterwood opened this issue May 19, 2019 · 3 comments
Labels
Milestone

Comments

@osterwood
Copy link
Contributor

I think there may be a typo on line 47 of Tristate.elaborate().

def elaborate(self, platform):
if hasattr(platform, "get_tristate"):
return platform.get_tristate(self.triple, self.target)
m = Module()
m.d.comb += self.triple.i.eq(self.target)

The import statement at the top is:

from .module import Module as CompatModule

I think that Module should be CompatModule. But, making that change and running locally results in the following error.

File nmigen/compat/fhdl/module.py", line 133, in __getattr__
    .format(type(self).__name__, name))
AttributeError: 'CompatModule' object has no attribute 'd'

But, that error is causing me to second guess this change. Any ideas on what's going on here?

@whitequark
Copy link
Contributor

I think that Module should be CompatModule. But, making that change and running locally results in the following error.

Why do you think that? That import is correct. (Admittedly the naming in nmigen.compat is confusing, but clarity was not my first priority for that part of nMigen.)

@osterwood
Copy link
Contributor Author

I meant the m = Module() call on line 47, not the import. Sorry for the confusion.

But I think I've found the actual error, an additional import statement is needed

from ...hdl.dsl import Module

line 47 is correct, but Module is not currently imported in the file.

@whitequark
Copy link
Contributor

Yes, that seems right.

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