summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/base/abci/abc.c22
-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
5 files changed, 31 insertions, 11 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c
index cea4d0f7..a508cb29 100644
--- a/src/base/abci/abc.c
+++ b/src/base/abci/abc.c
@@ -12689,7 +12689,7 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
fLutMux = 0;
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "KCFADEqaflepmrsdbugovh" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "KCFADEqaflepmrsdbugojvh" ) ) != EOF )
{
switch ( c )
{
@@ -12803,6 +12803,9 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'o':
pPars->fUseBuffs ^= 1;
break;
+ case 'j':
+ pPars->fEnableCheck ^= 1;
+ break;
case 'v':
pPars->fVerbose ^= 1;
break;
@@ -12881,7 +12884,19 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
}
pPars->fCutMin = 1;
}
-
+/*
+ if ( pPars->fEnableCheck )
+ {
+ extern int If_CutPerformCheck( unsigned * pTruth, int nVars, int nLeaves );
+ if ( pPars->nLutSize < 6 || pPars->nLutSize > 7 )
+ {
+ Abc_Print( -1, "This feature only works for {6,7}-LUTs.\n" );
+ return 1;
+ }
+ pPars->pFuncCell = If_CutPerformCheck;
+ pPars->fCutMin = 1;
+ }
+*/
// enable truth table computation if cut minimization is selected
if ( pPars->fCutMin )
{
@@ -12959,7 +12974,7 @@ usage:
sprintf( LutSize, "library" );
else
sprintf( LutSize, "%d", pPars->nLutSize );
- Abc_Print( -2, "usage: if [-KCFA num] [-DE float] [-qarlepmsdbugovh]\n" );
+ Abc_Print( -2, "usage: if [-KCFA num] [-DE float] [-qarlepmsdbugojvh]\n" );
Abc_Print( -2, "\t performs FPGA technology mapping of the network\n" );
Abc_Print( -2, "\t-K num : the number of LUT inputs (2 < num < %d) [default = %s]\n", IF_MAX_LUTSIZE+1, LutSize );
Abc_Print( -2, "\t-C num : the max number of priority cuts (0 < num < 2^12) [default = %d]\n", pPars->nCutsMax );
@@ -12981,6 +12996,7 @@ usage:
Abc_Print( -2, "\t-u : toggles the use of MUXes along with LUTs [default = %s]\n", fLutMux? "yes": "no" );
Abc_Print( -2, "\t-g : toggles global delay optimization [default = %s]\n", pPars->fDelayOpt? "yes": "no" );
Abc_Print( -2, "\t-o : toggles using buffers to decouple combinational outputs [default = %s]\n", pPars->fUseBuffs? "yes": "no" );
+ Abc_Print( -2, "\t-j : toggles enabling additional check [default = %s]\n", pPars->fEnableCheck? "yes": "no" );
Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
Abc_Print( -2, "\t-h : prints the command usage\n");
return 1;
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;