Skip to content

Commit ed8277b

Browse files
committed
[Router] Removed the R_upstream field in t_rr_node_route_inf
The `R_upstream` field added to the `t_rr_node_route_inf` structure for convenience in commit b11b2 is removed and kept inside the connection router class instead. This allows the size of each `t_rr_node_route_inf` to be as minimal as possible, which tends to be more cache-friendly when accessing the large RR node route info data, leading to higher performance.
1 parent 0066be2 commit ed8277b

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

vpr/src/base/vpr_types.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1684,13 +1684,6 @@ struct t_rr_node_route_inf {
16841684
float acc_cost;
16851685
float path_cost;
16861686
float backward_path_cost;
1687-
float R_upstream; // TODO: Investigate the effect of adding the R_upstream field in
1688-
// this struct. It is put in for the fine-grained parallel
1689-
// router's benefits. It is increasing the working set, which
1690-
// can have some performance implications. This could affect
1691-
// the performance of the serial connection router, which will
1692-
// make the Hybrid Connection Router less efficient (but that
1693-
// needs to be investigated).
16941687

16951688
public: //Accessors
16961689
short occ() const { return occ_; }

vpr/src/route/connection_router.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,8 @@ void ConnectionRouter<Heap>::timing_driven_expand_cheapest(RRNodeId from_node,
373373
// element for the corresponding node.
374374
node_t current;
375375
current.backward_path_cost = rr_node_route_inf_[from_node].backward_path_cost;
376-
current.R_upstream = rr_node_route_inf_[from_node].R_upstream;
377376
current.prev_edge = rr_node_route_inf_[from_node].prev_edge;
377+
current.R_upstream = rr_node_R_upstream[from_node];
378378

379379
VTR_LOGV_DEBUG(router_debug_, " Better cost to %d\n", from_node);
380380
VTR_LOGV_DEBUG(router_debug_, " New total cost: %g\n", new_total_cost);
@@ -887,7 +887,7 @@ void ConnectionRouter<Heap>::add_route_tree_node_to_heap(
887887
rr_node_route_inf_[inode].path_cost = tot_cost;
888888
rr_node_route_inf_[inode].prev_edge = RREdgeId::INVALID();
889889
rr_node_route_inf_[inode].backward_path_cost = backward_path_cost;
890-
rr_node_route_inf_[inode].R_upstream = R_upstream;
890+
rr_node_R_upstream[inode] = R_upstream;
891891
heap_.push_back(tot_cost, inode);
892892

893893
// push_back_node(&heap_, rr_node_route_inf_,
@@ -900,7 +900,7 @@ void ConnectionRouter<Heap>::add_route_tree_node_to_heap(
900900
rr_node_route_inf_[inode].path_cost = expected_total_cost;
901901
rr_node_route_inf_[inode].prev_edge = RREdgeId::INVALID();
902902
rr_node_route_inf_[inode].backward_path_cost = backward_path_cost;
903-
rr_node_route_inf_[inode].R_upstream = R_upstream;
903+
rr_node_R_upstream[inode] = R_upstream;
904904

905905
rcv_path_manager.alloc_path_struct(rcv_path_data[inode]);
906906
rcv_path_data[inode]->backward_delay = rt_node.Tdel;

vpr/src/route/connection_router.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ class ConnectionRouter : public ConnectionRouterInterface {
6060
heap_.init_heap(grid);
6161
// heap_.set_prune_limit(rr_nodes_.size(), kHeapPruneFactor * rr_nodes_.size());
6262
only_opin_inter_layer = (grid.get_num_layers() > 1) && inter_layer_connections_limited_to_opin(*rr_graph);
63+
rr_node_R_upstream.resize(rr_node_route_inf.size());
6364
rcv_path_data.resize(rr_node_route_inf.size());
6465
}
6566

@@ -81,6 +82,9 @@ class ConnectionRouter : public ConnectionRouterInterface {
8182
for (const auto& node : modified_rr_node_inf_) {
8283
rcv_path_data[node] = nullptr;
8384
}
85+
// Note: R_upstream of each node is intentionally not reset here.
86+
// For the reasons and details, please refer to the `Update R_upstream`
87+
// in `evaluate_timing_driven_node_costs` in `connection_router.cpp`.
8488
}
8589

8690
/** Finds a path from the route tree rooted at rt_root to sink_node.
@@ -311,6 +315,11 @@ class ConnectionRouter : public ConnectionRouterInterface {
311315
// Timing
312316
std::chrono::microseconds sssp_total_time{0};
313317

318+
// Used only by the timing-driven router. Stores the upstream resistance to ground from this node, including the resistance
319+
// of the node itself (device_ctx.rr_nodes[index].R). Since the `t_heap` is hardly used for heap node structure in the
320+
// connection router anymore, the `R_upstream` field of the `t_heap` is kept inside the connection router class instead.
321+
vtr::vector<RRNodeId, float> rr_node_R_upstream;
322+
314323
// The path manager for RCV, keeps track of the route tree as a set, also manages the allocation of the heap types
315324
PathManager rcv_path_manager;
316325
vtr::vector<RRNodeId, t_heap_path*> rcv_path_data;

0 commit comments

Comments
 (0)