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

Handling of unknown width for multiports #2057

Merged
merged 4 commits into from
Oct 26, 2023
Merged

Conversation

edwardalee
Copy link
Collaborator

@edwardalee edwardalee commented Oct 14, 2023

This fixes #1833.

@edwardalee edwardalee requested a review from cmnrd October 14, 2023 17:08
@edwardalee edwardalee added diagrams Problems with diagram synthesis bugfix labels Oct 14, 2023
Copy link
Member

@lhstrh lhstrh left a comment

Choose a reason for hiding this comment

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

LGTM! We should probably add the failing code from #1833 as a test case.

@edwardalee
Copy link
Collaborator Author

I don't know how to add a test for this. The NPE occurred during diagram synthesis. During compilation, you only get a a warning.

Note that fundamentally, because in Cpp the widths of banks and multiports may not be knowable before executing the code, you have no assurance that the diagram is correct. My fix errs on the side of making more connections rather than fewer. There are probably examples where you will get false reports of causality loops.

@cmnrd
Copy link
Collaborator

cmnrd commented Oct 15, 2023

Thanks for fixing this Edward! I think it is OK to assume more connections (and be conservative in cycle detection). Situations where this can go wrong are rather obscure.

Since we introduced the lfd tool, we also test diagram generation in CI. However, it is not fully functional at the moment, as I didn't figure out how to draw the diagrams fully expanded yet. So I am not sure if the bug would be triggered. In any case, I think it would be good to add a testcase.

@lhstrh lhstrh changed the title Handle unknown width for multiports Handling of unknown width for multiports Oct 26, 2023
@lhstrh lhstrh enabled auto-merge October 26, 2023 20:35
Copy link
Member

@lhstrh lhstrh left a comment

Choose a reason for hiding this comment

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

Approving this because having the fix is more important than not having the test.

@lhstrh lhstrh added this pull request to the merge queue Oct 26, 2023
Merged via the queue into master with commit 8e7980d Oct 26, 2023
41 checks passed
@lhstrh lhstrh deleted the handle-unknown-width branch October 26, 2023 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix diagrams Problems with diagram synthesis
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Misleading multiport warning and NullPointerException in diagram synthesis
3 participants