Commit 009cc92e by Alan Mishchenko

Buf fixes and minor changes to the &if mapper.

parent a495163f
......@@ -1760,6 +1760,31 @@ static inline word Abc_Tt6Cofactor1( word t, int iVar )
assert( iVar >= 0 && iVar < 6 );
return (t & Truth6[iVar]) | ((t & Truth6[iVar]) >> (1<<iVar));
}
int If_CluCheckDecInAny( word t, int nVars )
{
int v, u, Cof2[2], Cof4[4];
for ( v = 0; v < nVars; v++ )
{
Cof2[0] = Abc_Tt6Cofactor0( t, v );
Cof2[1] = Abc_Tt6Cofactor1( t, v );
for ( u = v+1; u < nVars; u++ )
{
Cof4[0] = Abc_Tt6Cofactor0( Cof2[0], u );
Cof4[1] = Abc_Tt6Cofactor1( Cof2[0], u );
Cof4[2] = Abc_Tt6Cofactor0( Cof2[1], u );
Cof4[3] = Abc_Tt6Cofactor1( Cof2[1], u );
if ( Cof4[0] == Cof4[1] && Cof4[0] == Cof4[2] )
return 1;
if ( Cof4[0] == Cof4[2] && Cof4[0] == Cof4[3] )
return 1;
if ( Cof4[0] == Cof4[1] && Cof4[0] == Cof4[3] )
return 1;
if ( Cof4[1] == Cof4[2] && Cof4[1] == Cof4[3] )
return 1;
}
}
return 0;
}
int If_CluCheckDecIn( word t, int nVars )
{
int v, u, Cof2[2], Cof4[4];
......
......@@ -276,24 +276,24 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
// skip 5-input cuts, which cannot be decomposed
if ( (p->pPars->fEnableCheck75 || p->pPars->fEnableCheck75u) && pCut->nLeaves == 5 && pCut->nLimit == 5 )
{
extern int If_CluCheckDecIn( word t, int nVars );
extern int If_CluCheckDecInAny( word t, int nVars );
extern int If_CluCheckDecOut( word t, int nVars );
unsigned TruthU = *If_CutTruth(pCut);
word Truth = (((word)TruthU << 32) | (word)TruthU);
p->nCuts5++;
if ( If_CluCheckDecIn( Truth, 5 ) || If_CluCheckDecOut( Truth, 5 ) )
if ( If_CluCheckDecInAny( Truth, 5 ) )
p->nCuts5a++;
else
continue;
}
else if ( p->pPars->fVerbose && pCut->nLeaves == 5 )
{
extern int If_CluCheckDecIn( word t, int nVars );
extern int If_CluCheckDecInAny( word t, int nVars );
extern int If_CluCheckDecOut( word t, int nVars );
unsigned TruthU = *If_CutTruth(pCut);
word Truth = (((word)TruthU << 32) | (word)TruthU);
p->nCuts5++;
if ( If_CluCheckDecIn( Truth, 5 ) || If_CluCheckDecOut( Truth, 5 ) )
if ( If_CluCheckDecInAny( Truth, 5 ) || If_CluCheckDecOut( Truth, 5 ) )
p->nCuts5a++;
}
}
......
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