diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2021-03-28 15:40:27 -1000 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2021-03-28 15:40:27 -1000 |
commit | 9145a5c20d5fe85523364d7fe2727b8d83c90aaa (patch) | |
tree | 6cd8e6bd0abc6332d67e144a9790cb5bb8ff2cac /src/base/abci/abc.c | |
parent | 18088bd7dcf3de03cc4f9a439e6b41d04e2f8413 (diff) | |
download | abc-9145a5c20d5fe85523364d7fe2727b8d83c90aaa.tar.gz abc-9145a5c20d5fe85523364d7fe2727b8d83c90aaa.tar.bz2 abc-9145a5c20d5fe85523364d7fe2727b8d83c90aaa.zip |
An option to extend the number of primary inputs.
Diffstat (limited to 'src/base/abci/abc.c')
-rw-r--r-- | src/base/abci/abc.c | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index 35281f77..df7ae5ab 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -32068,13 +32068,14 @@ int Abc_CommandAbc9Strash( Abc_Frame_t * pAbc, int argc, char ** argv ) extern Gia_Man_t * Gia_ManDupMuxRestructure( Gia_Man_t * p ); Gia_Man_t * pTemp; int c, Limit = 2; + int Multi = 0; int fAddStrash = 0; int fCollapse = 0; int fAddMuxes = 0; int fStrMuxes = 0; int fRehashMap = 0; Extra_UtilGetoptReset(); - while ( ( c = Extra_UtilGetopt( argc, argv, "Lacmrsh" ) ) != EOF ) + while ( ( c = Extra_UtilGetopt( argc, argv, "LMacmrsh" ) ) != EOF ) { switch ( c ) { @@ -32089,6 +32090,17 @@ int Abc_CommandAbc9Strash( Abc_Frame_t * pAbc, int argc, char ** argv ) if ( Limit < 0 ) goto usage; break; + case 'M': + if ( globalUtilOptind >= argc ) + { + Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" ); + goto usage; + } + Multi = atoi(argv[globalUtilOptind]); + globalUtilOptind++; + if ( Multi <= 0 ) + goto usage; + break; case 'a': fAddStrash ^= 1; break; @@ -32115,6 +32127,13 @@ int Abc_CommandAbc9Strash( Abc_Frame_t * pAbc, int argc, char ** argv ) Abc_Print( -1, "Abc_CommandAbc9Strash(): There is no AIG.\n" ); return 1; } + if ( Multi > 0 ) + { + extern Gia_Man_t * Gia_ManDupAddPis( Gia_Man_t * p, int nMulti ); + pTemp = Gia_ManDupAddPis( pAbc->pGia, Multi ); + Abc_FrameUpdateGia( pAbc, pTemp ); + return 0; + } if ( fStrMuxes ) { if ( Gia_ManHasMapping(pAbc->pGia) ) @@ -32182,13 +32201,14 @@ int Abc_CommandAbc9Strash( Abc_Frame_t * pAbc, int argc, char ** argv ) return 0; usage: - Abc_Print( -2, "usage: &st [-L num] [-acmrsh]\n" ); + Abc_Print( -2, "usage: &st [-LM num] [-acmrsh]\n" ); Abc_Print( -2, "\t performs structural hashing\n" ); Abc_Print( -2, "\t-a : toggle additional hashing [default = %s]\n", fAddStrash? "yes": "no" ); Abc_Print( -2, "\t-c : toggle collapsing hierarchical AIG [default = %s]\n", fCollapse? "yes": "no" ); Abc_Print( -2, "\t-m : toggle converting to larger gates [default = %s]\n", fAddMuxes? "yes": "no" ); Abc_Print( -2, "\t-L num : create MUX when sum of refs does not exceed this limit [default = %d]\n", Limit ); Abc_Print( -2, "\t (use L = 1 to create AIG with XORs but without MUXes)\n" ); + Abc_Print( -2, "\t-M num : create an AIG with additional primary inputs [default = %d]\n", Multi ); Abc_Print( -2, "\t-r : toggle rehashing AIG while preserving mapping [default = %s]\n", fRehashMap? "yes": "no" ); Abc_Print( -2, "\t-s : toggle using MUX restructuring [default = %s]\n", fStrMuxes? "yes": "no" ); Abc_Print( -2, "\t-h : print the command usage\n"); @@ -33048,6 +33068,11 @@ int Abc_CommandAbc9Iwls21Test( Abc_Frame_t * pAbc, int argc, char ** argv ) Abc_Print( -1, "Abc_CommandAbc9Iwls21Test(): This command works only for combinational AIGs.\n" ); return 0; } + if ( Gia_ManCoNum(pAig) != 10 ) + { + Abc_Print( -1, "Abc_CommandAbc9Iwls21Test(): Expecting an AIG with 10 outputs.\n" ); + return 0; + } Gia_ManTestWordFile( pAig, pArgvNew[1], pDumpFile, fVerbose ); Gia_ManStop( pAig ); return 0; @@ -33057,6 +33082,11 @@ int Abc_CommandAbc9Iwls21Test( Abc_Frame_t * pAbc, int argc, char ** argv ) Abc_Print( -1, "Abc_CommandAbc9Iwls21Test(): There is no AIG.\n" ); return 1; } + if ( Gia_ManCoNum(pAbc->pGia) != 10 ) + { + Abc_Print( -1, "Abc_CommandAbc9Iwls21Test(): Expecting an AIG with 10 outputs.\n" ); + return 0; + } if ( nArgcNew != 1 ) { Abc_Print( -1, "Abc_CommandAbc9Iwls21Test(): Expecting data file name on the command line.\n" ); |