@@ -48,6 +48,7 @@ static void alloc_and_load_pb_graph(t_pb_graph_node* pb_graph_node,
48
48
t_pb_graph_node* parent_pb_graph_node,
49
49
t_pb_type* pb_type,
50
50
const int index,
51
+ const int flat_index,
51
52
bool load_power_structures,
52
53
int & pin_count_in_cluster);
53
54
@@ -151,6 +152,7 @@ void alloc_and_load_all_pb_graphs(bool load_power_structures, bool is_flat) {
151
152
nullptr ,
152
153
type.pb_type ,
153
154
0 ,
155
+ 0 ,
154
156
load_power_structures,
155
157
pin_count_in_cluster);
156
158
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,
224
226
t_pb_graph_node* parent_pb_graph_node,
225
227
t_pb_type* pb_type,
226
228
const int index,
229
+ const int flat_index,
227
230
bool load_power_structures,
228
231
int & pin_count_in_cluster) {
229
232
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,
237
240
pb_graph_node->num_clock_ports = 0 ;
238
241
239
242
pb_graph_node->total_primitive_count = 0 ;
243
+ pb_graph_node->flat_site_index = flat_index;
240
244
241
245
/* Generate ports for pb graph node */
242
246
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,
349
353
sizeof (t_pb_graph_node*));
350
354
for (j = 0 ; j < pb_type->modes [i].num_pb_type_children ; j++) {
351
355
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
+
352
358
for (k = 0 ; k < pb_type->modes [i].pb_type_children [j].num_pb ; k++) {
353
359
alloc_and_load_pb_graph (&pb_graph_node->child_pb_graph_nodes [i][j][k],
354
360
pb_graph_node,
355
361
&pb_type->modes [i].pb_type_children [j],
356
362
k,
363
+ base + k,
357
364
load_power_structures,
358
365
pin_count_in_cluster);
359
366
}
0 commit comments