-
Notifications
You must be signed in to change notification settings - Fork 414
legalizer frontend #2615
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
legalizer frontend #2615
Conversation
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.
Some suggested changes.
One more thing: we'll need a documentation topic for the new file format and command line options. The high level documentation can be in the new file format description (that matches what we do for other things, like floorplanning constraints).
Between the documentation and some high level commenting, the overall flow & use case of a flat placement should be clear (right now the big picture isn't documented). The separate documentation can be done in a separate PR if more convenient.
We should also define if a flat placement needs to include a placement for every atom or if only some is OK (in that high level documentation).
@AlexandreSinger can you help me figure out why these keep failing? |
It looks like memory corruption. I looked at one of the strong regtests, and there are a huge number of failures due to vpr not completing. You can download the raw logs by clicking on the gear icon after clicking on a test: 2024-06-18T12:15:00.0635639Z �[32;1m12:15:00�[0m | log file : /root/vtr-verilog-to-routing/vtr-verilog-to-routing/vtr_flow/tasks/regression_tests/vtr_reg_nightly_test7/titan_other_run_flat/run001/stratixiv_arch.timing.xml/sudoku_check_stratixiv_arch_timing.blif/common/vpr.out You can see the vpr output by selecting the download log archive from the same gear icon, double clicking on a regression test and opening the big text.txt output file. That shows there is a segmentation fault at the end of placement (signal 11 is a seg fault), e.g.: 2024-06-18T12:05:27.4656365Z <Placement perturbation distribution by block and move type: I suggest running a circuit locally and bringing it up in the debugger to see the call stack, and/or you could run the sanitized build or valgrind. |
Silly me, forgot to delete the old (unconditional) call to print_flat_placement when I moved it inside a function and added a condition. @vaughnbetz can you take a look once CI has finished? |
Looks good; thanks. |
Frontend modifications to incorporate legalizer.
Description
vpr_api.cpp:
if doPacking=STAGE_LOAD and packer_opts.load_flat_placement=true, this code:
a. builds the device grid per a specified fixed device layout
b. calls load_flat_place (impl coming soon), which will:
- load and legalize the input flat placement file
- print a clustered netlist
- print a fixed clusters (partial .place) file
c. clears the device grid
d. if placement will run next, specifies the fixed clusters file as a constraints file.
e. resumes normal load packing behavior (load .net file, do various checks)
SetupGrid.h:
Added default arguments to create_device_grid so that it can be called with a fixed device layout without other args (that are only used when auto-sizing).
read_options.h/cpp:
Added the following command line inputs:
--legalize, enables the legalizer
--flat_place_file , legalizer input file
--write_fix_clusters (default: fix_clusters.out), for legalizer placed clusters output
--write_flat_place (default: flat_place.out), for post-placement flat placement output
SetupVPR.cpp:
Added the following fields to the FileNameOpts data structure:
Added a do_legalize option, which sets doPacking to STAGE_LOAD and sets a flag (packer_opts.load_flat_placement) instructing the packer to load from a flat placement file.
CheckSetup.cpp:
read_place.h/cpp:
Added an optional boolean input to print_place which defaults to true (in which case the function's behavior does not change). If false, the header is not printed, unplaced blocks (loc.x = -1) are skipped, and the net_file and net_id parameters are unused and can be set to nullptr. This is useful if the output will be used as a constraints (fix clusters) file.
added load_flat_place.h/cpp:
Function to print a flat placement file.
Function to load flat placement (impl coming soon).
Related Issue
Motivation and Context
Incorporates the legalizer.
How Has This Been Tested?
Verified that, if legalizer option is not enabled, vpr runs as usual with no QoR change.
The legalization capability has been tested on all Titan23 benchmarks.
Types of changes
Checklist: