summaryrefslogtreecommitdiffstats
path: root/src/map/scl
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2018-10-18 17:09:23 +0700
committerAlan Mishchenko <alanmi@berkeley.edu>2018-10-18 17:09:23 +0700
commit18943f64621c66307e9d285d4d5efa1ecda47c84 (patch)
treeb7de1c418b5fbcfa991adb2cc43aacf8468a5238 /src/map/scl
parentc5b48bbf299bb9a0a9b6dc5254b6057298a56abf (diff)
downloadabc-18943f64621c66307e9d285d4d5efa1ecda47c84.tar.gz
abc-18943f64621c66307e9d285d4d5efa1ecda47c84.tar.bz2
abc-18943f64621c66307e9d285d4d5efa1ecda47c84.zip
Skip cells in Liberty files which have dont_use attribute.
Diffstat (limited to 'src/map/scl')
-rw-r--r--src/map/scl/sclLiberty.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/map/scl/sclLiberty.c b/src/map/scl/sclLiberty.c
index fc06bc47..cd28a607 100644
--- a/src/map/scl/sclLiberty.c
+++ b/src/map/scl/sclLiberty.c
@@ -629,6 +629,14 @@ int Scl_LibertyReadCellIsFlop( Scl_Tree_t * p, Scl_Item_t * pCell )
return 1;
return 0;
}
+int Scl_LibertyReadCellIsDontUse( Scl_Tree_t * p, Scl_Item_t * pCell )
+{
+ Scl_Item_t * pAttr;
+ Scl_ItemForEachChild( p, pCell, pAttr )
+ if ( !Scl_LibertyCompare(p, pAttr->Key, "dont_use") )
+ return 1;
+ return 0;
+}
char * Scl_LibertyReadCellArea( Scl_Tree_t * p, Scl_Item_t * pCell )
{
Scl_Item_t * pArea;
@@ -704,6 +712,11 @@ Vec_Str_t * Scl_LibertyReadGenlibStr( Scl_Tree_t * p, int fVerbose )
if ( fVerbose ) printf( "Scl_LibertyReadGenlib() skipped sequential cell \"%s\".\n", Scl_LibertyReadString(p, pCell->Head) );
continue;
}
+ if ( Scl_LibertyReadCellIsDontUse(p, pCell) )
+ {
+ if ( fVerbose ) printf( "Scl_LibertyReadGenlib() skipped cell \"%s\" due to dont_use attribute.\n", Scl_LibertyReadString(p, pCell->Head) );
+ continue;
+ }
if ( Scl_LibertyReadCellIsThreeState(p, pCell) )
{
if ( fVerbose ) printf( "Scl_LibertyReadGenlib() skipped three-state cell \"%s\".\n", Scl_LibertyReadString(p, pCell->Head) );
@@ -1417,7 +1430,7 @@ Vec_Str_t * Scl_LibertyReadSclStr( Scl_Tree_t * p, int fVerbose, int fVeryVerbos
Vec_Wrd_t * vTruth;
char * pFormula, * pName;
int i, k, Counter, nOutputs, nCells;
- int nSkipped[3] = {0};
+ int nSkipped[4] = {0};
// read delay-table templates
vTemples = Scl_LibertyReadTemplates( p );
@@ -1451,6 +1464,12 @@ Vec_Str_t * Scl_LibertyReadSclStr( Scl_Tree_t * p, int fVerbose, int fVeryVerbos
nSkipped[0]++;
continue;
}
+ if ( Scl_LibertyReadCellIsDontUse(p, pCell) )
+ {
+ if ( fVeryVerbose ) printf( "Scl_LibertyReadGenlib() skipped cell \"%s\" due to dont_use attribute.\n", Scl_LibertyReadString(p, pCell->Head) );
+ nSkipped[3]++;
+ continue;
+ }
if ( Scl_LibertyReadCellIsThreeState(p, pCell) )
{
if ( fVeryVerbose ) printf( "Scl_LibertyReadGenlib() skipped three-state cell \"%s\".\n", Scl_LibertyReadString(p, pCell->Head) );
@@ -1473,6 +1492,8 @@ Vec_Str_t * Scl_LibertyReadSclStr( Scl_Tree_t * p, int fVerbose, int fVeryVerbos
{
if ( Scl_LibertyReadCellIsFlop(p, pCell) )
continue;
+ if ( Scl_LibertyReadCellIsDontUse(p, pCell) )
+ continue;
if ( Scl_LibertyReadCellIsThreeState(p, pCell) )
continue;
if ( (Counter = Scl_LibertyReadCellOutputNum(p, pCell)) == 0 )
@@ -1640,8 +1661,8 @@ Vec_Str_t * Scl_LibertyReadSclStr( Scl_Tree_t * p, int fVerbose, int fVeryVerbos
{
printf( "Library \"%s\" from \"%s\" has %d cells ",
Scl_LibertyReadString(p, Scl_LibertyRoot(p)->Head), p->pFileName, nCells );
- printf( "(%d skipped: %d seq; %d tri-state; %d no func). ",
- nSkipped[0]+nSkipped[1]+nSkipped[2], nSkipped[0], nSkipped[1], nSkipped[2] );
+ printf( "(%d skipped: %d seq; %d tri-state; %d no func; %d dont_use). ",
+ nSkipped[0]+nSkipped[1]+nSkipped[2], nSkipped[0], nSkipped[1], nSkipped[2], nSkipped[3] );
Abc_PrintTime( 1, "Time", Abc_Clock() - p->clkStart );
}
return vOut;