Skip to content

Commit abf42b9

Browse files
committed
fixed discrepancy between function def and impl
1 parent 9e1ffcf commit abf42b9

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

libs/libarchfpga/src/physical_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,6 +1225,7 @@ struct t_pin_to_pin_annotation {
12251225
* parent_pb_graph_node : parent pb graph node
12261226
* total_primitive_count : Total number of this primitive type in the cluster. If there are 10 ALMs per cluster
12271227
* and 2 FFs per ALM (given the mode of the parent of this primitive) then the total is 20.
1228+
* flat_site_index : index of this primitive within its primitive type in this cluster; in [0,...,total_primitive_count]
12281229
* illegal_modes : vector containing illegal modes that result in conflicts during routing
12291230
*/
12301231
class t_pb_graph_node {
@@ -1281,6 +1282,7 @@ class t_pb_graph_node {
12811282
int num_output_pin_class; /* number of output pin classes that this pb_graph_node has */
12821283

12831284
int total_primitive_count; /* total number of this primitive type in the cluster */
1285+
int flat_site_index; /* index of this primitive within sites of its type in this cluster */
12841286

12851287
/* Interconnect instances for this pb
12861288
* Only used for power

vpr/src/pack/pb_type_graph.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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,10 +353,13 @@ 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],
362+
base + k,
356363
k,
357364
load_power_structures,
358365
pin_count_in_cluster);

vpr/src/pack/re_cluster_util.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ bool start_new_cluster_for_mol(t_pack_molecule* molecule,
8989
t_lb_router_data** router_data,
9090
PartitionRegion& temp_cluster_pr,
9191
NocGroupId& temp_cluster_noc_grp_id,
92-
const int detailed_routing_stage = 1);
92+
const int& detailed_routing_stage = 1);
9393

9494
/**
9595
* @brief A function that packs a molecule into an existing cluster
@@ -109,7 +109,7 @@ bool pack_mol_in_existing_cluster(t_pack_molecule* molecule,
109109
bool during_packing,
110110
t_clustering_data& clustering_data,
111111
t_lb_router_data*& router_data,
112-
const int detailed_routing_stage = 1);
112+
const int& detailed_routing_stage = 1);
113113

114114
/**
115115
* @brief A function that fix the clustered netlist if the move is performed

0 commit comments

Comments
 (0)