Skip to content

[Place] Independent Placement Verification #2769

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

Conversation

AlexandreSinger
Copy link
Contributor

Created a method that would independently verify the placement in the VPR flow. If a placement passes this verification, it is assumed that it can be used in routing without issue.

By design, this method does not use any global variables (everything needs to be passed in) and recomputes everything that it does not assume. This allows it to be independent of the placement flow being used, so this method can be used in the AP flow as well.

@github-actions github-actions bot added VPR VPR FPGA Placement & Routing Tool lang-cpp C/C++ code labels Oct 13, 2024
@AlexandreSinger AlexandreSinger force-pushed the feature-verify-placement branch from e91a7ed to 176844b Compare October 13, 2024 18:55
@AlexandreSinger
Copy link
Contributor Author

@vaughnbetz This is the check_place changes we discussed on Friday. I split out all of the invariants from the check_place method and used it to create this method. The idea of the verify_placement method is to be an independent check to ensure that all the necessary data structures of placement are filled correctly such that the rest of the VPR flow has no issues (nothing more, nothing less). Please review.

I do have a FIXME in this code which I am not sure about. Are the macros required for the rest of the VPR flow? My intention for this code is that this MUST pass in order for the rest of the VPR flow to be used without issue; but I do not see uses of the pl_macros anywhere outside of placement (and drawing). If they are not used then I think this check should happen somewhere else. What do you think?

@vaughnbetz
Copy link
Contributor

If the macros aren't respected generally routing will fail, as the main reason macros are created is for fixed routing patterns (no programmability). So I'd check them.

@soheilshahrouz
Copy link
Contributor

A few checks are done in sync_grid_to_blocks() function. I feel those check belong to verify_placement.cpp.

@vaughnbetz
Copy link
Contributor

This looks good to me. @AlexandreSinger feel free to merge when you are ready. I tend to agree with @soheilshahrouz that a few blank lines to break up concepts are helpful to readability, but will leave it to you to decide if /where to add any blank lines.

@vaughnbetz
Copy link
Contributor

As we discussed the sync_grid_to_blocks() function call could/should be moved inside load_placement, which will make the overall control a bit cleaner. You could also move the post_place_sync () function call into both the end of placement and the end of load_placement if you like, as that would again simplify the overall control.

Merge whenever you see fit ...

@AlexandreSinger
Copy link
Contributor Author

AlexandreSinger commented Nov 6, 2024

@soheilshahrouz @vaughnbetz I looked into the sync_grid_to_blocks() method in detail and found something troubling. All of the checks in this function are already in the verifier; however, there is an issue with how blocks are placed in the grid. The placer always places clusters in the root tile location of large blocks (and leaves the other locations in that tile alone); but this method places clusters in ALL locations of a tile (so a 2x2 tile would have the cluster placed in 4 tile locations).

I found that some strong tests (specifically the flat router) rely on this placement style.

This inconsistency makes it impossible to make a full verifier. You would need to call the verifier, then call sync_grid_to_blocks() afterwards and never call the verifier again (since the output of this method would not pass the verified since the verifier is checking that only the root tile location has a placed block). I decided to not let this block this PR; however I have raised an issue on this topic: see issue #2801

I will raise a separate PR to fix this issue, but we should come to a consensus on which of these two is correct. Do we only want to place the clusters at the root tile locations? Or do we want to place the clusters at all tile locations of the large tile?

@vaughnbetz Are you ok with me merging this PR?

@vaughnbetz
Copy link
Contributor

We should only place blocks at the root position in the grid; that's faster, so it's what we want to do during placement. Not sure why sync_blocks_to_grid isn't doing that, but I think we should change it and see if anything breaks (it shouldn't).

I'm OK with merging.

@danahow
Copy link

danahow commented Nov 6, 2024

If you want to mark each and every grid covered by a tile, fill in non-root grids with a pointer to the associated root grid. These extra pointers never need to change.

@vaughnbetz
Copy link
Contributor

That's what happens now; the grid has non-root node locations point back to the root node.

Created a method that would independently verify the placement in the
VPR flow. If a placement passes this verification, it is assumed that it
can be used in routing without issue.

By design, this method does not use any global variables (everything
needs to be passed in) and recomputes everything that it does not
assume. This allows it to be independent of the placement flow being
used, so this method can be used in the AP flow as well.
@AlexandreSinger AlexandreSinger force-pushed the feature-verify-placement branch from c18e984 to c096e2f Compare November 7, 2024 02:44
@AlexandreSinger AlexandreSinger merged commit 045a9e8 into verilog-to-routing:master Nov 7, 2024
37 checks passed
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.

4 participants