Commit 18943f64 by Alan Mishchenko

Skip cells in Liberty files which have dont_use attribute.

parent c5b48bbf
......@@ -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 )
{
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment