diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2014-04-26 21:05:02 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2014-04-26 21:05:02 -0700 |
commit | 6e465e57fe8fb098b8a0fc6286d45a444655775f (patch) | |
tree | 3dea9f7cbc53cdeae763604dbc19a8bcc3a216a4 /src/misc/extra | |
parent | 37703eaaa867a0c108ebc0505e4d499084bb65d8 (diff) | |
download | abc-6e465e57fe8fb098b8a0fc6286d45a444655775f.tar.gz abc-6e465e57fe8fb098b8a0fc6286d45a444655775f.tar.bz2 abc-6e465e57fe8fb098b8a0fc6286d45a444655775f.zip |
Exploration of functions.
Diffstat (limited to 'src/misc/extra')
-rw-r--r-- | src/misc/extra/extraUtilEnum.c | 67 |
1 files changed, 65 insertions, 2 deletions
diff --git a/src/misc/extra/extraUtilEnum.c b/src/misc/extra/extraUtilEnum.c index e96e5445..f4ce65cd 100644 --- a/src/misc/extra/extraUtilEnum.c +++ b/src/misc/extra/extraUtilEnum.c @@ -48,7 +48,7 @@ ABC_NAMESPACE_IMPL_START ***********************************************************************/ void Abc_GetFirst( int * pnVars, int * pnMints, int * pnFuncs, unsigned * pVars, unsigned * pMints, unsigned * pFuncs ) { - int nVars = 8; + int nVars = 8; int nMints = 16; int nFuncs = 8; char * pMintStrs[16] = { @@ -111,7 +111,7 @@ void Abc_GetFirst( int * pnVars, int * pnMints, int * pnFuncs, unsigned * pVars, ***********************************************************************/ void Abc_GetSecond( int * pnVars, int * pnMints, int * pnFuncs, unsigned * pVars, unsigned * pMints, unsigned * pFuncs ) { - int nVars = 10; + int nVars = 10; int nMints = 32; int nFuncs = 7; char * pMintStrs[32] = { @@ -192,6 +192,68 @@ void Abc_GetSecond( int * pnVars, int * pnMints, int * pnFuncs, unsigned * pVars SeeAlso [] ***********************************************************************/ +void Abc_GetThird( int * pnVars, int * pnMints, int * pnFuncs, unsigned * pVars, unsigned * pMints, unsigned * pFuncs ) +{ + int nVars = 8; + int nMints = 16; + int nFuncs = 7; + char * pMintStrs[16] = { + "1---1---", + "1----1--", + "1-----1-", + "1------1", + + "-1--1---", + "-1---1--", + "-1----1-", + "-1-----1", + + "--1-1---", + "--1--1--", + "--1---1-", + "--1----1", + + "---11---", + "---1-1--", + "---1--1-", + "---1---1" + }; + char * pFuncStrs[7] = { + "1111111011001000", + "0000000100110111", + "1000000100100100", + "0100100000010010", + "0010010010000001", + "0001001001001000", + "1111111111111111" + }; + int i, k; + *pnVars = nVars; + *pnMints = nMints; + *pnFuncs = nFuncs; + // extract mints + for ( i = 0; i < nMints; i++ ) + for ( k = 0; k < nVars; k++ ) + if ( pMintStrs[i][k] == '1' ) + pMints[i] |= (1 << k), pVars[k] |= (1 << i); + // extract funcs + for ( i = 0; i < nFuncs; i++ ) + for ( k = 0; k < nMints; k++ ) + if ( pFuncStrs[i][k] == '1' ) + pFuncs[i] |= (1 << k); +} + +/**Function************************************************************* + + Synopsis [] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ void Abc_EnumPrint_rec( Vec_Int_t * vGates, int i, int nVars ) { int Fan0 = Vec_IntEntry(vGates, 2*i); @@ -270,6 +332,7 @@ void Abc_EnumerateFunctions( int nDecMax ) // extract data // Abc_GetFirst( &nVars, &nMints, &nFuncs, pVars, pMints, pFuncs ); Abc_GetSecond( &nVars, &nMints, &nFuncs, pVars, pMints, pFuncs ); +// Abc_GetThird( &nVars, &nMints, &nFuncs, pVars, pMints, pFuncs ); // create hash table assert( nMints == 16 || nMints == 32 ); |