summaryrefslogtreecommitdiffstats
path: root/src/map
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
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')
-rw-r--r--src/map/amap/amapLiberty.c32
-rw-r--r--src/map/scl/sclLiberty.c27
2 files changed, 56 insertions, 3 deletions
diff --git a/src/map/amap/amapLiberty.c b/src/map/amap/amapLiberty.c
index 13b18df5..d5d2d72a 100644
--- a/src/map/amap/amapLiberty.c
+++ b/src/map/amap/amapLiberty.c
@@ -209,6 +209,26 @@ int Amap_LibertyCellIsFlop( Amap_Tree_t * p, Amap_Item_t * pCell )
/**Function*************************************************************
+ Synopsis [Returns cell's function.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Amap_LibertyCellIsDontUse( Amap_Tree_t * p, Amap_Item_t * pCell )
+{
+ Amap_Item_t * pAttr;
+ Amap_ItemForEachChild( p, pCell, pAttr )
+ if ( !Amap_LibertyCompare(p, pAttr->Key, "dont_use") )
+ return 1;
+ return 0;
+}
+
+/**Function*************************************************************
+
Synopsis [Returns pin's function.]
Description []
@@ -414,6 +434,12 @@ int Amap_LibertyPrintGenlib( Amap_Tree_t * p, char * pFileName, int fVerbose )
printf( "Amap_LibertyPrintGenlib() skipped sequential cell \"%s\".\n", Amap_LibertyGetString(p, pCell->Head) );
continue;
}
+ if ( Amap_LibertyCellIsDontUse(p, pCell) )
+ {
+ if ( fVerbose )
+ printf( "Amap_LibertyPrintGenlib() skipped cell \"%s\" due to dont_use attribute.\n", Amap_LibertyGetString(p, pCell->Head) );
+ continue;
+ }
Counter = Amap_LibertyCellCountOutputs( p, pCell );
if ( Counter == 0 )
{
@@ -498,6 +524,12 @@ Vec_Str_t * Amap_LibertyPrintGenlibStr( Amap_Tree_t * p, int fVerbose )
printf( "Amap_LibertyPrintGenlib() skipped sequential cell \"%s\".\n", Amap_LibertyGetString(p, pCell->Head) );
continue;
}
+ if ( Amap_LibertyCellIsDontUse(p, pCell) )
+ {
+ if ( fVerbose )
+ printf( "Amap_LibertyPrintGenlib() skipped cell \"%s\" due to dont_use attribute.\n", Amap_LibertyGetString(p, pCell->Head) );
+ continue;
+ }
Counter = Amap_LibertyCellCountOutputs( p, pCell );
if ( Counter == 0 )
{
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;