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

Read Initial Placement #2666

Merged
merged 6 commits into from
Aug 2, 2024
Merged

Read Initial Placement #2666

merged 6 commits into from
Aug 2, 2024

Conversation

amin1377
Copy link
Contributor

@amin1377 amin1377 commented Jul 26, 2024

In this PR, I have added an option to the CLI to read the initial placement. It was tested on the Titan Murax circuit, and the results from reading the initial placement from a file were the same as those from running the initial placement during the flow.

@github-actions github-actions bot added VPR VPR FPGA Placement & Routing Tool lang-cpp C/C++ code labels Jul 26, 2024
@amin1377 amin1377 requested a review from vaughnbetz July 26, 2024 23:36
vpr/src/place/initial_placement.cpp Outdated Show resolved Hide resolved
vpr/src/place/initial_placement.cpp Outdated Show resolved Hide resolved
}
if(!placer_opts.read_initial_place_file.empty()) {
const auto& grid = g_vpr_ctx.device().grid;
read_place(nullptr, placer_opts.read_initial_place_file.c_str(), false, grid);
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if both constraint and initial placement files are specified?

I think read_constraints() initializes the location of some blocks and mark them as fixed. The location in the initial placement would override the location in the constraint file. We probably need to handle this case

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it is better to print something to show that the initial placement is read from a file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right. The locations in the initial placement file will override the assigned locations in the constraint file. However, at the end of the initial placement, we call a function to check the legality of the placement, and any issues can be caught there.

Regarding printing that the initial placement is read from a file, the read_place function prints a message indicating that the placement is read from a file, along with the file name.

Copy link
Contributor

Choose a reason for hiding this comment

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

Are you referring to check_initial_placement_legality() or another function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I meant this function. I thought it would check whether the location of the fixed blocks matched the one specified in the constraint file, but upon reviewing the implementation, I realized that's not the case.

To avoid slowing down set_block_location, which is on the critical path of the placement code, I added the check when the placement file is read in the read_place.cpp file.

vpr/src/place/place.cpp Outdated Show resolved Hide resolved
@vaughnbetz vaughnbetz merged commit 49de5fb into master Aug 2, 2024
36 checks passed
@vaughnbetz vaughnbetz deleted the read_init_place branch August 2, 2024 14:28
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.

3 participants