Commit a8a08035 by Alan Mishchenko

Changes to LUT mappers.

parent 83963214
...@@ -1298,7 +1298,7 @@ Gia_Man_t * Gia_ManFromIfLogic( If_Man_t * pIfMan ) ...@@ -1298,7 +1298,7 @@ Gia_Man_t * Gia_ManFromIfLogic( If_Man_t * pIfMan )
If_CutForEachLeaf( pIfMan, pCutBest, pIfLeaf, k ) If_CutForEachLeaf( pIfMan, pCutBest, pIfLeaf, k )
Vec_IntPush( vLeaves, pIfLeaf->iCopy ); Vec_IntPush( vLeaves, pIfLeaf->iCopy );
// perform one of the two types of mapping: with and without structures // perform one of the two types of mapping: with and without structures
if ( pIfMan->pPars->fUseDsd ) if ( pIfMan->pPars->fUseDsd && pIfMan->pPars->pLutStruct )
{ {
if ( pSat == NULL ) if ( pSat == NULL )
pSat = (sat_solver *)If_ManSatBuildXY( (int)(pIfMan->pPars->pLutStruct[0] - '0') ); pSat = (sat_solver *)If_ManSatBuildXY( (int)(pIfMan->pPars->pLutStruct[0] - '0') );
...@@ -1308,7 +1308,7 @@ Gia_Man_t * Gia_ManFromIfLogic( If_Man_t * pIfMan ) ...@@ -1308,7 +1308,7 @@ Gia_Man_t * Gia_ManFromIfLogic( If_Man_t * pIfMan )
pIfObj->iCopy = Gia_ManFromIfLogicCreateLut( pNew, If_CutTruthW(pIfMan, pCutBest), vLeaves, vCover, vMapping, vMapping2 ); pIfObj->iCopy = Gia_ManFromIfLogicCreateLut( pNew, If_CutTruthW(pIfMan, pCutBest), vLeaves, vCover, vMapping, vMapping2 );
pIfObj->iCopy = Abc_LitNotCond( pIfObj->iCopy, pCutBest->fCompl ); pIfObj->iCopy = Abc_LitNotCond( pIfObj->iCopy, pCutBest->fCompl );
} }
else if ( pIfMan->pPars->fDeriveLuts && pIfMan->pPars->fTruth ) else if ( (pIfMan->pPars->fDeriveLuts && pIfMan->pPars->fTruth) || pIfMan->pPars->fUseDsd )
{ {
// perform decomposition of the cut // perform decomposition of the cut
pIfObj->iCopy = Gia_ManFromIfLogicNode( pIfMan, pNew, i, vLeaves, vLeaves2, If_CutTruthW(pIfMan, pCutBest), pIfMan->pPars->pLutStruct, vCover, vMapping, vMapping2, vPacking, (pIfMan->pPars->fEnableCheck75 || pIfMan->pPars->fEnableCheck75u), pIfMan->pPars->fEnableCheck07 ); pIfObj->iCopy = Gia_ManFromIfLogicNode( pIfMan, pNew, i, vLeaves, vLeaves2, If_CutTruthW(pIfMan, pCutBest), pIfMan->pPars->pLutStruct, vCover, vMapping, vMapping2, vPacking, (pIfMan->pPars->fEnableCheck75 || pIfMan->pPars->fEnableCheck75u), pIfMan->pPars->fEnableCheck07 );
...@@ -1528,7 +1528,7 @@ Gia_Man_t * Gia_ManPerformMapping( Gia_Man_t * p, void * pp, int fNormalized ) ...@@ -1528,7 +1528,7 @@ Gia_Man_t * Gia_ManPerformMapping( Gia_Man_t * p, void * pp, int fNormalized )
If_Man_t * pIfMan; If_Man_t * pIfMan;
If_Par_t * pPars = (If_Par_t *)pp; If_Par_t * pPars = (If_Par_t *)pp;
// disable cut minimization when GIA strucure is needed // disable cut minimization when GIA strucure is needed
if ( !pPars->fDelayOpt && !pPars->fUserRecLib && ((!pPars->fDeriveLuts && !pPars->fUseDsd) || !pPars->pLutStruct) ) if ( !pPars->fDelayOpt && !pPars->fUserRecLib && !pPars->fDeriveLuts && !pPars->fUseDsd )
pPars->fCutMin = 0; pPars->fCutMin = 0;
// reconstruct GIA according to the hierarchy manager // reconstruct GIA according to the hierarchy manager
......
...@@ -15531,14 +15531,25 @@ usage: ...@@ -15531,14 +15531,25 @@ usage:
***********************************************************************/ ***********************************************************************/
int Abc_CommandDsdPs( Abc_Frame_t * pAbc, int argc, char ** argv ) int Abc_CommandDsdPs( Abc_Frame_t * pAbc, int argc, char ** argv )
{ {
int c, fPrintLib = 0; int c, Number = 0, fVerbose = 0;
Extra_UtilGetoptReset(); Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "ph" ) ) != EOF ) while ( ( c = Extra_UtilGetopt( argc, argv, "Nvh" ) ) != EOF )
{ {
switch ( c ) switch ( c )
{ {
case 'p': case 'N':
fPrintLib ^= 1; if ( globalUtilOptind >= argc )
{
Abc_Print( -1, "Command line switch \"-N\" should be followed by a floating point number.\n" );
goto usage;
}
Number = atoi(argv[globalUtilOptind]);
globalUtilOptind++;
if ( Number < 0 )
goto usage;
break;
case 'v':
fVerbose ^= 1;
break; break;
case 'h': case 'h':
goto usage; goto usage;
...@@ -15551,12 +15562,13 @@ int Abc_CommandDsdPs( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -15551,12 +15562,13 @@ int Abc_CommandDsdPs( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print( 1, "The DSD manager is not started.\n" ); Abc_Print( 1, "The DSD manager is not started.\n" );
return 0; return 0;
} }
If_DsdManPrint( (If_DsdMan_t *)Abc_FrameReadManDsd(), NULL, 0 ); If_DsdManPrint( (If_DsdMan_t *)Abc_FrameReadManDsd(), NULL, Number, fVerbose );
return 0; return 0;
usage: usage:
Abc_Print( -2, "usage: dsd_ps [-h]\n" ); Abc_Print( -2, "usage: dsd_ps [-N num] [-vh]\n" );
Abc_Print( -2, "\t prints statistics of DSD manager\n" ); Abc_Print( -2, "\t prints statistics of DSD manager\n" );
Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
Abc_Print( -2, "\t-h : print the command usage\n"); Abc_Print( -2, "\t-h : print the command usage\n");
return 1; return 1;
} }
...@@ -519,7 +519,7 @@ extern int If_CluCheckExt3( void * p, word * pTruth, int nVars, int ...@@ -519,7 +519,7 @@ extern int If_CluCheckExt3( void * p, word * pTruth, int nVars, int
/*=== ifDsd.c =============================================================*/ /*=== ifDsd.c =============================================================*/
extern If_DsdMan_t * If_DsdManAlloc( int nVars, int nLutSize ); extern If_DsdMan_t * If_DsdManAlloc( int nVars, int nLutSize );
extern void If_DsdManDump( If_DsdMan_t * p ); extern void If_DsdManDump( If_DsdMan_t * p );
extern void If_DsdManPrint( If_DsdMan_t * p, char * pFileName, int fVerbose ); extern void If_DsdManPrint( If_DsdMan_t * p, char * pFileName, int Number, int fVerbose );
extern void If_DsdManTune( If_DsdMan_t * p, int LutSize, int fFast, int fSpec, int fVerbose ); extern void If_DsdManTune( If_DsdMan_t * p, int LutSize, int fFast, int fSpec, int fVerbose );
extern void If_DsdManFree( If_DsdMan_t * p, int fVerbose ); extern void If_DsdManFree( If_DsdMan_t * p, int fVerbose );
extern void If_DsdManSave( If_DsdMan_t * p, char * pFileName ); extern void If_DsdManSave( If_DsdMan_t * p, char * pFileName );
......
...@@ -220,7 +220,7 @@ void If_DsdManFree( If_DsdMan_t * p, int fVerbose ) ...@@ -220,7 +220,7 @@ void If_DsdManFree( If_DsdMan_t * p, int fVerbose )
int v; int v;
// If_DsdManDump( p ); // If_DsdManDump( p );
if ( fVerbose ) if ( fVerbose )
If_DsdManPrint( p, NULL, 0 ); If_DsdManPrint( p, NULL, 0, 0 );
if ( fVerbose ) if ( fVerbose )
Vec_MemDumpTruthTables( p->vTtMem, "dumpdsd", p->nVars ); Vec_MemDumpTruthTables( p->vTtMem, "dumpdsd", p->nVars );
for ( v = 2; v < p->nVars; v++ ) for ( v = 2; v < p->nVars; v++ )
...@@ -396,7 +396,7 @@ void If_DsdManPrintDistrib( If_DsdMan_t * p ) ...@@ -396,7 +396,7 @@ void If_DsdManPrintDistrib( If_DsdMan_t * p )
printf( "(%6.2f %%)", 100.0 * CountNonTotal / Vec_PtrSize(p->vObjs) ); printf( "(%6.2f %%)", 100.0 * CountNonTotal / Vec_PtrSize(p->vObjs) );
printf( "\n" ); printf( "\n" );
} }
void If_DsdManPrint( If_DsdMan_t * p, char * pFileName, int fVerbose ) void If_DsdManPrint( If_DsdMan_t * p, char * pFileName, int Number, int fVerbose )
{ {
If_DsdObj_t * pObj; If_DsdObj_t * pObj;
int i, DsdMax = 0, CountUsed = 0, CountNonDsdStr = 0, CountMarked = 0; int i, DsdMax = 0, CountUsed = 0, CountNonDsdStr = 0, CountMarked = 0;
...@@ -441,8 +441,8 @@ void If_DsdManPrint( If_DsdMan_t * p, char * pFileName, int fVerbose ) ...@@ -441,8 +441,8 @@ void If_DsdManPrint( If_DsdMan_t * p, char * pFileName, int fVerbose )
return; return;
If_DsdVecForEachObj( p->vObjs, pObj, i ) If_DsdVecForEachObj( p->vObjs, pObj, i )
{ {
// if ( i == 50 ) if ( Number && i % Number )
// break; continue;
If_DsdManPrintOne( pFile, p, pObj->Id, NULL, 1 ); If_DsdManPrintOne( pFile, p, pObj->Id, NULL, 1 );
} }
fprintf( pFile, "\n" ); fprintf( pFile, "\n" );
......
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