18
18
#include " route_common.h"
19
19
#include " route_debug.h"
20
20
21
+ /* *
22
+ * We will profile delay/congestion using this many tracks for each wire type.
23
+ * Larger values increase the time to compute the lookahead, but may give
24
+ * more accurate lookahead estimates during routing.
25
+ */
26
+ static constexpr int MAX_TRACK_OFFSET = 16 ;
27
+
21
28
static void dijkstra_flood_to_wires (int itile, RRNodeId inode, util::t_src_opin_delays& src_opin_delays);
22
29
23
30
static void dijkstra_flood_to_ipins (RRNodeId node, util::t_chan_ipins_delays& chan_ipins_delays);
@@ -51,13 +58,42 @@ static void expand_dijkstra_neighbours(util::PQ_Entry parent_entry,
51
58
vtr::vector<RRNodeId, bool >& node_expanded,
52
59
std::priority_queue<util::PQ_Entry>& pq);
53
60
54
- static std::pair<int , int > adjust_rr_position (const RRNodeId rr);
55
61
56
- static std::pair<int , int > adjust_rr_pin_position (const RRNodeId rr);
62
+ /* *
63
+ * @brief Computes the adjusted position of an RR graph node.
64
+ * This function does not modify the position of the given node.
65
+ * It only returns the computed adjusted position.
66
+ * @param rr The ID of the node whose adjusted position is desired.
67
+ * @return The adjusted position (x, y).
68
+ */
69
+ static std::pair<int , int > get_adjusted_rr_position (RRNodeId rr);
70
+
71
+ /* *
72
+ * @brief Computes the adjusted location of a pin to match the position of
73
+ * the channel it can reach based on which side of the block it is at.
74
+ * @param rr The corresponding node of a pin whose adjusted positions
75
+ * is desired.
76
+ * @return The adjusted position (x, y).
77
+ */
78
+ static std::pair<int , int > get_adjusted_rr_pin_position (RRNodeId rr);
57
79
58
- static std::pair<int , int > adjust_rr_wire_position (const RRNodeId rr);
80
+ /* *
81
+ * @brief Computed the adjusted position of a node of type
82
+ * CHANX or CHANY. For uni-directional wires, return the position
83
+ * of the driver, and for bi-directional wires, compute the middle point.
84
+ * @param rr The ID of the node whose adjusted position is desired.
85
+ * @return The adjusted position (x, y).
86
+ */
87
+ static std::pair<int , int > get_adjusted_rr_wire_position (RRNodeId rr);
59
88
60
- static std::pair<int , int > adjust_rr_src_sink_position (const RRNodeId rr);
89
+ /* *
90
+ * @brief Computes the adjusted position and source and sink nodes.
91
+ * SOURCE/SINK nodes assume the full dimensions of their associated block/
92
+ * This function computes the average position for the given node.
93
+ * @param rr SOURCE or SINK node whose adjusted position is needed.
94
+ * @return The adjusted position (x, y).
95
+ */
96
+ static std::pair<int , int > get_adjusted_rr_src_sink_position (RRNodeId rr);
61
97
62
98
// Constants needed to reduce the bounding box when expanding CHAN wires to reach the IPINs.
63
99
// These are used when finding all the delays to get to the IPINs of all the different tile types
@@ -549,7 +585,6 @@ RRNodeId get_start_node(int layer, int start_x, int start_y, int target_x, int t
549
585
return result;
550
586
}
551
587
552
- /* returns the absolute delta_x and delta_y offset required to reach to_node from from_node */
553
588
std::pair<int , int > get_xy_deltas (RRNodeId from_node, RRNodeId to_node) {
554
589
auto & device_ctx = g_vpr_ctx.device ();
555
590
const auto & rr_graph = device_ctx.rr_graph ;
@@ -561,8 +596,8 @@ std::pair<int, int> get_xy_deltas(RRNodeId from_node, RRNodeId to_node) {
561
596
562
597
if (!is_chan (from_type) && !is_chan (to_type)) {
563
598
// Alternate formulation for non-channel types
564
- auto [from_x, from_y] = adjust_rr_position (from_node);
565
- auto [to_x, to_y] = adjust_rr_position (to_node);
599
+ auto [from_x, from_y] = get_adjusted_rr_position (from_node);
600
+ auto [to_x, to_y] = get_adjusted_rr_position (to_node);
566
601
567
602
delta_x = to_x - from_x;
568
603
delta_y = to_y - from_y;
@@ -757,7 +792,7 @@ t_routing_cost_map get_routing_cost_map(int longest_seg_length,
757
792
routing_cost_map.fill (Expansion_Cost_Entry ());
758
793
759
794
// to avoid multiple memory allocation and de-allocations in run_dijkstra()
760
- // dijkstra_data is created outside the for loop as passed by reference to dijkstra_data()
795
+ // dijkstra_data is created outside the for loop and passed by reference to dijkstra_data()
761
796
t_dijkstra_data dijkstra_data;
762
797
763
798
for (RRNodeId sample_node : sample_nodes) {
@@ -1375,23 +1410,23 @@ static void expand_dijkstra_neighbours(util::PQ_Entry parent_entry,
1375
1410
}
1376
1411
}
1377
1412
1378
- static std::pair<int , int > adjust_rr_position (const RRNodeId rr) {
1413
+ static std::pair<int , int > get_adjusted_rr_position (const RRNodeId rr) {
1379
1414
auto & device_ctx = g_vpr_ctx.device ();
1380
1415
const auto & rr_graph = device_ctx.rr_graph ;
1381
1416
1382
1417
e_rr_type rr_type = rr_graph.node_type (rr);
1383
1418
1384
1419
if (is_chan (rr_type)) {
1385
- return adjust_rr_wire_position (rr);
1420
+ return get_adjusted_rr_wire_position (rr);
1386
1421
} else if (is_pin (rr_type)) {
1387
- return adjust_rr_pin_position (rr);
1422
+ return get_adjusted_rr_pin_position (rr);
1388
1423
} else {
1389
1424
VTR_ASSERT_SAFE (is_src_sink (rr_type));
1390
- return adjust_rr_src_sink_position (rr);
1425
+ return get_adjusted_rr_src_sink_position (rr);
1391
1426
}
1392
1427
}
1393
1428
1394
- static std::pair<int , int > adjust_rr_pin_position (const RRNodeId rr) {
1429
+ static std::pair<int , int > get_adjusted_rr_pin_position (const RRNodeId rr) {
1395
1430
/*
1396
1431
* VPR uses a co-ordinate system where wires above and to the right of a block
1397
1432
* are at the same location as the block:
@@ -1458,7 +1493,7 @@ static std::pair<int, int> adjust_rr_pin_position(const RRNodeId rr) {
1458
1493
return {x, y};
1459
1494
}
1460
1495
1461
- static std::pair<int , int > adjust_rr_wire_position (const RRNodeId rr) {
1496
+ static std::pair<int , int > get_adjusted_rr_wire_position (const RRNodeId rr) {
1462
1497
auto & device_ctx = g_vpr_ctx.device ();
1463
1498
const auto & rr_graph = device_ctx.rr_graph ;
1464
1499
@@ -1481,7 +1516,7 @@ static std::pair<int, int> adjust_rr_wire_position(const RRNodeId rr) {
1481
1516
}
1482
1517
}
1483
1518
1484
- static std::pair<int , int > adjust_rr_src_sink_position (const RRNodeId rr) {
1519
+ static std::pair<int , int > get_adjusted_rr_src_sink_position (const RRNodeId rr) {
1485
1520
// SOURCE/SINK nodes assume the full dimensions of their
1486
1521
// associated block
1487
1522
0 commit comments