Skip to content

Add check route option #1288

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 7 commits into from
May 7, 2020

Conversation

acomodi
Copy link
Collaborator

@acomodi acomodi commented Apr 28, 2020

Description

This PR adds an option that controls how check route runs. It consists of three values:

  • off: check route is completely disabled;
  • quick: non-configurable nodes are skipped from the check;
  • full: performs the full check;

Motivation and Context

For some of the real devices, check route takes a non-negligible amount of time due to the high presence of non-configurable nodes, which check slows down the entire process.

With this PR the user can choose to skip the check of these nodes, or completely disable the check route.

How Has This Been Tested?

reg_basic
reg_strong

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:

  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

acomodi and others added 4 commits April 28, 2020 11:06
The difference between the "quick" and "full" check is the non-configurable
nodes that are checked in the "full" and skipped with the "quick" option

Signed-off-by: Alessandro Comodi <[email protected]>
@probot-autolabeler probot-autolabeler bot added lang-cpp C/C++ code VPR VPR FPGA Placement & Routing Tool labels Apr 28, 2020
@acomodi acomodi requested review from kmurray and vaughnbetz April 28, 2020 09:40
Copy link
Contributor

@kmurray kmurray left a comment

Choose a reason for hiding this comment

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

Overall the code in this PR looks good.

On question however, I recall someone (perhaps @HackerFoo?) mentioning they had found a performance fix for check route. If that fix exists, is it reasonable to just land the fix instead of adding this option?

If this does get merged, we should include a strong regression test for the added command-line option (testing: off, quick, full).

Other comments are below.

Comment on lines 713 to 719
if (router_opts.check_route == e_check_route_option::QUICK) {
check_route(router_opts.route_type, /*quick=*/true);
} else if (router_opts.check_route == e_check_route_option::FULL) {
check_route(router_opts.route_type, /*quick=*/false);
} else {
VTR_LOG_WARN("The user disabled the check route step.");
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd suggest moving this code inside check_route (passing in route_opts.check_route as an argument).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

One reason I did put the check_route option check outside of check_route is that, if the option disables it, then check_route should not be called.

I thought it was cleaner to leave all the conditions of the check route option in one place

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's OK to put the check inside check_route and have it bail out early, something like:

void check_route(e_route_type route_type, e_check_route_option option) {
    if (option == e_check_route_option::OFF) {
        VTR_LOG_WARN("The user disabled the check route step.");
        return;
    }

   //Normal check route...
}

That keeps check_route() more re-usable and ensures the option is respected if more calls to check_route() are ever added in the future (e.g. after tweaking/fine-tuning an existing routing).

Copy link
Contributor

Choose a reason for hiding this comment

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

I also like embedding the check inside check_route to make it all self contained.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure, done. Also added a reg test with all the three options.

@HackerFoo
Copy link
Contributor

See the changes I made to create_sets(): #1271

This may improve the runtime of check_route().

I can make and test a separate PR.

@probot-autolabeler probot-autolabeler bot added tests VTR Flow VTR Design Flow (scripts/benchmarks/architectures) labels Apr 29, 2020
Copy link
Contributor

@kmurray kmurray left a comment

Choose a reason for hiding this comment

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

I've made a comment about the default value below.

I guess my only remaining question is, do we still need this option if #1289 makes the non-config edge check run-time acceptable?

" * off : check route is completely disabled.\n"
" * quick : runs check route with slow checks disabled.\n"
" * full : runs the full check route step.\n")
.default_value("quick")
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd lean towards keeping the default for this option as full. That ensures we do the most thorough checking by default (which is what we want, for example in regular VTR). Particularly if #1289 narrows the run-time difference between quick and full.

If someone (e.g. symbiflow) want to use quick, I feel that should be an end-user/flow override.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure, moved the option default back to full

@acomodi
Copy link
Collaborator Author

acomodi commented Apr 30, 2020

I guess my only remaining question is, do we still need this option if #1289 makes the non-config edge check run-time acceptable?

I think we need to wait for @HackerFoo's data. Probably this will not be needed anymore if run-time goes back to acceptable levels.

@acomodi acomodi requested a review from kmurray May 5, 2020 14:48
@kmurray kmurray merged commit ed15840 into verilog-to-routing:master May 7, 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 tests VPR VPR FPGA Placement & Routing Tool VTR Flow VTR Design Flow (scripts/benchmarks/architectures)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants