Skip to content

Refactor place.cpp Part I #1529

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 3 commits into from
Sep 11, 2020

Conversation

Bill-hbrhbr
Copy link
Contributor

@Bill-hbrhbr Bill-hbrhbr commented Sep 9, 2020

Description

PR in progress. More to come...

  • Created placer context for accessing various data structures.
  • Moved timing update related routines to place_timing_update.h/cpp.
  • Moved connection delay related routines to place_delay_model.h/cpp.
  • Merge t_placer_costs and t_placer_inverse_costs.
  • Use t_annealing_state to reduce function argument list's length.

Motivation and Context

Refactor place.cpp to modularize it and reduce its length and complexity.

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)

…the VPR placer. Refactored place.cpp based on the moved global structures by moving certain interrelated routines into other (new) files.
@probot-autolabeler probot-autolabeler bot added lang-cpp C/C++ code VPR VPR FPGA Placement & Routing Tool labels Sep 9, 2020
@Bill-hbrhbr Bill-hbrhbr self-assigned this Sep 9, 2020
@Bill-hbrhbr
Copy link
Contributor Author

Hi @vaughnbetz @HackerFoo , this is a PR in progress. Please drop by and leave some comments when you are available so that I can fix potential issues as early as possible!

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 good Bill, thanks!
The style and commenting looks good. My two main comments (details embedded) are:

  • Please run cpu tests regularly and attach them as you do this refactoring. I gave one example above of a particularly tricky run time impact (pointer alias analysis) which is impacted by the scope of the variables used in key loops and if their address has ever been taken. Hard to reason about, so good to check regularly.
  • Splitting into multiple files is very good. I think it's good to think about what code should go in each. For example, is place.cpp only for annealing? (I think it should be). place_utils is for utilities that are reasonably general and may be useful for more than one placement algorithm (e.g. anneal and analytic). Putting those guidelines in the comments will help future developers stick with your organization.

@@ -83,10 +85,6 @@ using std::min;
#define UPDATED_ONCE 'U'
#define GOT_FROM_SCRATCH 'S'

Copy link
Contributor

Choose a reason for hiding this comment

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

Good to add a comment about what should go in this file. (This is an annealing based, cluster-level placer. This file ...)

@Bill-hbrhbr
Copy link
Contributor Author

Titan benchmark run001@commit bdaf63c: https://drive.google.com/file/d/1F1U-P6b6LLMa3rCzoPEeeJZjWBgqaiGE/view?usp=sharing

Comment: No runtime or performance degradation.

@vaughnbetz
Copy link
Contributor

Great, thanks Bill. Should this be merged now?

@vaughnbetz
Copy link
Contributor

vaughnbetz commented Sep 10, 2020

I suggest addressing the comments I have in the review (which aren't too big, pretty much all commenting I think) and then we merge. After that you can do another PR for more refactoring (if you have the time), but probably best to do this in stages. What do you think?

@Bill-hbrhbr
Copy link
Contributor Author

Doing this in multiple stages sounds good. I'll just reference this PR in the new PR.

@vaughnbetz
Copy link
Contributor

Sounds good. Let me know when the comments above are addressed and I'll merge this.

@Bill-hbrhbr
Copy link
Contributor Author

Hi @vaughnbetz, I added more comments for the override delay model class. Regarding comments on what should be included in place.cpp, I think maybe it's more suitable for me to do that once the refactorization is mostly done.

QoR test can be skipped since I only changed comments. This PR can be merged now. The next step for me is to shorten the argument lists for various core placer routiners.

@Bill-hbrhbr Bill-hbrhbr changed the title Refactor place.cpp to modularize it and reduce its length and complexity Refactor place.cpp Part I Sep 10, 2020
@vaughnbetz
Copy link
Contributor

Great, thanks Bill.

@vaughnbetz vaughnbetz merged commit 776026f into verilog-to-routing:master Sep 11, 2020
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.

2 participants