summaryrefslogtreecommitdiffstats
path: root/src/base
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2019-10-27 21:07:06 +0200
committerAlan Mishchenko <alanmi@berkeley.edu>2019-10-27 21:07:06 +0200
commit5a1184460b918330ab47b7780b3c19bcc4d274c1 (patch)
tree229855ebb87e924bbd1d8c9ef00c8e70b72f5f8f /src/base
parentf9309ce949cbfc432af1ee543fab15fe1ac99d2e (diff)
downloadabc-5a1184460b918330ab47b7780b3c19bcc4d274c1.tar.gz
abc-5a1184460b918330ab47b7780b3c19bcc4d274c1.tar.bz2
abc-5a1184460b918330ab47b7780b3c19bcc4d274c1.zip
Experiments with simulation.
Diffstat (limited to 'src/base')
-rw-r--r--src/base/abci/abc.c50
1 files changed, 49 insertions, 1 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c
index ec234fae..8d8f1ba4 100644
--- a/src/base/abci/abc.c
+++ b/src/base/abci/abc.c
@@ -137,6 +137,7 @@ static int Abc_CommandTestNpn ( Abc_Frame_t * pAbc, int argc, cha
static int Abc_CommandTestRPO ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandRunEco ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandRunGen ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandRunSim ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandRewrite ( Abc_Frame_t * pAbc, int argc, char ** argv );
static int Abc_CommandRefactor ( Abc_Frame_t * pAbc, int argc, char ** argv );
@@ -839,6 +840,7 @@ void Abc_Init( Abc_Frame_t * pAbc )
Cmd_CommandAdd( pAbc, "LogiCS", "testrpo", Abc_CommandTestRPO, 0 );
Cmd_CommandAdd( pAbc, "Synthesis", "runeco", Abc_CommandRunEco, 0 );
Cmd_CommandAdd( pAbc, "Synthesis", "rungen", Abc_CommandRunGen, 0 );
+ Cmd_CommandAdd( pAbc, "Synthesis", "runsim", Abc_CommandRunSim, 0 );
Cmd_CommandAdd( pAbc, "Synthesis", "rewrite", Abc_CommandRewrite, 1 );
Cmd_CommandAdd( pAbc, "Synthesis", "refactor", Abc_CommandRefactor, 1 );
@@ -7017,6 +7019,52 @@ usage:
return 1;
}
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_CommandRunSim( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+ extern void Gia_Sim4Try( char * pFileName0, char * pFileName1, int fVerbose );
+ int c, fVerbose = 1;
+ Extra_UtilGetoptReset();
+ while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
+ {
+ switch ( c )
+ {
+ case 'v':
+ fVerbose ^= 1;
+ break;
+ case 'h':
+ goto usage;
+ default:
+ goto usage;
+ }
+ }
+ if ( argc - globalUtilOptind != 2 )
+ {
+ Abc_Print( 1, "Expecting two file names on the command line.\n" );
+ goto usage;
+ }
+ Gia_Sim4Try( argv[globalUtilOptind+0], argv[globalUtilOptind+1], fVerbose );
+ return 0;
+
+usage:
+ Abc_Print( -2, "usage: runsim <file1> <file2> [-vh]\n" );
+ Abc_Print( -2, "\t experimental command\n" );
+ Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+ Abc_Print( -2, "\t-h : print the command usage\n");
+ return 1;
+}
+
+
/**Function*************************************************************
@@ -30398,7 +30446,7 @@ int Abc_CommandAbc9Write( Abc_Frame_t * pAbc, int argc, char ** argv )
Gia_ManStop( pGia );
}
else if ( fVerilog )
- Gia_ManDumpVerilog( pAbc->pGia, pFileName );
+ Gia_ManDumpVerilog( pAbc->pGia, pFileName, NULL );
else if ( fMiniAig )
Gia_ManWriteMiniAig( pAbc->pGia, pFileName );
else if ( fMiniLut )