-
Notifications
You must be signed in to change notification settings - Fork 895
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
gowin: add mux techmap and whitebox #4004
base: main
Are you sure you want to change the base?
Conversation
Let's see if I understand the effect here vis-a-vis the gowin synthesis script.
Do we have an idea of what to expect with respect to QoR? Isn't the optimized mux gate mapping here what ABC should come up with on its own anyway if it were smart enough (with |
I actually feel slightly pessimistic about this PR specifically as mentioned, ABC (or ABC9) can generate better results provided that they are mux-aware. I'm thinking if it's instead better to teach ABC9 that LUT4 + LUT4 + MUX2_LUT5 exists, and is not simply a LUT5. My current thoughts on this is that this is not perfect, and in fact pessimizes more often than not, but if you in fact need a MUX8, this is the only way to generate it, at least with an ABC9 flow. |
Ah, so this uses the primitives in a way ABC doesn't consider, is that right?
Not sure I understand you here. |
I haven't tried with ABC, but with ABC9, MUX4s are generated by a LUT6.
module _MUX8(input [7:0] x, input [2:0] sel, output reg y);
always @* begin
y = x[sel];
end
endmodule Take this code for example, then Yosys apparently generates this by making a MUX4 using 4xLUT1, 1xMUX2_LUT5, 1xMUX2_LUT6, and then it does something with the other inputs, and feeds it to a LUT4 in the end, to create the final result. From what I understand, signals would propagate through the LUT1, MUX2_LUT5, MUX2_LUT6, LUT4. With this MUX8, it would go through LUT3, MUX2_LUT5, MUX2_LUT6, where the first LUT also implementing a MUX. i.e. it gets to convert it to a mux tree. The commands I used to generate both are: This is probably not scientific, but these are the timings according to nextpnr:
As you can see however, while the MUX8 is better at being a MUX, it might still pessimize in larger designs, as that LUT3 is unable to have additional logic, and instead only serves as a MUX2. |
No description provided.