Skip to content

Commit e3380ce

Browse files
Merge pull request #2987 from verilog-to-routing/pack_remove_c_arr
Change some internal packer APIs to not use C-style arrays
2 parents 0357aa4 + 313a984 commit e3380ce

File tree

5 files changed

+49
-63
lines changed

5 files changed

+49
-63
lines changed

libs/libarchfpga/src/cad_types.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ struct t_cluster_placement_primitive {
126126
t_pb_graph_node* pb_graph_node;
127127
bool valid;
128128
float base_cost; /* cost independent of current status of packing */
129-
float incremental_cost; /* cost dependant on current status of packing */
129+
float incremental_cost; /* cost dependent on current status of packing */
130130
};
131131

132132
#endif

vpr/src/pack/cluster_legalizer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1205,7 +1205,7 @@ e_block_pack_status ClusterLegalizer::try_pack_molecule(PackMoleculeId molecule_
12051205
while (block_pack_status != e_block_pack_status::BLK_PASSED) {
12061206
if (!get_next_primitive_list(cluster.placement_stats,
12071207
molecule_id,
1208-
primitives_list.data(),
1208+
primitives_list,
12091209
prepacker_)) {
12101210
VTR_LOGV(log_verbosity_ > 3, "\t\tFAILED No candidate primitives available\n");
12111211
block_pack_status = e_block_pack_status::BLK_FAILED_FEASIBLE;

vpr/src/pack/cluster_placement.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ static void update_primitive_cost_or_status(t_intra_cluster_placement_stats* clu
4646
static float try_place_molecule(t_intra_cluster_placement_stats* cluster_placement_stats,
4747
PackMoleculeId molecule_id,
4848
t_pb_graph_node* root,
49-
t_pb_graph_node** primitives_list,
49+
std::vector<t_pb_graph_node*>& primitives_list,
5050
const Prepacker& prepacker);
5151

5252
static bool expand_forced_pack_molecule_placement(t_intra_cluster_placement_stats* cluster_placement_stats,
5353
PackMoleculeId molecule_id,
5454
const t_pack_pattern_block* pack_pattern_block,
55-
t_pb_graph_node** primitives_list,
55+
std::vector<t_pb_graph_node*>& primitives_list,
5656
const Prepacker& prepacker,
5757
float* cost);
5858

@@ -177,7 +177,7 @@ void free_cluster_placement_stats(t_intra_cluster_placement_stats* cluster_place
177177

178178
bool get_next_primitive_list(t_intra_cluster_placement_stats* cluster_placement_stats,
179179
PackMoleculeId molecule_id,
180-
t_pb_graph_node** primitives_list,
180+
std::vector<t_pb_graph_node*>& primitives_list,
181181
const Prepacker& prepacker,
182182
int force_site) {
183183
std::unordered_multimap<int, t_cluster_placement_primitive*>::iterator best;
@@ -479,7 +479,7 @@ static void update_primitive_cost_or_status(t_intra_cluster_placement_stats* clu
479479
static float try_place_molecule(t_intra_cluster_placement_stats* cluster_placement_stats,
480480
PackMoleculeId molecule_id,
481481
t_pb_graph_node* root,
482-
t_pb_graph_node** primitives_list,
482+
std::vector<t_pb_graph_node*>& primitives_list,
483483
const Prepacker& prepacker) {
484484
float cost = std::numeric_limits<float>::max();
485485
const t_pack_molecule& molecule = prepacker.get_molecule(molecule_id);
@@ -527,7 +527,7 @@ static float try_place_molecule(t_intra_cluster_placement_stats* cluster_placeme
527527
static bool expand_forced_pack_molecule_placement(t_intra_cluster_placement_stats* cluster_placement_stats,
528528
PackMoleculeId molecule_id,
529529
const t_pack_pattern_block* pack_pattern_block,
530-
t_pb_graph_node** primitives_list,
530+
std::vector<t_pb_graph_node*>& primitives_list,
531531
const Prepacker& prepacker,
532532
float* cost) {
533533
t_pb_graph_node* pb_graph_node = primitives_list[pack_pattern_block->block_id];

vpr/src/pack/cluster_placement.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ void free_cluster_placement_stats(t_intra_cluster_placement_stats* cluster_place
163163
bool get_next_primitive_list(
164164
t_intra_cluster_placement_stats* cluster_placement_stats,
165165
PackMoleculeId molecule_id,
166-
t_pb_graph_node** primitives_list,
166+
std::vector<t_pb_graph_node*>& primitives_list,
167167
const Prepacker& prepacker,
168168
int force_site = -1);
169169

0 commit comments

Comments
 (0)