Skip to content

Set the maximum pres_fac #2523

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 22 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
1744d6c
vpr: router: cap pres_fac to 1000
amin1377 Mar 27, 2024
b456298
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 Apr 1, 2024
c9da9d4
vpr: add max_pres_fac to command line argument
amin1377 Apr 1, 2024
8f86b04
vpr: show max_pres_fac in log
amin1377 Apr 1, 2024
3efa8a2
vpr: set the max pres fac of router to the value pass through the com…
amin1377 Apr 1, 2024
9855a8e
document: add max_pres_fac to online document
amin1377 Apr 1, 2024
a472c96
make format
amin1377 Apr 1, 2024
d38956b
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 Apr 2, 2024
5276017
vpr: fix a type. set max pres fac
amin1377 Apr 2, 2024
26380cc
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 May 16, 2024
e6af24c
[CLI] add doc for max_pres_fac
amin1377 May 16, 2024
33ea049
[vpr][route] set pres fac before calling update_draw_pres_fac
amin1377 May 16, 2024
c8a3e22
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 May 22, 2024
9978c70
Merge branch 'pres_fac_max' of https://github.com/verilog-to-routing/…
amin1377 May 22, 2024
81604de
[vpr][router] solve the bug with update_draw_pres_fac
amin1377 May 22, 2024
ba8c455
[vpr][placement] fix comment
amin1377 May 23, 2024
a66176c
[test] update nightly_test_2 golden results
amin1377 May 23, 2024
43b2c4a
Merge branch 'master' of https://github.com/verilog-to-routing/vtr-ve…
amin1377 May 28, 2024
27839bd
[test] update nightly_test_1 golden result
amin1377 May 29, 2024
7bea33f
[vpr][router] fix fuction signiture
amin1377 May 29, 2024
313eb02
fix a typo
amin1377 May 29, 2024
24d69c0
Merge branch 'master' into pres_fac_max
amin1377 May 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions doc/src/vpr/command_line_usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1163,6 +1163,14 @@ VPR uses a negotiated congestion algorithm (based on Pathfinder) to perform rout

**Default:** ``1.3``

.. option:: --max_pres_fac <float>

Sets the maximum present overuse penalty factor that can ever result during routing. Should always be less than 1e25 or so to prevent overflow.
Smaller values may help prevent circuitous routing in difficult routing problems, but may increase
the number of routing iterations needed and hence runtime.

**Default:** ``1000.0``

.. option:: --acc_fac <float>

Specifies the accumulated overuse factor (historical congestion cost factor).
Expand Down
1 change: 1 addition & 0 deletions vpr/src/base/SetupVPR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ static void SetupRouterOpts(const t_options& Options, t_router_opts* RouterOpts)
RouterOpts->min_incremental_reroute_fanout = Options.min_incremental_reroute_fanout;
RouterOpts->incr_reroute_delay_ripup = Options.incr_reroute_delay_ripup;
RouterOpts->pres_fac_mult = Options.pres_fac_mult;
RouterOpts->max_pres_fac = Options.max_pres_fac;
RouterOpts->route_type = Options.RouteType;

