Skip to content

Commit 838b704

Browse files
authored
Merge pull request #1598 from acomodi/followup-comments-on-robust-delay-norm-factor
rr_graph: added comments on the new rr_graph_indexed data calculation
2 parents 93af9f1 + 573e78c commit 838b704

File tree

1 file changed

+28
-14
lines changed

1 file changed

+28
-14
lines changed

vpr/src/route/rr_graph_indexed_data.cpp

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -297,14 +297,20 @@ static float get_delay_normalization_fac() {
297297
return delay_norm_fac;
298298
}
299299

300+
/*
301+
* Scans all the RR nodes of CHAN type getting the medians for their R and C values (delays)
302+
* as well as the delay data of all the nodes' switches, averaging them to find the following
303+
* indexed data values for each wire type:
304+
* - T_linear
305+
* - T_quadratic
306+
* - C_load
307+
*
308+
* The indexed data is used in different locations such as:
309+
* - Base cost calculation for each cost_index
310+
* - Lookahead map computation
311+
* - Placement Delay Matrix computation
312+
*/
300313
static void load_rr_indexed_data_T_values() {
301-
/* Loads the average propagation times through segments of each index type *
302-
* for either all CHANX segment types or all CHANY segment types. It does *
303-
* this by looking at all the segments in one channel in the middle of the *
304-
* array and averaging the R, C, and Cinternal values of all segments of the *
305-
* same type and using them to compute average delay values for this type of *
306-
* segment. */
307-
308314
auto& device_ctx = g_vpr_ctx.mutable_device();
309315
auto& rr_nodes = device_ctx.rr_nodes;
310316
auto& rr_indexed_data = device_ctx.rr_indexed_data;
@@ -315,12 +321,13 @@ static void load_rr_indexed_data_T_values() {
315321
std::vector<std::vector<float>> C_total(rr_indexed_data.size());
316322
std::vector<std::vector<float>> R_total(rr_indexed_data.size());
317323

318-
/* August 2014: Not all wire-to-wire switches connecting from some wire segment will
319-
* necessarily have the same delay. i.e. a mux with less inputs will have smaller delay
320-
* than a mux with a greater number of inputs. So to account for these differences we will
321-
* get the average R/Tdel/Cinternal values by first averaging them for a single wire segment
322-
* (first for loop below), and then by averaging this value over all wire segments in the channel
323-
* (second for loop below) */
324+
/*
325+
* Not all wire-to-wire switches connecting from some wire segment will necessarily have the same delay.
326+
* i.e. a mux with less inputs will have smaller delay than a mux with a greater number of inputs.
327+
* So to account for these differences we will get the average R/Tdel/Cinternal values by first averaging
328+
* them for a single wire segment, and then by averaging this value over all the average values corresponding
329+
* to the switches node
330+
*/
324331
std::vector<std::vector<float>> switch_R_total(rr_indexed_data.size());
325332
std::vector<std::vector<float>> switch_T_total(rr_indexed_data.size());
326333
std::vector<std::vector<float>> switch_Cinternal_total(rr_indexed_data.size());
@@ -412,7 +419,7 @@ static void load_rr_indexed_data_T_values() {
412419
// from each wire and so we will correspondingly add one load for internal capacitance.
413420
// The first transient response is the product between the resistance of the switch with
414421
// the combined capacitance of the node and internal capacitance of the switch. The
415-
// second transient response is the result of the Rnode being distributed halfway along a
422+
// multiplication by the second term by 0.5 is the result of the Rnode being distributed halfway along a
416423
// wire segment's length times the total capacitance.
417424
rr_indexed_data[cost_index].T_linear = Tsw + Rsw * (Cinternalsw + Cnode)
418425
+ 0.5 * Rnode * (Cnode + Cinternalsw);
@@ -431,6 +438,13 @@ static void load_rr_indexed_data_T_values() {
431438
}
432439
}
433440

441+
/*
442+
* This routine calculates the average R/Tdel/Cinternal values of all the switches corresponding
443+
* to the fan-in edges of the input inode.
444+
*
445+
* It is not safe to assume that each node of the same wire type has the same switches with the same
446+
* delays, therefore we take their average to take into account the possible differences
447+
*/
434448
static void calculate_average_switch(int inode, double& avg_switch_R, double& avg_switch_T, double& avg_switch_Cinternal, int& num_switches, short& buffered, vtr::vector<RRNodeId, std::vector<RREdgeId>>& fan_in_list) {
435449
auto& device_ctx = g_vpr_ctx.device();
436450
const auto& rr_nodes = device_ctx.rr_nodes.view();

0 commit comments

Comments
 (0)