Skip to content

Commit 573e78c

Browse files
committed
rr_graph: added comments on the new rr_graph_indexed data calculation
Signed-off-by: Alessandro Comodi <[email protected]>
1 parent 18b7ca6 commit 573e78c

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
@@ -292,14 +292,20 @@ static float get_delay_normalization_fac() {
292292
return delay_norm_fac;
293293
}
294294

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

313-
/* August 2014: Not all wire-to-wire switches connecting from some wire segment will
314-
* necessarily have the same delay. i.e. a mux with less inputs will have smaller delay
315-
* than a mux with a greater number of inputs. So to account for these differences we will
316-
* get the average R/Tdel/Cinternal values by first averaging them for a single wire segment
317-
* (first for loop below), and then by averaging this value over all wire segments in the channel
318-
* (second for loop below) */
319+
/*
320+
* Not all wire-to-wire switches connecting from some wire segment will necessarily have the same delay.
321+
* i.e. a mux with less inputs will have smaller delay than a mux with a greater number of inputs.
322+
* So to account for these differences we will get the average R/Tdel/Cinternal values by first averaging
323+
* them for a single wire segment, and then by averaging this value over all the average values corresponding
324+
* to the switches node
325+
*/
319326
std::vector<std::vector<float>> switch_R_total(rr_indexed_data.size());
320327
std::vector<std::vector<float>> switch_T_total(rr_indexed_data.size());
321328
std::vector<std::vector<float>> switch_Cinternal_total(rr_indexed_data.size());
@@ -407,7 +414,7 @@ static void load_rr_indexed_data_T_values() {
407414
// from each wire and so we will correspondingly add one load for internal capacitance.
408415
// The first transient response is the product between the resistance of the switch with
409416
// the combined capacitance of the node and internal capacitance of the switch. The
410-
// second transient response is the result of the Rnode being distributed halfway along a
417+
// multiplication by the second term by 0.5 is the result of the Rnode being distributed halfway along a
411418
// wire segment's length times the total capacitance.
412419
rr_indexed_data[cost_index].T_linear = Tsw + Rsw * (Cinternalsw + Cnode)
413420
+ 0.5 * Rnode * (Cnode + Cinternalsw);
@@ -426,6 +433,13 @@ static void load_rr_indexed_data_T_values() {
426433
}
427434
}
428435

436+
/*
437+
* This routine calculates the average R/Tdel/Cinternal values of all the switches corresponding
438+
* to the fan-in edges of the input inode.
439+
*
440+
* It is not safe to assume that each node of the same wire type has the same switches with the same
441+
* delays, therefore we take their average to take into account the possible differences
442+
*/
429443
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) {
430444
auto& device_ctx = g_vpr_ctx.device();
431445
const auto& rr_nodes = device_ctx.rr_nodes.view();

0 commit comments

Comments
 (0)