From da6838463fedf0821f542dcc3a4451bfe1ca3abd Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Mon, 27 Aug 2012 14:29:32 -0700 Subject: Added features 'map -M ' to control the use of large gates. --- src/map/amap/amapLiberty.c | 19 ++++++++++++------- src/map/amap/amapParse.c | 5 +++-- 2 files changed, 15 insertions(+), 9 deletions(-) (limited to 'src/map/amap') diff --git a/src/map/amap/amapLiberty.c b/src/map/amap/amapLiberty.c index 34bd5303..e3391e66 100644 --- a/src/map/amap/amapLiberty.c +++ b/src/map/amap/amapLiberty.c @@ -345,7 +345,7 @@ char * Amap_LibertyGetStringFormula( Amap_Tree_t * p, Amap_Pair_t Pair ) SeeAlso [] ***********************************************************************/ -int Amap_LibertyPrintGenlib( Amap_Tree_t * p, char * pFileName ) +int Amap_LibertyPrintGenlib( Amap_Tree_t * p, char * pFileName, int fVerbose ) { FILE * pFile; Amap_Item_t * pCell, * pArea, * pFunc, * pPin, * pOutput; @@ -390,24 +390,28 @@ int Amap_LibertyPrintGenlib( Amap_Tree_t * p, char * pFileName ) continue; if ( Amap_LibertyCellIsFlop(p, pCell) ) { - printf( "Amap_LibertyPrintGenlib() skipped sequential cell \"%s\".\n", Amap_LibertyGetString(p, pCell->Head) ); + if ( fVerbose ) + printf( "Amap_LibertyPrintGenlib() skipped sequential cell \"%s\".\n", Amap_LibertyGetString(p, pCell->Head) ); continue; } Counter = Amap_LibertyCellCountOutputs( p, pCell ); if ( Counter == 0 ) { - printf( "Amap_LibertyPrintGenlib() skipped cell \"%s\" without logic function.\n", Amap_LibertyGetString(p, pCell->Head) ); + if ( fVerbose ) + printf( "Amap_LibertyPrintGenlib() skipped cell \"%s\" without logic function.\n", Amap_LibertyGetString(p, pCell->Head) ); continue; } if ( Counter > 1 ) { - printf( "Amap_LibertyPrintGenlib() skipped multi-output cell \"%s\".\n", Amap_LibertyGetString(p, pCell->Head) ); + if ( fVerbose ) + printf( "Amap_LibertyPrintGenlib() skipped multi-output cell \"%s\".\n", Amap_LibertyGetString(p, pCell->Head) ); continue; } pArea = Amap_LibertyCellArea( p, pCell ); if ( pArea == NULL ) { - printf( "Amap_LibertyPrintGenlib() skipped cell \"%s\" with unspecified area.\n", Amap_LibertyGetString(p, pCell->Head) ); + if ( fVerbose ) + printf( "Amap_LibertyPrintGenlib() skipped cell \"%s\" with unspecified area.\n", Amap_LibertyGetString(p, pCell->Head) ); continue; } pOutput = Amap_LibertyCellOutput( p, pCell ); @@ -415,7 +419,8 @@ int Amap_LibertyPrintGenlib( Amap_Tree_t * p, char * pFileName ) pForm = Amap_LibertyGetStringFormula( p, pFunc->Head ); if ( !strcmp(pForm, "0") || !strcmp(pForm, "1") ) { - printf( "Amap_LibertyPrintGenlib() skipped cell \"%s\" with constant formula \"%s\".\n", Amap_LibertyGetString(p, pCell->Head), pForm ); + if ( fVerbose ) + printf( "Amap_LibertyPrintGenlib() skipped cell \"%s\" with constant formula \"%s\".\n", Amap_LibertyGetString(p, pCell->Head), pForm ); continue; } @@ -900,7 +905,7 @@ int Amap_LibertyParse( char * pFileName, char * pFileGenlib, int fVerbose ) if ( fVerbose ) printf( "Parsing finished successfully.\n" ); // Amap_LibertyPrintLiberty( p, "temp_.lib" ); - Amap_LibertyPrintGenlib( p, "temp.genlib" ); + Amap_LibertyPrintGenlib( p, "temp.genlib", fVerbose ); RetValue = 1; } else diff --git a/src/map/amap/amapParse.c b/src/map/amap/amapParse.c index d81411bc..f2a38db6 100644 --- a/src/map/amap/amapParse.c +++ b/src/map/amap/amapParse.c @@ -434,7 +434,8 @@ int Amap_LibParseEquations( Amap_Lib_t * p, int fVerbose ) pTruth = Hop_ManConvertAigToTruth( pMan, pObj, pGate->nPins, vTruth, 0 ); if ( Kit_TruthSupportSize(pTruth, pGate->nPins) < (int)pGate->nPins ) { - printf( "Skipping gate \"%s\" because its output \"%s\" does not depend on all input variables.\n", pGate->pName, pGate->pForm ); + if ( fVerbose ) + printf( "Skipping gate \"%s\" because its output \"%s\" does not depend on all input variables.\n", pGate->pName, pGate->pForm ); continue; } pGate->pFunc = (unsigned *)Aig_MmFlexEntryFetch( p->pMemGates, sizeof(unsigned)*Abc_TruthWordNum(pGate->nPins) ); @@ -459,7 +460,7 @@ int Amap_LibParseEquations( Amap_Lib_t * p, int fVerbose ) ***********************************************************************/ void Amap_LibParseTest( char * pFileName ) { - int fVerbose = 1; + int fVerbose = 0; Amap_Lib_t * p; clock_t clk = clock(); p = Amap_LibReadFile( pFileName, fVerbose ); -- cgit v1.2.3