Commit 27bb2a68 by Alan Mishchenko

Updated technology mapping.

parent b8b75cf1
...@@ -12689,7 +12689,7 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -12689,7 +12689,7 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
fLutMux = 0; fLutMux = 0;
Extra_UtilGetoptReset(); Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "KCFADEqaflepmrsdbugovh" ) ) != EOF ) while ( ( c = Extra_UtilGetopt( argc, argv, "KCFADEqaflepmrsdbugojvh" ) ) != EOF )
{ {
switch ( c ) switch ( c )
{ {
...@@ -12803,6 +12803,9 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -12803,6 +12803,9 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'o': case 'o':
pPars->fUseBuffs ^= 1; pPars->fUseBuffs ^= 1;
break; break;
case 'j':
pPars->fEnableCheck ^= 1;
break;
case 'v': case 'v':
pPars->fVerbose ^= 1; pPars->fVerbose ^= 1;
break; break;
...@@ -12881,7 +12884,19 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -12881,7 +12884,19 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
} }
pPars->fCutMin = 1; 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 // enable truth table computation if cut minimization is selected
if ( pPars->fCutMin ) if ( pPars->fCutMin )
{ {
...@@ -12959,7 +12974,7 @@ usage: ...@@ -12959,7 +12974,7 @@ usage:
sprintf( LutSize, "library" ); sprintf( LutSize, "library" );
else else
sprintf( LutSize, "%d", pPars->nLutSize ); 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 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-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 ); 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: ...@@ -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-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-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-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-v : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
Abc_Print( -2, "\t-h : prints the command usage\n"); Abc_Print( -2, "\t-h : prints the command usage\n");
return 1; return 1;
......
...@@ -96,6 +96,7 @@ struct If_Par_t_ ...@@ -96,6 +96,7 @@ struct If_Par_t_
int fBidec; // use bi-decomposition int fBidec; // use bi-decomposition
int fUseBat; // use one specialized feature int fUseBat; // use one specialized feature
int fUseBuffs; // use buffers to decouple outputs int fUseBuffs; // use buffers to decouple outputs
int fEnableCheck; // enable additional checking
int fVerbose; // the verbosity flag int fVerbose; // the verbosity flag
// internal parameters // internal parameters
int fDelayOpt; // special delay optimization int fDelayOpt; // special delay optimization
...@@ -444,7 +445,7 @@ extern float If_CutDelay( If_Man_t * p, If_Cut_t * pCut ); ...@@ -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_CutPropagateRequired( If_Man_t * p, If_Cut_t * pCut, float Required );
extern void If_CutRotatePins( If_Man_t * p, If_Cut_t * pCut ); extern void If_CutRotatePins( If_Man_t * p, If_Cut_t * pCut );
/*=== ifTruth.c ===========================================================*/ /*=== 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 ); extern void If_CutTruthPermute( unsigned * pOut, unsigned * pIn, int nVars, float * pDelays, int * pVars );
/*=== ifUtil.c ============================================================*/ /*=== ifUtil.c ============================================================*/
extern void If_ManCleanNodeCopy( If_Man_t * p ); extern void If_ManCleanNodeCopy( If_Man_t * p );
......
...@@ -685,7 +685,7 @@ void If_CutSort( If_Man_t * p, If_Set_t * pCutSet, If_Cut_t * pCut ) ...@@ -685,7 +685,7 @@ void If_CutSort( If_Man_t * p, If_Set_t * pCutSet, If_Cut_t * pCut )
return; return;
} }
if ( p->pPars->fUseBat && !pCut->fUseless ) if ( (p->pPars->fUseBat || p->pPars->fEnableCheck) && !pCut->fUseless )
{ {
If_Cut_t * pFirst = pCutSet->ppCuts[0]; If_Cut_t * pFirst = pCutSet->ppCuts[0];
if ( pFirst->fUseless || If_ManSortCompare(p, pFirst, pCut) == 1 ) if ( pFirst->fUseless || If_ManSortCompare(p, pFirst, pCut) == 1 )
......
...@@ -135,14 +135,16 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep ...@@ -135,14 +135,16 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
if ( p->pPars->fTruth ) if ( p->pPars->fTruth )
{ {
// int clk = clock(); // 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; // 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 ); pCut->fUseless = !p->pPars->pFuncCell( If_CutTruth(pCut), pCut->nLimit, pCut->nLeaves );
p->nCutsUseless += pCut->fUseless; p->nCutsUseless += pCut->fUseless;
} }
} }
// compute the application-specific cost and depth // compute the application-specific cost and depth
pCut->fUser = (p->pPars->pFuncCost != NULL); pCut->fUser = (p->pPars->pFuncCost != NULL);
......
...@@ -355,7 +355,7 @@ static inline unsigned If_CutTruthPhase( If_Cut_t * pCut, If_Cut_t * pCut1 ) ...@@ -355,7 +355,7 @@ static inline unsigned If_CutTruthPhase( If_Cut_t * pCut, If_Cut_t * pCut1 )
SeeAlso [] 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 ); 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 ...@@ -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 // minimize the support of the cut
if ( p->pPars->fCutMin ) if ( p->pPars->fCutMin )
If_CutTruthMinimize( p, pCut ); return If_CutTruthMinimize( p, pCut );
// perform // perform
// If_CutFactorTest( If_CutTruth(pCut), pCut->nLimit ); // If_CutFactorTest( If_CutTruth(pCut), pCut->nLimit );
// printf( "%d ", If_CutLeaveNum(pCut) - If_CutTruthSupportSize(If_CutTruth(pCut), If_CutLeaveNum(pCut)) ); // 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 ) ...@@ -412,7 +413,7 @@ int If_CutTruthMinimize( If_Man_t * p, If_Cut_t * pCut )
if ( nSuppSize < 2 ) if ( nSuppSize < 2 )
{ {
p->nSmallSupp++; p->nSmallSupp++;
return 0; return 2;
} }
// if ( If_CutLeaveNum(pCut) - nSuppSize > 1 ) // if ( If_CutLeaveNum(pCut) - nSuppSize > 1 )
// return 0; // return 0;
......
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