diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2016-11-22 20:09:25 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2016-11-22 20:09:25 -0800 |
commit | 64bdbe1a74fcf6343e06caa0dc4f6dae0e621e76 (patch) | |
tree | 2550880c19afe04036b1269e645a6c546ccaedaf /src | |
parent | b483c97fdd6e1fe6d52158d1b0231678073ace5e (diff) | |
download | abc-64bdbe1a74fcf6343e06caa0dc4f6dae0e621e76.tar.gz abc-64bdbe1a74fcf6343e06caa0dc4f6dae0e621e76.tar.bz2 abc-64bdbe1a74fcf6343e06caa0dc4f6dae0e621e76.zip |
Adding switch '-c' to generate only stuck-at faults in 'faultclasses -g'.
Diffstat (limited to 'src')
-rw-r--r-- | src/base/abci/abc.c | 14 | ||||
-rw-r--r-- | src/base/abci/abcDetect.c | 8 |
2 files changed, 14 insertions, 8 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index 3efc41c9..4dcea33a 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -7241,18 +7241,21 @@ usage: int Abc_CommandFaultClasses( Abc_Frame_t * pAbc, int argc, char ** argv ) { extern void Abc_NtkDetectClassesTest( Abc_Ntk_t * pNtk, int fSeq, int fVerbose, int fVeryVerbose ); - extern void Abc_NtkGenFaultList( Abc_Ntk_t * pNtk, char * pFileName ); + extern void Abc_NtkGenFaultList( Abc_Ntk_t * pNtk, char * pFileName, int fStuckAt ); Abc_Ntk_t * pNtk; - int c, fGen = 0, fSeq = 0, fVerbose = 0, fVeryVerbose = 0; + int c, fGen = 0, fStuckAt = 0, fSeq = 0, fVerbose = 0, fVeryVerbose = 0; pNtk = Abc_FrameReadNtk(pAbc); Extra_UtilGetoptReset(); - while ( ( c = Extra_UtilGetopt( argc, argv, "gsvwh" ) ) != EOF ) + while ( ( c = Extra_UtilGetopt( argc, argv, "gcsvwh" ) ) != EOF ) { switch ( c ) { case 'g': fGen ^= 1; break; + case 'c': + fStuckAt ^= 1; + break; case 's': fSeq ^= 1; break; @@ -7281,18 +7284,19 @@ int Abc_CommandFaultClasses( Abc_Frame_t * pAbc, int argc, char ** argv ) if ( fGen ) { char * pFileName = Extra_FileNameGenericAppend(Abc_NtkSpec(pNtk), "_faults.txt"); - Abc_NtkGenFaultList( pNtk, pFileName ); + Abc_NtkGenFaultList( pNtk, pFileName, fStuckAt ); } else Abc_NtkDetectClassesTest( pNtk, fSeq, fVerbose, fVeryVerbose ); return 0; usage: - Abc_Print( -2, "usage: faultclasses [-gsvwh]\n" ); + Abc_Print( -2, "usage: faultclasses [-gcsvwh]\n" ); Abc_Print( -2, "\t computes equivalence classes of faults in the given mapped netlist;\n" ); Abc_Print( -2, "\t the fault list with faults in the format: <fault_id> <node_name> <fault_name>\n" ); Abc_Print( -2, "\t should be read by command \"read_fins\" before calling this command\n" ); Abc_Print( -2, "\t-g : toggle generating a fault list for the current mapped network [default = %s]\n", fGen? "yes": "no" ); + Abc_Print( -2, "\t-c : toggle using only stuck-at faults in the generated fault list [default = %s]\n", fStuckAt? "yes": "no" ); Abc_Print( -2, "\t-s : toggle detecting sequential equivalence classes [default = %s]\n", fSeq? "yes": "no" ); Abc_Print( -2, "\t-v : toggle verbose printout during computation [default = %s]\n", fVerbose? "yes": "no" ); Abc_Print( -2, "\t-w : toggle printing of resulting fault equivalence classes [default = %s]\n", fVeryVerbose? "yes": "no" ); diff --git a/src/base/abci/abcDetect.c b/src/base/abci/abcDetect.c index 4325f49c..8b8bba64 100644 --- a/src/base/abci/abcDetect.c +++ b/src/base/abci/abcDetect.c @@ -63,7 +63,7 @@ typedef enum { SeeAlso [] ***********************************************************************/ -void Abc_NtkGenFaultList( Abc_Ntk_t * pNtk, char * pFileName ) +void Abc_NtkGenFaultList( Abc_Ntk_t * pNtk, char * pFileName, int fStuckAt ) { Mio_Library_t * pLib = (Mio_Library_t *)pNtk->pManFunc; Mio_Gate_t * pGate; @@ -84,14 +84,16 @@ void Abc_NtkGenFaultList( Abc_Ntk_t * pNtk, char * pFileName ) fprintf( pFile, "%d %s %s\n", Count, Abc_ObjName(pObj), "SA0" ), Count++; fprintf( pFile, "%d %s %s\n", Count, Abc_ObjName(pObj), "SA1" ), Count++; fprintf( pFile, "%d %s %s\n", Count, Abc_ObjName(pObj), "NEG" ), Count++; + if ( fStuckAt ) + continue; // add other faults, which correspond to changing the given gate // by another gate with the same support-size from the same library Mio_LibraryForEachGate( pLib, pGate ) if ( pGate != pGateObj && Mio_GateReadPinNum(pGate) == nInputs ) fprintf( pFile, "%d %s %s\n", Count, Abc_ObjName(pObj), Mio_GateReadName(pGate) ), Count++; } - printf( "Generated fault list \"%s\" for network \"%s\" with %d nodes and %d faults.\n", - pFileName, Abc_NtkName(pNtk), Abc_NtkNodeNum(pNtk), Count-1 ); + printf( "Generated fault list \"%s\" for network \"%s\" with %d nodes and %d %sfaults.\n", + pFileName, Abc_NtkName(pNtk), Abc_NtkNodeNum(pNtk), Count-1, fStuckAt ? "stuck-at ":"" ); fclose( pFile ); } |