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

synth_gatemate: Ensure proper mapping of multiplexers #4746

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

pu-cc
Copy link
Contributor

@pu-cc pu-cc commented Nov 15, 2024

What are the reasons/motivation for this change?

This PR addresses an issue where multiplexers may remain unmapped, leading to their representation as simple assignments in the final netlist instead of as technology primitives.

Explain how this is achieved.

By running simplemap after muxcover, we ensure proper mapping of multiplexers into technology primitives.

@mmicko mmicko self-requested a review November 15, 2024 10:26
Copy link
Member

@povik povik left a comment

Choose a reason for hiding this comment

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

It's not clear what the issue is and how an unmapped mux gets to the final netlist. Do you perhaps have a reproducer?

@@ -301,6 +301,7 @@ struct SynthGateMatePass : public ScriptPass
}
run("muxcover " + muxcover_args);
run("opt -full");
run("simplemap");
Copy link
Member

Choose a reason for hiding this comment

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

simplemap will break down $mux into individual $_MUX_ slices so I would expect it sequenced before muxcover which expects $_MUX_ cells for its input. Then there's simplemap in the map_regs section already ahead of muxcover

Copy link
Member

Choose a reason for hiding this comment

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

Problem here is that in this case after opt -full $mux cells would appear again, so simplemap is needed them to get them back to $_MUX_.

@povik
Copy link
Member

povik commented Nov 15, 2024

I was provided a reproducer by @mmicko

Copy link
Member

@mmicko mmicko left a comment

Choose a reason for hiding this comment

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

This approach works fine, and there are potential improvements there, but let's leave that for future, since this unbreaks some use cases.

@mmicko mmicko merged commit 9fa9a2b into YosysHQ:main Nov 15, 2024
26 checks passed
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