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

Add flat version of sync_netlists_to_routing #2691

Conversation

fkosar-ql
Copy link
Contributor

@fkosar-ql fkosar-ql commented Aug 15, 2024

Run flat changes the internal cluster routing, and can also rotate truth tables in LUTs. To generate a bitstream or perform post-routing simulation, we need to update the intra-cluster routing data and mapping data of what inputs/outputs have been re-ordered by the router. this PR does that.

Description

Made a sync_netlists_to_routing flat routine which rebuilds the clustered netlist and the intra-cluster routing (pb_routes) and updates the atom lookup data structure.

Related Issue

Issue from OpenFPGA repo:

Motivation and Context

Flat routing won't be usable by QuickLogic, OpenFPGA etc. without this change.

How Has This Been Tested?

  • Ran with a QuickLogic architecture and verified the bitstream is correct
  • Ran with the flagship architecture and confirmed it doesn't crash.
    TODO:
  • Run with stratixiv_arch, confirm it doesn't crash (currently it does)
  • Run post-routing simulation on both flagship arch and stratixiv_arch to confirm they work.
  • Should put at least one run-flat post-routing simulation for flagship arch and stratix iv arch in CI.

Types of changes

  • Bug fix (change which fixes an issue)
  • New feature (change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • No documentation changes
  • I have added tests to cover my changes
  • All new and existing tests passed

@github-actions github-actions bot added VPR VPR FPGA Placement & Routing Tool lang-cpp C/C++ code labels Aug 15, 2024
@fkosar-ql fkosar-ql force-pushed the sync-packing-to-flat-routing branch from 7ba4dd1 to 4a955ec Compare August 15, 2024 18:00
@github-actions github-actions bot added the libarchfpga Library for handling FPGA Architecture descriptions label Aug 15, 2024
@vaughnbetz
Copy link
Contributor

Needs to be tested with stratix iv arch.
Needs to be tested with post-routing simulation.

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 nice overall. Good mapping reverse engineering!

Themes:

  1. Add Doxygen comments in various spots.
  2. Add warnings / asserts / comments on clocks needing to be ideal, and minimize the amount of code that checks if something is a clock. Please file an issue on clock remapping with flat routing. It may not be that hard to add clock support. In many cases there won't be any pin swappability, and when there is due to a small intra-cluster crossbar I think the code to figure out the pins is basically the same.

libs/libarchfpga/src/physical_types.h Outdated Show resolved Hide resolved
vpr/src/pack/post_routing_pb_pin_fixup.h Show resolved Hide resolved
vpr/src/pack/sync_netlists_to_routing_flat.cpp Outdated Show resolved Hide resolved
vpr/src/pack/sync_netlists_to_routing_flat.cpp Outdated Show resolved Hide resolved
vpr/src/pack/sync_netlists_to_routing_flat.cpp Outdated Show resolved Hide resolved
vpr/src/pack/sync_netlists_to_routing_flat.h Outdated Show resolved Hide resolved
vpr/src/route/annotate_routing.cpp Outdated Show resolved Hide resolved
vpr/src/route/annotate_routing.h Show resolved Hide resolved
vpr/src/route/route_utils.h Show resolved Hide resolved
@fkosar-ql fkosar-ql force-pushed the sync-packing-to-flat-routing branch from 7231688 to 58b5eac Compare September 9, 2024 23:48
@fkosar-ql fkosar-ql force-pushed the sync-packing-to-flat-routing branch from 3f55019 to 19dd7ba Compare September 30, 2024 21:39
@fkosar-ql fkosar-ql force-pushed the sync-packing-to-flat-routing branch from 19dd7ba to 551b987 Compare September 30, 2024 21:47
@vaughnbetz
Copy link
Contributor

The even/odd NoC routing failure is a known one that Soheil is working on; ignore it (he will disable the test if needed). (unit tests)
vtr_reg_strong: spree failed with parallel flat routing during netlist re-sync with signal 6 (seg fault). I suggest running valgrind. @duck2 tells me that regtest doesn't seg fault for him, but hopefully valgrind will show the issue.

@vaughnbetz
Copy link
Contributor

Hang also found a vulnerability / error in the connection router destructor with parallel routing and has fixed it in another PR. Probably not related but it would be good to rebase once that change goes in.

@duck2
Copy link
Contributor

duck2 commented Oct 1, 2024

todo: add flat spree.v to basic and run with sanitizer & valgrind

@duck2
Copy link
Contributor

duck2 commented Oct 3, 2024

Closing this PR and re-opening from a branch in this repo... since the CI doesn't seem to pull the right version?

@duck2 duck2 closed this Oct 3, 2024
fkosar-ql added a commit that referenced this pull request Oct 10, 2024
…-routing

Add flat version of sync_netlists_to_routing (see #2691)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang-cpp C/C++ code libarchfpga Library for handling FPGA Architecture descriptions VPR VPR FPGA Placement & Routing Tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants