@@ -292,14 +292,20 @@ static float get_delay_normalization_fac() {
292
292
return delay_norm_fac;
293
293
}
294
294
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
+ */
295
308
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
-
303
309
auto & device_ctx = g_vpr_ctx.mutable_device ();
304
310
auto & rr_nodes = device_ctx.rr_nodes ;
305
311
auto & rr_indexed_data = device_ctx.rr_indexed_data ;
@@ -310,12 +316,13 @@ static void load_rr_indexed_data_T_values() {
310
316
std::vector<std::vector<float >> C_total (rr_indexed_data.size ());
311
317
std::vector<std::vector<float >> R_total (rr_indexed_data.size ());
312
318
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
+ */
319
326
std::vector<std::vector<float >> switch_R_total (rr_indexed_data.size ());
320
327
std::vector<std::vector<float >> switch_T_total (rr_indexed_data.size ());
321
328
std::vector<std::vector<float >> switch_Cinternal_total (rr_indexed_data.size ());
@@ -407,7 +414,7 @@ static void load_rr_indexed_data_T_values() {
407
414
// from each wire and so we will correspondingly add one load for internal capacitance.
408
415
// The first transient response is the product between the resistance of the switch with
409
416
// 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
411
418
// wire segment's length times the total capacitance.
412
419
rr_indexed_data[cost_index].T_linear = Tsw + Rsw * (Cinternalsw + Cnode)
413
420
+ 0.5 * Rnode * (Cnode + Cinternalsw);
@@ -426,6 +433,13 @@ static void load_rr_indexed_data_T_values() {
426
433
}
427
434
}
428
435
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
+ */
429
443
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) {
430
444
auto & device_ctx = g_vpr_ctx.device ();
431
445
const auto & rr_nodes = device_ctx.rr_nodes .view ();
0 commit comments