Changing default values.

This commit is contained in:
Alan Mishchenko 2013-10-02 14:36:33 -07:00
parent f2fab57936
commit 7b99370e0a
6 changed files with 33 additions and 25 deletions

View File

@ -568,7 +568,7 @@ void Dam_ManCreatePairs( Dam_Man_t * p, int fVerbose )
p->vHash = Hash_IntManStart( 3 * nDivsUsed /2 ); p->vHash = Hash_IntManStart( 3 * nDivsUsed /2 );
p->vCounts = Vec_FltAlloc( 2 * nDivsUsed ); Vec_FltPush( p->vCounts, ABC_INFINITY ); p->vCounts = Vec_FltAlloc( 2 * nDivsUsed ); Vec_FltPush( p->vCounts, ABC_INFINITY );
p->vQue = Vec_QueAlloc( Vec_FltCap(p->vCounts) ); p->vQue = Vec_QueAlloc( Vec_FltCap(p->vCounts) );
Vec_QueSetCosts( p->vQue, Vec_FltArrayP(p->vCounts) ); Vec_QueSetPriority( p->vQue, Vec_FltArrayP(p->vCounts) );
// mapping div to node // mapping div to node
p->vDiv2Nod = Vec_IntAlloc( 2 * nDivsUsed ); Vec_IntPush( p->vDiv2Nod, ABC_INFINITY ); p->vDiv2Nod = Vec_IntAlloc( 2 * nDivsUsed ); Vec_IntPush( p->vDiv2Nod, ABC_INFINITY );
p->vNodStore = Vec_IntAlloc( Gia_ManObjNum(p->pGia) ); Vec_IntPush( p->vNodStore, -1 ); p->vNodStore = Vec_IntAlloc( Gia_ManObjNum(p->pGia) ); Vec_IntPush( p->vNodStore, -1 );
@ -907,7 +907,7 @@ Gia_Man_t * Dam_ManMultiExtractInt( Gia_Man_t * pGia, int nNewNodesMax, int fVer
int i, iDiv; int i, iDiv;
p = Dam_ManAlloc( pGia ); p = Dam_ManAlloc( pGia );
Dam_ManCreatePairs( p, fVerbose ); Dam_ManCreatePairs( p, fVerbose );
for ( i = 0; i < nNewNodesMax && Vec_QueTopCost(p->vQue) > 2; i++ ) for ( i = 0; i < nNewNodesMax && Vec_QueTopPriority(p->vQue) >= 2; i++ )
{ {
iDiv = Vec_QuePop(p->vQue); iDiv = Vec_QuePop(p->vQue);
if ( fVeryVerbose ) if ( fVeryVerbose )

View File

@ -27436,7 +27436,7 @@ int Abc_CommandAbc9Fx( Abc_Frame_t * pAbc, int argc, char ** argv )
int fVeryVerbose = 0; int fVeryVerbose = 0;
// set the defaults // set the defaults
Extra_UtilGetoptReset(); Extra_UtilGetoptReset();
while ( (c = Extra_UtilGetopt(argc, argv, "NMrvh")) != EOF ) while ( (c = Extra_UtilGetopt(argc, argv, "NMrvwh")) != EOF )
{ {
switch (c) switch (c)
{ {
@ -27468,6 +27468,9 @@ int Abc_CommandAbc9Fx( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'v': case 'v':
fVerbose ^= 1; fVerbose ^= 1;
break; break;
case 'w':
fVeryVerbose ^= 1;
break;
case 'h': case 'h':
goto usage; goto usage;
break; break;
@ -27499,6 +27502,7 @@ usage:
Abc_Print( -2, "\t-M <num> : upper bound on literal count of divisors to extract [default = %d]\n", LitCountMax ); Abc_Print( -2, "\t-M <num> : upper bound on literal count of divisors to extract [default = %d]\n", LitCountMax );
Abc_Print( -2, "\t-r : reversing variable order during ISOP computation [default = %s]\n", fReverse? "yes": "no" ); Abc_Print( -2, "\t-r : reversing variable order during ISOP computation [default = %s]\n", fReverse? "yes": "no" );
Abc_Print( -2, "\t-v : print verbose information [default = %s]\n", fVerbose? "yes": "no" ); Abc_Print( -2, "\t-v : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
Abc_Print( -2, "\t-w : toggle printing additional information [default = %s]\n", fVeryVerbose? "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;
} }

View File

@ -395,7 +395,7 @@ static inline int Fx_ManComputeLevelDiv( Fx_Man_t * p, Vec_Int_t * vCubeFree )
int i, Lit, Level = 0; int i, Lit, Level = 0;
Vec_IntForEachEntry( vCubeFree, Lit, i ) Vec_IntForEachEntry( vCubeFree, Lit, i )
Level = Abc_MaxInt( Level, Vec_IntEntry(p->vLevels, Abc_Lit2Var(Abc_Lit2Var(Lit))) ); Level = Abc_MaxInt( Level, Vec_IntEntry(p->vLevels, Abc_Lit2Var(Abc_Lit2Var(Lit))) );
return Abc_MinInt( Level, 200 ); return Abc_MinInt( Level, 800 );
} }
static inline int Fx_ManComputeLevelCube( Fx_Man_t * p, Vec_Int_t * vCube ) static inline int Fx_ManComputeLevelCube( Fx_Man_t * p, Vec_Int_t * vCube )
{ {
@ -473,7 +473,7 @@ static inline void Fx_PrintDiv( Fx_Man_t * p, int iDiv )
int i; int i;
printf( "%4d : ", p->nDivs ); printf( "%4d : ", p->nDivs );
printf( "Div %7d : ", iDiv ); printf( "Div %7d : ", iDiv );
printf( "Weight %5d ", (int)Vec_FltEntry(p->vWeights, iDiv) ); printf( "Weight %12.5f ", Vec_FltEntry(p->vWeights, iDiv) );
// printf( "Compl %4d ", p->nCompls ); // printf( "Compl %4d ", p->nCompls );
Fx_PrintDivOne( Hsh_VecReadEntry(p->pHash, iDiv) ); Fx_PrintDivOne( Hsh_VecReadEntry(p->pHash, iDiv) );
for ( i = Vec_IntSize(Hsh_VecReadEntry(p->pHash, iDiv)) + 3; i < 16; i++ ) for ( i = Vec_IntSize(Hsh_VecReadEntry(p->pHash, iDiv)) + 3; i < 16; i++ )
@ -503,6 +503,8 @@ static void Fx_PrintMatrix( Fx_Man_t * p )
Vec_Int_t * vCube; Vec_Int_t * vCube;
int i, v, Lit, nObjs; int i, v, Lit, nObjs;
char * pLine; char * pLine;
if ( Vec_WecSize(p->vLits)/2 > 26 )
return;
printf( " " ); printf( " " );
nObjs = Vec_WecSize(p->vLits)/2; nObjs = Vec_WecSize(p->vLits)/2;
for ( i = 0; i < Abc_MinInt(nObjs, 26); i++ ) for ( i = 0; i < Abc_MinInt(nObjs, 26); i++ )
@ -794,7 +796,7 @@ int Fx_ManCubeSingleCubeDivisors( Fx_Man_t * p, Vec_Int_t * vPivot, int fRemove,
{ {
if ( Vec_FltSize(p->vWeights) == iDiv ) if ( Vec_FltSize(p->vWeights) == iDiv )
{ {
Vec_FltPush(p->vWeights, -2 -0.001 * Fx_ManComputeLevelDiv(p, p->vCubeFree)); Vec_FltPush(p->vWeights, -2 + 0.9 - 0.001 * Fx_ManComputeLevelDiv(p, p->vCubeFree));
p->nDivsS++; p->nDivsS++;
} }
assert( iDiv < Vec_FltSize(p->vWeights) ); assert( iDiv < Vec_FltSize(p->vWeights) );
@ -846,7 +848,7 @@ void Fx_ManCubeDoubleCubeDivisors( Fx_Man_t * p, int iFirst, Vec_Int_t * vPivot,
if ( !fRemove ) if ( !fRemove )
{ {
if ( iDiv == Vec_FltSize(p->vWeights) ) if ( iDiv == Vec_FltSize(p->vWeights) )
Vec_FltPush(p->vWeights, -Vec_IntSize(p->vCubeFree) -0.001 * Fx_ManComputeLevelDiv(p, p->vCubeFree)); Vec_FltPush(p->vWeights, -Vec_IntSize(p->vCubeFree) + 0.9 - 0.0009 * Fx_ManComputeLevelDiv(p, p->vCubeFree));
assert( iDiv < Vec_FltSize(p->vWeights) ); assert( iDiv < Vec_FltSize(p->vWeights) );
Vec_FltAddToEntry( p->vWeights, iDiv, Base + Vec_IntSize(p->vCubeFree) - 1 ); Vec_FltAddToEntry( p->vWeights, iDiv, Base + Vec_IntSize(p->vCubeFree) - 1 );
p->nPairsD++; p->nPairsD++;
@ -884,7 +886,7 @@ void Fx_ManCreateDivisors( Fx_Man_t * p )
Fx_ManCubeDoubleCubeDivisors( p, i+1, vCube, 0, 0 ); // add - no update Fx_ManCubeDoubleCubeDivisors( p, i+1, vCube, 0, 0 ); // add - no update
// create queue with all divisors // create queue with all divisors
p->vPrio = Vec_QueAlloc( Vec_FltSize(p->vWeights) ); p->vPrio = Vec_QueAlloc( Vec_FltSize(p->vWeights) );
Vec_QueSetCosts( p->vPrio, Vec_FltArrayP(p->vWeights) ); Vec_QueSetPriority( p->vPrio, Vec_FltArrayP(p->vWeights) );
Vec_FltForEachEntry( p->vWeights, Weight, i ) Vec_FltForEachEntry( p->vWeights, Weight, i )
if ( Weight > 0.0 ) if ( Weight > 0.0 )
Vec_QuePush( p->vPrio, i ); Vec_QuePush( p->vPrio, i );
@ -985,6 +987,8 @@ void Fx_ManUpdate( Fx_Man_t * p, int iDiv )
Vec_Int_t * vDiv = p->vDiv; Vec_Int_t * vDiv = p->vDiv;
int nLitsNew = p->nLits - (int)Vec_FltEntry(p->vWeights, iDiv); int nLitsNew = p->nLits - (int)Vec_FltEntry(p->vWeights, iDiv);
int i, k, Lit0, Lit1, iVarNew, RetValue, Level; int i, k, Lit0, Lit1, iVarNew, RetValue, Level;
float Diff = Vec_FltEntry(p->vWeights, iDiv) - (float)((int)Vec_FltEntry(p->vWeights, iDiv));
assert( Diff > 0.0 && Diff < 1.0 );
// get the divisor and select pivot variables // get the divisor and select pivot variables
p->nDivs++; p->nDivs++;
@ -1179,7 +1183,7 @@ int Fx_FastExtract( Vec_Wec_t * vCubes, int ObjIdMax, int nNewNodesMax, int LitC
Fx_PrintStats( p, Abc_Clock() - clk ); Fx_PrintStats( p, Abc_Clock() - clk );
// perform extraction // perform extraction
p->timeStart = Abc_Clock(); p->timeStart = Abc_Clock();
for ( i = 0; i < nNewNodesMax && Vec_QueTopCost(p->vPrio) > 0.0; i++ ) for ( i = 0; i < nNewNodesMax && Vec_QueTopPriority(p->vPrio) > 0.0; i++ )
{ {
iDiv = Vec_QuePop(p->vPrio); iDiv = Vec_QuePop(p->vPrio);
if ( fVeryVerbose ) if ( fVeryVerbose )

View File

@ -689,7 +689,7 @@ Buf_Man_t * Buf_ManStart( Abc_Ntk_t * pNtk, int FanMin, int FanMax, int fBufPis
Vec_IntFill( p->vArr, p->nObjAlloc, 0 ); Vec_IntFill( p->vArr, p->nObjAlloc, 0 );
Vec_IntFill( p->vDep, p->nObjAlloc, 0 ); Vec_IntFill( p->vDep, p->nObjAlloc, 0 );
Vec_FltFill( p->vCounts, p->nObjAlloc, -ABC_INFINITY ); Vec_FltFill( p->vCounts, p->nObjAlloc, -ABC_INFINITY );
Vec_QueSetCosts( p->vQue, Vec_FltArrayP(p->vCounts) ); Vec_QueSetPriority( p->vQue, Vec_FltArrayP(p->vCounts) );
// collect edge delays // collect edge delays
p->DelayInv = Mio_GateReadPinDelay( Mio_LibraryReadInv((Mio_Library_t *)pNtk->pManFunc), 0 ); p->DelayInv = Mio_GateReadPinDelay( Mio_LibraryReadInv((Mio_Library_t *)pNtk->pManFunc), 0 );
p->vEdges = Vec_IntAlloc( 1000 ); p->vEdges = Vec_IntAlloc( 1000 );

View File

@ -161,7 +161,7 @@ static inline SC_Man * Abc_SclManAlloc( SC_Lib * pLib, Abc_Ntk_t * pNtk )
p->vBestFans = Vec_IntStart( p->nObjs ); p->vBestFans = Vec_IntStart( p->nObjs );
p->vTimesOut = Vec_FltStart( Abc_NtkCoNum(pNtk) ); p->vTimesOut = Vec_FltStart( Abc_NtkCoNum(pNtk) );
p->vQue = Vec_QueAlloc( Abc_NtkCoNum(pNtk) ); p->vQue = Vec_QueAlloc( Abc_NtkCoNum(pNtk) );
Vec_QueSetCosts( p->vQue, Vec_FltArrayP(p->vTimesOut) ); Vec_QueSetPriority( p->vQue, Vec_FltArrayP(p->vTimesOut) );
for ( i = 0; i < Abc_NtkCoNum(pNtk); i++ ) for ( i = 0; i < Abc_NtkCoNum(pNtk); i++ )
Vec_QuePush( p->vQue, i ); Vec_QuePush( p->vQue, i );
p->vUpdates = Vec_IntAlloc( 1000 ); p->vUpdates = Vec_IntAlloc( 1000 );
@ -174,7 +174,7 @@ static inline SC_Man * Abc_SclManAlloc( SC_Lib * pLib, Abc_Ntk_t * pNtk )
p->vNode2Gain = Vec_FltStart( p->nObjs ); p->vNode2Gain = Vec_FltStart( p->nObjs );
p->vNode2Gate = Vec_IntStart( p->nObjs ); p->vNode2Gate = Vec_IntStart( p->nObjs );
p->vNodeByGain = Vec_QueAlloc( p->nObjs ); p->vNodeByGain = Vec_QueAlloc( p->nObjs );
Vec_QueSetCosts( p->vNodeByGain, Vec_FltArrayP(p->vNode2Gain) ); Vec_QueSetPriority( p->vNodeByGain, Vec_FltArrayP(p->vNode2Gain) );
p->vNodeIter = Vec_IntStartFull( p->nObjs ); p->vNodeIter = Vec_IntStartFull( p->nObjs );
p->vLevels = Vec_WecStart( 2 * Abc_NtkLevel(pNtk) ); p->vLevels = Vec_WecStart( 2 * Abc_NtkLevel(pNtk) );
p->vChanged = Vec_IntAlloc( 100 ); p->vChanged = Vec_IntAlloc( 100 );

View File

@ -47,7 +47,7 @@ struct Vec_Que_t_
float ** pCostsFlt; // owned by the caller float ** pCostsFlt; // owned by the caller
}; };
static inline float Vec_QueCost( Vec_Que_t * p, int v ) { return *p->pCostsFlt ? (*p->pCostsFlt)[v] : v; } static inline float Vec_QuePrio( Vec_Que_t * p, int v ) { return *p->pCostsFlt ? (*p->pCostsFlt)[v] : v; }
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
/// MACRO DEFINITIONS /// /// MACRO DEFINITIONS ///
@ -92,7 +92,7 @@ static inline void Vec_QueFreeP( Vec_Que_t ** p )
Vec_QueFree( *p ); Vec_QueFree( *p );
*p = NULL; *p = NULL;
} }
static inline void Vec_QueSetCosts( Vec_Que_t * p, float ** pCosts ) static inline void Vec_QueSetPriority( Vec_Que_t * p, float ** pCosts )
{ {
assert( p->pCostsFlt == NULL ); assert( p->pCostsFlt == NULL );
p->pCostsFlt = pCosts; p->pCostsFlt = pCosts;
@ -140,9 +140,9 @@ static inline int Vec_QueTop( Vec_Que_t * p )
{ {
return Vec_QueSize(p) > 0 ? p->pHeap[1] : -1; return Vec_QueSize(p) > 0 ? p->pHeap[1] : -1;
} }
static inline float Vec_QueTopCost( Vec_Que_t * p ) static inline float Vec_QueTopPriority( Vec_Que_t * p )
{ {
return Vec_QueSize(p) > 0 ? Vec_QueCost(p, p->pHeap[1]) : -ABC_INFINITY; return Vec_QueSize(p) > 0 ? Vec_QuePrio(p, p->pHeap[1]) : -ABC_INFINITY;
} }
/**Function************************************************************* /**Function*************************************************************
@ -158,13 +158,13 @@ static inline float Vec_QueTopCost( Vec_Que_t * p )
***********************************************************************/ ***********************************************************************/
static inline int Vec_QueMoveUp( Vec_Que_t * p, int v ) static inline int Vec_QueMoveUp( Vec_Que_t * p, int v )
{ {
float Cost = Vec_QueCost(p, v); float Cost = Vec_QuePrio(p, v);
int i = p->pOrder[v]; int i = p->pOrder[v];
int parent = i >> 1; int parent = i >> 1;
int fMoved = 0; int fMoved = 0;
assert( p->pOrder[v] != -1 ); assert( p->pOrder[v] != -1 );
assert( p->pHeap[i] == v ); assert( p->pHeap[i] == v );
while ( i > 1 && Cost > Vec_QueCost(p, p->pHeap[parent]) ) while ( i > 1 && Cost > Vec_QuePrio(p, p->pHeap[parent]) )
{ {
p->pHeap[i] = p->pHeap[parent]; p->pHeap[i] = p->pHeap[parent];
p->pOrder[p->pHeap[i]] = i; p->pOrder[p->pHeap[i]] = i;
@ -178,15 +178,15 @@ static inline int Vec_QueMoveUp( Vec_Que_t * p, int v )
} }
static inline void Vec_QueMoveDown( Vec_Que_t * p, int v ) static inline void Vec_QueMoveDown( Vec_Que_t * p, int v )
{ {
float Cost = Vec_QueCost(p, v); float Cost = Vec_QuePrio(p, v);
int i = p->pOrder[v]; int i = p->pOrder[v];
int child = i << 1; int child = i << 1;
while ( child < p->nSize ) while ( child < p->nSize )
{ {
if ( child + 1 < p->nSize && Vec_QueCost(p, p->pHeap[child]) < Vec_QueCost(p, p->pHeap[child+1]) ) if ( child + 1 < p->nSize && Vec_QuePrio(p, p->pHeap[child]) < Vec_QuePrio(p, p->pHeap[child+1]) )
child++; child++;
assert( child < p->nSize ); assert( child < p->nSize );
if ( Cost >= Vec_QueCost(p, p->pHeap[child])) if ( Cost >= Vec_QuePrio(p, p->pHeap[child]))
break; break;
p->pHeap[i] = p->pHeap[child]; p->pHeap[i] = p->pHeap[child];
p->pOrder[p->pHeap[i]] = i; p->pOrder[p->pHeap[i]] = i;
@ -269,7 +269,7 @@ static inline void Vec_QuePrint( Vec_Que_t * p )
printf( "\n" ); printf( "\n" );
for ( m = 0; m < k; m++ ) for ( m = 0; m < k; m++ )
if ( i+m < p->nSize ) if ( i+m < p->nSize )
printf( "%-5.0f", Vec_QueCost(p, p->pHeap[i+m]) ); printf( "%-5.0f", Vec_QuePrio(p, p->pHeap[i+m]) );
printf( "\n" ); printf( "\n" );
printf( "\n" ); printf( "\n" );
} }
@ -307,10 +307,10 @@ static inline void Vec_QueCheck( Vec_Que_t * p )
{ {
child = i << 1; child = i << 1;
if ( child < p->nSize ) if ( child < p->nSize )
assert( Vec_QueCost(p, p->pHeap[i]) >= Vec_QueCost(p, p->pHeap[child]) ); assert( Vec_QuePrio(p, p->pHeap[i]) >= Vec_QuePrio(p, p->pHeap[child]) );
child++; child++;
if ( child < p->nSize ) if ( child < p->nSize )
assert( Vec_QueCost(p, p->pHeap[i]) >= Vec_QueCost(p, p->pHeap[child]) ); assert( Vec_QuePrio(p, p->pHeap[i]) >= Vec_QuePrio(p, p->pHeap[child]) );
} }
} }
@ -333,7 +333,7 @@ static inline void Vec_QueTest( Vec_Flt_t * vCosts )
// start the queue // start the queue
p = Vec_QueAlloc( Vec_FltSize(vCosts) ); p = Vec_QueAlloc( Vec_FltSize(vCosts) );
Vec_QueSetCosts( p, Vec_FltArrayP(vCosts) ); Vec_QueSetPriority( p, Vec_FltArrayP(vCosts) );
for ( i = 0; i < Vec_FltSize(vCosts); i++ ) for ( i = 0; i < Vec_FltSize(vCosts); i++ )
Vec_QuePush( p, i ); Vec_QuePush( p, i );
// Vec_QuePrint( p ); // Vec_QuePrint( p );