summaryrefslogtreecommitdiffstats
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/if/if.h3
-rw-r--r--src/map/if/ifCut.c2
-rw-r--r--src/map/if/ifMap.c8
-rw-r--r--src/map/if/ifTruth.c7
4 files changed, 12 insertions, 8 deletions
diff --git a/src/map/if/if.h b/src/map/if/if.h
index ff2e9541..72b1f5b2 100644
--- a/src/map/if/if.h
+++ b/src/map/if/if.h
@@ -96,6 +96,7 @@ struct If_Par_t_
int fBidec; // use bi-decomposition
int fUseBat; // use one specialized feature
int fUseBuffs; // use buffers to decouple outputs
+ int fEnableCheck; // enable additional checking
int fVerbose; // the verbosity flag
// internal parameters
int fDelayOpt; // special delay optimization
@@ -444,7 +445,7 @@ extern float If_CutDelay( If_Man_t * p, If_Cut_t * pCut );
extern void If_CutPropagateRequired( If_Man_t * p, If_Cut_t * pCut, float Required );
extern void If_CutRotatePins( If_Man_t * p, If_Cut_t * pCut );
/*=== ifTruth.c ===========================================================*/
-extern void If_CutComputeTruth( If_Man_t * p, If_Cut_t * pCut, If_Cut_t * pCut0, If_Cut_t * pCut1, int fCompl0, int fCompl1 );
+extern int If_CutComputeTruth( If_Man_t * p, If_Cut_t * pCut, If_Cut_t * pCut0, If_Cut_t * pCut1, int fCompl0, int fCompl1 );
extern void If_CutTruthPermute( unsigned * pOut, unsigned * pIn, int nVars, float * pDelays, int * pVars );
/*=== ifUtil.c ============================================================*/
extern void If_ManCleanNodeCopy( If_Man_t * p );
diff --git a/src/map/if/ifCut.c b/src/map/if/ifCut.c
index 58224692..c37f9c04 100644
--- a/src/map/if/ifCut.c
+++ b/src/map/if/ifCut.c
@@ -685,7 +685,7 @@ void If_CutSort( If_Man_t * p, If_Set_t * pCutSet, If_Cut_t * pCut )
return;
}
- if ( p->pPars->fUseBat && !pCut->fUseless )
+ if ( (p->pPars->fUseBat || p->pPars->fEnableCheck) && !pCut->fUseless )
{
If_Cut_t * pFirst = pCutSet->ppCuts[0];
if ( pFirst->fUseless || If_ManSortCompare(p, pFirst, pCut) == 1 )
diff --git a/src/map/if/ifMap.c b/src/map/if/ifMap.c
index f5d1356f..1a7b6ea7 100644
--- a/src/map/if/ifMap.c
+++ b/src/map/if/ifMap.c
@@ -135,14 +135,16 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
if ( p->pPars->fTruth )
{
// int clk = clock();
- If_CutComputeTruth( p, pCut, pCut0, pCut1, pObj->fCompl0, pObj->fCompl1 );
+ int RetValue = If_CutComputeTruth( p, pCut, pCut0, pCut1, pObj->fCompl0, pObj->fCompl1 );
// p->timeTruth += clock() - clk;
- if ( p->pPars->pFuncCell )
+ pCut->fUseless = 0;
+ if ( p->pPars->pFuncCell && RetValue < 2 )
{
- assert( pCut->nLimit >= 4 && pCut->nLimit <= 6 );
+ assert( pCut->nLimit >= 4 && pCut->nLimit <= 7 );
pCut->fUseless = !p->pPars->pFuncCell( If_CutTruth(pCut), pCut->nLimit, pCut->nLeaves );
p->nCutsUseless += pCut->fUseless;
}
+
}
// compute the application-specific cost and depth
pCut->fUser = (p->pPars->pFuncCost != NULL);
diff --git a/src/map/if/ifTruth.c b/src/map/if/ifTruth.c
index 75bc49db..5adf96fb 100644
--- a/src/map/if/ifTruth.c
+++ b/src/map/if/ifTruth.c
@@ -355,7 +355,7 @@ static inline unsigned If_CutTruthPhase( If_Cut_t * pCut, If_Cut_t * pCut1 )
SeeAlso []
***********************************************************************/
-void If_CutComputeTruth( If_Man_t * p, If_Cut_t * pCut, If_Cut_t * pCut0, If_Cut_t * pCut1, int fCompl0, int fCompl1 )
+int If_CutComputeTruth( If_Man_t * p, If_Cut_t * pCut, If_Cut_t * pCut0, If_Cut_t * pCut1, int fCompl0, int fCompl1 )
{
extern void If_CutFactorTest( unsigned * pTruth, int nVars );
@@ -380,11 +380,12 @@ void If_CutComputeTruth( If_Man_t * p, If_Cut_t * pCut, If_Cut_t * pCut0, If_Cut
// minimize the support of the cut
if ( p->pPars->fCutMin )
- If_CutTruthMinimize( p, pCut );
+ return If_CutTruthMinimize( p, pCut );
// perform
// If_CutFactorTest( If_CutTruth(pCut), pCut->nLimit );
// printf( "%d ", If_CutLeaveNum(pCut) - If_CutTruthSupportSize(If_CutTruth(pCut), If_CutLeaveNum(pCut)) );
+ return 0;
}
@@ -412,7 +413,7 @@ int If_CutTruthMinimize( If_Man_t * p, If_Cut_t * pCut )
if ( nSuppSize < 2 )
{
p->nSmallSupp++;
- return 0;
+ return 2;
}
// if ( If_CutLeaveNum(pCut) - nSuppSize > 1 )
// return 0;