Skip to content

Commit 01945e9

Browse files
committed
removed rr_nodes from device
1 parent f10e387 commit 01945e9

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

vpr/src/base/vpr_context.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ struct DeviceContext : public Context {
147147
/*
148148
* Structures to define the routing architecture of the FPGA.
149149
*/
150-
t_rr_graph_storage rr_nodes; // autogenerated in build_rr_graph
150+
//t_rr_graph_storage rr_nodes; // autogenerated in build_rr_graph
151151

152152
vtr::vector<RRIndexedDataId, t_rr_indexed_data> rr_indexed_data; // [0 .. num_rr_indexed_data-1]
153153

@@ -168,7 +168,7 @@ struct DeviceContext : public Context {
168168
/* A read-only view of routing resource graph to be the ONLY database
169169
* for client functions: GUI, placer, router, timing analyzer etc.
170170
*/
171-
RRGraphView rr_graph{rr_nodes, rr_graph_builder.node_lookup(), rr_indexed_data, rr_graph_builder.rr_segments(), rr_graph_builder.rr_switch()};
171+
RRGraphView rr_graph{rr_graph_builder.rr_nodes(), rr_graph_builder.node_lookup(), rr_indexed_data, rr_graph_builder.rr_segments(), rr_graph_builder.rr_switch()};
172172
int num_arch_switches;
173173
t_arch_switch_inf* arch_switch_inf; // [0..(num_arch_switches-1)]
174174

vpr/src/device/rr_graph_builder.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ void RRGraphBuilder::add_node_to_all_locs(RRNodeId node) {
5858

5959
void RRGraphBuilder::clear() {
6060
node_lookup_.clear();
61+
node_storage_.clear();
6162
rr_segments_.clear();
6263
rr_switch_inf_.clear();
6364
}

vpr/src/device/rr_graph_builder.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,11 @@ class RRGraphBuilder {
182182
inline void emplace_back_edge(RRNodeId src, RRNodeId dest, short edge_switch) {
183183
node_storage_.emplace_back_edge(src, dest, edge_switch);
184184
}
185+
inline void emplace_back() {
186+
// No edges can be assigned if mutating the rr node array.
187+
188+
node_storage_.emplace_back();
189+
}
185190

186191
/** @brief alloc_and_load_edges; It adds a batch of edges. */
187192
inline void alloc_and_load_edges(const t_rr_edge_info_set* rr_edges_to_create) {

vpr/src/route/clock_connection_builders.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ void RoutingToClockConnection::create_switches(const ClockRRGraphBuilder& clock_
9191

9292
RRNodeId RoutingToClockConnection::create_virtual_clock_network_sink_node(int x, int y) {
9393
auto& device_ctx = g_vpr_ctx.mutable_device();
94-
auto& rr_graph = device_ctx.rr_nodes;
94+
//auto& rr_graph = device_ctx.rr_nodes;
9595
//auto& temp_rr_graph = device_ctx.rr_graph; // replace this with rr_graph once device_ctx.rr_nodes is unused
9696
auto& rr_graph_builder = device_ctx.rr_graph_builder;
9797
auto& node_lookup = device_ctx.rr_graph_builder.node_lookup();
98-
rr_graph.emplace_back();
98+
rr_graph_builder.emplace_back();
9999
RRNodeId node_index = RRNodeId(device_ctx.rr_graph.num_nodes() - 1);
100100

101101
//Determine the a valid PTC
@@ -119,8 +119,8 @@ RRNodeId RoutingToClockConnection::create_virtual_clock_network_sink_node(int x,
119119

120120
// Use a generic way when adding nodes to lookup.
121121
// However, since the SINK node has the same xhigh/xlow as well as yhigh/ylow, we can probably use a shortcut
122-
for (int ix = rr_graph.node_xlow(node_index); ix <= rr_graph.node_xhigh(node_index); ++ix) {
123-
for (int iy = rr_graph.node_ylow(node_index); iy <= rr_graph.node_yhigh(node_index); ++iy) {
122+
for (int ix = device_ctx.rr_graph.node_xlow(node_index); ix <= device_ctx.rr_graph.node_xhigh(node_index); ++ix) {
123+
for (int iy = device_ctx.rr_graph.node_ylow(node_index); iy <= device_ctx.rr_graph.node_yhigh(node_index); ++iy) {
124124
node_lookup.add_node(node_index, ix, iy, device_ctx.rr_graph.node_type(node_index), device_ctx.rr_graph.node_class_num(node_index));
125125
}
126126
}

vpr/src/route/rr_graph.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1405,7 +1405,7 @@ void free_rr_graph() {
14051405

14061406
device_ctx.read_rr_graph_filename.clear();
14071407

1408-
device_ctx.rr_nodes.clear();
1408+
//device_ctx.rr_nodes.clear();
14091409

14101410
device_ctx.rr_graph_builder.clear();
14111411

0 commit comments

Comments
 (0)