Skip to content

Commit d5aef9a

Browse files
add log messages for atom_cluster_noc_group_check()
1 parent 9bfa10f commit d5aef9a

File tree

4 files changed

+28
-24
lines changed

4 files changed

+28
-24
lines changed

vpr/src/pack/cluster_util.cpp

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,8 @@ e_block_pack_status try_pack_molecule(t_cluster_placement_stats* cluster_placeme
994994
for (int i_mol = 0; i_mol < molecule_size; i_mol++) {
995995
if (molecule->atom_block_ids[i_mol]) {
996996
bool block_pack_noc_grp_status = atom_cluster_noc_group_check(molecule->atom_block_ids[i_mol],
997-
verbosity, temp_noc_grp_id);
997+
clb_index, verbosity,
998+
temp_noc_grp_id);
998999

9991000
if (!block_pack_noc_grp_status) {
10001001
//Record the failure of this molecule in the current pb stats
@@ -1111,9 +1112,7 @@ e_block_pack_status try_pack_molecule(t_cluster_placement_stats* cluster_placeme
11111112
//update cluster PartitionRegion if atom with floorplanning constraints was added
11121113
if (cluster_pr_update_check) {
11131114
floorplanning_ctx.cluster_constraints[clb_index] = temp_cluster_pr;
1114-
if (verbosity > 2) {
1115-
VTR_LOG("\nUpdated PartitionRegion of cluster %d\n", clb_index);
1116-
}
1115+
VTR_LOGV(verbosity > 2, "\nUpdated PartitionRegion of cluster %d\n", clb_index);
11171116
}
11181117

11191118
for (int i = 0; i < molecule_size; i++) {
@@ -1333,9 +1332,9 @@ bool atom_cluster_floorplanning_check(AtomBlockId blk_id,
13331332
//if the atom does not belong to a partition, it can be put in the cluster
13341333
//regardless of what the cluster's PartitionRegion is because it has no constraints
13351334
if (partid == PartitionId::INVALID()) {
1336-
if (verbosity > 3) {
1337-
VTR_LOG("\t\t\t Intersect: Atom block %d has no floorplanning constraints, passed for cluster %d \n", blk_id, clb_index);
1338-
}
1335+
VTR_LOGV(verbosity > 3,
1336+
"\t\t\t Intersect: Atom block %d has no floorplanning constraints, passed for cluster %d \n",
1337+
blk_id, clb_index);
13391338
cluster_pr_needs_update = false;
13401339
return true;
13411340
} else {
@@ -1348,9 +1347,9 @@ bool atom_cluster_floorplanning_check(AtomBlockId blk_id,
13481347
if (cluster_pr.empty()) {
13491348
temp_cluster_pr = atom_pr;
13501349
cluster_pr_needs_update = true;
1351-
if (verbosity > 3) {
1352-
VTR_LOG("\t\t\t Intersect: Atom block %d has floorplanning constraints, passed cluster %d which has empty PR\n", blk_id, clb_index);
1353-
}
1350+
VTR_LOGV(verbosity > 3,
1351+
"\t\t\t Intersect: Atom block %d has floorplanning constraints, passed cluster %d which has empty PR\n",
1352+
blk_id, clb_index);
13541353
return true;
13551354
} else {
13561355
//update cluster_pr with the intersection of the cluster's PartitionRegion
@@ -1360,40 +1359,50 @@ bool atom_cluster_floorplanning_check(AtomBlockId blk_id,
13601359

13611360
// At this point, cluster_pr is the intersection of atom_pr and the clusters current pr
13621361
if (cluster_pr.empty()) {
1363-
if (verbosity > 3) {
1364-
VTR_LOG("\t\t\t Intersect: Atom block %d failed floorplanning check for cluster %d \n", blk_id, clb_index);
1365-
}
1362+
VTR_LOGV(verbosity > 3,
1363+
"\t\t\t Intersect: Atom block %d failed floorplanning check for cluster %d \n",
1364+
blk_id, clb_index);
13661365
cluster_pr_needs_update = false;
13671366
return false;
13681367
} else {
13691368
//update the cluster's PartitionRegion with the intersecting PartitionRegion
13701369
temp_cluster_pr = cluster_pr;
13711370
cluster_pr_needs_update = true;
1372-
if (verbosity > 3) {
1373-
VTR_LOG("\t\t\t Intersect: Atom block %d passed cluster %d, cluster PR was updated with intersection result \n", blk_id, clb_index);
1374-
}
1371+
VTR_LOGV(verbosity > 3,
1372+
"\t\t\t Intersect: Atom block %d passed cluster %d, cluster PR was updated with intersection result \n",
1373+
blk_id, clb_index);
13751374
return true;
13761375
}
13771376
}
13781377
}
13791378

13801379
bool atom_cluster_noc_group_check(AtomBlockId blk_id,
1380+
ClusterBlockId clb_index,
13811381
int verbosity,
13821382
NocGroupId& temp_cluster_noc_grp_id) {
13831383
const NocGroupId atom_noc_grp_id = g_vpr_ctx.cl_helper().atom_noc_grp_id[blk_id];
13841384

13851385
if (temp_cluster_noc_grp_id == NocGroupId::INVALID()) {
13861386
// the cluster does not have a NoC group
13871387
// assign the atom's NoC group to cluster
1388+
VTR_LOGV(verbosity > 3,
1389+
"\t\t\t NoC Group: Atom block %d passed cluster %d, cluster's NoC group was updated with the atom's group %d\n",
1390+
blk_id, clb_index, (size_t)atom_noc_grp_id);
13881391
temp_cluster_noc_grp_id = atom_noc_grp_id;
13891392
return true;
13901393
} else if (temp_cluster_noc_grp_id == atom_noc_grp_id) {
13911394
// the cluster has the same NoC group ID as the atom,
13921395
// so they are compatible
1396+
VTR_LOGV(verbosity > 3,
1397+
"\t\t\t NoC Group: Atom block %d passed cluster %d, cluster's NoC group was compatible with the atom's group %d\n",
1398+
blk_id, clb_index, (size_t)atom_noc_grp_id);
13931399
return true;
13941400
} else {
13951401
// the cluster belongs to a different NoC group than the atom's group,
13961402
// so they are incompatible
1403+
VTR_LOGV(verbosity > 3,
1404+
"\t\t\t NoC Group: Atom block %d failed NoC group check for cluster %d. Cluster's NoC group: %d, atom's NoC group: %d\n",
1405+
blk_id, clb_index, (size_t)temp_cluster_noc_grp_id, size_t(atom_noc_grp_id));
13971406
return false;
13981407
}
13991408
}

vpr/src/pack/cluster_util.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ bool atom_cluster_floorplanning_check(AtomBlockId blk_id,
287287
bool& cluster_pr_needs_update);
288288

289289
bool atom_cluster_noc_group_check(AtomBlockId blk_id,
290+
ClusterBlockId clb_index,
290291
int verbosity,
291292
NocGroupId& temp_cluster_noc_grp_id);
292293

vpr/src/pack/noc_aware_cluster_util.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ void update_noc_reachability_partitions(const std::vector<AtomBlockId>& noc_atom
5252
auto noc_grp_id = (NocGroupId)noc_grp_id_cnt;
5353
noc_grp_id_cnt++;
5454

55-
5655
std::queue<AtomBlockId> q;
5756
q.push(noc_atom_id);
5857
atom_visited[noc_atom_id] = true;

vpr/src/util/vpr_utils.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
#include <cstring>
21
#include <unordered_set>
32
#include <regex>
43
#include <algorithm>
54
#include <sstream>
6-
#include <string.h>
5+
#include <cstring>
76

87
#include "vtr_assert.h"
98
#include "vtr_log.h"
109
#include "vtr_memory.h"
11-
#include "vtr_random.h"
1210

1311
#include "vpr_types.h"
1412
#include "vpr_error.h"
@@ -17,18 +15,15 @@
1715
#include "globals.h"
1816
#include "vpr_utils.h"
1917
#include "cluster_placement.h"
20-
#include "place_macro.h"
21-
#include "pack_types.h"
2218
#include "device_grid.h"
23-
#include "timing_fail_error.h"
2419
#include "re_cluster_util.h"
2520

2621
/* This module contains subroutines that are used in several unrelated parts *
2722
* of VPR. They are VPR-specific utility routines. */
2823

2924
/* This defines the maximum string length that could be parsed by functions *
3025
* in vpr_utils. */
31-
#define MAX_STRING_LEN 128
26+
static constexpr size_t MAX_STRING_LEN = 128;
3227

3328
/******************** File-scope variables declarations **********************/
3429

0 commit comments

Comments
 (0)