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

[LowerToHW] Fix output port index mapping #6530

Merged
merged 1 commit into from
Dec 18, 2023

Conversation

prithayan
Copy link
Contributor

The LowerToHW logic that was moving the symbol from the port to the wire was incorrectly assuming that all the output ports are ordered after the input ports, this resulted in the port index mapping being incorrect.
This was causing the incorrect port symbol being moved to a temporary wire.
Fix the port index calculation logic.

Copy link
Contributor

@darthscsi darthscsi left a comment

Choose a reason for hiding this comment

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

LGTM

@darthscsi
Copy link
Contributor

It might be good to keep the port mapping in the portinfo like lowering info. I think I do something like this in lowersigs.

@prithayan
Copy link
Contributor Author

It might be good to keep the port mapping in the portinfo like lowering info. I think I do something like this in lowersigs.

Good idea, to avoid similar issues.

@prithayan prithayan merged commit 2caafc7 into main Dec 18, 2023
4 checks passed
@prithayan prithayan deleted the dev/pbarua/lower-to-hw-portindex-fix branch December 18, 2023 18:42
@dtzSiFive
Copy link
Contributor

💯 , thanks Prithayan!

And yeah totally the port lowering probably should be reworked a bit as well and if two separate bits of code have assumptions about ordering details that should be captured and used instead of implicit in the code.

Thanks for identifying the problem + quick fix!

mikeurbach pushed a commit that referenced this pull request Dec 21, 2023
The logic that was moving the symbol from the port to the wire was
 incorrectly assuming that all the output ports are ordered after the input
  ports, this resulted in the port index mapping being incorrect.
This was causing the incorrect port symbol being moved to a temporary wire.
This commit fixes the port index calculation logic.
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.

3 participants