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

Change the type of current_module to Module #2754

Merged
merged 1 commit into from
May 14, 2021

Conversation

rswarbrick
Copy link
Contributor

The current_module global is needed so that genRTLIL has somewhere to
put cells and wires that it generates as it makes sense of expressions
that it sees. However, that doesn't actually need to be an AstModule:
the Module base class is enough.

This patch should cause no functional change, but the point is that
it's now possible to call genRTLIL with a module that isn't an
AstModule as "current_module". This will be needed for 'bind' support.

(Note: This patch is part of the larger queue at #2752. The idea is to split things out to avoid having a giant PR to review all at once)

@rswarbrick rswarbrick requested a review from zachjs as a code owner May 13, 2021 11:58
The current_module global is needed so that genRTLIL has somewhere to
put cells and wires that it generates as it makes sense of expressions
that it sees. However, that doesn't actually need to be an AstModule:
the Module base class is enough.

This patch should cause no functional change, but the point is that
it's now possible to call genRTLIL with a module that isn't an
AstModule as "current_module". This will be needed for 'bind' support.
Copy link
Collaborator

@zachjs zachjs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obviously the continued use of the current_module global is not ideal, but the direction you're headed here doesn't make the situation worse at all. I think this is reasonable.

@zachjs zachjs merged commit 3421979 into YosysHQ:master May 14, 2021
@rswarbrick rswarbrick deleted the current-module-type branch May 14, 2021 08:27
@rswarbrick
Copy link
Contributor Author

Yep, I agree. I guess any further tidy-up will still have some notion of the current module (even if it's no longer a global), so I think this change would be needed in some form even with such a tidy-up.

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

Successfully merging this pull request may close these issues.

2 participants