@@ -931,7 +931,8 @@ e_block_pack_status try_pack_molecule(t_cluster_placement_stats* cluster_placeme
931931 bool enable_pin_feasibility_filter,
932932 int feasible_block_array_size,
933933 t_ext_pin_util max_external_pin_util,
934- PartitionRegion& temp_cluster_pr) {
934+ PartitionRegion& temp_cluster_pr,
935+ NocGroupId& temp_noc_grp_id) {
935936 t_pb* parent;
936937 t_pb* cur_pb;
937938
@@ -989,6 +990,20 @@ e_block_pack_status try_pack_molecule(t_cluster_placement_stats* cluster_placeme
989990 }
990991 }
991992
993+ // check if all atoms in the molecule can be added to the cluster without NoC group conflicts
994+ for (int i_mol = 0 ; i_mol < molecule_size; i_mol++) {
995+ if (molecule->atom_block_ids [i_mol]) {
996+ bool block_pack_noc_grp_status = atom_cluster_noc_group_check (molecule->atom_block_ids [i_mol],
997+ verbosity, temp_noc_grp_id);
998+
999+ if (!block_pack_noc_grp_status) {
1000+ // Record the failure of this molecule in the current pb stats
1001+ record_molecule_failure (molecule, pb);
1002+ return e_block_pack_status::BLK_FAILED_NOC_GROUP;
1003+ }
1004+ }
1005+ }
1006+
9921007 e_block_pack_status block_pack_status = e_block_pack_status::BLK_STATUS_UNDEFINED;
9931008
9941009 while (block_pack_status != e_block_pack_status::BLK_PASSED) {
@@ -1362,6 +1377,28 @@ bool atom_cluster_floorplanning_check(AtomBlockId blk_id,
13621377 }
13631378}
13641379
1380+ bool atom_cluster_noc_group_check (AtomBlockId blk_id,
1381+ int verbosity,
1382+ NocGroupId& temp_cluster_noc_grp_id) {
1383+ const NocGroupId atom_noc_grp_id = g_vpr_ctx.cl_helper ().atom_noc_grp_id [blk_id];
1384+
1385+
1386+ if (temp_cluster_noc_grp_id == NocGroupId::INVALID ()) {
1387+ // the cluster does not have a NoC group
1388+ // assign the atom's NoC group to cluster
1389+ temp_cluster_noc_grp_id = atom_noc_grp_id;
1390+ return true ;
1391+ } else if (temp_cluster_noc_grp_id == atom_noc_grp_id) {
1392+ // the cluster has the same NoC group ID as the atom,
1393+ // so they are compatible
1394+ return true ;
1395+ } else {
1396+ // the cluster belongs to a different NoC group than the atom's group,
1397+ // so they are incompatible
1398+ return false ;
1399+ }
1400+ }
1401+
13651402/* Revert trial atom block iblock and free up memory space accordingly
13661403 */
13671404void revert_place_atom_block (const AtomBlockId blk_id, t_lb_router_data* router_data) {
@@ -1497,6 +1534,7 @@ void try_fill_cluster(const t_packer_opts& packer_opts,
14971534 t_lb_router_data* router_data,
14981535 t_ext_pin_util target_ext_pin_util,
14991536 PartitionRegion& temp_cluster_pr,
1537+ NocGroupId& temp_noc_grp_id,
15001538 e_block_pack_status& block_pack_status,
15011539 t_molecule_link* unclustered_list_head,
15021540 const int & unclustered_list_head_size,
@@ -1519,7 +1557,8 @@ void try_fill_cluster(const t_packer_opts& packer_opts,
15191557 packer_opts.enable_pin_feasibility_filter ,
15201558 packer_opts.feasible_block_array_size ,
15211559 target_ext_pin_util,
1522- temp_cluster_pr);
1560+ temp_cluster_pr,
1561+ temp_noc_grp_id);
15231562
15241563 auto blk_id = next_molecule->atom_block_ids [next_molecule->root ];
15251564 VTR_ASSERT (blk_id);
@@ -2041,7 +2080,8 @@ void start_new_cluster(t_cluster_placement_stats* cluster_placement_stats,
20412080 bool enable_pin_feasibility_filter,
20422081 bool balance_block_type_utilization,
20432082 const int feasible_block_array_size,
2044- PartitionRegion& temp_cluster_pr) {
2083+ PartitionRegion& temp_cluster_pr,
2084+ NocGroupId& temp_noc_grp_id) {
20452085 /* Given a starting seed block, start_new_cluster determines the next cluster type to use
20462086 * It expands the FPGA if it cannot find a legal cluster for the atom block
20472087 */
@@ -2123,7 +2163,8 @@ void start_new_cluster(t_cluster_placement_stats* cluster_placement_stats,
21232163 enable_pin_feasibility_filter,
21242164 feasible_block_array_size,
21252165 FULL_EXTERNAL_PIN_UTIL,
2126- temp_cluster_pr);
2166+ temp_cluster_pr,
2167+ temp_noc_grp_id);
21272168
21282169 success = (pack_result == e_block_pack_status::BLK_PASSED);
21292170 }
0 commit comments