Skip to content

More fixes to sync_netlists_to_routing_flat #2867

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

Merged
merged 22 commits into from
Apr 28, 2025
Merged

Conversation

fkosar-ql
Copy link
Contributor

@fkosar-ql fkosar-ql commented Jan 21, 2025

This PR contains a number of fixes to enable OpenFPGA bitstream generation using flat router results:

  • "Unset" port equivalence in the architecture (in memory) before flat routing starts. This is for compatibility with OpenFPGA (also may simplify the sync code)
  • Rename new cluster nets created while rebuilding the clustered netlist more consistently (avoid name clashes)
  • In annotate_rr_node_nets, don't fail right away if two cluster nets point to the same RR nodes, instead check if they are mapped to the same atom net. (This lets OpenFPGA have net -> rr node annotations without having to split the flat route trees if an atom net produced two or more cluster nets)

@github-actions github-actions bot added VPR VPR FPGA Placement & Routing Tool lang-cpp C/C++ code labels Jan 21, 2025
@vaughnbetz
Copy link
Contributor

Crash in flat routing so some bug still.
Please add an output message (that is easy to interpret) when you turn off pin equivalence in memory (should say you're doing this and why).
Should run the nightly tests manually once basic CI passes.

Copy link
Contributor

@vaughnbetz vaughnbetz left a comment

Choose a reason for hiding this comment

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

Looks mostly good -- some commenting requested.

@fkosar-ql
Copy link
Contributor Author

No idea how it's passing with the current version of sync_netlists_to_routing_flat, but spree.v seems to connect some global nets to CLBs and routing fails when I try to run with --constant_net_method route. This means the synchronized results will be invalid since the flat router does not see which pins the globals are using.

For now I'm just adding a warning for that case to make the CI work, but it should be handled at some point.

@amin1377 amin1377 self-requested a review March 20, 2025 20:27
@amin1377
Copy link
Contributor

@vaughnbetz @duck2

I looked into the circuit Fahri pointed out, and the reason it fails to route is that the CIN pin on a CLB (loc: 11,6) is connected to a constant net, where the source of the constant net generator is located in a different column (loc:1,5). Since CIN is not connected to the general routing resources, the flat router fails to route it. The two-stage router also fails when routing of constant nets is enabled.

@amin1377
Copy link
Contributor

Adding @AmirhosseinPoolad as a reviewer for the code I modified in the packer.

Copy link
Contributor

@AmirhosseinPoolad AmirhosseinPoolad left a comment

Choose a reason for hiding this comment

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

Thank you for the changes @amin1377! I just had a bunch of nitpicks.

Copy link
Contributor

@vaughnbetz vaughnbetz left a comment

Choose a reason for hiding this comment

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

Thanks! Some commenting enhancements suggested.

@amin1377
Copy link
Contributor

Thanks @vaughnbetz and @AmirhosseinPoolad for reviewing the code. I've addressed your comments. I also ran the nightly tests a few days ago to ensure they are passing ([Link]). Aside from some AP tests (which are also failing on the master branch, [Link]), all other tests passed.

@AlexandreSinger FYI.

@AlexandreSinger
Copy link
Contributor

Thanks @vaughnbetz and @AmirhosseinPoolad for reviewing the code. I've addressed your comments. I also ran the nightly tests a few days ago to ensure they are passing ([Link]). Aside from some AP tests (which are also failing on the master branch, [Link]), all other tests passed.

@AlexandreSinger FYI.

@amin1377 Thanks for pointing this out! I got the notification this morning. I have a fix that I am testing now. Will raise a PR today fixing the AP failure.

@amin1377
Copy link
Contributor

@AmirhosseinPoolad All tests are passing, and the merge conflicts have been resolved. Feel free to merge the PR if you have no further comments.

@vaughnbetz vaughnbetz merged commit 796f652 into master Apr 28, 2025
36 checks passed
@vaughnbetz vaughnbetz deleted the fix-flat-bitgen branch April 28, 2025 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang-cpp C/C++ code VPR VPR FPGA Placement & Routing Tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants