@@ -297,14 +297,20 @@ static float get_delay_normalization_fac() {
297
297
return delay_norm_fac;
298
298
}
299
299
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
+ */
300
313
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
-
308
314
auto & device_ctx = g_vpr_ctx.mutable_device ();
309
315
auto & rr_nodes = device_ctx.rr_nodes ;
310
316
auto & rr_indexed_data = device_ctx.rr_indexed_data ;
@@ -315,12 +321,13 @@ static void load_rr_indexed_data_T_values() {
315
321
std::vector<std::vector<float >> C_total (rr_indexed_data.size ());
316
322
std::vector<std::vector<float >> R_total (rr_indexed_data.size ());
317
323
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
+ */
324
331
std::vector<std::vector<float >> switch_R_total (rr_indexed_data.size ());
325
332
std::vector<std::vector<float >> switch_T_total (rr_indexed_data.size ());
326
333
std::vector<std::vector<float >> switch_Cinternal_total (rr_indexed_data.size ());
@@ -412,7 +419,7 @@ static void load_rr_indexed_data_T_values() {
412
419
// from each wire and so we will correspondingly add one load for internal capacitance.
413
420
// The first transient response is the product between the resistance of the switch with
414
421
// 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
416
423
// wire segment's length times the total capacitance.
417
424
rr_indexed_data[cost_index].T_linear = Tsw + Rsw * (Cinternalsw + Cnode)
418
425
+ 0.5 * Rnode * (Cnode + Cinternalsw);
@@ -431,6 +438,13 @@ static void load_rr_indexed_data_T_values() {
431
438
}
432
439
}
433
440
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
+ */
434
448
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) {
435
449
auto & device_ctx = g_vpr_ctx.device ();
436
450
const auto & rr_nodes = device_ctx.rr_nodes .view ();
0 commit comments