RouterOpts->full_stats = Options.full_stats;
Expand Down
2 changes: 2 additions & 0 deletions vpr/src/base/ShowSetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ static void ShowRouterOpts(const t_router_opts& RouterOpts) {
VTR_LOG("RouterOpts.first_iter_pres_fac: %f\n", RouterOpts.first_iter_pres_fac);
VTR_LOG("RouterOpts.initial_pres_fac: %f\n", RouterOpts.initial_pres_fac);
VTR_LOG("RouterOpts.pres_fac_mult: %f\n", RouterOpts.pres_fac_mult);
VTR_LOG("RouterOpts.max_pres_fac: %f\n", RouterOpts.max_pres_fac);
VTR_LOG("RouterOpts.max_router_iterations: %d\n", RouterOpts.max_router_iterations);
VTR_LOG("RouterOpts.min_incremental_reroute_fanout: %d\n", RouterOpts.min_incremental_reroute_fanout);
VTR_LOG("RouterOpts.do_check_rr_graph: %s\n", RouterOpts.do_check_rr_graph ? "true" : "false");
Expand Down Expand Up @@ -473,6 +474,7 @@ static void ShowRouterOpts(const t_router_opts& RouterOpts) {
VTR_LOG("RouterOpts.first_iter_pres_fac: %f\n", RouterOpts.first_iter_pres_fac);
VTR_LOG("RouterOpts.initial_pres_fac: %f\n", RouterOpts.initial_pres_fac);
VTR_LOG("RouterOpts.pres_fac_mult: %f\n", RouterOpts.pres_fac_mult);
VTR_LOG("RouterOpts.max_pres_fac: %f\n", RouterOpts.max_pres_fac);
VTR_LOG("RouterOpts.max_router_iterations: %d\n", RouterOpts.max_router_iterations);
VTR_LOG("RouterOpts.min_incremental_reroute_fanout: %d\n", RouterOpts.min_incremental_reroute_fanout);
VTR_LOG("RouterOpts.do_check_rr_graph: %s\n", RouterOpts.do_check_rr_graph ? "true" : "false");
Expand Down
5 changes: 5 additions & 0 deletions vpr/src/base/read_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2333,6 +2333,11 @@ argparse::ArgumentParser create_arg_parser(const std::string& prog_name, t_optio
.default_value("1.3")
.show_in(argparse::ShowIn::HELP_ONLY);

route_grp.add_argument(args.max_pres_fac, "-max_pres_fac")
.help("Sets the maximum present overuse penalty factor")
.default_value("1000.0")
.show_in(argparse::ShowIn::HELP_ONLY);

route_grp.add_argument(args.acc_fac, "--acc_fac")
.help("Specifies the accumulated overuse factor (historical congestion cost factor)")
.default_value("1.0")
Expand Down
1 change: 1 addition & 0 deletions vpr/src/base/read_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ struct t_options {
argparse::ArgValue<float> first_iter_pres_fac;
argparse::ArgValue<float> initial_pres_fac;
argparse::ArgValue<float> pres_fac_mult;
argparse::ArgValue<float> max_pres_fac;
argparse::ArgValue<float> acc_fac;
argparse::ArgValue<int> bb_factor;
argparse::ArgValue<e_base_cost_type> base_cost_type;
Expand Down
1 change: 1 addition & 0 deletions vpr/src/base/vpr_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -1405,6 +1405,7 @@ struct t_router_opts {
float first_iter_pres_fac;
float initial_pres_fac;
float pres_fac_mult;
float max_pres_fac;
float acc_fac;
float bend_cost;
int max_router_iterations;
Expand Down
4 changes: 2 additions & 2 deletions vpr/src/place/place.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1708,8 +1708,8 @@ static e_move_result try_swap(const t_annealing_state* state,
if (manual_move_enabled) {
#ifndef NO_GRAPHICS
create_move_outcome = manual_move_display_and_propose(manual_move_generator, blocks_affected, proposed_action.move_type, rlim, placer_opts, criticalities);
#else //NO_GRAPHICS
// Cast to void to explicitly avoid warning.
#else //NO_GRAPHICS
//Cast to void to explicitly avoid warning.
(void)manual_move_generator;
#endif //NO_GRAPHICS
} else if (router_block_move) {
Expand Down
18 changes: 11 additions & 7 deletions vpr/src/route/route.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ bool route(const Netlist<>& net_list,
VTR_ASSERT(router_lookahead != nullptr);

/* Routing parameters */
float pres_fac = update_draw_pres_fac(router_opts.first_iter_pres_fac); /* Typically 0 -> ignore cong. */
float pres_fac = router_opts.first_iter_pres_fac;
update_draw_pres_fac(pres_fac); /* Typically 0 -> ignore cong. */
int bb_fac = router_opts.bb_factor;

/* When routing conflicts are detected the bounding boxes are scaled
Expand Down Expand Up @@ -357,7 +358,8 @@ bool route(const Netlist<>& net_list,
//Decrease pres_fac so that critical connections will take more direct routes
//Note that we use first_iter_pres_fac here (typically zero), and switch to
//use initial_pres_fac on the next iteration.
pres_fac = update_draw_pres_fac(router_opts.first_iter_pres_fac);
pres_fac = router_opts.first_iter_pres_fac;
update_draw_pres_fac(pres_fac);

//Reduce timing tolerances to re-route more delay-suboptimal signals
connections_inf.set_connection_criticality_tolerance(0.7);
Expand All @@ -374,7 +376,8 @@ bool route(const Netlist<>& net_list,
//after the first routing convergence. Since that is often zero,
//we want to set pres_fac to a reasonable (i.e. typically non-zero)
//value afterwards -- so it grows when multiplied by pres_fac_mult
pres_fac = update_draw_pres_fac(router_opts.initial_pres_fac);
pres_fac = router_opts.initial_pres_fac;
update_draw_pres_fac(pres_fac);
}

//Have we converged the maximum number of times, did not make any changes, or does it seem
Expand Down Expand Up @@ -437,12 +440,13 @@ bool route(const Netlist<>& net_list,

//Update pres_fac
if (itry == 1) {
pres_fac = update_draw_pres_fac(router_opts.initial_pres_fac);
pres_fac = router_opts.initial_pres_fac;
update_draw_pres_fac(pres_fac);
} else {
pres_fac *= router_opts.pres_fac_mult;

/* Avoid overflow for high iteration counts, even if acc_cost is big */
pres_fac = update_draw_pres_fac(std::min(pres_fac, static_cast<float>(HUGE_POSITIVE_FLOAT / 1e5)));
pres_fac = std::min(pres_fac, router_opts.max_pres_fac);
/* Set the maximum pres_fac to the value passed by the command line argument */
update_draw_pres_fac(pres_fac);

// Increase short path criticality if it's having a hard time resolving hold violations due to congestion
if (budgeting_inf.if_set()) {
Expand Down
9 changes: 5 additions & 4 deletions vpr/src/route/route_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,15 +507,16 @@ void try_graph(int width_fac,
is_flat);
}

float update_draw_pres_fac(float new_pres_fac) {
#ifndef NO_GRAPHICS

void update_draw_pres_fac(const float new_pres_fac) {
#else
void update_draw_pres_fac(const float /*new_pres_fac*/) {
#endif
#ifndef NO_GRAPHICS
// Only updates the drawing pres_fac if graphics is enabled
get_draw_state_vars()->pres_fac = new_pres_fac;

#endif // NO_GRAPHICS

return new_pres_fac;
}

#ifndef NO_GRAPHICS
Expand Down
6 changes: 2 additions & 4 deletions vpr/src/route/route_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,8 @@ void try_graph(int width_fac,
int num_directs,
bool is_flat);

/* This routine should take the new value of the present congestion factor
* and propagate it to all the relevant data fields in the vpr flow.
* Currently, it only updates the pres_fac used by the drawing functions */
float update_draw_pres_fac(float new_pres_fac);
/* This routine updates the pres_fac used by the drawing functions */
void update_draw_pres_fac(const float new_pres_fac);

#ifndef NO_GRAPHICS
/** Updates router iteration information and checks for router iteration and net id breakpoints
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ k6_frac_2uripple_N8_22nm.xml fir_nopipe_27.v common 21.80 vpr 75.34 MiB 0.13 12
k6_frac_2uripple_N8_22nm.xml fir_nopipe_28.v common 27.61 vpr 75.93 MiB 0.13 12672 -1 -1 1 0.42 -1 -1 39444 -1 -1 83 22 0 8 success 3634420-dirty release IPO VTR_ASSERT_LEVEL=2 GNU 9.5.0 on Linux-5.10.35-v8 x86_64 2023-11-11T22:36:55 gh-actions-runner-vtr-auto-spawned38 /root/vtr-verilog-to-routing/vtr-verilog-to-routing 77752 22 19 2459 1781 1 1417 132 18 18 324 mult_36 auto 38.4 MiB 0.91 8901 22577 4985 14993 2599 75.9 MiB 0.76 0.01 7.8713 -549.689 -7.8713 7.8713 1.41 0.0044721 0.00400453 0.37567 0.335486 70 15022 26 8.18539e+06 4.3894e+06 1.34436e+06 4149.26 18.64 2.63309 2.3407 37264 347768 -1 13242 23 9518 11089 1869023 398865 0 0 1869023 398865 10194 9636 0 0 76816 71405 0 0 102665 82788 0 0 10196 9695 0 0 837549 113400 0 0 831603 111941 0 0 10194 0 0 701 5045 4474 13769 940 130 8.87728 8.87728 -957.043 -8.87728 0 0 1.69344e+06 5226.66 0.81 0.83 0.44 -1 -1 0.81 0.299514 0.271162 594 551 513 19 0 0
k6_frac_2uripple_N8_22nm.xml fir_nopipe_29.v common 27.15 vpr 76.10 MiB 0.14 12824 -1 -1 1 0.46 -1 -1 40700 -1 -1 85 22 0 9 success 3634420-dirty release IPO VTR_ASSERT_LEVEL=2 GNU 9.5.0 on Linux-5.10.35-v8 x86_64 2023-11-11T22:36:55 gh-actions-runner-vtr-auto-spawned38 /root/vtr-verilog-to-routing/vtr-verilog-to-routing 77928 22 19 2565 1853 1 1485 135 22 22 484 mult_36 auto 38.7 MiB 0.98 9689 25047 6275 16269 2503 76.1 MiB 0.94 0.01 7.43624 -544.661 -7.43624 7.43624 2.37 0.00627739 0.005399 0.475538 0.415759 70 16428 27 1.33067e+07 4.81483e+06 2.06816e+06 4273.05 14.91 2.30064 2.03522 56434 539830 -1 14001 25 11439 13263 2233851 474457 0 0 2233851 474457 12595 11730 0 0 97078 90555 0 0 128940 103685 0 0 12598 11816 0 0 988671 129989 0 0 993969 126682 0 0 12595 0 0 1181 5046 6091 28215 698 2 8.73683 8.73683 -847.048 -8.73683 0 0 2.60483e+06 5381.88 1.40 1.01 0.68 -1 -1 1.40 0.349618 0.316208 619 570 532 19 0 0
k6_frac_2uripple_N8_22nm.xml fir_nopipe_30.v common 25.19 vpr 76.62 MiB 0.14 12956 -1 -1 1 0.47 -1 -1 39948 -1 -1 89 22 0 9 success 3634420-dirty release IPO VTR_ASSERT_LEVEL=2 GNU 9.5.0 on Linux-5.10.35-v8 x86_64 2023-11-11T22:36:55 gh-actions-runner-vtr-auto-spawned38 /root/vtr-verilog-to-routing/vtr-verilog-to-routing 78460 22 19 2639 1910 1 1523 139 22 22 484 mult_36 auto 39.2 MiB 1.02 9640 28859 6707 18502 3650 76.6 MiB 1.13 0.01 7.43624 -520.251 -7.43624 7.43624 2.32 0.00629213 0.00540153 0.557969 0.48787 70 16649 34 1.33067e+07 4.87369e+06 2.06816e+06 4273.05 12.67 2.06295 1.82406 56434 539830 -1 14184 24 12418 14250 2862133 602975 0 0 2862133 602975 13565 12580 0 0 104860 98182 0 0 141217 112467 0 0 13569 12703 0 0 1300740 182621 0 0 1288182 184422 0 0 13565 0 0 1174 4689 4837 20323 761 3 8.95347 8.95347 -846.506 -8.95347 0 0 2.60483e+06 5381.88 1.35 1.16 0.68 -1 -1 1.35 0.337838 0.304321 639 589 551 19 0 0
k6_frac_2uripple_N8_22nm.xml fir_nopipe_31.v common 29.27 vpr 77.28 MiB 0.15 13268 -1 -1 1 0.50 -1 -1 40004 -1 -1 93 22 0 9 success 3634420-dirty release IPO VTR_ASSERT_LEVEL=2 GNU 9.5.0 on Linux-5.10.35-v8 x86_64 2023-11-11T22:36:55 gh-actions-runner-vtr-auto-spawned38 /root/vtr-verilog-to-routing/vtr-verilog-to-routing 79136 22 19 2744 1981 1 1590 143 22 22 484 mult_36 auto 39.9 MiB 1.02 10213 28491 6600 18816 3075 77.3 MiB 1.04 0.01 7.49539 -582.535 -7.49539 7.49539 2.26 0.00571464 0.00518578 0.46636 0.42051 66 19056 43 1.33067e+07 4.93255e+06 1.96511e+06 4060.15 17.03 2.09287 1.85069 54986 507526 -1 15439 26 13348 15703 3065311 631596 0 0 3065311 631596 14541 13592 0 0 110840 103858 0 0 151041 119264 0 0 14544 13652 0 0 1379224 189774 0 0 1395121 191456 0 0 14541 0 0 1223 6898 7095 21649 1209 28 9.15632 9.15632 -1101.43 -9.15632 0 0 2.45963e+06 5081.88 1.27 1.24 0.60 -1 -1 1.27 0.360304 0.325056 665 608 570 19 0 0
k6_frac_2uripple_N8_22nm.xml fir_nopipe_31.v common 29.27 vpr 77.28 MiB 0.15 13268 -1 -1 1 0.50 -1 -1 40004 -1 -1 93 22 0 9 success 3634420-dirty release IPO VTR_ASSERT_LEVEL=2 GNU 9.5.0 on Linux-5.10.35-v8 x86_64 2023-11-11T22:36:55 gh-actions-runner-vtr-auto-spawned38 /root/vtr-verilog-to-routing/vtr-verilog-to-routing 79136 22 19 2744 1981 1 1590 143 22 22 484 mult_36 auto 39.9 MiB 1.02 10213 28491 6600 18816 3075 77.3 MiB 1.04 0.01 7.49539 -582.535 -7.49539 7.49539 2.26 0.00571464 0.00518578 0.46636 0.42051 70 19056 43 1.33067e+07 4.93255e+06 1.96511e+06 4060.15 17.03 2.09287 1.85069 54986 507526 -1 15439 26 13348 15703 3065311 631596 0 0 3065311 631596 14541 13592 0 0 110840 103858 0 0 151041 119264 0 0 14544 13652 0 0 1379224 189774 0 0 1395121 191456 0 0 14541 0 0 1223 6898 7095 21649 1209 28 9.15632 9.15632 -1101.43 -9.15632 0 0 2.45963e+06 5081.88 1.27 1.24 0.60 -1 -1 1.27 0.360304 0.325056 665 608 570 19 0 0
k6_frac_2uripple_N8_22nm.xml fir_nopipe_32.v common 91.23 vpr 77.48 MiB 0.15 13384 -1 -1 1 0.55 -1 -1 40200 -1 -1 96 22 0 9 success 3634420-dirty release IPO VTR_ASSERT_LEVEL=2 GNU 9.5.0 on Linux-5.10.35-v8 x86_64 2023-11-11T22:36:55 gh-actions-runner-vtr-auto-spawned38 /root/vtr-verilog-to-routing/vtr-verilog-to-routing 79340 22 19 2818 2038 1 1627 146 22 22 484 mult_36 auto 40.3 MiB 1.09 10325 30482 7786 19419 3277 77.5 MiB 1.10 0.01 7.52039 -582.013 -7.52039 7.52039 2.22 0.00673795 0.00600573 0.559271 0.496011 66 18458 33 1.33067e+07 4.9767e+06 1.96511e+06 4060.15 78.92 4.50174 3.97192 54986 507526 -1 15293 24 12697 14781 2882895 607845 0 0 2882895 607845 13913 12967 0 0 106785 100349 0 0 141821 114087 0 0 13919 13073 0 0 1294441 181143 0 0 1312016 186226 0 0 13913 0 0 1241 5665 5902 20707 932 59 9.34202 9.34202 -1030.73 -9.34202 0 0 2.45963e+06 5081.88 1.31 1.11 0.62 -1 -1 1.31 0.310599 0.281128 684 627 589 19 0 0
k6_frac_2uripple_N8_22nm.xml fir_nopipe_33.v common 26.53 vpr 78.12 MiB 0.16 13808 -1 -1 1 0.56 -1 -1 40348 -1 -1 100 22 0 10 success 3634420-dirty release IPO VTR_ASSERT_LEVEL=2 GNU 9.5.0 on Linux-5.10.35-v8 x86_64 2023-11-11T22:36:55 gh-actions-runner-vtr-auto-spawned38 /root/vtr-verilog-to-routing/vtr-verilog-to-routing 79992 22 19 2923 2109 1 1695 151 22 22 484 mult_36 auto 40.9 MiB 0.97 10491 33835 8574 21105 4156 78.1 MiB 1.20 0.01 7.94064 -597.141 -7.94064 7.94064 2.29 0.00674974 0.00577428 0.614694 0.531941 64 19070 50 1.33067e+07 5.43155e+06 1.90554e+06 3937.06 14.02 2.63693 2.32895 54502 494576 -1 15787 25 13858 15489 2824485 600452 0 0 2824485 600452 14633 14088 0 0 112285 105253 0 0 152161 121338 0 0 14640 14194 0 0 1278006 170780 0 0 1252760 174799 0 0 14633 0 0 801 4949 5286 21186 894 34 9.95291 9.95291 -1096.7 -9.95291 0 0 2.40101e+06 4960.76 1.27 1.19 0.59 -1 -1 1.27 0.380018 0.342807 710 646 608 19 0 0
k6_frac_2uripple_N8_22nm.xml fir_nopipe_34.v common 38.28 vpr 78.56 MiB 0.16 14048 -1 -1 1 0.58 -1 -1 40192 -1 -1 101 22 0 10 success 3634420-dirty release IPO VTR_ASSERT_LEVEL=2 GNU 9.5.0 on Linux-5.10.35-v8 x86_64 2023-11-11T22:36:55 gh-actions-runner-vtr-auto-spawned38 /root/vtr-verilog-to-routing/vtr-verilog-to-routing 80444 22 19 2997 2166 1 1734 152 22 22 484 mult_36 auto 41.4 MiB 1.33 10939 30122 6941 19995 3186 78.6 MiB 1.07 0.01 7.88963 -601.708 -7.88963 7.88963 2.34 0.00551573 0.0049006 0.494171 0.437728 66 19440 28 1.33067e+07 5.44627e+06 1.96511e+06 4060.15 25.16 3.23147 2.86271 54986 507526 -1 16262 25 13499 15395 2906042 608239 0 0 2906042 608239 14574 13765 0 0 115250 108127 0 0 152837 123878 0 0 14585 13883 0 0 1312936 172636 0 0 1295860 175950 0 0 14574 0 0 1098 5319 5331 20493 889 64 9.72351 9.72351 -1073.66 -9.72351 0 0 2.45963e+06 5081.88 1.32 1.22 0.63 -1 -1 1.32 0.385734 0.348973 729 665 627 19 0 0
Expand Down
Loading
Loading