Skip to content

Change some internal packer APIs to not use C-style arrays #2987

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libs/libarchfpga/src/cad_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ struct t_cluster_placement_primitive {
t_pb_graph_node* pb_graph_node;
bool valid;
float base_cost; /* cost independent of current status of packing */
float incremental_cost; /* cost dependant on current status of packing */
float incremental_cost; /* cost dependent on current status of packing */
};

#endif
2 changes: 1 addition & 1 deletion vpr/src/pack/cluster_legalizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,7 @@ e_block_pack_status ClusterLegalizer::try_pack_molecule(PackMoleculeId molecule_
while (block_pack_status != e_block_pack_status::BLK_PASSED) {
if (!get_next_primitive_list(cluster.placement_stats,
molecule_id,
primitives_list.data(),
primitives_list,
prepacker_)) {
VTR_LOGV(log_verbosity_ > 3, "\t\tFAILED No candidate primitives available\n");
block_pack_status = e_block_pack_status::BLK_FAILED_FEASIBLE;
Expand Down
10 changes: 5 additions & 5 deletions vpr/src/pack/cluster_placement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ static void update_primitive_cost_or_status(t_intra_cluster_placement_stats* clu
static float try_place_molecule(t_intra_cluster_placement_stats* cluster_placement_stats,
PackMoleculeId molecule_id,
t_pb_graph_node* root,
t_pb_graph_node** primitives_list,
std::vector<t_pb_graph_node*>& primitives_list,
const Prepacker& prepacker);

static bool expand_forced_pack_molecule_placement(t_intra_cluster_placement_stats* cluster_placement_stats,
PackMoleculeId molecule_id,
const t_pack_pattern_block* pack_pattern_block,
t_pb_graph_node** primitives_list,
std::vector<t_pb_graph_node*>& primitives_list,
const Prepacker& prepacker,
float* cost);

Expand Down Expand Up @@ -177,7 +177,7 @@ void free_cluster_placement_stats(t_intra_cluster_placement_stats* cluster_place

bool get_next_primitive_list(t_intra_cluster_placement_stats* cluster_placement_stats,
PackMoleculeId molecule_id,
t_pb_graph_node** primitives_list,
std::vector<t_pb_graph_node*>& primitives_list,
const Prepacker& prepacker,
int force_site) {
std::unordered_multimap<int, t_cluster_placement_primitive*>::iterator best;
Expand Down Expand Up @@ -479,7 +479,7 @@ static void update_primitive_cost_or_status(t_intra_cluster_placement_stats* clu
static float try_place_molecule(t_intra_cluster_placement_stats* cluster_placement_stats,
PackMoleculeId molecule_id,
t_pb_graph_node* root,
t_pb_graph_node** primitives_list,
std::vector<t_pb_graph_node*>& primitives_list,
const Prepacker& prepacker) {
float cost = std::numeric_limits<float>::max();
const t_pack_molecule& molecule = prepacker.get_molecule(molecule_id);
Expand Down Expand Up @@ -527,7 +527,7 @@ static float try_place_molecule(t_intra_cluster_placement_stats* cluster_placeme
static bool expand_forced_pack_molecule_placement(t_intra_cluster_placement_stats* cluster_placement_stats,
PackMoleculeId molecule_id,
const t_pack_pattern_block* pack_pattern_block,
t_pb_graph_node** primitives_list,
std::vector<t_pb_graph_node*>& primitives_list,
const Prepacker& prepacker,
float* cost) {
t_pb_graph_node* pb_graph_node = primitives_list[pack_pattern_block->block_id];
Expand Down
2 changes: 1 addition & 1 deletion vpr/src/pack/cluster_placement.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ void free_cluster_placement_stats(t_intra_cluster_placement_stats* cluster_place
bool get_next_primitive_list(
t_intra_cluster_placement_stats* cluster_placement_stats,
PackMoleculeId molecule_id,
t_pb_graph_node** primitives_list,
std::vector<t_pb_graph_node*>& primitives_list,
const Prepacker& prepacker,
int force_site = -1);

Expand Down
Loading