From 6a49d1f4c61b9e4a9f135ea46f6c64e90aba0e6c Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Fri, 3 May 2013 15:45:50 -0700 Subject: Reading/writing MiniAIG and several minor changes. --- src/base/abci/abc.c | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'src/base') diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index e533e1ad..22545a3e 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -23716,17 +23716,21 @@ int Abc_CommandAbc9Read( Abc_Frame_t * pAbc, int argc, char ** argv ) FILE * pFile; char ** pArgvNew; char * FileName, * pTemp; - int nArgcNew; - int c, fVerbose = 0; + int c, nArgcNew; + int fUseMini = 0; + int fVerbose = 0; int fSkipStrash = 0; Extra_UtilGetoptReset(); - while ( ( c = Extra_UtilGetopt( argc, argv, "svh" ) ) != EOF ) + while ( ( c = Extra_UtilGetopt( argc, argv, "smvh" ) ) != EOF ) { switch ( c ) { case 's': fSkipStrash ^= 1; break; + case 'm': + fUseMini ^= 1; + break; case 'v': fVerbose ^= 1; break; @@ -23758,14 +23762,18 @@ int Abc_CommandAbc9Read( Abc_Frame_t * pAbc, int argc, char ** argv ) } fclose( pFile ); - pAig = Gia_AigerRead( FileName, fSkipStrash, 0 ); + if ( fUseMini ) + pAig = Gia_ManReadMiniAig( FileName ); + else + pAig = Gia_AigerRead( FileName, fSkipStrash, 0 ); Abc_FrameUpdateGia( pAbc, pAig ); return 0; usage: - Abc_Print( -2, "usage: &r [-svh] \n" ); + Abc_Print( -2, "usage: &r [-smvh] \n" ); Abc_Print( -2, "\t reads the current AIG from the AIGER file\n" ); Abc_Print( -2, "\t-s : toggles structural hashing while reading [default = %s]\n", !fSkipStrash? "yes": "no" ); + Abc_Print( -2, "\t-m : toggles reading MiniAIG rather than AIGER file [default = %s]\n", fUseMini? "yes": "no" ); Abc_Print( -2, "\t-v : toggles additional verbose output [default = %s]\n", fVerbose? "yes": "no" ); Abc_Print( -2, "\t-h : print the command usage\n"); Abc_Print( -2, "\t : the file name\n"); @@ -24192,15 +24200,19 @@ int Abc_CommandAbc9Write( Abc_Frame_t * pAbc, int argc, char ** argv ) char ** pArgvNew; int c, nArgcNew; int fUnique = 0; + int fMiniAig = 0; int fVerbose = 0; Extra_UtilGetoptReset(); - while ( ( c = Extra_UtilGetopt( argc, argv, "uvh" ) ) != EOF ) + while ( ( c = Extra_UtilGetopt( argc, argv, "umvh" ) ) != EOF ) { switch ( c ) { case 'u': fUnique ^= 1; break; + case 'm': + fMiniAig ^= 1; + break; case 'v': fVerbose ^= 1; break; @@ -24229,14 +24241,17 @@ int Abc_CommandAbc9Write( Abc_Frame_t * pAbc, int argc, char ** argv ) Gia_AigerWriteSimple( pGia, pFileName ); Gia_ManStop( pGia ); } + else if ( fMiniAig ) + Gia_ManWriteMiniAig( pAbc->pGia, pFileName ); else Gia_AigerWrite( pAbc->pGia, pFileName, 0, 0 ); return 0; usage: - Abc_Print( -2, "usage: &w [-uvh] \n" ); + Abc_Print( -2, "usage: &w [-umvh] \n" ); Abc_Print( -2, "\t writes the current AIG into the AIGER file\n" ); Abc_Print( -2, "\t-u : toggle writing canonical AIG structure [default = %s]\n", fUnique? "yes" : "no" ); + Abc_Print( -2, "\t-m : toggle writing MiniAIG rather than AIGER [default = %s]\n", fMiniAig? "yes" : "no" ); Abc_Print( -2, "\t-v : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" ); Abc_Print( -2, "\t-h : print the command usage\n"); Abc_Print( -2, "\t : the file name\n"); -- cgit v1.2.3