@@ -955,6 +955,7 @@ static void update_molecule_chain_info(t_pack_molecule* chain_molecule, const t_
955
955
*/
956
956
static void revert_place_atom_block (const AtomBlockId blk_id,
957
957
t_lb_router_data* router_data,
958
+ const Prepacker& prepacker,
958
959
vtr::vector_map<AtomBlockId, LegalizationClusterId>& atom_cluster) {
959
960
auto & atom_ctx = g_vpr_ctx.mutable_atom ();
960
961
@@ -971,7 +972,7 @@ static void revert_place_atom_block(const AtomBlockId blk_id,
971
972
*/
972
973
973
974
t_pb* next = pb->parent_pb ;
974
- revalid_molecules (pb);
975
+ revalid_molecules (pb, prepacker );
975
976
free_pb (pb);
976
977
pb = next;
977
978
@@ -988,7 +989,7 @@ static void revert_place_atom_block(const AtomBlockId blk_id,
988
989
/* If the code gets here, then that means that placing the initial seed molecule
989
990
* failed, don't free the actual complex block itself as the seed needs to find
990
991
* another placement */
991
- revalid_molecules (pb);
992
+ revalid_molecules (pb, prepacker );
992
993
free_pb (pb);
993
994
}
994
995
}
@@ -1114,6 +1115,7 @@ e_block_pack_status ClusterLegalizer::try_pack_molecule(t_pack_molecule* molecul
1114
1115
// TODO: Remove these global accesses.
1115
1116
// AtomContext used for:
1116
1117
// - printing verbose statements
1118
+ // - Looking up the primitive pb
1117
1119
const AtomContext& atom_ctx = g_vpr_ctx.atom ();
1118
1120
// FloorplanningContext used for:
1119
1121
// - Checking if the atom can be placed in the cluster for floorplanning
@@ -1332,7 +1334,7 @@ e_block_pack_status ClusterLegalizer::try_pack_molecule(t_pack_molecule* molecul
1332
1334
continue ;
1333
1335
1334
1336
/* invalidate all molecules that share atom block with current molecule */
1335
- t_pack_molecule* cur_molecule = atom_ctx. prepacker .get_atom_molecule (atom_blk_id);
1337
+ t_pack_molecule* cur_molecule = prepacker.get_atom_molecule (atom_blk_id);
1336
1338
// TODO: This should really be named better. Something like
1337
1339
// "is_clustered". and then it should be set to true.
1338
1340
// Right now, valid implies "not clustered" which is
@@ -1359,7 +1361,7 @@ e_block_pack_status ClusterLegalizer::try_pack_molecule(t_pack_molecule* molecul
1359
1361
for (int i = 0 ; i < failed_location; i++) {
1360
1362
AtomBlockId atom_blk_id = molecule->atom_block_ids [i];
1361
1363
if (atom_blk_id) {
1362
- revert_place_atom_block (atom_blk_id, cluster.router_data , atom_cluster);
1364
+ revert_place_atom_block (atom_blk_id, cluster.router_data , prepacker, atom_cluster);
1363
1365
}
1364
1366
}
1365
1367
@@ -1504,7 +1506,7 @@ void ClusterLegalizer::destroy_cluster(LegalizationClusterId cluster_id) {
1504
1506
for (int i = 0 ; i < molecule_size; i++) {
1505
1507
AtomBlockId atom_blk_id = mol->atom_block_ids [i];
1506
1508
if (atom_blk_id) {
1507
- revert_place_atom_block (atom_blk_id, cluster.router_data , atom_cluster);
1509
+ revert_place_atom_block (atom_blk_id, cluster.router_data , prepacker, atom_cluster);
1508
1510
}
1509
1511
}
1510
1512
}
@@ -1558,18 +1560,18 @@ bool ClusterLegalizer::check_cluster_legality(LegalizationClusterId cluster_id)
1558
1560
return try_intra_lb_route (cluster.router_data , log_verbosity, &mode_status);
1559
1561
}
1560
1562
1561
- void ClusterLegalizer::init (const AtomNetlist& atom_netlist,
1562
- const Prepacker& prepacker ,
1563
- const std::vector<t_logical_block_type>& logical_block_types,
1564
- std::vector<t_lb_type_rr_node>* t_lb_type_rr_graphs,
1565
- size_t t_num_models,
1566
- const std::vector<std::string>& target_external_pin_util_str,
1567
- const t_pack_high_fanout_thresholds& high_fanout_thresholds,
1568
- ClusterLegalizationStrategy t_cluster_legalization_strategy,
1569
- bool t_enable_pin_feasibility_filter,
1570
- int t_feasible_block_array_size,
1571
- int t_log_verbosity,
1572
- int t_force_site) {
1563
+ ClusterLegalizer::ClusterLegalizer (const AtomNetlist& atom_netlist,
1564
+ const Prepacker& t_prepacker ,
1565
+ const std::vector<t_logical_block_type>& logical_block_types,
1566
+ std::vector<t_lb_type_rr_node>* t_lb_type_rr_graphs,
1567
+ size_t t_num_models,
1568
+ const std::vector<std::string>& target_external_pin_util_str,
1569
+ const t_pack_high_fanout_thresholds& high_fanout_thresholds,
1570
+ ClusterLegalizationStrategy t_cluster_legalization_strategy,
1571
+ bool t_enable_pin_feasibility_filter,
1572
+ int t_feasible_block_array_size,
1573
+ int t_log_verbosity,
1574
+ int t_force_site) : prepacker(t_prepacker ) {
1573
1575
// Ensure that this is not being initialized twice.
1574
1576
VTR_ASSERT (cluster_placement_stats == nullptr &&
1575
1577
primitives_list == nullptr &&
0 commit comments