From 5a1184460b918330ab47b7780b3c19bcc4d274c1 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Sun, 27 Oct 2019 21:07:06 +0200 Subject: Experiments with simulation. --- src/base/abci/abc.c | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) (limited to 'src/base') 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 [-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 ) -- cgit v1.2.3