Skip to content

Commit bbf1d04

Browse files
committed
Integrate schema based reader with edge refactoring.
Signed-off-by: Keith Rothman <[email protected]>
1 parent 4990def commit bbf1d04

File tree

4 files changed

+127
-138
lines changed

4 files changed

+127
-138
lines changed

vpr/src/route/rr_graph.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ static void build_rr_graph(const t_graph_type graph_type,
725725

726726
//Partition the rr graph edges for efficient access to configurable/non-configurable
727727
//edge subsets. Must be done after RR switches have been allocated
728-
partition_rr_graph_edges(&device_ctx.rr_nodes);
728+
device_ctx.rr_nodes.partition_edges();
729729

730730
//Save the channel widths for the newly constructed graph
731731
device_ctx.chan_width = nodes_per_chan;

vpr/src/route/rr_graph_storage.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "rr_node_fwd.h"
77
#include "rr_graph2.h"
88
#include "vtr_log.h"
9+
#include "vpr_utils.h"
910

1011
/* Main structure describing one routing resource node. Everything in *
1112
* this structure should describe the graph -- information needed only *
@@ -101,6 +102,17 @@ class t_rr_graph_storage {
101102
clear();
102103
}
103104

105+
// Makes room in storage for RRNodeId in amoritized O(1) fashion.
106+
//
107+
// This results in an allocation pattern similiar to what would happen
108+
// if push_back(x) / emplace_back() were used if underlying storage
109+
// was not preallocated.
110+
void make_room_for_node(RRNodeId elem_position) {
111+
make_room_in_vector(&storage_, size_t(elem_position));
112+
ptc_.reserve(storage_.capacity());
113+
ptc_.resize(storage_.size());
114+
}
115+
104116
void reserve(size_t size) {
105117
// No edges can be assigned if mutating the rr node array.
106118
VTR_ASSERT(!edges_read_);

0 commit comments

Comments
 (0)