Commit 7b99370e by Alan Mishchenko

Changing default values.

parent f2fab579
......@@ -568,7 +568,7 @@ void Dam_ManCreatePairs( Dam_Man_t * p, int fVerbose )
p->vHash = Hash_IntManStart( 3 * nDivsUsed /2 );
p->vCounts = Vec_FltAlloc( 2 * nDivsUsed ); Vec_FltPush( p->vCounts, ABC_INFINITY );
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
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 );
......@@ -907,7 +907,7 @@ Gia_Man_t * Dam_ManMultiExtractInt( Gia_Man_t * pGia, int nNewNodesMax, int fVer
int i, iDiv;
p = Dam_ManAlloc( pGia );
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);
if ( fVeryVerbose )
......
......@@ -27436,7 +27436,7 @@ int Abc_CommandAbc9Fx( Abc_Frame_t * pAbc, int argc, char ** argv )
int fVeryVerbose = 0;
// set the defaults
Extra_UtilGetoptReset();
while ( (c = Extra_UtilGetopt(argc, argv, "NMrvh")) != EOF )
while ( (c = Extra_UtilGetopt(argc, argv, "NMrvwh")) != EOF )
{
switch (c)
{
......@@ -27468,6 +27468,9 @@ int Abc_CommandAbc9Fx( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'v':
fVerbose ^= 1;
break;
case 'w':
fVeryVerbose ^= 1;
break;
case 'h':
goto usage;
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-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-w : toggle printing additional information [default = %s]\n", fVeryVerbose? "yes": "no" );
Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
......@@ -395,7 +395,7 @@ static inline int Fx_ManComputeLevelDiv( Fx_Man_t * p, Vec_Int_t * vCubeFree )
int i, Lit, Level = 0;
Vec_IntForEachEntry( vCubeFree, Lit, i )
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 )
{
......@@ -473,7 +473,7 @@ static inline void Fx_PrintDiv( Fx_Man_t * p, int iDiv )
int i;
printf( "%4d : ", p->nDivs );
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 );
Fx_PrintDivOne( Hsh_VecReadEntry(p->pHash, iDiv) );
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;
int i, v, Lit, nObjs;
char * pLine;
if ( Vec_WecSize(p->vLits)/2 > 26 )
return;
printf( " " );
nObjs = Vec_WecSize(p->vLits)/2;
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 )
{
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++;
}
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 ( 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) );
Vec_FltAddToEntry( p->vWeights, iDiv, Base + Vec_IntSize(p->vCubeFree) - 1 );
p->nPairsD++;
......@@ -884,7 +886,7 @@ void Fx_ManCreateDivisors( Fx_Man_t * p )
Fx_ManCubeDoubleCubeDivisors( p, i+1, vCube, 0, 0 ); // add - no update
// create queue with all divisors
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 )
if ( Weight > 0.0 )
Vec_QuePush( p->vPrio, i );
......@@ -985,6 +987,8 @@ void Fx_ManUpdate( Fx_Man_t * p, int iDiv )
Vec_Int_t * vDiv = p->vDiv;
int nLitsNew = p->nLits - (int)Vec_FltEntry(p->vWeights, iDiv);
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
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 );
// perform extraction
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);
if ( fVeryVerbose )
......
......@@ -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->vDep, p->nObjAlloc, 0 );
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
p->DelayInv = Mio_GateReadPinDelay( Mio_LibraryReadInv((Mio_Library_t *)pNtk->pManFunc), 0 );
p->vEdges = Vec_IntAlloc( 1000 );
......
......@@ -161,7 +161,7 @@ static inline SC_Man * Abc_SclManAlloc( SC_Lib * pLib, Abc_Ntk_t * pNtk )
p->vBestFans = Vec_IntStart( p->nObjs );
p->vTimesOut = Vec_FltStart( 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++ )
Vec_QuePush( p->vQue, i );
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->vNode2Gate = Vec_IntStart( 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->vLevels = Vec_WecStart( 2 * Abc_NtkLevel(pNtk) );
p->vChanged = Vec_IntAlloc( 100 );
......
......@@ -47,7 +47,7 @@ struct Vec_Que_t_
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 ///
......@@ -92,7 +92,7 @@ static inline void Vec_QueFreeP( Vec_Que_t ** p )
Vec_QueFree( *p );
*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 );
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;
}
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*************************************************************
......@@ -158,13 +158,13 @@ static inline float Vec_QueTopCost( Vec_Que_t * p )
***********************************************************************/
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 parent = i >> 1;
int fMoved = 0;
assert( p->pOrder[v] != -1 );
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->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 )
{
float Cost = Vec_QueCost(p, v);
float Cost = Vec_QuePrio(p, v);
int i = p->pOrder[v];
int child = i << 1;
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++;
assert( child < p->nSize );
if ( Cost >= Vec_QueCost(p, p->pHeap[child]))
if ( Cost >= Vec_QuePrio(p, p->pHeap[child]))
break;
p->pHeap[i] = p->pHeap[child];
p->pOrder[p->pHeap[i]] = i;
......@@ -269,7 +269,7 @@ static inline void Vec_QuePrint( Vec_Que_t * p )
printf( "\n" );
for ( m = 0; m < k; m++ )
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" );
}
......@@ -307,10 +307,10 @@ static inline void Vec_QueCheck( Vec_Que_t * p )
{
child = i << 1;
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++;
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
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++ )
Vec_QuePush( p, i );
// Vec_QuePrint( p );
......
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