@@ -48,6 +48,7 @@ static void alloc_and_load_pb_graph(t_pb_graph_node* pb_graph_node,
4848 t_pb_graph_node* parent_pb_graph_node,
4949 t_pb_type* pb_type,
5050 const int index,
51+ const int flat_index,
5152 bool load_power_structures,
5253 int & pin_count_in_cluster);
5354
@@ -151,6 +152,7 @@ void alloc_and_load_all_pb_graphs(bool load_power_structures, bool is_flat) {
151152 nullptr ,
152153 type.pb_type ,
153154 0 ,
155+ 0 ,
154156 load_power_structures,
155157 pin_count_in_cluster);
156158 type.pb_graph_head ->total_pb_pins = pin_count_in_cluster;
@@ -224,6 +226,7 @@ static void alloc_and_load_pb_graph(t_pb_graph_node* pb_graph_node,
224226 t_pb_graph_node* parent_pb_graph_node,
225227 t_pb_type* pb_type,
226228 const int index,
229+ const int flat_index,
227230 bool load_power_structures,
228231 int & pin_count_in_cluster) {
229232 int i, j, k, i_input, i_output, i_clockport;
@@ -237,6 +240,7 @@ static void alloc_and_load_pb_graph(t_pb_graph_node* pb_graph_node,
237240 pb_graph_node->num_clock_ports = 0 ;
238241
239242 pb_graph_node->total_primitive_count = 0 ;
243+ pb_graph_node->flat_site_index = flat_index;
240244
241245 /* Generate ports for pb graph node */
242246 for (i = 0 ; i < pb_type->num_ports ; i++) {
@@ -349,11 +353,14 @@ static void alloc_and_load_pb_graph(t_pb_graph_node* pb_graph_node,
349353 sizeof (t_pb_graph_node*));
350354 for (j = 0 ; j < pb_type->modes [i].num_pb_type_children ; j++) {
351355 pb_graph_node->child_pb_graph_nodes [i][j] = (t_pb_graph_node*)vtr::calloc (pb_type->modes [i].pb_type_children [j].num_pb , sizeof (t_pb_graph_node));
356+ int base = flat_index*(pb_type->modes [i].pb_type_children [j].num_pb );
357+
352358 for (k = 0 ; k < pb_type->modes [i].pb_type_children [j].num_pb ; k++) {
353359 alloc_and_load_pb_graph (&pb_graph_node->child_pb_graph_nodes [i][j][k],
354360 pb_graph_node,
355361 &pb_type->modes [i].pb_type_children [j],
356362 k,
363+ base + k,
357364 load_power_structures,
358365 pin_count_in_cluster);
359366 }
0 commit comments