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

Fix setting bits of parameters in setundef pass #4733

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kamilrakoczy
Copy link
Contributor

@kamilrakoczy kamilrakoczy commented Nov 12, 2024

What are the reasons/motivation for this change?

This PR fixes setting bits of parameters in setundef pass.

Explain how this is achieved.

Currently we are looping through module parameters using for (auto bit : parameter.second).
It is equivalent to:

for( auto _bit = parameter.second.begin(); _bit != parameter.second.end(); _bit++) {
    auto bit = *_bit;
    ...
}

where auto is resolved to RTLIL::Const.

Iterator that we are using is defined in Const class which iterates through State enum.

operator * of iterator returns copy of the state.

This PR changes to use reference instead.

If applicable, please suggest to reviewers how they can test the change.

I attached example test case that showcase the problem.

Fixes: #4732

This commit also adds test that verifies correctness of this change.
tgorochowik added a commit to chipsalliance/synlig that referenced this pull request Nov 22, 2024
This PR updates yosys.

It also applies patch to yosys until:
YosysHQ/yosys#4733 will be merged upstream.
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.

Module parameters are not affected by setundef pass
2 participants