summaryrefslogtreecommitdiff
path: root/src/base/abci/abc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/base/abci/abc.c')
-rw-r--r--src/base/abci/abc.c529
1 files changed, 456 insertions, 73 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c
index d652b9f..3a3ccac 100644
--- a/src/base/abci/abc.c
+++ b/src/base/abci/abc.c
@@ -186,6 +186,7 @@ static int Abc_CommandExtSeqDcs ( Abc_Frame_t * pAbc, int argc, cha
static int Abc_CommandReach ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandCone ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandNode ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandCof ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandTopmost ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandTopAnd ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandTrim ( Abc_Frame_t * pAbc, int argc, char ** argv );
@@ -317,6 +318,7 @@ static int Abc_CommandPermute ( Abc_Frame_t * pAbc, int argc, cha
static int Abc_CommandUnpermute ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandCubeEnum ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandPathEnum ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandFunEnum ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandCec ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandDCec ( Abc_Frame_t * pAbc, int argc, char ** argv );
@@ -879,8 +881,9 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd( pAbc, "Various", "reach", Abc_CommandReach, 0 );
Cmd_CommandAdd( pAbc, "Various", "cone", Abc_CommandCone, 1 );
Cmd_CommandAdd( pAbc, "Various", "node", Abc_CommandNode, 1 );
+ Cmd_CommandAdd( pAbc, "Various", "cof", Abc_CommandCof, 1 );
Cmd_CommandAdd( pAbc, "Various", "topmost", Abc_CommandTopmost, 1 );
- Cmd_CommandAdd( pAbc, "Various", "topand", Abc_CommandTopAnd, 1 );
+ Cmd_CommandAdd( pAbc, "Various", "topand", Abc_CommandTopAnd, 1 );
Cmd_CommandAdd( pAbc, "Various", "trim", Abc_CommandTrim, 1 );
Cmd_CommandAdd( pAbc, "Various", "short_names", Abc_CommandShortNames, 0 );
Cmd_CommandAdd( pAbc, "Various", "move_names", Abc_CommandMoveNames, 0 );
@@ -1005,6 +1008,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd( pAbc, "Sequential", "unpermute", Abc_CommandUnpermute, 1 );
Cmd_CommandAdd( pAbc, "Sequential", "cubeenum", Abc_CommandCubeEnum, 0 );
Cmd_CommandAdd( pAbc, "Sequential", "pathenum", Abc_CommandPathEnum, 0 );
+ Cmd_CommandAdd( pAbc, "Sequential", "funenum", Abc_CommandFunEnum, 0 );
Cmd_CommandAdd( pAbc, "Verification", "cec", Abc_CommandCec, 0 );
Cmd_CommandAdd( pAbc, "Verification", "dcec", Abc_CommandDCec, 0 );
@@ -3059,15 +3063,22 @@ int Abc_CommandShowBdd( Abc_Frame_t * pAbc, int argc, char ** argv )
{
Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
Abc_Obj_t * pNode;
- int c;
- extern void Abc_NodeShowBdd( Abc_Obj_t * pNode );
+ int c, fCompl = 0, fGlobal = 0;
+ extern void Abc_NodeShowBdd( Abc_Obj_t * pNode, int fCompl );
+ extern void Abc_NtkShowBdd( Abc_Ntk_t * pNtk, int fCompl );
// set defaults
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "cgh" ) ) != EOF )
{
switch ( c )
{
+ case 'c':
+ fCompl ^= 1;
+ break;
+ case 'g':
+ fGlobal ^= 1;
+ break;
case 'h':
goto usage;
default:
@@ -3081,12 +3092,20 @@ int Abc_CommandShowBdd( Abc_Frame_t * pAbc, int argc, char ** argv )
return 1;
}
+ if ( fGlobal )
+ {
+ Abc_Ntk_t * pTemp = Abc_NtkIsStrash(pNtk) ? pNtk : Abc_NtkStrash(pNtk, 0, 0, 0);
+ Abc_NtkShowBdd( pTemp, fCompl );
+ if ( pTemp != pNtk )
+ Abc_NtkDelete( pTemp );
+ return 0;
+ }
+
if ( !Abc_NtkIsBddLogic(pNtk) )
{
Abc_Print( -1, "Visualizing BDDs can only be done for logic BDD networks (run \"bdd\").\n" );
return 1;
}
-
if ( argc > globalUtilOptind + 1 )
{
Abc_Print( -1, "Wrong number of auguments.\n" );
@@ -3110,17 +3129,20 @@ int Abc_CommandShowBdd( Abc_Frame_t * pAbc, int argc, char ** argv )
return 1;
}
}
- Abc_NodeShowBdd( pNode );
+ Abc_NodeShowBdd( pNode, fCompl );
return 0;
usage:
- Abc_Print( -2, "usage: show_bdd [-h] <node>\n" );
- Abc_Print( -2, " visualizes the BDD of a node using DOT and GSVIEW\n" );
+ Abc_Print( -2, "usage: show_bdd [-cgh] <node>\n" );
+ Abc_Print( -2, " uses DOT and GSVIEW to visualize the global BDDs of primary outputs\n" );
+ Abc_Print( -2, " in terms of primary inputs or the local BDD of a node in terms of its fanins\n" );
#ifdef WIN32
Abc_Print( -2, " \"dot.exe\" and \"gsview32.exe\" should be set in the paths\n" );
Abc_Print( -2, " (\"gsview32.exe\" may be in \"C:\\Program Files\\Ghostgum\\gsview\\\")\n" );
#endif
- Abc_Print( -2, "\t<node>: the node to consider [default = the driver of the first PO]\n");
+ Abc_Print( -2, "\t<node>: (optional) the node to consider [default = the driver of the first PO]\n");
+ Abc_Print( -2, "\t-c : toggle visualizing BDD with complemented edges [default = %s].\n", fCompl? "yes": "no" );
+ Abc_Print( -2, "\t-g : toggle visualizing the global BDDs of primary outputs [default = %s].\n", fGlobal? "yes": "no" );
Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -8291,7 +8313,7 @@ int Abc_CommandTwoExact( Abc_Frame_t * pAbc, int argc, char ** argv )
Bmc_EsPar_t Pars, * pPars = &Pars;
Bmc_EsParSetDefault( pPars );
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "INaogvh" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "INTaogvh" ) ) != EOF )
{
switch ( c )
{
@@ -8317,6 +8339,17 @@ int Abc_CommandTwoExact( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pPars->nNodes < 0 )
goto usage;
break;
+ case 'T':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ pPars->RuntimeLim = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( pPars->RuntimeLim < 0 )
+ goto usage;
+ break;
case 'a':
pPars->fOnlyAnd ^= 1;
break;
@@ -8364,10 +8397,11 @@ int Abc_CommandTwoExact( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- Abc_Print( -2, "usage: twoexact [-IN <num>] [-aogvh] <hex>\n" );
+ Abc_Print( -2, "usage: twoexact [-INT <num>] [-aogvh] <hex>\n" );
Abc_Print( -2, "\t exact synthesis of multi-input function using two-input gates\n" );
Abc_Print( -2, "\t-I <num> : the number of input variables [default = %d]\n", pPars->nVars );
- Abc_Print( -2, "\t-N <num> : the number of MAJ3 nodes [default = %d]\n", pPars->nNodes );
+ Abc_Print( -2, "\t-N <num> : the number of two-input nodes [default = %d]\n", pPars->nNodes );
+ Abc_Print( -2, "\t-T <num> : the runtime limit in seconds [default = %d]\n", pPars->RuntimeLim );
Abc_Print( -2, "\t-a : toggle using only AND-gates (without XOR-gates) [default = %s]\n", pPars->fOnlyAnd ? "yes" : "no" );
Abc_Print( -2, "\t-o : toggle using additional optimizations [default = %s]\n", pPars->fFewerVars ? "yes" : "no" );
Abc_Print( -2, "\t-g : toggle using Glucose 3.0 by Gilles Audemard and Laurent Simon [default = %s]\n", pPars->fGlucose ? "yes" : "no" );
@@ -8403,7 +8437,7 @@ int Abc_CommandLutExact( Abc_Frame_t * pAbc, int argc, char ** argv )
Bmc_EsPar_t Pars, * pPars = &Pars;
Bmc_EsParSetDefault( pPars );
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "INKiaogvh" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "INKTiaogvh" ) ) != EOF )
{
switch ( c )
{
@@ -8440,6 +8474,17 @@ int Abc_CommandLutExact( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pPars->nLutSize < 0 )
goto usage;
break;
+ case 'T':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ pPars->RuntimeLim = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( pPars->RuntimeLim < 0 )
+ goto usage;
+ break;
case 'i':
pPars->fUseIncr ^= 1;
break;
@@ -8495,11 +8540,12 @@ int Abc_CommandLutExact( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- Abc_Print( -2, "usage: lutexact [-INK <num>] [-iaogvh] <hex>\n" );
+ Abc_Print( -2, "usage: lutexact [-INKT <num>] [-iaogvh] <hex>\n" );
Abc_Print( -2, "\t exact synthesis of I-input function using N K-input gates\n" );
Abc_Print( -2, "\t-I <num> : the number of input variables [default = %d]\n", pPars->nVars );
Abc_Print( -2, "\t-N <num> : the number of K-input nodes [default = %d]\n", pPars->nNodes );
Abc_Print( -2, "\t-K <num> : the number of node fanins [default = %d]\n", pPars->nLutSize );
+ Abc_Print( -2, "\t-T <num> : the runtime limit in seconds [default = %d]\n", pPars->RuntimeLim );
Abc_Print( -2, "\t-i : toggle using incremental solving [default = %s]\n", pPars->fUseIncr ? "yes" : "no" );
Abc_Print( -2, "\t-a : toggle using only AND-gates when K = 2 [default = %s]\n", pPars->fOnlyAnd ? "yes" : "no" );
Abc_Print( -2, "\t-o : toggle using additional optimizations [default = %s]\n", pPars->fFewerVars ? "yes" : "no" );
@@ -10681,7 +10727,7 @@ int Abc_CommandExpand( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_NtkDelete( pNtk2 );
// convert it into an AIG
pGia = Abc_NtkClpGia( pStrash );
- //Gia_AigerWrite( pGia, "aig_dump.aig", 0, 0 );
+ //Gia_AigerWrite( pGia, "aig_dump.aig", 0, 0, 0 );
Abc_NtkDelete( pStrash );
// get the new network
Abc_NtkExpandCubes( pNtk, pGia, fVerbose );
@@ -10946,6 +10992,11 @@ int Abc_CommandReach( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print( -1, "Reachability analysis works only for AIGs (run \"strash\").\n" );
return 1;
}
+ if ( pAbc->fBatchMode && (pAbc->Status == 0 || pAbc->Status == 1) )
+ {
+ Abc_Print( 1, "The miters is already solved; skipping the command.\n" );
+ return 0;
+ }
pAbc->Status = Abc_NtkDarReach( pNtk, pPars );
pAbc->nFrames = pPars->iFrame;
Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
@@ -11197,6 +11248,81 @@ usage:
return 1;
}
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_CommandCof( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ Abc_Ntk_t * pNtk;
+ Abc_Obj_t * pNode;
+ int c, Const;
+
+ pNtk = Abc_FrameReadNtk(pAbc);
+ // set defaults
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 'h':
+ goto usage;
+ default:
+ goto usage;
+ }
+ }
+
+ if ( pNtk == NULL )
+ {
+ Abc_Print( -1, "Empty network.\n" );
+ return 1;
+ }
+
+ if ( !Abc_NtkIsLogic(pNtk) )
+ {
+ Abc_Print( -1, "Currently can only be applied to a logic network.\n" );
+ return 1;
+ }
+
+ if ( argc != globalUtilOptind + 2 )
+ {
+ Abc_Print( -1, "Wrong number of auguments.\n" );
+ goto usage;
+ }
+ pNode = Abc_NtkFindCi( pNtk, argv[globalUtilOptind] );
+ if ( pNode == NULL )
+ pNode = Abc_NtkFindNode( pNtk, argv[globalUtilOptind] );
+ if ( pNode == NULL )
+ {
+ Abc_Print( -1, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
+ return 1;
+ }
+ Const = atoi( argv[globalUtilOptind+1] );
+ if ( Const != 0 && Const != 1 )
+ {
+ Abc_Print( -1, "Constant should be 0 or 1.\n", argv[globalUtilOptind+1] );
+ return 1;
+ }
+ Abc_ObjReplaceByConstant( pNode, Const );
+ return 0;
+
+usage:
+ Abc_Print( -2, "usage: cof [-h] <node> <const>\n" );
+ Abc_Print( -2, "\t replaces one node in a logic network by constant 0 or 1\n" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ Abc_Print( -2, "\t<node> : the node to replace\n");
+ Abc_Print( -2, "\t<const> : the constant to replace the node with\n");
+ Abc_Print( -2, "\tname : the node name\n");
+ return 1;
+}
+
/**Function*************************************************************
@@ -13030,6 +13156,7 @@ int Abc_CommandTestColor( Abc_Frame_t * pAbc, int argc, char ** argv )
***********************************************************************/
int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
{
+ extern void Dau_NetworkEnumTest();
//Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int nCutMax = 1;
int nLeafMax = 4;
@@ -13188,7 +13315,7 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
*/
{
// extern void Abc_EnumerateFuncs( int nDecMax, int nDivMax, int fVerbose );
-// Abc_EnumerateFuncs( nDecMax, nDivMax, fVerbose );
+// Abc_EnumerateFuncs( 4, 7, 0 );
}
/*
if ( fNewAlgo )
@@ -13239,7 +13366,8 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
// Cba_PrsReadBlifTest();
}
// Abc_NtkComputePaths( Abc_FrameReadNtk(pAbc) );
- Dau_NetworkEnumTest();
+ //Dau_NetworkEnumTest();
+ //Ext_TruthDiagnoseTest();
return 0;
usage:
Abc_Print( -2, "usage: test [-CKDNM] [-aovwh] <file_name>\n" );
@@ -14991,6 +15119,7 @@ int Abc_CommandIProve( Abc_Frame_t * pAbc, int argc, char ** argv )
Prove_Params_t Params, * pParams = &Params;
Abc_Ntk_t * pNtk, * pNtkTemp;
int c, RetValue, iOut = -1;
+ char * pLogFileName = NULL;
abctime clk;
extern int Abc_NtkIvyProve( Abc_Ntk_t ** ppNtk, void * pPars );
@@ -15001,7 +15130,7 @@ int Abc_CommandIProve( Abc_Frame_t * pAbc, int argc, char ** argv )
pParams->fUseRewriting = 1;
pParams->fVerbose = 0;
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "NCFGLIrfbvh" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "NCFGMILrfbvh" ) ) != EOF )
{
switch ( c )
{
@@ -15049,10 +15178,10 @@ int Abc_CommandIProve( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pParams->nFraigingLimitMulti < 0 )
goto usage;
break;
- case 'L':
+ case 'M':
if ( globalUtilOptind >= argc )
{
- Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
+ Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
goto usage;
}
pParams->nMiteringLimitLast = atoi(argv[globalUtilOptind]);
@@ -15071,6 +15200,15 @@ int Abc_CommandIProve( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pParams->nTotalInspectLimit < 0 )
goto usage;
break;
+ case 'L':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
+ goto usage;
+ }
+ pLogFileName = argv[globalUtilOptind];
+ globalUtilOptind++;
+ break;
case 'r':
pParams->fUseRewriting ^= 1;
break;
@@ -15144,17 +15282,20 @@ int Abc_CommandIProve( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Cex_t * pCex = Abc_CexDeriveFromCombModel( pNtkTemp->pModel, Abc_NtkPiNum(pNtkTemp), 0, iOut );
Abc_FrameReplaceCex( pAbc, &pCex );
}
+ if ( pLogFileName )
+ Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, pAbc->nFrames, "iprove" );
return 0;
usage:
- Abc_Print( -2, "usage: iprove [-NCFGLI num] [-rfbvh]\n" );
+ Abc_Print( -2, "usage: iprove [-NCFGMI num] [-L file] [-rfbvh]\n" );
Abc_Print( -2, "\t performs CEC using a new method\n" );
Abc_Print( -2, "\t-N num : max number of iterations [default = %d]\n", pParams->nItersMax );
Abc_Print( -2, "\t-C num : max starting number of conflicts in mitering [default = %d]\n", pParams->nMiteringLimitStart );
Abc_Print( -2, "\t-F num : max starting number of conflicts in fraiging [default = %d]\n", pParams->nFraigingLimitStart );
Abc_Print( -2, "\t-G num : multiplicative coefficient for fraiging [default = %d]\n", (int)pParams->nFraigingLimitMulti );
- Abc_Print( -2, "\t-L num : max last-gasp number of conflicts in mitering [default = %d]\n", pParams->nMiteringLimitLast );
+ Abc_Print( -2, "\t-M num : max last-gasp number of conflicts in mitering [default = %d]\n", pParams->nMiteringLimitLast );
Abc_Print( -2, "\t-I num : max number of clause inspections in all SAT calls [default = %d]\n", (int)pParams->nTotalInspectLimit );
+ Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
Abc_Print( -2, "\t-r : toggle the use of rewriting [default = %s]\n", pParams->fUseRewriting? "yes": "no" );
Abc_Print( -2, "\t-f : toggle the use of FRAIGing [default = %s]\n", pParams->fUseFraiging? "yes": "no" );
Abc_Print( -2, "\t-b : toggle the use of BDDs [default = %s]\n", pParams->fUseBdds? "yes": "no" );
@@ -16716,7 +16857,7 @@ int Abc_CommandRecDump3( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print( 0, "No structure in the library.\n" );
return 1;
}
- Gia_AigerWrite( pGia, FileName, 0, 0 );
+ Gia_AigerWrite( pGia, FileName, 0, 0, 0 );
}
return 0;
@@ -22972,6 +23113,126 @@ usage:
return 1;
}
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_CommandFunEnum( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ extern void Dtt_EnumerateLf( int nVars, int nNodeMax, int fDelay, int fMulti, int fVerbose );
+ extern void Dau_FunctionEnum( int nInputs, int nVars, int nNodeMax, int fUseTwo, int fReduce, int fVerbose );
+ int c, nInputs = 4, nVars = 4, nNodeMax = 32, fUseTwo = 0, fReduce = 0, fSimple = 0, fDelay = 0, fMulti = 0, fVerbose = 0;
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "SIMtrldmvh" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 'S':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ nInputs = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( nInputs < 0 )
+ goto usage;
+ break;
+ case 'I':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ nVars = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( nVars < 0 )
+ goto usage;
+ break;
+ case 'M':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ nNodeMax = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( nNodeMax < 0 )
+ goto usage;
+ break;
+ case 't':
+ fUseTwo ^= 1;
+ break;
+ case 'r':
+ fReduce ^= 1;
+ break;
+ case 'l':
+ fSimple ^= 1;
+ break;
+ case 'd':
+ fDelay ^= 1;
+ break;
+ case 'm':
+ fMulti ^= 1;
+ break;
+ case 'v':
+ fVerbose ^= 1;
+ break;
+ case 'h':
+ goto usage;
+ default:
+ Abc_Print( -2, "Unknown switch.\n");
+ goto usage;
+ }
+ }
+ if ( fSimple || fDelay )
+ {
+ if ( nVars < 3 || nVars > 5 )
+ {
+ Abc_Print( -1, "The number of inputs should be 3 <= I <= 5.\n" );
+ goto usage;
+ }
+ Dtt_EnumerateLf( nVars, nNodeMax, fDelay, fMulti, fVerbose );
+ }
+ else
+ {
+ if ( nVars < 2 || nVars > 6 )
+ {
+ Abc_Print( -1, "The number of inputs should be 2 <= I <= 6.\n" );
+ goto usage;
+ }
+ if ( nInputs < nVars || nInputs > 6 )
+ {
+ Abc_Print( -1, "The intermediate support size should be I <= S <= 6.\n" );
+ goto usage;
+ }
+ Dau_FunctionEnum( nInputs, nVars, nNodeMax, fUseTwo, fReduce, fVerbose );
+ }
+ return 0;
+
+usage:
+ Abc_Print( -2, "usage: funenum [-SIM num] [-trldmvh]\n" );
+ Abc_Print( -2, "\t enumerates minimum 2-input-gate implementations\n" );
+ Abc_Print( -2, "\t-S num : the maximum intermediate support size [default = %d]\n", nInputs );
+ Abc_Print( -2, "\t-I num : the number of inputs of Boolean functions [default = %d]\n", nVars );
+ Abc_Print( -2, "\t-M num : the maximum number of 2-input gates [default = %d]\n", nNodeMax );
+ Abc_Print( -2, "\t-t : toggle adding combination of two gates [default = %s]\n", fUseTwo? "yes": "no" );
+ Abc_Print( -2, "\t-r : toggle reducing the last level [default = %s]\n", fReduce? "yes": "no" );
+ Abc_Print( -2, "\t-l : toggle generating L(f) rather than C(f) [default = %s]\n", fSimple? "yes": "no" );
+ Abc_Print( -2, "\t-d : toggle generating D(f) rather than C(f) [default = %s]\n", fDelay? "yes": "no" );
+ Abc_Print( -2, "\t-m : toggle generating multiplicity statistics [default = %s]\n", fMulti? "yes": "no" );
+ Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ return 1;
+}
+
/**Function*************************************************************
@@ -23645,12 +23906,16 @@ int Abc_CommandDProve( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print( -1, "Empty network.\n" );
return 1;
}
-
if ( !Abc_NtkIsStrash(pNtk) )
{
Abc_Print( -1, "This command works only for structrally hashed networks. Run \"st\".\n" );
return 0;
}
+ if ( pAbc->fBatchMode && (pAbc->Status == 0 || pAbc->Status == 1) )
+ {
+ Abc_Print( 1, "The miters is already solved; skipping the command.\n" );
+ return 0;
+ }
// perform verification
pAbc->Status = Abc_NtkDarProve( pNtk, pSecPar, nBmcFramesMax, nBmcConfMax );
@@ -25349,6 +25614,11 @@ int Abc_CommandBmc( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print( -1, "Does not work for combinational networks.\n" );
return 0;
}
+ if ( pAbc->fBatchMode && (pAbc->Status == 0 || pAbc->Status == 1) )
+ {
+ Abc_Print( 1, "The miters is already solved; skipping the command.\n" );
+ return 0;
+ }
pAbc->Status = Abc_NtkDarBmc( pNtk, 0, nFrames, nSizeMax, nNodeDelta, 0, nBTLimit, nBTLimitAll, fRewrite, fNewAlgo, 0, nCofFanLit, fVerbose, &iFrames, fUseSatoko );
pAbc->nFrames = iFrames;
Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
@@ -25544,6 +25814,11 @@ int Abc_CommandBmc2( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print( -1, "Does not work for combinational networks.\n" );
return 0;
}
+ if ( pAbc->fBatchMode && (pAbc->Status == 0 || pAbc->Status == 1) )
+ {
+ Abc_Print( 1, "The miters is already solved; skipping the command.\n" );
+ return 0;
+ }
pAbc->Status = Abc_NtkDarBmc( pNtk, nStart, nFrames, nSizeMax, nNodeDelta, nTimeOut, nBTLimit, nBTLimitAll, fRewrite, fNewAlgo, fOrDecomp, 0, fVerbose, &iFrames, fUseSatoko );
pAbc->nFrames = iFrames;
Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
@@ -25798,6 +26073,11 @@ int Abc_CommandBmc3( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print( -1, "Constraints have to be folded (use \"fold\").\n" );
return 0;
}
+ if ( pAbc->fBatchMode && (pAbc->Status == 0 || pAbc->Status == 1) )
+ {
+ Abc_Print( 1, "The miters is already solved; skipping the command.\n" );
+ return 0;
+ }
pPars->fUseBridge = pAbc->fBridgeMode;
pAbc->Status = Abc_NtkDarBmc3( pNtk, pPars, fOrDecomp );
pAbc->nFrames = pNtk->vSeqModelVec ? -1 : pPars->iFrame;
@@ -26004,6 +26284,11 @@ int Abc_CommandBmcInter( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
return 0;
}
+ if ( pAbc->fBatchMode && (pAbc->Status == 0 || pAbc->Status == 1) )
+ {
+ Abc_Print( 1, "The miters is already solved; skipping the command.\n" );
+ return 0;
+ }
if ( Abc_NtkLatchNum(pNtk) == 0 )
{
Abc_Print( -1, "Does not work for combinational networks.\n" );
@@ -27049,6 +27334,11 @@ int Abc_CommandFold( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print( 0, "The network has no constraints.\n" );
return 0;
}
+ if ( Abc_NtkConstrNum(pNtk) == Abc_NtkPoNum(pNtk) )
+ {
+ Abc_Print( 0, "The network has no primary outputs (only constraints).\n" );
+ return 0;
+ }
if ( Abc_NtkIsComb(pNtk) )
Abc_Print( 0, "The network is combinational.\n" );
// modify the current network
@@ -27532,11 +27822,12 @@ int Abc_CommandPdr( Abc_Frame_t * pAbc, int argc, char ** argv )
{
extern int Abc_NtkDarPdr( Abc_Ntk_t * pNtk, Pdr_Par_t * pPars );
Pdr_Par_t Pars, * pPars = &Pars;
- Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+ Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc), * pNtkUsed, * pNtkFlop = NULL;
+ char * pLogFileName = NULL;
int c;
Pdr_ManSetDefaultParams( pPars );
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "MFCDQTHGSaxrmuyfqipdegjonctkvwzh" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "MFCDQTHGSLaxrmuyfqipdegjonctkvwzh" ) ) != EOF )
{
switch ( c )
{
@@ -27639,6 +27930,15 @@ int Abc_CommandPdr( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pPars->nRandomSeed < 0 )
goto usage;
break;
+ case 'L':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
+ goto usage;
+ }
+ pLogFileName = argv[globalUtilOptind];
+ globalUtilOptind++;
+ break;
case 'a':
pPars->fSolveAll ^= 1;
break;
@@ -27715,29 +28015,38 @@ int Abc_CommandPdr( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print( -2, "There is no current network.\n");
return 0;
}
- if ( Abc_NtkLatchNum(pNtk) == 0 )
- {
- Abc_Print( 0, "The current network is combinational.\n");
- return 0;
- }
if ( !Abc_NtkIsStrash(pNtk) )
{
Abc_Print( -2, "The current network is not an AIG (run \"strash\").\n");
return 0;
}
+ if ( pAbc->fBatchMode && (pAbc->Status == 0 || pAbc->Status == 1) )
+ {
+ Abc_Print( 1, "The miters is already solved; skipping the command.\n" );
+ return 0;
+ }
+ if ( Abc_NtkLatchNum(pNtk) == 0 )
+ {
+ pNtkFlop = Abc_NtkDup( pNtk );
+ Abc_NtkAddLatch( pNtkFlop, Abc_AigConst1(pNtkFlop), ABC_INIT_ONE );
+ }
// run the procedure
pPars->fUseBridge = pAbc->fBridgeMode;
- pAbc->Status = Abc_NtkDarPdr( pNtk, pPars );
- pAbc->nFrames = pNtk->vSeqModelVec ? -1 : pPars->iFrame;
+ pNtkUsed = pNtkFlop ? pNtkFlop : pNtk;
+ pAbc->Status = Abc_NtkDarPdr( pNtkUsed, pPars );
+ pAbc->nFrames = pNtkUsed->vSeqModelVec ? -1 : pPars->iFrame;
Abc_FrameReplacePoStatuses( pAbc, &pPars->vOutMap );
- if ( pNtk->vSeqModelVec )
- Abc_FrameReplaceCexVec( pAbc, &pNtk->vSeqModelVec );
+ if ( pNtkUsed->vSeqModelVec )
+ Abc_FrameReplaceCexVec( pAbc, &pNtkUsed->vSeqModelVec );
else
- Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
+ Abc_FrameReplaceCex( pAbc, &pNtkUsed->pSeqModel );
+ if ( pNtkFlop ) Abc_NtkDelete( pNtkFlop );
+ if ( pLogFileName )
+ Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, pAbc->nFrames, "pdr" );
return 0;
usage:
- Abc_Print( -2, "usage: pdr [-MFCDQTHGS <num>] [-axrmuyfqipdegjonctkvwzh]\n" );
+ Abc_Print( -2, "usage: pdr [-MFCDQTHGS <num>] [-L <file>] [-axrmuyfqipdegjonctkvwzh]\n" );
Abc_Print( -2, "\t model checking using property directed reachability (aka IC3)\n" );
Abc_Print( -2, "\t pioneered by Aaron R. Bradley (http://theory.stanford.edu/~arbrad/)\n" );
Abc_Print( -2, "\t with improvements by Niklas Een (http://een.se/niklas/)\n" );
@@ -27750,6 +28059,7 @@ usage:
Abc_Print( -2, "\t-H num : runtime limit per output, in miliseconds (with \"-a\") [default = %d]\n", pPars->nTimeOutOne );
Abc_Print( -2, "\t-G num : runtime gap since the last CEX (0 = no limit) [default = %d]\n", pPars->nTimeOutGap );
Abc_Print( -2, "\t-S num : * value to seed the SAT solver with [default = %d]\n", pPars->nRandomSeed );
+ Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
Abc_Print( -2, "\t-a : toggle solving all outputs even if one of them is SAT [default = %s]\n", pPars->fSolveAll? "yes": "no" );
Abc_Print( -2, "\t-x : toggle storing CEXes when solving all outputs [default = %s]\n", pPars->fStoreCex? "yes": "no" );
Abc_Print( -2, "\t-r : toggle using more effort in generalization [default = %s]\n", pPars->fTwoRounds? "yes": "no" );
@@ -29192,6 +29502,7 @@ int Abc_CommandAbc9Get( Abc_Frame_t * pAbc, int argc, char ** argv )
pGia->DefOutReqs = Abc_NtkReadDefaultRequiredWorst(pNtk);
pGia->vInArrs = Vec_FltAllocArray( Abc_NtkGetCiArrivalFloats(pNtk), Abc_NtkCiNum(pNtk) );
pGia->vOutReqs = Vec_FltAllocArray( Abc_NtkGetCoRequiredFloats(pNtk), Abc_NtkCoNum(pNtk) );
+ pGia->And2Delay = pNtk->AndGateDelay;
}
Abc_FrameUpdateGia( pAbc, pGia );
return 0;
@@ -29759,9 +30070,10 @@ int Abc_CommandAbc9Write( Abc_Frame_t * pAbc, int argc, char ** argv )
int fVerilog = 0;
int fMiniAig = 0;
int fMiniLut = 0;
+ int fWriteNewLine = 0;
int fVerbose = 0;
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "upmlvh" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "upmlcvh" ) ) != EOF )
{
switch ( c )
{
@@ -29777,6 +30089,9 @@ int Abc_CommandAbc9Write( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'l':
fMiniLut ^= 1;
break;
+ case 'c':
+ fWriteNewLine ^= 1;
+ break;
case 'v':
fVerbose ^= 1;
break;
@@ -29812,16 +30127,17 @@ int Abc_CommandAbc9Write( Abc_Frame_t * pAbc, int argc, char ** argv )
else if ( fMiniLut )
Gia_ManWriteMiniLut( pAbc->pGia, pFileName );
else
- Gia_AigerWrite( pAbc->pGia, pFileName, 0, 0 );
+ Gia_AigerWrite( pAbc->pGia, pFileName, 0, 0, fWriteNewLine );
return 0;
usage:
- Abc_Print( -2, "usage: &w [-upmlvh] <file>\n" );
+ Abc_Print( -2, "usage: &w [-upmlcvh] <file>\n" );
Abc_Print( -2, "\t writes the current AIG into the AIGER file\n" );
Abc_Print( -2, "\t-u : toggle writing canonical AIG structure [default = %s]\n", fUnique? "yes" : "no" );
Abc_Print( -2, "\t-p : toggle writing Verilog with 'and' and 'not' [default = %s]\n", fVerilog? "yes" : "no" );
Abc_Print( -2, "\t-m : toggle writing MiniAIG rather than AIGER [default = %s]\n", fMiniAig? "yes" : "no" );
Abc_Print( -2, "\t-l : toggle writing MiniLUT rather than AIGER [default = %s]\n", fMiniLut? "yes" : "no" );
+ Abc_Print( -2, "\t-c : toggle writing \'\\n\' after \'c\' in the AIGER file [default = %s]\n", fWriteNewLine? "yes": "no" );
Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
Abc_Print( -2, "\t-h : print the command usage\n");
Abc_Print( -2, "\t<file> : the file name\n");
@@ -34399,7 +34715,7 @@ int Abc_CommandAbc9Srm( Abc_Frame_t * pAbc, int argc, char ** argv )
pTemp = Gia_ManSeqStructSweep( pAux = pTemp, 1, 1, 0 );
Gia_ManStop( pAux );
}
- Gia_AigerWrite( pTemp, pFileNameIn ? pFileNameIn : pFileName, 0, 0 );
+ Gia_AigerWrite( pTemp, pFileNameIn ? pFileNameIn : pFileName, 0, 0, 0 );
Abc_Print( 1, "Speculatively reduced model was written into file \"%s\".\n", pFileName );
Gia_ManPrintStatsShort( pTemp );
Gia_ManStop( pTemp );
@@ -34412,7 +34728,7 @@ int Abc_CommandAbc9Srm( Abc_Frame_t * pAbc, int argc, char ** argv )
pTemp = Gia_ManSeqStructSweep( pAux = pTemp, 1, 1, 0 );
Gia_ManStop( pAux );
- Gia_AigerWrite( pTemp, pFileName2, 0, 0 );
+ Gia_AigerWrite( pTemp, pFileName2, 0, 0, 0 );
Abc_Print( 1, "Reduced original network was written into file \"%s\".\n", pFileName2 );
Gia_ManPrintStatsShort( pTemp );
Gia_ManStop( pTemp );
@@ -34513,7 +34829,7 @@ int Abc_CommandAbc9Srm2( Abc_Frame_t * pAbc, int argc, char ** argv )
pTemp = Gia_ManSeqStructSweep( pAux = pTemp, 1, 1, 0 );
Gia_ManStop( pAux );
- Gia_AigerWrite( pTemp, pFileName, 0, 0 );
+ Gia_AigerWrite( pTemp, pFileName, 0, 0, 0 );
Abc_Print( 1, "Speculatively reduced model was written into file \"%s\".\n", pFileName );
Gia_ManPrintStatsShort( pTemp );
Gia_ManStop( pTemp );
@@ -34970,7 +35286,7 @@ int Abc_CommandAbc9Cec( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( fDumpMiter )
{
Abc_Print( 0, "The verification miter is written into file \"%s\".\n", "cec_miter.aig" );
- Gia_AigerWrite( pMiter, "cec_miter.aig", 0, 0 );
+ Gia_AigerWrite( pMiter, "cec_miter.aig", 0, 0, 0 );
}
pAbc->Status = Cec_ManVerify( pMiter, pPars );
Abc_FrameReplaceCex( pAbc, &pGias[0]->pCexComb );
@@ -40227,7 +40543,7 @@ int Abc_CommandAbc9Cone( Abc_Frame_t * pAbc, int argc, char ** argv )
{
Gia_Man_t * pOne = Gia_ManDupDfsCone( pAbc->pGia, pObj );
sprintf( Buffer, "%s_%0*d.aig", Extra_FileNameGeneric(pAbc->pGia->pSpec), nDigits, i );
- Gia_AigerWrite( pOne, Buffer, 0, 0 );
+ Gia_AigerWrite( pOne, Buffer, 0, 0, 0 );
Gia_ManStop( pOne );
}
printf( "Dumped all outputs into individual AIGER files.\n" );
@@ -41513,7 +41829,7 @@ int Abc_CommandAbc9FFTest( Abc_Frame_t * pAbc, int argc, char ** argv )
int c;
Gia_ParFfSetDefault( pPars );
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "ATNKSGkbsfdeunvh" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "ATNKSGkbsfcdeunvh" ) ) != EOF )
{
switch ( c )
{
@@ -41591,6 +41907,9 @@ int Abc_CommandAbc9FFTest( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'f':
pPars->fFfOnly ^= 1;
break;
+ case 'c':
+ pPars->fCheckUntest ^= 1;
+ break;
case 'd':
pPars->fDump ^= 1;
break;
@@ -41681,7 +42000,7 @@ int Abc_CommandAbc9FFTest( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- Abc_Print( -2, "usage: &fftest [-ATNK num] [-kbsfdeunvh] <file> [-G file] [-S str]\n" );
+ Abc_Print( -2, "usage: &fftest [-ATNK num] [-kbsfcdeunvh] <file> [-G file] [-S str]\n" );
Abc_Print( -2, "\t performs functional fault test generation\n" );
Abc_Print( -2, "\t-A num : selects fault model for all gates [default = %d]\n", pPars->Algo );
Abc_Print( -2, "\t 0: fault model is not selected (use -S str)\n" );
@@ -41696,9 +42015,10 @@ usage:
Abc_Print( -2, "\t-b : toggles testing for single faults (the same as \"-K 1\") [default = %s]\n", pPars->fBasic? "yes": "no" );
Abc_Print( -2, "\t-s : toggles starting with the all-0 and all-1 patterns [default = %s]\n", pPars->fStartPats? "yes": "no" );
Abc_Print( -2, "\t-f : toggles faults at flop inputs only with \"-A 1\" and \"-S str\" [default = %s]\n", pPars->fFfOnly? "yes": "no" );
- Abc_Print( -2, "\t-d : toggles dumping test patterns into file \"tests.txt\" [default = %s]\n", pPars->fDump? "yes": "no" );
+ Abc_Print( -2, "\t-c : toggles checking if there are untestable faults [default = %s]\n", pPars->fCheckUntest? "yes": "no" );
+ Abc_Print( -2, "\t-d : toggles dumping test patterns into file \"<file>_tests.txt\" [default = %s]\n", pPars->fDump? "yes": "no" );
Abc_Print( -2, "\t-e : toggles dumping test pattern pairs (delay faults only) [default = %s]\n", pPars->fDumpDelay? "yes": "no" );
- Abc_Print( -2, "\t-u : toggles dumping untestable faults into \"untest.txt\" [default = %s]\n", pPars->fDumpUntest? "yes": "no" );
+ Abc_Print( -2, "\t-u : toggles dumping untestable faults into \"<file>_untest.txt\" [default = %s]\n", pPars->fDumpUntest? "yes": "no" );
Abc_Print( -2, "\t-n : toggles dumping faults not detected by a given test set [default = %s]\n", pPars->fDumpNewFaults? "yes": "no" );
Abc_Print( -2, "\t-v : toggles printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
Abc_Print( -2, "\t-h : print the command usage\n");
@@ -42614,8 +42934,8 @@ int Abc_CommandAbc9Demiter( Abc_Frame_t * pAbc, int argc, char ** argv )
sprintf( pName1, "%s_2.aig", pGen );
ABC_FREE( pGen );
}
- Gia_AigerWrite( pPart1, pName0, 0, 0 );
- Gia_AigerWrite( pPart2, pName1, 0, 0 );
+ Gia_AigerWrite( pPart1, pName0, 0, 0, 0 );
+ Gia_AigerWrite( pPart2, pName1, 0, 0, 0 );
Gia_ManStop( pPart1 );
Gia_ManStop( pPart2 );
if ( fDumpFilesTwo )
@@ -43333,10 +43653,16 @@ usage:
int Abc_CommandAbc9Exorcism( Abc_Frame_t * pAbc, int argc, char ** argv )
{
extern int Abc_ExorcismMain( Vec_Wec_t * vEsop, int nIns, int nOuts, char * pFileNameOut, int Quality, int Verbosity, int nCubesMax, int fUseQCost );
+ extern Vec_Wec_t * Abc_ExorcismNtk2Esop( Abc_Ntk_t * pNtk );
+
extern Gia_Man_t * Eso_ManCompute( Gia_Man_t * pGia, int fVerbose, Vec_Wec_t ** pvRes );
Vec_Wec_t * vEsop = NULL;
+ Abc_Ntk_t * pNtk = NULL;
+ char * pFileNameIn = NULL;
char * pFileNameOut = NULL;
int c, Quality = 2, Verbosity = 0, nCubesMax = 20000, fUseQCost = 0, fVerbose = 0;
+ int nInputs = -1, nOutputs = -1;
+
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "QVCqvh" ) ) != EOF )
{
@@ -43387,30 +43713,72 @@ int Abc_CommandAbc9Exorcism( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
- if ( pAbc->pGia == NULL )
+
+ if ( argc == globalUtilOptind + 2 )
{
- Abc_Print( -1, "Abc_CommandAbc9Exorcism(): There is no AIG.\n" );
- return 0;
+ pFileNameIn = argv[globalUtilOptind];
+ pFileNameOut = argv[globalUtilOptind + 1];
}
- // get the output file name
- if ( argc == globalUtilOptind + 1 )
+ else if ( argc == globalUtilOptind + 1 )
+ {
pFileNameOut = argv[globalUtilOptind];
- // generate starting cover and run minimization
- Eso_ManCompute( pAbc->pGia, fVerbose, &vEsop );
- Abc_ExorcismMain( vEsop, Gia_ManCiNum(pAbc->pGia), Gia_ManCoNum(pAbc->pGia), pFileNameOut, Quality, Verbosity, nCubesMax, fUseQCost );
- Vec_WecFree( vEsop );
- return 0;
-
-usage:
- Abc_Print( -2, "usage: &exorcism [-Q N] [-V N] [-C N] -q <file>\n" );
- Abc_Print( -2, " performs heuristic exclusive sum-of-project minimization\n" );
- Abc_Print( -2, " -Q N : minimization quality [default = %d]\n", Quality);
- Abc_Print( -2, " increasing this number improves quality and adds to runtime\n");
- Abc_Print( -2, " -V N : verbosity level [default = %d]\n", Verbosity);
- Abc_Print( -2, " 0 = no output; 1 = outline; 2 = verbose\n");
- Abc_Print( -2, " -C N : maximum number of cubes in startign cover [default = %d]\n", nCubesMax );
- Abc_Print( -2, " -q : toggle using quantum cost [default = %s]\n", fUseQCost? "yes": "no" );
- Abc_Print( -2, " <file>: the output file name in ESOP-PLA format\n");
+ }
+ else
+ {
+ Abc_Print( -1, "Abc_CommandAbc9Exorcism(): Argument error.\n" );
+ goto usage;
+ }
+
+ if ( pAbc->pGia == NULL && pFileNameIn == NULL )
+ {
+ Abc_Print( -1, "Abc_CommandAbc9Exorcism(): There is neither an AIG nor an ESOP-PLA file.\n" );
+ return 0;
+ }
+
+ if ( pFileNameIn )
+ {
+ pNtk = Io_ReadPla( pFileNameIn, 0, 0, 0, /* no preprocessing = */1, /* check = */1 );
+ if ( pNtk == NULL )
+ {
+ printf( "Reading PLA file has failed.\n" );
+ return 1;
+ }
+ nInputs = Abc_NtkCiNum( pNtk );
+ nOutputs = Abc_NtkCoNum( pNtk );
+ vEsop = Abc_ExorcismNtk2Esop( pNtk );
+ if ( vEsop == NULL )
+ {
+ printf( "Converting PLA to ESOP failed.\n" );
+ return 1;
+ }
+ }
+ else if ( pAbc->pGia )
+ {
+ // generate starting cover
+ nInputs = Gia_ManCiNum( pAbc->pGia );
+ nOutputs = Gia_ManCoNum( pAbc->pGia );
+ Eso_ManCompute( pAbc->pGia, fVerbose, &vEsop );
+ }
+
+ if ( vEsop )
+ {
+ // run minimization
+ Abc_ExorcismMain( vEsop, nInputs, nOutputs, pFileNameOut, Quality, Verbosity, nCubesMax, fUseQCost );
+ Vec_WecFree( vEsop );
+ }
+ return 0;
+
+usage:
+ Abc_Print( -2, "usage: &exorcism [-Q N] [-V N] [-C N] -q [file_in] <file_out>\n" );
+ Abc_Print( -2, " performs heuristic exclusive sum-of-project minimization\n" );
+ Abc_Print( -2, " -Q N : minimization quality [default = %d]\n", Quality);
+ Abc_Print( -2, " increasing this number improves quality and adds to runtime\n");
+ Abc_Print( -2, " -V N : verbosity level [default = %d]\n", Verbosity);
+ Abc_Print( -2, " 0 = no output; 1 = outline; 2 = verbose\n");
+ Abc_Print( -2, " -C N : maximum number of cubes in startign cover [default = %d]\n", nCubesMax );
+ Abc_Print( -2, " -q : toggle using quantum cost [default = %s]\n", fUseQCost? "yes": "no" );
+ Abc_Print( -2, " [file_in] : optional input file in ESOP-PLA format (otherwise current AIG is used)\n");
+ Abc_Print( -2, " <file_out> : output file in ESOP-PLA format\n");
Abc_Print( -2, "\n" );
return 1;
}
@@ -43556,6 +43924,16 @@ int Abc_CommandAbc9Mfs( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print( -1, "Abc_CommandAbc9Mfs(): The current AIG has no mapping.\n" );
return 0;
}
+ if ( Gia_ManLutSizeMax(pAbc->pGia) > 6 )
+ {
+ Abc_Print( -1, "Abc_CommandAbc9Mfs(): The current mapping has nodes with more than 6 inputs. Cannot use \"mfs\".\n" );
+ return 0;
+ }
+ if ( pAbc->pGia->pAigExtra && Gia_ManPiNum(pAbc->pGia->pAigExtra) > 6 )
+ {
+ Abc_Print( -1, "Abc_CommandAbc9Mfs(): The current white-boxes have more than 6 inputs. Cannot use \"mfs\".\n" );
+ return 0;
+ }
pTemp = Gia_ManPerformMfs( pAbc->pGia, pPars );
Abc_FrameUpdateGia( pAbc, pTemp );
return 0;
@@ -43573,7 +43951,7 @@ usage:
Abc_Print( -2, "\t-d : toggle performing redundancy removal [default = %s]\n", pPars->fRrOnly? "yes": "no" );
Abc_Print( -2, "\t-a : toggle minimizing area or area+edges [default = %s]\n", pPars->fArea? "area": "area+edges" );
Abc_Print( -2, "\t-e : toggle high-effort resubstitution [default = %s]\n", pPars->fMoreEffort? "yes": "no" );
- Abc_Print( -2, "\t-b : toggle preserving all while boxes [default = %s]\n", pPars->fAllBoxes? "yes": "no" );
+ Abc_Print( -2, "\t-b : toggle preserving all white boxes [default = %s]\n", pPars->fAllBoxes? "yes": "no" );
Abc_Print( -2, "\t-v : toggle printing optimization summary [default = %s]\n", pPars->fVerbose? "yes": "no" );
Abc_Print( -2, "\t-w : toggle printing detailed stats for each node [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
Abc_Print( -2, "\t-h : print the command usage\n");
@@ -44134,6 +44512,11 @@ int Abc_CommandAbc9GlaDerive( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
}
*/
+ if ( pAbc->fBatchMode && (pAbc->Status == 0 || pAbc->Status == 1) )
+ {
+ Abc_Print( 1, "The miters is already solved; skipping the command.\n" );
+ return 0;
+ }
if ( pAbc->pGia->vGateClasses == NULL )
{
Abc_Print( -1, "Abstraction gate map is missing.\n" );