From c6afb9db639b7ce0ac714e4e63e629b4c8bf1ac1 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Wed, 9 Nov 2016 21:17:44 -0800 Subject: Equivalent fault detection code. --- src/base/abci/abc.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'src/base/abci/abc.c') diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index 953a6c6a..b1c81cd5 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -7237,21 +7237,28 @@ usage: ***********************************************************************/ int Abc_CommandDetect( Abc_Frame_t * pAbc, int argc, char ** argv ) { - extern void Abc_NtkDetectClassesTest( Abc_Ntk_t * pNtk, int fSeq, int fVerbose ); + extern void Abc_NtkDetectClassesTest( Abc_Ntk_t * pNtk, int fSeq, int fVerbose, int fVeryVerbose ); + extern void Abc_NtkGenFaultList( Abc_Ntk_t * pNtk, char * pFileName ); Abc_Ntk_t * pNtk; - int c, fSeq = 0, fVerbose = 0; + int c, fGen = 0, fSeq = 0, fVerbose = 0, fVeryVerbose = 0; pNtk = Abc_FrameReadNtk(pAbc); Extra_UtilGetoptReset(); - while ( ( c = Extra_UtilGetopt( argc, argv, "svh" ) ) != EOF ) + while ( ( c = Extra_UtilGetopt( argc, argv, "gsvwh" ) ) != EOF ) { switch ( c ) { + case 'g': + fGen ^= 1; + break; case 's': fSeq ^= 1; break; case 'v': fVerbose ^= 1; break; + case 'w': + fVeryVerbose ^= 1; + break; case 'h': goto usage; default: @@ -7268,14 +7275,22 @@ int Abc_CommandDetect( Abc_Frame_t * pAbc, int argc, char ** argv ) Abc_Print( -1, "Only applicable to a logic network.\n" ); return 1; } - Abc_NtkDetectClassesTest( pNtk, fSeq, fVerbose ); + if ( fGen ) + { + char * pFileName = Extra_FileNameGenericAppend(Abc_NtkSpec(pNtk), "_faults.txt"); + Abc_NtkGenFaultList( pNtk, pFileName ); + } + else + Abc_NtkDetectClassesTest( pNtk, fSeq, fVerbose, fVeryVerbose ); return 0; usage: - Abc_Print( -2, "usage: detect [-svh]\n" ); + Abc_Print( -2, "usage: detect [-gsvwh]\n" ); Abc_Print( -2, "\t detects properties of internal nodes\n" ); + Abc_Print( -2, "\t-g : toggle generating fault list for the given network [default = %s]\n", fGen? "yes": "no" ); Abc_Print( -2, "\t-s : toggle using sequential circuit information [default = %s]\n", fSeq? "yes": "no" ); Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" ); + Abc_Print( -2, "\t-w : toggle printing equivalence classes [default = %s]\n", fVeryVerbose? "yes": "no" ); Abc_Print( -2, "\t-h : print the command usage\n"); return 1; } -- cgit v1.2.3 From 71a52ae9e5e0572f93df9eb14cba8c7567d3e676 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Thu, 10 Nov 2016 09:38:07 -0800 Subject: Renaming command 'detect' to be 'faultclasses'. --- src/base/abci/abc.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'src/base/abci/abc.c') diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index b1c81cd5..07ea78b2 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -134,7 +134,7 @@ static int Abc_CommandRr ( Abc_Frame_t * pAbc, int argc, cha static int Abc_CommandCascade ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandExtract ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandVarMin ( Abc_Frame_t * pAbc, int argc, char ** argv ); -static int Abc_CommandDetect ( Abc_Frame_t * pAbc, int argc, char ** argv ); +static int Abc_CommandFaultClasses ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandExact ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandBmsStart ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandBmsStop ( Abc_Frame_t * pAbc, int argc, char ** argv ); @@ -778,7 +778,7 @@ void Abc_Init( Abc_Frame_t * pAbc ) Cmd_CommandAdd( pAbc, "Synthesis", "cascade", Abc_CommandCascade, 1 ); Cmd_CommandAdd( pAbc, "Synthesis", "extract", Abc_CommandExtract, 1 ); Cmd_CommandAdd( pAbc, "Synthesis", "varmin", Abc_CommandVarMin, 0 ); - Cmd_CommandAdd( pAbc, "Synthesis", "detect", Abc_CommandDetect, 0 ); + Cmd_CommandAdd( pAbc, "Synthesis", "faultclasses", Abc_CommandFaultClasses, 0 ); Cmd_CommandAdd( pAbc, "Synthesis", "exact", Abc_CommandExact, 1 ); Cmd_CommandAdd( pAbc, "Exact synthesis", "bms_start", Abc_CommandBmsStart, 0 ); @@ -7235,7 +7235,7 @@ usage: SeeAlso [] ***********************************************************************/ -int Abc_CommandDetect( Abc_Frame_t * pAbc, int argc, char ** argv ) +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 ); @@ -7285,12 +7285,14 @@ int Abc_CommandDetect( Abc_Frame_t * pAbc, int argc, char ** argv ) return 0; usage: - Abc_Print( -2, "usage: detect [-gsvwh]\n" ); - Abc_Print( -2, "\t detects properties of internal nodes\n" ); - Abc_Print( -2, "\t-g : toggle generating fault list for the given network [default = %s]\n", fGen? "yes": "no" ); - Abc_Print( -2, "\t-s : toggle using sequential circuit information [default = %s]\n", fSeq? "yes": "no" ); - Abc_Print( -2, "\t-v : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" ); - Abc_Print( -2, "\t-w : toggle printing equivalence classes [default = %s]\n", fVeryVerbose? "yes": "no" ); + Abc_Print( -2, "usage: faultclasses [-gsvwh]\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: \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-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" ); Abc_Print( -2, "\t-h : print the command usage\n"); return 1; } -- cgit v1.2.3