@@ -278,6 +278,7 @@ static int Abc_CommandSimSec ( Abc_Frame_t * pAbc, int argc, cha
278278static int Abc_CommandMatch ( Abc_Frame_t * pAbc, int argc, char ** argv );
279279//static int Abc_CommandHaig ( Abc_Frame_t * pAbc, int argc, char ** argv );
280280static int Abc_CommandQbf ( Abc_Frame_t * pAbc, int argc, char ** argv );
281+ static int Abc_CommandAigSim ( Abc_Frame_t * pAbc, int argc, char ** argv );
281282
282283static int Abc_CommandFraig ( Abc_Frame_t * pAbc, int argc, char ** argv );
283284static int Abc_CommandFraigTrust ( Abc_Frame_t * pAbc, int argc, char ** argv );
@@ -1107,6 +1108,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
11071108 Cmd_CommandAdd( pAbc, "New AIG", "csweep", Abc_CommandCSweep, 1 );
11081109// Cmd_CommandAdd( pAbc, "New AIG", "haig", Abc_CommandHaig, 1 );
11091110 Cmd_CommandAdd( pAbc, "New AIG", "qbf", Abc_CommandQbf, 0 );
1111+ Cmd_CommandAdd( pAbc, "New AIG", "aigsim", Abc_CommandAigSim, 0 );
11101112
11111113 Cmd_CommandAdd( pAbc, "Fraiging", "fraig", Abc_CommandFraig, 1 );
11121114 Cmd_CommandAdd( pAbc, "Fraiging", "fraig_trust", Abc_CommandFraigTrust, 1 );
@@ -19269,6 +19271,68 @@ int Abc_CommandQbf( Abc_Frame_t * pAbc, int argc, char ** argv )
1926919271 return 1;
1927019272}
1927119273
19274+
19275+ /**Function*************************************************************
19276+
19277+ Synopsis []
19278+
19279+ Description []
19280+
19281+ SideEffects []
19282+
19283+ SeeAlso []
19284+
19285+ ***********************************************************************/
19286+ int Abc_CommandAigSim( Abc_Frame_t * pAbc, int argc, char ** argv )
19287+ {
19288+ extern int SimulateAigTop( char *fname1, char *fname2, char * mask, int verbose );
19289+ char * pMask = NULL;
19290+ char ** pArgvNew = NULL;
19291+ int nArgcNew = 0;
19292+ int c, fVerbose = 0;
19293+ Extra_UtilGetoptReset();
19294+ while ( ( c = Extra_UtilGetopt( argc, argv, "Mvh" ) ) != EOF )
19295+ {
19296+ switch ( c )
19297+ {
19298+ case 'M':
19299+ if ( globalUtilOptind >= argc )
19300+ {
19301+ Abc_Print( -1, "Command line switch \"-M\" should be followed by a string.\n" );
19302+ goto usage;
19303+ }
19304+ pMask = argv[globalUtilOptind];
19305+ globalUtilOptind++;
19306+ break;
19307+ case 'v':
19308+ fVerbose ^= 1;
19309+ break;
19310+ case 'h':
19311+ goto usage;
19312+ default:
19313+ goto usage;
19314+ }
19315+ }
19316+ pArgvNew = argv + globalUtilOptind;
19317+ nArgcNew = argc - globalUtilOptind;
19318+ if ( nArgcNew != 2 ) {
19319+ Abc_Print( -1, "Expecting two files names on the command line.\n" );
19320+ return 1;
19321+ }
19322+ SimulateAigTop( pArgvNew[0], pArgvNew[1], pMask, fVerbose );
19323+ return 0;
19324+
19325+ usage:
19326+ Abc_Print( -2, "usage: aigsim -M <str> [-vh] <file1> <file2>\n" );
19327+ Abc_Print( -2, "\t combinational AIG simulation\n" );
19328+ Abc_Print( -2, "\t-M <str> : mask to select inputs for simulation [default = unused]\n" );
19329+ Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
19330+ Abc_Print( -2, "\t-h : print the command usage\n");
19331+ Abc_Print( -2, "\t<file1> : the first file to simulate\n");
19332+ Abc_Print( -2, "\t<file2> : the second file to simulate\n");
19333+ return 1;
19334+ }
19335+
1927219336/**Function*************************************************************
1927319337
1927419338 Synopsis []
0 commit comments