-
Notifications
You must be signed in to change notification settings - Fork 250
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
nexus: LUT and FF clustering #863
Conversation
Signed-off-by: Maciej Kurc <[email protected]>
Signed-off-by: Maciej Kurc <[email protected]>
Signed-off-by: Maciej Kurc <[email protected]>
…rameter controlling the ratio of FFs that got glued to carry-chain clusters. Signed-off-by: Maciej Kurc <[email protected]>
ff->constr_y = lut->constr_y; | ||
ff->constr_z = lut->constr_z + 2; | ||
ff->constr_abs_z = lut->constr_abs_z; | ||
root->constr_children.push_back(ff); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this case also needs to be checking that the FF can legally be added to the cluster (i.e. CLK/LSR/CE sharing etc)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, you are right. I missed that... I'll push a fix soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, should be fixed by now.
…configuration Signed-off-by: Maciej Kurc <[email protected]>
Thanks! |
This PR adds to the nexus architecture inference of directly connected LUT+FF pairs followed by clustering them together.
For each directly connected LUT and FF nextpnr now creates a new cluster. Moreover it glues FFs to existing clusters comprised of LUTs like wide LUTs and carry-chains.
The new behavior is enabled by default but can be disabled by the
--no-pack-lutff
option. Another option--carry-lutff-ratio
allows to specify a ratio of clustering together FFs and LUTs which are part of carry-chains.The added clustering approach has been analyzed on a single design (the SoC from https://chromium.googlesource.com/chromiumos/platform/hps-firmware) targeting LIFCL-17 FPGA using 500 chosen seeds. A timeout of 5min was set for each run so that when it expired a run was considered a failure. The conclusions are the following:
The following two charts show router2 progression in terms of overused wire count vs. iteration count. Each trace is terminated either with a green circle (indicating a success) or a red "x" (indicating a failure). Plots are clipped to 200 iterations for better clarity.
No clustering:

With clustering:

I'm also attaching CSV files with the gathered statistical results:
no-clustering.csv
with-clustering.csv
As it can be seen in the pictures with the LUT and FF clustering enabled the router is able to converge much quicker and gets stuck more rarely.
The option to specify clustering ratio for FFs and existing carry-chain clusters is meant to mitigate situations when placement of such large clusters of fully populated slices cannot be legalized.