summaryrefslogtreecommitdiffstats
path: root/src/base/abci
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2015-09-26 14:55:07 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2015-09-26 14:55:07 -0700
commitd0af09a20977a2afd1d8f056bf22dc7428d246e3 (patch)
tree143dacc249c9cad1104882846d85d05b94cfac43 /src/base/abci
parent62e5ff900eebce673440713742a471089cfe25b8 (diff)
downloadabc-d0af09a20977a2afd1d8f056bf22dc7428d246e3.tar.gz
abc-d0af09a20977a2afd1d8f056bf22dc7428d246e3.tar.bz2
abc-d0af09a20977a2afd1d8f056bf22dc7428d246e3.zip
New command &rexwalk.
Diffstat (limited to 'src/base/abci')
-rw-r--r--src/base/abci/abc.c71
1 files changed, 71 insertions, 0 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c
index f9af09e9..c8152d0e 100644
--- a/src/base/abci/abc.c
+++ b/src/base/abci/abc.c
@@ -346,6 +346,7 @@ static int Abc_CommandAbc9PSig ( Abc_Frame_t * pAbc, int argc, cha
static int Abc_CommandAbc9Status ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9MuxProfile ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Rex2Gia ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9RexWalk ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Show ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9SetRegNum ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandAbc9Strash ( Abc_Frame_t * pAbc, int argc, char ** argv );
@@ -964,6 +965,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd( pAbc, "ABC9", "&status", Abc_CommandAbc9Status, 0 );
Cmd_CommandAdd( pAbc, "ABC9", "&profile", Abc_CommandAbc9MuxProfile, 0 );
Cmd_CommandAdd( pAbc, "ABC9", "&rex2gia", Abc_CommandAbc9Rex2Gia, 0 );
+ Cmd_CommandAdd( pAbc, "ABC9", "&rexwalk", Abc_CommandAbc9RexWalk, 0 );
Cmd_CommandAdd( pAbc, "ABC9", "&show", Abc_CommandAbc9Show, 0 );
Cmd_CommandAdd( pAbc, "ABC9", "&setregnum", Abc_CommandAbc9SetRegNum, 0 );
Cmd_CommandAdd( pAbc, "ABC9", "&st", Abc_CommandAbc9Strash, 0 );
@@ -27009,6 +27011,75 @@ usage:
SeeAlso []
***********************************************************************/
+int Abc_CommandAbc9RexWalk( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ extern void Gia_ManAutomWalk( Gia_Man_t * p, int nSteps, int nWalks, int fVerbose );
+ int c, nSteps = 50, nWalks = 5, fVerbose = 0;
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "SRvh" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 'S':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ nSteps = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( nSteps < 0 )
+ goto usage;
+ break;
+ case 'R':
+ if ( globalUtilOptind >= argc )
+ {
+ Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
+ goto usage;
+ }
+ nWalks = atoi(argv[globalUtilOptind]);
+ globalUtilOptind++;
+ if ( nWalks < 0 )
+ goto usage;
+ break;
+ case 'v':
+ fVerbose ^= 1;
+ break;
+ case 'h':
+ goto usage;
+ default:
+ goto usage;
+ }
+ }
+ if ( pAbc->pGia == NULL )
+ {
+ Abc_Print( -1, "Abc_CommandAbc9Show(): There is no AIG.\n" );
+ return 1;
+ }
+ Gia_ManAutomWalk( pAbc->pGia, nSteps, nWalks, fVerbose );
+ return 0;
+
+usage:
+ Abc_Print( -2, "usage: &rexwalk [-SR] [-vh]\n" );
+ Abc_Print( -2, "\t performs simulation of an AIG representing a regular expression\n" );
+ Abc_Print( -2, "\t-S num : the number of steps to take [default = %d]\n", nSteps );
+ Abc_Print( -2, "\t-R num : the number of walks to make [default = %d]\n", nWalks );
+ 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*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
int Abc_CommandAbc9Show( Abc_Frame_t * pAbc, int argc, char ** argv )
{
Aig_Man_t * pMan;