Skip to content

Commit

Permalink
verbose reporting of unused SDF primitives
Browse files Browse the repository at this point in the history
  • Loading branch information
rmanohar committed Aug 12, 2024
1 parent dd0b697 commit 500495e
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 4 deletions.
28 changes: 25 additions & 3 deletions sdf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,7 @@ sdf_cell *sdf_celltype::getInst (ActId *id)
}


void SDF::reportUnusedCells (const char *msg, FILE *fp)
void SDF::reportUnusedCells (const char *msg, FILE *fp, bool verbose)
{
hash_bucket_t *b;
hash_iter_t it;
Expand All @@ -1293,8 +1293,19 @@ void SDF::reportUnusedCells (const char *msg, FILE *fp)
fprintf (fp, "%s: %s was not used.\n", msg, b->key);
}
else {
if (ci->all && !ci->all->used) {
fprintf (fp, "%s: %s / generic SDF entry not used.\n", msg, b->key);
if (ci->all) {
if (!ci->all->used) {
fprintf (fp, "%s: %s / generic SDF entry not used.\n", msg, b->key);
}
else if (verbose) {
for (int i=0; i < A_LEN (ci->all->_paths); i++) {
if (!ci->all->_paths[i].used) {
fprintf (fp, "%s: %s/generic: ", msg, b->key);
ci->all->_paths[i].printBrief (fp, _h.divider);
fprintf (fp, "\n");
}
}
}
}
if (ci->inst) {
chash_bucket_t *cb;
Expand All @@ -1308,6 +1319,17 @@ void SDF::reportUnusedCells (const char *msg, FILE *fp)
id->Print (fp);
fprintf (fp, " SDF entry not used.\n");
}
else if (verbose) {
for (int i=0; i < A_LEN (c->_paths); i++) {
if (!c->_paths[i].used) {
fprintf (fp, "%s: %s/", msg, b->key);
id->Print (fp);
fprintf (fp, " ");
c->_paths[i].printBrief (fp, _h.divider);
fprintf (fp, "\n");
}
}
}
}
}
}
Expand Down
21 changes: 20 additions & 1 deletion sdf.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,23 @@ struct sdf_path {
}
}

void printBrief (FILE *fp, char delim) {
fprintf (fp, "%s ", _names[type]);
if (from) {
from->Print (fp, NULL, 0, delim);
if (dirfrom == 1) {
fprintf (fp, "+");
}
else if (dirfrom == 2) {
fprintf (fp, "-");
}
fprintf (fp, " ");
}
if (to) {
to->Print (fp, NULL, 0, delim);
}
}

sdf_path() {
type = SDF_ELEM_NONE;
e = NULL;
Expand Down Expand Up @@ -384,8 +401,10 @@ class SDF {
* Report unused cell information
* @param msg is the message prefix
* @param fp is the output log file
* @param verbose if this is set to true, then individual unused
* paths/delay directives are reported.
*/
void reportUnusedCells (const char *msg, FILE *fp);
void reportUnusedCells (const char *msg, FILE *fp, bool verbose = false);

/**
* @return the time scale factor
Expand Down

0 comments on commit 500495e

Please sign in to comment.