Skip to content

Commit 7af902a

Browse files
author
Muhammad Haris Zafar
authored
Merge branch 'master' into api_partition_edges
2 parents 830b620 + 89dffd5 commit 7af902a

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

vpr/src/device/rr_graph_builder.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@ class RRGraphBuilder {
145145
node_storage_.remap_rr_node_switch_indices(switch_fanin);
146146
}
147147

148+
/** @brief Marks that edge switch values are rr switch indicies*/
149+
inline void mark_edges_as_rr_switch_ids() {
150+
node_storage_.mark_edges_as_rr_switch_ids();
151+
}
152+
148153
/** @brief Counts the number of rr switches needed based on fan in to support mux
149154
* size dependent switch delays. */
150155
inline size_t count_rr_switches(
@@ -154,6 +159,16 @@ class RRGraphBuilder {
154159
return node_storage_.count_rr_switches(num_arch_switches, arch_switch_inf, arch_switch_fanins);
155160
}
156161

162+
/** @brief This function reserve storage for RR nodes. */
163+
inline void reserve_nodes(size_t size) {
164+
node_storage_.reserve(size);
165+
}
166+
167+
/** @brief This function resize node storage to accomidate size RR nodes. */
168+
inline void resize_nodes(size_t size) {
169+
node_storage_.resize(size);
170+
}
171+
157172
/** brief Validate that edge data is partitioned correctly
158173
* @note This function is used to validate the correctness of the routing resource graph in terms
159174
* of graph attributes. Strongly recommend to call it when you finish the building a routing resource

vpr/src/route/rr_graph.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,9 +576,9 @@ static void build_rr_graph(const t_graph_type graph_type,
576576
size_t expected_node_count = num_rr_nodes;
577577
if (clock_modeling == DEDICATED_NETWORK) {
578578
expected_node_count += ClockRRGraphBuilder::estimate_additional_nodes(grid);
579-
device_ctx.rr_nodes.reserve(expected_node_count);
579+
device_ctx.rr_graph_builder.reserve_nodes(expected_node_count);
580580
}
581-
device_ctx.rr_nodes.resize(num_rr_nodes);
581+
device_ctx.rr_graph_builder.resize_nodes(num_rr_nodes);
582582

583583
/* These are data structures used by the the unidir opin mapping. They are used
584584
* to spread connections evenly for each segment type among the available

vpr/src/route/rr_graph_uxsdcxx_serializer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ class RrGraphSerializer final : public uxsd::RrGraphBase<RrGraphContextTypes> {
755755
* </xs:complexType>
756756
*/
757757
inline void preallocate_rr_nodes_node(void*& /*ctx*/, size_t size) final {
758-
rr_nodes_->reserve(size);
758+
rr_graph_builder_->reserve_nodes(size);
759759
}
760760
inline int add_rr_nodes_node(void*& /*ctx*/, unsigned int capacity, unsigned int id, uxsd::enum_node_type type) final {
761761
// make_room_in_vector will not allocate if preallocate_rr_nodes_node
@@ -958,7 +958,7 @@ class RrGraphSerializer final : public uxsd::RrGraphBase<RrGraphContextTypes> {
958958
// Partition the rr graph edges for efficient access to
959959
// configurable/non-configurable edge subsets. Must be done after RR
960960
// switches have been allocated.
961-
rr_nodes_->mark_edges_as_rr_switch_ids();
961+
rr_graph_builder_->mark_edges_as_rr_switch_ids();
962962
rr_graph_builder_->partition_edges();
963963

964964
for (int source_node = 0; source_node < (ssize_t)rr_nodes_->size(); ++source_node) {

0 commit comments

Comments
 (0)