summaryrefslogtreecommitdiffstats
path: root/src/map
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2015-10-25 20:23:44 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2015-10-25 20:23:44 -0700
commit9519341aaf8b7448cf946687e1a1fad504b0034d (patch)
treeface1ba8c1786d21d1e674b71d22ea4b04359c3e /src/map
parent9d67bbe583299c1e1586f6731abc196f15108471 (diff)
downloadabc-9519341aaf8b7448cf946687e1a1fad504b0034d.tar.gz
abc-9519341aaf8b7448cf946687e1a1fad504b0034d.tar.bz2
abc-9519341aaf8b7448cf946687e1a1fad504b0034d.zip
Extending library handling to 8 inputs.
Diffstat (limited to 'src/map')
-rw-r--r--src/map/mio/exp.h59
-rw-r--r--src/map/mio/mio.h3
-rw-r--r--src/map/mpm/mpmMan.c2
3 files changed, 62 insertions, 2 deletions
diff --git a/src/map/mio/exp.h b/src/map/mio/exp.h
index 1e14b1bd..962e218a 100644
--- a/src/map/mio/exp.h
+++ b/src/map/mio/exp.h
@@ -202,6 +202,65 @@ static inline word Exp_Truth6( int nVars, Vec_Int_t * p, word * puFanins )
ABC_FREE( puNodes );
return Res;
}
+static inline void Exp_Truth8( int nVars, Vec_Int_t * p, word ** puFanins, word * puRes )
+{
+ word Truth8[8][4] = {
+ { ABC_CONST(0xAAAAAAAAAAAAAAAA),ABC_CONST(0xAAAAAAAAAAAAAAAA),ABC_CONST(0xAAAAAAAAAAAAAAAA),ABC_CONST(0xAAAAAAAAAAAAAAAA) },
+ { ABC_CONST(0xCCCCCCCCCCCCCCCC),ABC_CONST(0xCCCCCCCCCCCCCCCC),ABC_CONST(0xCCCCCCCCCCCCCCCC),ABC_CONST(0xCCCCCCCCCCCCCCCC) },
+ { ABC_CONST(0xF0F0F0F0F0F0F0F0),ABC_CONST(0xF0F0F0F0F0F0F0F0),ABC_CONST(0xF0F0F0F0F0F0F0F0),ABC_CONST(0xF0F0F0F0F0F0F0F0) },
+ { ABC_CONST(0xFF00FF00FF00FF00),ABC_CONST(0xFF00FF00FF00FF00),ABC_CONST(0xFF00FF00FF00FF00),ABC_CONST(0xFF00FF00FF00FF00) },
+ { ABC_CONST(0xFFFF0000FFFF0000),ABC_CONST(0xFFFF0000FFFF0000),ABC_CONST(0xFFFF0000FFFF0000),ABC_CONST(0xFFFF0000FFFF0000) },
+ { ABC_CONST(0xFFFFFFFF00000000),ABC_CONST(0xFFFFFFFF00000000),ABC_CONST(0xFFFFFFFF00000000),ABC_CONST(0xFFFFFFFF00000000) },
+ { ABC_CONST(0x0000000000000000),ABC_CONST(0xFFFFFFFFFFFFFFFF),ABC_CONST(0x0000000000000000),ABC_CONST(0xFFFFFFFFFFFFFFFF) },
+ { ABC_CONST(0x0000000000000000),ABC_CONST(0x0000000000000000),ABC_CONST(0xFFFFFFFFFFFFFFFF),ABC_CONST(0xFFFFFFFFFFFFFFFF) }
+ };
+ word * puFaninsInt[8], * pStore, * pThis = NULL;
+ int i, k, iRoot = Vec_IntEntryLast(p);
+ if ( puFanins == NULL )
+ {
+ puFanins = puFaninsInt;
+ for ( k = 0; k < 8; k++ )
+ puFanins[k] = Truth8[k];
+ }
+ if ( Exp_NodeNum(p) == 0 )
+ {
+ assert( iRoot < 2 * nVars );
+ if ( iRoot == EXP_CONST0 || iRoot == EXP_CONST1 )
+ for ( k = 0; k < 4; k++ )
+ puRes[k] = iRoot == EXP_CONST0 ? 0 : ~(word)0;
+ else
+ for ( k = 0; k < 4; k++ )
+ puRes[k] = Abc_LitIsCompl(iRoot) ? ~puFanins[Abc_Lit2Var(iRoot)][k] : puFanins[Abc_Lit2Var(iRoot)][k];
+ return;
+ }
+ pStore = ABC_CALLOC( word, 4 * Exp_NodeNum(p) );
+ for ( i = 0; i < Exp_NodeNum(p); i++ )
+ {
+ int iVar0 = Abc_Lit2Var( Vec_IntEntry(p, 2*i+0) );
+ int iVar1 = Abc_Lit2Var( Vec_IntEntry(p, 2*i+1) );
+ int fCompl0 = Abc_LitIsCompl( Vec_IntEntry(p, 2*i+0) );
+ int fCompl1 = Abc_LitIsCompl( Vec_IntEntry(p, 2*i+1) );
+ word * pIn0 = iVar0 < nVars ? puFanins[iVar0] : pStore + 4 * (iVar0 - nVars);
+ word * pIn1 = iVar1 < nVars ? puFanins[iVar1] : pStore + 4 * (iVar1 - nVars);
+ pThis = pStore + 4 * i;
+ if ( fCompl0 && fCompl1 )
+ for ( k = 0; k < 4; k++ )
+ pThis[k] = ~pIn0[k] & ~pIn1[k];
+ else if ( fCompl0 && !fCompl1 )
+ for ( k = 0; k < 4; k++ )
+ pThis[k] = ~pIn0[k] & pIn1[k];
+ else if ( !fCompl0 && fCompl1 )
+ for ( k = 0; k < 4; k++ )
+ pThis[k] = pIn0[k] & ~pIn1[k];
+ else //if ( !fCompl0 && !fCompl1 )
+ for ( k = 0; k < 4; k++ )
+ pThis[k] = pIn0[k] & pIn1[k];
+ }
+ assert( Abc_Lit2Var(iRoot) - nVars == i - 1 );
+ for ( k = 0; k < 4; k++ )
+ puRes[k] = Abc_LitIsCompl(iRoot) ? ~pThis[k] : pThis[k];
+ ABC_FREE( pStore );
+}
static inline void Exp_TruthLit( int nVars, int Lit, word ** puFanins, word ** puNodes, word * pRes, int nWords )
{
int w;
diff --git a/src/map/mio/mio.h b/src/map/mio/mio.h
index a391e4a2..7db93dd8 100644
--- a/src/map/mio/mio.h
+++ b/src/map/mio/mio.h
@@ -59,7 +59,8 @@ struct Mio_Cell2_t_
{
char * pName; // name
Vec_Int_t * vExpr; // expression
- unsigned Id : 28; // gate ID
+ unsigned Id : 26; // gate ID
+ unsigned Type : 2; // gate type
unsigned nFanins : 4; // gate fanins
word Area; // area
word uTruth; // truth table
diff --git a/src/map/mpm/mpmMan.c b/src/map/mpm/mpmMan.c
index ae3bfc32..d2777b57 100644
--- a/src/map/mpm/mpmMan.c
+++ b/src/map/mpm/mpmMan.c
@@ -83,7 +83,7 @@ Mpm_Man_t * Mpm_ManStart( Mig_Man_t * pMig, Mpm_Par_t * pPars )
p->vTtMem = Vec_MemAlloc( p->nTruWords, 12 ); // 32 KB/page for 6-var functions
Vec_MemHashAlloc( p->vTtMem, 10000 );
p->funcCst0 = Vec_MemHashInsert( p->vTtMem, p->Truth );
- Abc_TtUnit( p->Truth, p->nTruWords );
+ Abc_TtUnit( p->Truth, p->nTruWords, 0 );
p->funcVar0 = Vec_MemHashInsert( p->vTtMem, p->Truth );
}
else if ( p->pPars->fUseDsd )