Commit 2fbb4b18 by Alan Mishchenko

Improved DSD.

parent db7852bb
...@@ -142,6 +142,22 @@ static inline void Abc_TtAnd( word * pOut, word * pIn1, word * pIn2, int nWords, ...@@ -142,6 +142,22 @@ static inline void Abc_TtAnd( word * pOut, word * pIn1, word * pIn2, int nWords,
for ( w = 0; w < nWords; w++ ) for ( w = 0; w < nWords; w++ )
pOut[w] = pIn1[w] & pIn2[w]; pOut[w] = pIn1[w] & pIn2[w];
} }
static inline void Abc_TtXor( word * pOut, word * pIn1, word * pIn2, int nWords, int fCompl )
{
int w;
if ( fCompl )
for ( w = 0; w < nWords; w++ )
pOut[w] = pIn1[w] ^ ~pIn2[w];
else
for ( w = 0; w < nWords; w++ )
pOut[w] = pIn1[w] ^ pIn2[w];
}
static inline void Abc_TtMux( word * pOut, word * pCtrl, word * pIn1, word * pIn0, int nWords )
{
int w;
for ( w = 0; w < nWords; w++ )
pOut[w] = (pCtrl[w] & pIn1[w]) | (~pCtrl[w] & pIn0[w]);
}
static inline int Abc_TtEqual( word * pIn1, word * pIn2, int nWords ) static inline int Abc_TtEqual( word * pIn1, word * pIn2, int nWords )
{ {
int w; int w;
...@@ -182,6 +198,42 @@ static inline int Abc_TtIsConst1( word * pIn1, int nWords ) ...@@ -182,6 +198,42 @@ static inline int Abc_TtIsConst1( word * pIn1, int nWords )
return 0; return 0;
return 1; return 1;
} }
static inline void Abc_TtConst0( word * pIn1, int nWords )
{
int w;
for ( w = 0; w < nWords; w++ )
pIn1[w] = 0;
}
static inline void Abc_TtConst1( word * pIn1, int nWords )
{
int w;
for ( w = 0; w < nWords; w++ )
pIn1[w] = ~(word)0;
}
/**Function*************************************************************
Synopsis [Compute elementary truth tables.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
static inline void Abc_TtElemInit( word ** pTtElems, int nVars )
{
int i, k, nWords = Abc_TtWordNum( nVars );
for ( i = 0; i < nVars; i++ )
if ( i < 6 )
for ( k = 0; k < nWords; k++ )
pTtElems[i][k] = s_Truths6[i];
else
for ( k = 0; k < nWords; k++ )
pTtElems[i][k] = (k & (1 << (i-6))) ? ~(word)0 : 0;
}
/**Function************************************************************* /**Function*************************************************************
......
...@@ -55,7 +55,10 @@ ABC_NAMESPACE_HEADER_START ...@@ -55,7 +55,10 @@ ABC_NAMESPACE_HEADER_START
/*=== dauCanon.c ==========================================================*/ /*=== dauCanon.c ==========================================================*/
extern unsigned Abc_TtCanonicize( word * pTruth, int nVars, char * pCanonPerm ); extern unsigned Abc_TtCanonicize( word * pTruth, int nVars, char * pCanonPerm );
/*=== dauDsd.c ==========================================================*/
extern char * Dau_DsdDecompose( word * pTruth, int nVarsInit, int * pnSizeNonDec ); extern char * Dau_DsdDecompose( word * pTruth, int nVarsInit, int * pnSizeNonDec );
extern word * Dau_DsdToTruth( char * p, int nVars );
ABC_NAMESPACE_HEADER_END ABC_NAMESPACE_HEADER_END
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment