@@ -2401,9 +2401,10 @@ static void start_new_cluster(t_cluster_placement_stats* cluster_placement_stats
2401
2401
/*
2402
2402
* Get candidate molecule to pack into currently open cluster
2403
2403
* Molecule selection priority:
2404
- * 1. Find unpacked molecule based on criticality and strong connectedness (connected by low fanout nets) with current cluster
2405
- * 2. Find unpacked molecule based on transitive connections (eg. 2 hops away) with current cluster
2406
- * 3. Find unpacked molecule based on weak connectedness (connected by high fanout nets) with current cluster
2404
+ * 1. Find unpacked molecules based on criticality and strong connectedness (connected by low fanout nets) with current cluster
2405
+ * 2. Find unpacked molecules based on transitive connections (eg. 2 hops away) with current cluster
2406
+ * 3. Find unpacked molecules based on weak connectedness (connected by high fanout nets) with current cluster
2407
+ * 4. Find unpacked molecules based on attraction group of the current cluster (if the cluster has an attraction group)
2407
2408
*/
2408
2409
static t_pack_molecule* get_highest_gain_molecule (t_pb* cur_pb,
2409
2410
const std::multimap<AtomBlockId, t_pack_molecule*>& atom_molecules,
@@ -2415,45 +2416,46 @@ static t_pack_molecule* get_highest_gain_molecule(t_pb* cur_pb,
2415
2416
bool prioritize_transitive_connectivity,
2416
2417
int transitive_fanout_threshold,
2417
2418
const int feasible_block_array_size) {
2418
- /* This routine populates a list of feasible blocks outside the cluster then returns the best one for the list *
2419
- * not currently in a cluster and satisfies the feasibility *
2420
- * function passed in as is_feasible. If there are no feasible *
2421
- * blocks it returns ClusterBlockId::INVALID(). * /
2419
+ /*
2420
+ * This routine populates a list of feasible blocks outside the cluster, then returns the best candidate for the cluster.
2421
+ * If there are no feasible blocks it returns a nullptr.
2422
+ */
2422
2423
2423
2424
if (gain_mode == HILL_CLIMBING) {
2424
2425
VPR_FATAL_ERROR (VPR_ERROR_PACK,
2425
2426
" Hill climbing not supported yet, error out.\n " );
2426
2427
}
2427
2428
2428
- // 1. Find unpacked molecule based on criticality and strong connectedness (connected by low fanout nets) with current cluster
2429
+ // 1. Find unpacked molecules based on criticality and strong connectedness (connected by low fanout nets) with current cluster
2429
2430
if (cur_pb->pb_stats ->num_feasible_blocks == NOT_VALID) {
2430
2431
add_cluster_molecule_candidates_by_connectivity_and_timing (cur_pb, cluster_placement_stats_ptr, atom_molecules, feasible_block_array_size);
2431
2432
}
2432
2433
2433
2434
if (prioritize_transitive_connectivity) {
2434
- // 2. Find unpacked molecule based on transitive connections (eg. 2 hops away) with current cluster
2435
+ // 2. Find unpacked molecules based on transitive connections (eg. 2 hops away) with current cluster
2435
2436
if (cur_pb->pb_stats ->num_feasible_blocks == 0 && cur_pb->pb_stats ->explore_transitive_fanout ) {
2436
2437
add_cluster_molecule_candidates_by_transitive_connectivity (cur_pb, cluster_placement_stats_ptr, atom_molecules, clb_inter_blk_nets,
2437
2438
cluster_index, transitive_fanout_threshold, feasible_block_array_size);
2438
2439
}
2439
2440
2440
- // 3. Find unpacked molecule based on weak connectedness (connected by high fanout nets) with current cluster
2441
+ // 3. Find unpacked molecules based on weak connectedness (connected by high fanout nets) with current cluster
2441
2442
if (cur_pb->pb_stats ->num_feasible_blocks == 0 && cur_pb->pb_stats ->tie_break_high_fanout_net ) {
2442
2443
add_cluster_molecule_candidates_by_highfanout_connectivity (cur_pb, cluster_placement_stats_ptr, atom_molecules, feasible_block_array_size);
2443
2444
}
2444
2445
} else { // Reverse order
2445
- // 3. Find unpacked molecule based on weak connectedness (connected by high fanout nets) with current cluster
2446
+ // 3. Find unpacked molecules based on weak connectedness (connected by high fanout nets) with current cluster
2446
2447
if (cur_pb->pb_stats ->num_feasible_blocks == 0 && cur_pb->pb_stats ->tie_break_high_fanout_net ) {
2447
2448
add_cluster_molecule_candidates_by_highfanout_connectivity (cur_pb, cluster_placement_stats_ptr, atom_molecules, feasible_block_array_size);
2448
2449
}
2449
2450
2450
- // 2. Find unpacked molecule based on transitive connections (eg. 2 hops away) with current cluster
2451
+ // 2. Find unpacked molecules based on transitive connections (eg. 2 hops away) with current cluster
2451
2452
if (cur_pb->pb_stats ->num_feasible_blocks == 0 && cur_pb->pb_stats ->explore_transitive_fanout ) {
2452
2453
add_cluster_molecule_candidates_by_transitive_connectivity (cur_pb, cluster_placement_stats_ptr, atom_molecules, clb_inter_blk_nets,
2453
2454
cluster_index, transitive_fanout_threshold, feasible_block_array_size);
2454
2455
}
2455
2456
}
2456
2457
2458
+ // 4. Find unpacked molecules based on attraction group of the current cluster (if the cluster has an attraction group)
2457
2459
add_cluster_molecule_candidates_by_attraction_group (cur_pb, cluster_placement_stats_ptr, atom_molecules, attraction_groups, feasible_block_array_size);
2458
2460
2459
2461
/* Grab highest gain molecule */
@@ -2469,6 +2471,7 @@ static t_pack_molecule* get_highest_gain_molecule(t_pb* cur_pb,
2469
2471
return molecule;
2470
2472
}
2471
2473
2474
+ /* Add molecules with strong connectedness to the current cluster to the list of feasible blocks. */
2472
2475
static void add_cluster_molecule_candidates_by_connectivity_and_timing (t_pb* cur_pb,
2473
2476
t_cluster_placement_stats* cluster_placement_stats_ptr,
2474
2477
const std::multimap<AtomBlockId, t_pack_molecule*>& atom_molecules,
@@ -2497,6 +2500,7 @@ static void add_cluster_molecule_candidates_by_connectivity_and_timing(t_pb* cur
2497
2500
}
2498
2501
}
2499
2502
2503
+ /* Add molecules based on weak connectedness (connected by high fanout nets) with current cluster */
2500
2504
static void add_cluster_molecule_candidates_by_highfanout_connectivity (t_pb* cur_pb,
2501
2505
t_cluster_placement_stats* cluster_placement_stats_ptr,
2502
2506
const std::multimap<AtomBlockId, t_pack_molecule*>& atom_molecules,
@@ -2536,15 +2540,18 @@ static void add_cluster_molecule_candidates_by_highfanout_connectivity(t_pb* cur
2536
2540
cur_pb->pb_stats ->tie_break_high_fanout_net = AtomNetId::INVALID (); /* Mark off that this high fanout net has been considered */
2537
2541
}
2538
2542
2543
+ /*
2544
+ * If the current cluster being packed has an attraction group associated with it
2545
+ * (i.e. there are atoms in it that belong to an attraction group), this routine adds molecules
2546
+ * from the associated attraction group to the list of feasible blocks for the cluster.
2547
+ */
2539
2548
static void add_cluster_molecule_candidates_by_attraction_group (t_pb* cur_pb,
2540
2549
t_cluster_placement_stats* cluster_placement_stats_ptr,
2541
2550
const std::multimap<AtomBlockId, t_pack_molecule*>& atom_molecules,
2542
2551
AttractionInfo& attraction_groups,
2543
2552
const int feasible_block_array_size) {
2544
2553
auto & atom_ctx = g_vpr_ctx.atom ();
2545
2554
2546
- // If the current cluster belongs to an attraction group, add all of the atoms
2547
- // from that attraction group to the feasible blocks
2548
2555
AttractGroupId grp_id = cur_pb->pb_stats ->attraction_grp_id ;
2549
2556
if (grp_id != AttractGroupId::INVALID ()) {
2550
2557
AttractionGroup group = attraction_groups.get_attraction_group_info (grp_id);
@@ -2567,6 +2574,7 @@ static void add_cluster_molecule_candidates_by_attraction_group(t_pb* cur_pb,
2567
2574
}
2568
2575
}
2569
2576
2577
+ /* Add molecules based on transitive connections (eg. 2 hops away) with current cluster*/
2570
2578
static void add_cluster_molecule_candidates_by_transitive_connectivity (t_pb* cur_pb,
2571
2579
t_cluster_placement_stats* cluster_placement_stats_ptr,
2572
2580
const std::multimap<AtomBlockId, t_pack_molecule*>& atom_molecules,
@@ -2597,6 +2605,7 @@ static void add_cluster_molecule_candidates_by_transitive_connectivity(t_pb* cur
2597
2605
}
2598
2606
}
2599
2607
2608
+ /* Check whether a free primitive exists for each atom block in the molecule*/
2600
2609
static bool check_free_primitives_for_molecule_atoms (t_pack_molecule* molecule, t_cluster_placement_stats* cluster_placement_stats_ptr) {
2601
2610
auto & atom_ctx = g_vpr_ctx.atom ();
2602
2611
bool success = true ;
@@ -2606,8 +2615,8 @@ static bool check_free_primitives_for_molecule_atoms(t_pack_molecule* molecule,
2606
2615
VTR_ASSERT (atom_ctx.lookup .atom_clb (molecule->atom_block_ids [i_atom]) == ClusterBlockId::INVALID ());
2607
2616
auto blk_id2 = molecule->atom_block_ids [i_atom];
2608
2617
if (!exists_free_primitive_for_atom_block (cluster_placement_stats_ptr, blk_id2)) {
2609
- /* TODO: debating whether to check if placement exists for molecule
2610
- * (more robust) or individual atom blocks (faster) (Jason Luu) */
2618
+ /* TODO (Jason Luu) : debating whether to check if placement exists for molecule
2619
+ * (more robust) or individual atom blocks (faster)*/
2611
2620
success = false ;
2612
2621
break ;
2613
2622
}
0 commit comments