summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2013-08-29 16:03:40 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2013-08-29 16:03:40 -0700
commit009cc92e0544b69b0591394b3645de74eb513a8c (patch)
tree723fcc906b0a0ffbe43cbf78b90f9c7fba3ace26 /src
parenta495163f74ee677bf9199bd5be8118c32f65e66a (diff)
downloadabc-009cc92e0544b69b0591394b3645de74eb513a8c.tar.gz
abc-009cc92e0544b69b0591394b3645de74eb513a8c.tar.bz2
abc-009cc92e0544b69b0591394b3645de74eb513a8c.zip
Buf fixes and minor changes to the &if mapper.
Diffstat (limited to 'src')
-rw-r--r--src/map/if/ifDec16.c25
-rw-r--r--src/map/if/ifMap.c8
2 files changed, 29 insertions, 4 deletions
diff --git a/src/map/if/ifDec16.c b/src/map/if/ifDec16.c
index 372473a7..ce59a946 100644
--- a/src/map/if/ifDec16.c
+++ b/src/map/if/ifDec16.c
@@ -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];
diff --git a/src/map/if/ifMap.c b/src/map/if/ifMap.c
index 5ac85807..85efe18e 100644
--- a/src/map/if/ifMap.c
+++ b/src/map/if/ifMap.c
@@ -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++;
}
}