Skip to content

Commit e62a86a

Browse files
committed
[VPR] Deploy RRGraphView in route_common functions
1 parent fa880d5 commit e62a86a

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

vpr/src/route/route_common.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ static t_trace_branch traceback_branch(int node, int target_net_pin_index, std::
9090
static std::pair<t_trace*, t_trace*> add_trace_non_configurable(t_trace* head, t_trace* tail, int node, std::unordered_set<int>& visited);
9191
static std::pair<t_trace*, t_trace*> add_trace_non_configurable_recurr(int node, std::unordered_set<int>& visited, int depth = 0);
9292

93-
static vtr::vector<ClusterNetId, std::vector<int>> load_net_rr_terminals(const t_rr_node_indices& L_rr_node_indices);
94-
static vtr::vector<ClusterBlockId, std::vector<int>> load_rr_clb_sources(const t_rr_node_indices& L_rr_node_indices);
93+
static vtr::vector<ClusterNetId, std::vector<int>> load_net_rr_terminals(const RRGraphView& rr_graph);
94+
static vtr::vector<ClusterBlockId, std::vector<int>> load_rr_clb_sources(const RRGraphView& rr_graph);
9595

9696
static t_clb_opins_used alloc_and_load_clb_opins_used_locally();
9797
static void adjust_one_rr_occ_and_acc_cost(int inode, int add_or_sub, float acc_fac);
@@ -477,10 +477,10 @@ void init_route_structs(int bb_factor) {
477477
route_ctx.trace_nodes.resize(cluster_ctx.clb_nlist.nets().size());
478478

479479
//Various look-ups
480-
route_ctx.net_rr_terminals = load_net_rr_terminals(device_ctx.rr_node_indices);
480+
route_ctx.net_rr_terminals = load_net_rr_terminals(device_ctx.rr_graph);
481481
route_ctx.is_clock_net = load_is_clock_net();
482482
route_ctx.route_bb = load_route_bb(bb_factor);
483-
route_ctx.rr_blk_source = load_rr_clb_sources(device_ctx.rr_node_indices);
483+
route_ctx.rr_blk_source = load_rr_clb_sources(device_ctx.rr_graph);
484484
route_ctx.clb_opins_used_locally = alloc_and_load_clb_opins_used_locally();
485485
route_ctx.net_status.resize(cluster_ctx.clb_nlist.nets().size());
486486
}
@@ -966,7 +966,7 @@ void reset_rr_node_route_structs() {
966966
/* Allocates and loads the route_ctx.net_rr_terminals data structure. For each net it stores the rr_node *
967967
* index of the SOURCE of the net and all the SINKs of the net [clb_nlist.nets()][clb_nlist.net_pins()]. *
968968
* Entry [inet][pnum] stores the rr index corresponding to the SOURCE (opin) or SINK (ipin) of the pin. */
969-
static vtr::vector<ClusterNetId, std::vector<int>> load_net_rr_terminals(const t_rr_node_indices& L_rr_node_indices) {
969+
static vtr::vector<ClusterNetId, std::vector<int>> load_net_rr_terminals(const RRGraphView& rr_graph) {
970970
vtr::vector<ClusterNetId, std::vector<int>> net_rr_terminals;
971971

972972
auto& cluster_ctx = g_vpr_ctx.clustering();
@@ -993,9 +993,9 @@ static vtr::vector<ClusterNetId, std::vector<int>> load_net_rr_terminals(const t
993993

994994
int iclass = type->pin_class[phys_pin];
995995

996-
int inode = get_rr_node_index(L_rr_node_indices, i, j, (pin_count == 0 ? SOURCE : SINK), /* First pin is driver */
997-
iclass);
998-
net_rr_terminals[net_id][pin_count] = inode;
996+
RRNodeId inode = rr_graph.node_lookup().find_node(i, j, (pin_count == 0 ? SOURCE : SINK), /* First pin is driver */
997+
iclass);
998+
net_rr_terminals[net_id][pin_count] = size_t(inode);
999999
pin_count++;
10001000
}
10011001
}
@@ -1008,10 +1008,10 @@ static vtr::vector<ClusterNetId, std::vector<int>> load_net_rr_terminals(const t
10081008
* they are used only to reserve pins for locally used OPINs in the router. *
10091009
* [0..cluster_ctx.clb_nlist.blocks().size()-1][0..num_class-1]. *
10101010
* The values for blocks that are padsare NOT valid. */
1011-
static vtr::vector<ClusterBlockId, std::vector<int>> load_rr_clb_sources(const t_rr_node_indices& L_rr_node_indices) {
1011+
static vtr::vector<ClusterBlockId, std::vector<int>> load_rr_clb_sources(const RRGraphView& rr_graph) {
10121012
vtr::vector<ClusterBlockId, std::vector<int>> rr_blk_source;
10131013

1014-
int i, j, iclass, inode;
1014+
int i, j, iclass;
10151015
t_rr_type rr_type;
10161016

10171017
auto& cluster_ctx = g_vpr_ctx.clustering();
@@ -1036,8 +1036,8 @@ static vtr::vector<ClusterBlockId, std::vector<int>> load_rr_clb_sources(const t
10361036
else
10371037
rr_type = SINK;
10381038

1039-
inode = get_rr_node_index(L_rr_node_indices, i, j, rr_type, iclass);
1040-
rr_blk_source[blk_id][iclass] = inode;
1039+
RRNodeId inode = rr_graph.node_lookup().find_node(i, j, rr_type, iclass);
1040+
rr_blk_source[blk_id][iclass] = size_t(inode);
10411041
} else {
10421042
rr_blk_source[blk_id][iclass] = OPEN;
10431043
}

0 commit comments

Comments
 (0)