diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2014-03-09 20:49:12 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2014-03-09 20:49:12 -0700 |
commit | ff997b1b6506b8e54a498df17dbad3d90c40dbf6 (patch) | |
tree | ff07811e7d924b58494538aeb91088d607d603a9 /src | |
parent | c97a9c0d18ab0fd3c23c7acff3f7a8ab6aadbf27 (diff) | |
download | abc-ff997b1b6506b8e54a498df17dbad3d90c40dbf6.tar.gz abc-ff997b1b6506b8e54a498df17dbad3d90c40dbf6.tar.bz2 abc-ff997b1b6506b8e54a498df17dbad3d90c40dbf6.zip |
Changes to LUT mappers.
Diffstat (limited to 'src')
-rw-r--r-- | src/base/abci/abc.c | 46 | ||||
-rw-r--r-- | src/map/if/if.h | 1 | ||||
-rw-r--r-- | src/map/if/ifDsd.c | 7 |
3 files changed, 54 insertions, 0 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index 4a414c55..b4910092 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -238,6 +238,7 @@ static int Abc_CommandDsdFree ( Abc_Frame_t * pAbc, int argc, cha static int Abc_CommandDsdPs ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandDsdTune ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandDsdMerge ( Abc_Frame_t * pAbc, int argc, char ** argv ); +static int Abc_CommandDsdClean ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandScut ( Abc_Frame_t * pAbc, int argc, char ** argv ); static int Abc_CommandInit ( Abc_Frame_t * pAbc, int argc, char ** argv ); @@ -799,6 +800,7 @@ void Abc_Init( Abc_Frame_t * pAbc ) Cmd_CommandAdd( pAbc, "DSD manager", "dsd_ps", Abc_CommandDsdPs, 0 ); Cmd_CommandAdd( pAbc, "DSD manager", "dsd_tune", Abc_CommandDsdTune, 0 ); Cmd_CommandAdd( pAbc, "DSD manager", "dsd_merge", Abc_CommandDsdMerge, 0 ); + Cmd_CommandAdd( pAbc, "DSD manager", "dsd_clean", Abc_CommandDsdClean, 0 ); // Cmd_CommandAdd( pAbc, "Sequential", "scut", Abc_CommandScut, 0 ); Cmd_CommandAdd( pAbc, "Sequential", "init", Abc_CommandInit, 1 ); @@ -15737,6 +15739,50 @@ usage: return 1; } +/**Function************************************************************* + + Synopsis [] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +int Abc_CommandDsdClean( Abc_Frame_t * pAbc, int argc, char ** argv ) +{ + int c, fVerbose = 0; + 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 ( !Abc_FrameReadManDsd() ) + { + Abc_Print( 1, "The DSD manager is not started.\n" ); + return 0; + } + If_DsdManClean( (If_DsdMan_t *)Abc_FrameReadManDsd(), fVerbose ); + return 0; + +usage: + Abc_Print( -2, "usage: dsd_clean [-K num] [-vh]\n" ); + Abc_Print( -2, "\t cleans the occurrence counters\n" ); + Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" ); + Abc_Print( -2, "\t-h : print the command usage\n"); + return 1; +} + /**Function************************************************************* diff --git a/src/map/if/if.h b/src/map/if/if.h index 76241fc1..20d5b643 100644 --- a/src/map/if/if.h +++ b/src/map/if/if.h @@ -524,6 +524,7 @@ extern void If_DsdManFree( If_DsdMan_t * p, int fVerbose ); extern void If_DsdManSave( If_DsdMan_t * p, char * pFileName ); extern If_DsdMan_t * If_DsdManLoad( char * pFileName ); extern void If_DsdManMerge( If_DsdMan_t * p, If_DsdMan_t * pNew ); +extern void If_DsdManClean( If_DsdMan_t * p, int fVerbose ); extern int If_DsdManCompute( If_DsdMan_t * p, word * pTruth, int nLeaves, unsigned char * pPerm, char * pLutStruct ); extern char * If_DsdManFileName( If_DsdMan_t * p ); extern int If_DsdManVarNum( If_DsdMan_t * p ); diff --git a/src/map/if/ifDsd.c b/src/map/if/ifDsd.c index 275b9b8c..7f507ee9 100644 --- a/src/map/if/ifDsd.c +++ b/src/map/if/ifDsd.c @@ -860,6 +860,13 @@ void If_DsdManMerge( If_DsdMan_t * p, If_DsdMan_t * pNew ) assert( Vec_IntSize(vMap) == Vec_PtrSize(pNew->vObjs) ); Vec_IntFree( vMap ); } +void If_DsdManClean( If_DsdMan_t * p, int fVerbose ) +{ + If_DsdObj_t * pObj; + int i; + If_DsdVecForEachObj( p->vObjs, pObj, i ) + pObj->Count = 0; +} /**Function************************************************************* |