Commit 4669839b by Alan Mishchenko

Added new mapping feature.

parent 6fd29922
...@@ -2031,6 +2031,10 @@ SOURCE=.\src\map\if\ifDec.c ...@@ -2031,6 +2031,10 @@ SOURCE=.\src\map\if\ifDec.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\src\map\if\ifDec10.c
# End Source File
# Begin Source File
SOURCE=.\src\map\if\ifLib.c SOURCE=.\src\map\if\ifLib.c
# End Source File # End Source File
# Begin Source File # Begin Source File
......
...@@ -12878,7 +12878,7 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -12878,7 +12878,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, "KCFADEqaflepmrsdbugojvh" ) ) != EOF ) while ( ( c = Extra_UtilGetopt( argc, argv, "KCFADEqaflepmrsdbugojkvh" ) ) != EOF )
{ {
switch ( c ) switch ( c )
{ {
...@@ -12995,6 +12995,9 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -12995,6 +12995,9 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'j': case 'j':
pPars->fEnableCheck ^= 1; pPars->fEnableCheck ^= 1;
break; break;
case 'k':
pPars->fEnableCheck2 ^= 1;
break;
case 'v': case 'v':
pPars->fVerbose ^= 1; pPars->fVerbose ^= 1;
break; break;
...@@ -13074,6 +13077,11 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -13074,6 +13077,11 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
pPars->fCutMin = 1; pPars->fCutMin = 1;
} }
if ( pPars->fEnableCheck && pPars->fEnableCheck2 )
{
Abc_Print( -1, "These two checks cannot be enabled at the same time.\n" );
return 1;
}
if ( pPars->fEnableCheck ) if ( pPars->fEnableCheck )
{ {
if ( pPars->nLutSize < 6 || pPars->nLutSize > 7 ) if ( pPars->nLutSize < 6 || pPars->nLutSize > 7 )
...@@ -13085,6 +13093,17 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -13085,6 +13093,17 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
pPars->fCutMin = 1; pPars->fCutMin = 1;
} }
if ( pPars->fEnableCheck2 )
{
if ( pPars->nLutSize < 6 || pPars->nLutSize > 10 )
{
Abc_Print( -1, "This feature only works for {6,7,8,9,10}-LUTs.\n" );
return 1;
}
pPars->pFuncCell = If_CutPerformCheck10;
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 )
{ {
...@@ -13162,7 +13181,7 @@ usage: ...@@ -13162,7 +13181,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] [-qarlepmsdbugojvh]\n" ); Abc_Print( -2, "usage: if [-KCFA num] [-DE float] [-qarlepmsdbugojkvh]\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 );
...@@ -13185,6 +13204,7 @@ usage: ...@@ -13185,6 +13204,7 @@ usage:
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-j : toggles enabling additional check [default = %s]\n", pPars->fEnableCheck? "yes": "no" );
Abc_Print( -2, "\t-k : toggles enabling additional check [default = %s]\n", pPars->fEnableCheck2? "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;
......
...@@ -97,6 +97,7 @@ struct If_Par_t_ ...@@ -97,6 +97,7 @@ struct If_Par_t_
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 fEnableCheck; // enable additional checking
int fEnableCheck2; // 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
...@@ -406,6 +407,7 @@ extern float If_CutPowerDerefed( If_Man_t * p, If_Cut_t * pCut, If_Obj ...@@ -406,6 +407,7 @@ extern float If_CutPowerDerefed( If_Man_t * p, If_Cut_t * pCut, If_Obj
extern float If_CutPowerRefed( If_Man_t * p, If_Cut_t * pCut, If_Obj_t * pRoot ); extern float If_CutPowerRefed( If_Man_t * p, If_Cut_t * pCut, If_Obj_t * pRoot );
/*=== ifDec.c =============================================================*/ /*=== ifDec.c =============================================================*/
extern int If_CutPerformCheck( unsigned * pTruth, int nVars, int nLeaves ); extern int If_CutPerformCheck( unsigned * pTruth, int nVars, int nLeaves );
extern int If_CutPerformCheck10( unsigned * pTruth, int nVars, int nLeaves );
/*=== ifLib.c =============================================================*/ /*=== ifLib.c =============================================================*/
extern If_Lib_t * If_LutLibRead( char * FileName ); extern If_Lib_t * If_LutLibRead( char * FileName );
extern If_Lib_t * If_LutLibDup( If_Lib_t * p ); extern If_Lib_t * If_LutLibDup( If_Lib_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 || p->pPars->fEnableCheck) && !pCut->fUseless ) if ( (p->pPars->fUseBat || p->pPars->fEnableCheck || p->pPars->fEnableCheck2) && !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 )
......
...@@ -140,7 +140,7 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep ...@@ -140,7 +140,7 @@ void If_ObjPerformMappingAnd( If_Man_t * p, If_Obj_t * pObj, int Mode, int fPrep
pCut->fUseless = 0; pCut->fUseless = 0;
if ( p->pPars->pFuncCell && RetValue < 2 ) if ( p->pPars->pFuncCell && RetValue < 2 )
{ {
assert( pCut->nLimit >= 4 && pCut->nLimit <= 7 ); assert( pCut->nLimit >= 4 && pCut->nLimit <= 10 );
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;
} }
......
SRC += src/map/if/ifCore.c \ SRC += src/map/if/ifCore.c \
src/map/if/ifCut.c \ src/map/if/ifCut.c \
src/map/if/ifDec.c \ src/map/if/ifDec.c \
src/map/if/ifDec10.c \
src/map/if/ifLib.c \ src/map/if/ifLib.c \
src/map/if/ifMan.c \ src/map/if/ifMan.c \
src/map/if/ifMap.c \ src/map/if/ifMap.c \
......
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