Skip to content

Commit 39aeb4a

Browse files
committed
Fill data structure related to internal resources if flat_routing is enabled
1 parent 02ad280 commit 39aeb4a

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

vpr/src/base/SetupVPR.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ void SetupVPR(const t_options* Options,
249249

250250
{
251251
vtr::ScopedStartFinishTimer t("Building complex block graph");
252-
alloc_and_load_all_pb_graphs(PowerOpts->do_power);
252+
alloc_and_load_all_pb_graphs(PowerOpts->do_power, RouterOpts->flat_routing);
253253
*PackerRRGraphs = alloc_and_load_all_lb_type_rr_graph();
254254
}
255255

vpr/src/pack/pb_type_graph.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ static bool check_input_pins_equivalence(const t_pb_graph_pin* cur_pin,
133133
/**
134134
* Allocate memory into types and load the pb graph with interconnect edges
135135
*/
136-
void alloc_and_load_all_pb_graphs(bool load_power_structures) {
136+
void alloc_and_load_all_pb_graphs(bool load_power_structures, bool is_flat) {
137137
int errors;
138138
edges_head = nullptr;
139139
num_edges_head = nullptr;
@@ -148,8 +148,10 @@ void alloc_and_load_all_pb_graphs(bool load_power_structures) {
148148
type.pb_type, 0, load_power_structures, pin_count_in_cluster);
149149
type.pb_graph_head->total_pb_pins = pin_count_in_cluster;
150150
load_pin_classes_in_pb_graph_head(type.pb_graph_head);
151-
set_pins_logical_num(&type);
152-
add_logical_classes(&type);
151+
if(is_flat) {
152+
set_pins_logical_num(&type);
153+
add_logical_classes(&type);
154+
}
153155
} else {
154156
type.pb_graph_head = nullptr;
155157
VTR_ASSERT(&type == device_ctx.EMPTY_LOGICAL_BLOCK_TYPE);
@@ -465,11 +467,6 @@ static std::vector<const t_pb_graph_node*> get_all_logical_block_pb_graph_nodes(
465467
}
466468

467469
static void add_logical_classes(t_logical_block_type* logical_block) {
468-
/* Since logical blocks are allocated using "alloc" command, data structures are not initialized properly.
469-
* This is why we need to assign a new object to it. This won't be needed when logical blocks are allocated
470-
* using "new" operator.
471-
*/
472-
logical_block->pb_pin_to_class_logical_num_mapping = std::unordered_map<const t_pb_graph_pin*, int>();
473470

474471
auto pb_graph_nodes = get_all_logical_block_pb_graph_nodes(logical_block);
475472
for (auto pb_graph_node : pb_graph_nodes) {

vpr/src/pack/pb_type_graph.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const t_pb_graph_edge* get_edge_between_pins(
1616
const t_pb_graph_pin* driver_pin,
1717
const t_pb_graph_pin* pin);
1818

19-
void alloc_and_load_all_pb_graphs(bool load_power_structures);
19+
void alloc_and_load_all_pb_graphs(bool load_power_structures, bool is_flat);
2020
void echo_pb_graph(char* filename);
2121
void free_pb_graph_edges();
2222
t_pb_graph_pin*** alloc_and_load_port_pin_ptrs_from_string(const int line_num,

0 commit comments

Comments
 (0)