Skip to content

Commit 33ea049

Browse files
committed
[vpr][route] set pres fac before calling update_draw_pres_fac
1 parent e6af24c commit 33ea049

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

vpr/src/route/route.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,8 @@ bool route(const Netlist<>& net_list,
357357
//Decrease pres_fac so that critical connections will take more direct routes
358358
//Note that we use first_iter_pres_fac here (typically zero), and switch to
359359
//use initial_pres_fac on the next iteration.
360-
pres_fac = update_draw_pres_fac(router_opts.first_iter_pres_fac);
360+
pres_fac = router_opts.first_iter_pres_fac;
361+
update_draw_pres_fac(pres_fac);
361362

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

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

438440
//Update pres_fac
439441
if (itry == 1) {
440-
pres_fac = update_draw_pres_fac(router_opts.initial_pres_fac);
442+
pres_fac = router_opts.initial_pres_fac;
443+
update_draw_pres_fac(pres_fac);
441444
} else {
442445
pres_fac *= router_opts.pres_fac_mult;
443-
446+
pres_fac = std::min(pres_fac, router_opts.max_pres_fac);
444447
/* Set the maximum pres_fac to the value passed by the command line argument */
445-
pres_fac = update_draw_pres_fac(std::min(pres_fac, router_opts.max_pres_fac));
448+
update_draw_pres_fac(pres_fac));
446449

447450
// Increase short path criticality if it's having a hard time resolving hold violations due to congestion
448451
if (budgeting_inf.if_set()) {

vpr/src/route/route_utils.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -507,15 +507,13 @@ void try_graph(int width_fac,
507507
is_flat);
508508
}
509509

510-
float update_draw_pres_fac(float new_pres_fac) {
510+
void update_draw_pres_fac(const float new_pres_fac) {
511511
#ifndef NO_GRAPHICS
512512

513513
// Only updates the drawing pres_fac if graphics is enabled
514514
get_draw_state_vars()->pres_fac = new_pres_fac;
515515

516516
#endif // NO_GRAPHICS
517-
518-
return new_pres_fac;
519517
}
520518

521519
#ifndef NO_GRAPHICS

vpr/src/route/route_utils.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,8 @@ void try_graph(int width_fac,
136136
int num_directs,
137137
bool is_flat);
138138

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

144142
#ifndef NO_GRAPHICS
145143
/** Updates router iteration information and checks for router iteration and net id breakpoints

0 commit comments

Comments
 (0)