diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2016-02-13 15:15:01 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2016-02-13 15:15:01 -0800 |
commit | 390a145f0a293ae37d969d2d8ce5086a31d78ab5 (patch) | |
tree | 465ef179e4eaba5b143bc44016fb9531fde37fc2 /src/base/abci | |
parent | e0616441b3f42131bc2f9cf307ef4e44b29781a7 (diff) | |
download | abc-390a145f0a293ae37d969d2d8ce5086a31d78ab5.tar.gz abc-390a145f0a293ae37d969d2d8ce5086a31d78ab5.tar.bz2 abc-390a145f0a293ae37d969d2d8ce5086a31d78ab5.zip |
Adding support for a different bit-blasting of a multiplier and squarer.
Diffstat (limited to 'src/base/abci')
-rw-r--r-- | src/base/abci/abc.c | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index 92d6557d..afd2bcfe 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -418,6 +418,7 @@ static int Abc_CommandAbc9Mf ( Abc_Frame_t * pAbc, int argc, cha static int Abc_CommandAbc9Nf ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9Of ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9Pack ( Abc_Frame_t * pAbc, int argc, char ** argv ); +static int Abc_CommandAbc9SatLut ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9Unmap ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9Struct ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandAbc9Trace ( Abc_Frame_t * pAbc, int argc, char ** argv ); @@ -1042,6 +1043,7 @@ void Abc_Init( Abc_Frame_t * pAbc ) Cmd_CommandAdd( pAbc, "ABC9", "&nf", Abc_CommandAbc9Nf, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&of", Abc_CommandAbc9Of, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&pack", Abc_CommandAbc9Pack, 0 ); + Cmd_CommandAdd( pAbc, "ABC9", "&satlut", Abc_CommandAbc9SatLut, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&unmap", Abc_CommandAbc9Unmap, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&struct", Abc_CommandAbc9Struct, 0 ); Cmd_CommandAdd( pAbc, "ABC9", "&trace", Abc_CommandAbc9Trace, 0 ); @@ -34817,6 +34819,83 @@ usage: SeeAlso [] ***********************************************************************/ +int Abc_CommandAbc9SatLut( Abc_Frame_t * pAbc, int argc, char ** argv ) +{ + extern void Gia_ManLutSat( Gia_Man_t * p, int nNumber, int nConfl, int fVerbose ); + int c, nNumber = 32, nConfl = 0, fVerbose = 0; + Extra_UtilGetoptReset(); + while ( ( c = Extra_UtilGetopt( argc, argv, "NCvh" ) ) != EOF ) + { + switch ( c ) + { + case 'N': + if ( globalUtilOptind >= argc ) + { + Abc_Print( -1, "Command line switch \"-N\" should be followed by a positive integer.\n" ); + goto usage; + } + nNumber = atoi(argv[globalUtilOptind]); + globalUtilOptind++; + if ( nNumber < 2 ) + { + Abc_Print( -1, "Illigal number of AIG nodes.\n" ); + goto usage; + } + break; + case 'C': + if ( globalUtilOptind >= argc ) + { + Abc_Print( -1, "Command line switch \"-C\" should be followed by a positive integer.\n" ); + goto usage; + } + nConfl = atoi(argv[globalUtilOptind]); + globalUtilOptind++; + break; + case 'v': + fVerbose ^= 1; + break; + case 'h': + default: + goto usage; + } + } + + if ( pAbc->pGia == NULL ) + { + Abc_Print( -1, "Empty GIA network.\n" ); + return 1; + } + if ( !Gia_ManHasMapping(pAbc->pGia) ) + { + Abc_Print( -1, "Current AIG has no mapping. Run \"&if\".\n" ); + return 1; + } + if ( Gia_ManLutSizeMax(pAbc->pGia) > 4 ) + Abc_Print( 0, "Current AIG has mapping into %d-LUTs.\n", Gia_ManLutSizeMax(pAbc->pGia) ); + Gia_ManLutSat( pAbc->pGia, nNumber, nConfl, fVerbose ); + return 0; + +usage: + Abc_Print( -2, "usage: &satlut [-NC num] [-vh]\n" ); + Abc_Print( -2, "\t performs SAT-based remapping of the 4-LUT network\n" ); + Abc_Print( -2, "\t-N num : the limit on the number of AIG nodes in the window [default = %d]\n", nNumber ); + Abc_Print( -2, "\t-C num : the limit on the number of conflicts [default = %d]\n", nNumber ); + Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" ); + Abc_Print( -2, "\t-h : prints the command usage\n"); + return 1; +} + +/**Function************************************************************* + + Synopsis [] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ int Abc_CommandAbc9Unmap( Abc_Frame_t * pAbc, int argc, char ** argv ) { extern void Gia_ManTestStruct( Gia_Man_t * p ); |