Skip to content

Commit 264ede4

Browse files
committed
[packer] Fixing warnings and code format
1 parent 59ea568 commit 264ede4

File tree

3 files changed

+168
-175
lines changed

3 files changed

+168
-175
lines changed

vpr/src/pack/greedy_candidate_selector.cpp

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ static void add_molecule_to_pb_stats_candidates(
6262
PackMoleculeId molecule_id,
6363
ClusterGainStats& cluster_gain_stats,
6464
t_logical_block_type_ptr cluster_type,
65-
int max_queue_size,
6665
AttractionInfo& attraction_groups,
6766
const Prepacker& prepacker,
6867
const AtomNetlist& atom_netlist,
@@ -747,9 +746,7 @@ PackMoleculeId GreedyCandidateSelector::get_next_candidate_for_cluster(
747746
// then we need to clear the feasible blocks list and reset the number of pops.
748747
// This ensures that we can continue searching for feasible blocks for the remaining
749748
// steps (2.transitive, 3.high fanout, 4.attraction group).
750-
if (cluster_gain_stats.feasible_blocks.empty() ||
751-
cluster_gain_stats.current_stage_candidates_proposed_limit_reached()
752-
){
749+
if (cluster_gain_stats.feasible_blocks.empty() || cluster_gain_stats.current_stage_candidates_proposed_limit_reached()) {
753750
cluster_gain_stats.feasible_blocks.clear();
754751
cluster_gain_stats.num_candidates_proposed = 0;
755752
}
@@ -788,7 +785,8 @@ void GreedyCandidateSelector::add_cluster_molecule_candidates_by_connectivity_an
788785
const ClusterLegalizer& cluster_legalizer,
789786
AttractionInfo& attraction_groups) {
790787

791-
cluster_gain_stats.explore_transitive_fanout = true; /* If no legal molecules found, enable exploration of molecules two hops away */
788+
cluster_gain_stats.explore_transitive_fanout = true; /* If no legal molecules found, enable exploration of molecules two hops away */
789+
cluster_gain_stats.candidates_propose_limit = packer_opts_.feasible_block_array_size; // set the limit of candidates to propose
792790

793791
for (AtomBlockId blk_id : cluster_gain_stats.marked_blocks) {
794792
// Get the molecule that contains this block.
@@ -799,7 +797,6 @@ void GreedyCandidateSelector::add_cluster_molecule_candidates_by_connectivity_an
799797
add_molecule_to_pb_stats_candidates(molecule_id,
800798
cluster_gain_stats,
801799
cluster_legalizer.get_cluster_type(legalization_cluster_id),
802-
packer_opts_.feasible_block_array_size,
803800
attraction_groups,
804801
prepacker_,
805802
atom_netlist_,
@@ -815,6 +812,7 @@ void GreedyCandidateSelector::add_cluster_molecule_candidates_by_transitive_conn
815812
AttractionInfo& attraction_groups) {
816813
//TODO: For now, only done by fan-out; should also consider fan-in
817814
cluster_gain_stats.explore_transitive_fanout = false;
815+
cluster_gain_stats.candidates_propose_limit = std::min(packer_opts_.feasible_block_array_size, AAPACK_MAX_TRANSITIVE_EXPLORE); // set the limit of candidates to propose
818816

819817
/* First time finding transitive fanout candidates therefore alloc and load them */
820818
load_transitive_fanout_candidates(cluster_gain_stats,
@@ -828,8 +826,6 @@ void GreedyCandidateSelector::add_cluster_molecule_candidates_by_transitive_conn
828826
add_molecule_to_pb_stats_candidates(molecule_id,
829827
cluster_gain_stats,
830828
cluster_legalizer.get_cluster_type(legalization_cluster_id),
831-
std::min(packer_opts_.feasible_block_array_size,
832-
AAPACK_MAX_TRANSITIVE_EXPLORE),
833829
attraction_groups,
834830
prepacker_,
835831
atom_netlist_,
@@ -848,6 +844,7 @@ void GreedyCandidateSelector::add_cluster_molecule_candidates_by_highfanout_conn
848844
* related blocks */
849845

850846
AtomNetId net_id = cluster_gain_stats.tie_break_high_fanout_net;
847+
cluster_gain_stats.candidates_propose_limit = std::min(packer_opts_.feasible_block_array_size, AAPACK_MAX_TRANSITIVE_EXPLORE); // set the limit of candidates to propose
851848

852849
int count = 0;
853850
for (AtomPinId pin_id : atom_netlist_.net_pins(net_id)) {
@@ -862,8 +859,6 @@ void GreedyCandidateSelector::add_cluster_molecule_candidates_by_highfanout_conn
862859
add_molecule_to_pb_stats_candidates(molecule_id,
863860
cluster_gain_stats,
864861
cluster_legalizer.get_cluster_type(legalization_cluster_id),
865-
std::min(packer_opts_.feasible_block_array_size,
866-
AAPACK_MAX_HIGH_FANOUT_EXPLORE),
867862
attraction_groups,
868863
prepacker_,
869864
atom_netlist_,
@@ -891,6 +886,7 @@ void GreedyCandidateSelector::add_cluster_molecule_candidates_by_attraction_grou
891886
* group molecules for candidate molecules.
892887
*/
893888
AttractGroupId grp_id = cluster_gain_stats.attraction_grp_id;
889+
cluster_gain_stats.candidates_propose_limit = packer_opts_.feasible_block_array_size; // set the limit of candidates to propose
894890
if (grp_id == AttractGroupId::INVALID()) {
895891
return;
896892
}
@@ -923,7 +919,6 @@ void GreedyCandidateSelector::add_cluster_molecule_candidates_by_attraction_grou
923919
add_molecule_to_pb_stats_candidates(molecule_id,
924920
cluster_gain_stats,
925921
cluster_legalizer.get_cluster_type(legalization_cluster_id),
926-
packer_opts_.feasible_block_array_size,
927922
attraction_groups,
928923
prepacker_,
929924
atom_netlist_,
@@ -945,7 +940,6 @@ void GreedyCandidateSelector::add_cluster_molecule_candidates_by_attraction_grou
945940
add_molecule_to_pb_stats_candidates(molecule_id,
946941
cluster_gain_stats,
947942
cluster_legalizer.get_cluster_type(legalization_cluster_id),
948-
packer_opts_.feasible_block_array_size,
949943
attraction_groups,
950944
prepacker_,
951945
atom_netlist_,
@@ -960,7 +954,6 @@ void GreedyCandidateSelector::add_cluster_molecule_candidates_by_attraction_grou
960954
static void add_molecule_to_pb_stats_candidates(PackMoleculeId molecule_id,
961955
ClusterGainStats& cluster_gain_stats,
962956
t_logical_block_type_ptr cluster_type,
963-
int max_queue_size,
964957
AttractionInfo& attraction_groups,
965958
const Prepacker& prepacker,
966959
const AtomNetlist& atom_netlist,

vpr/src/pack/greedy_candidate_selector.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ struct ClusterGainStats {
135135
unsigned num_candidates_proposed;
136136

137137
/// @brief Check if the current stage candidates proposed limit is reached.
138-
bool current_stage_candidates_proposed_limit_reached(){
138+
bool current_stage_candidates_proposed_limit_reached() {
139139
return num_candidates_proposed >= candidates_propose_limit;
140140
}
141141
};

0 commit comments

Comments
 (0)