Experiments with don't-cares.

This commit is contained in:
Alan Mishchenko
2017-04-02 21:51:47 -07:00
parent 3898ba5486
commit f765e666ca
10 changed files with 611 additions and 340 deletions
+19 -19
View File
@@ -5676,30 +5676,19 @@ int Abc_CommandMfse( Abc_Frame_t * pAbc, int argc, char ** argv )
Acb_Par_t Pars, * pPars = &Pars; int c;
Acb_ParSetDefault( pPars );
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "MDOFLCavwh" ) ) != EOF )
while ( ( c = Extra_UtilGetopt( argc, argv, "IOWFLCavwh" ) ) != EOF )
{
switch ( c )
{
case 'M':
case 'I':
if ( globalUtilOptind >= argc )
{
Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
goto usage;
}
pPars->nTabooMax = atoi(argv[globalUtilOptind]);
pPars->nTfiLevMax = atoi(argv[globalUtilOptind]);
globalUtilOptind++;
if ( pPars->nTabooMax < 0 )
goto usage;
break;
case 'D':
if ( globalUtilOptind >= argc )
{
Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
goto usage;
}
pPars->nDivMax = atoi(argv[globalUtilOptind]);
globalUtilOptind++;
if ( pPars->nDivMax < 0 )
if ( pPars->nTfiLevMax < 0 )
goto usage;
break;
case 'O':
@@ -5713,6 +5702,17 @@ int Abc_CommandMfse( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pPars->nTfoLevMax < 0 )
goto usage;
break;
case 'W':
if ( globalUtilOptind >= argc )
{
Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
goto usage;
}
pPars->nWinNodeMax = atoi(argv[globalUtilOptind]);
globalUtilOptind++;
if ( pPars->nWinNodeMax < 0 )
goto usage;
break;
case 'F':
if ( globalUtilOptind >= argc )
{
@@ -5788,11 +5788,11 @@ int Abc_CommandMfse( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
Abc_Print( -2, "usage: mfse [-MDOFLC <num>] [-avwh]\n" );
Abc_Print( -2, "usage: mfse [-IOWFLC <num>] [-avwh]\n" );
Abc_Print( -2, "\t performs don't-care-based optimization of logic networks\n" );
Abc_Print( -2, "\t-M <num> : the max number of fanin nodes to skip (num >= 1) [default = %d]\n", pPars->nTabooMax );
Abc_Print( -2, "\t-D <num> : the max number of divisors [default = %d]\n", pPars->nDivMax );
Abc_Print( -2, "\t-I <num> : the number of levels in the TFI cone (2 <= num) [default = %d]\n", pPars->nTfiLevMax );
Abc_Print( -2, "\t-O <num> : the number of levels in the TFO cone (0 <= num) [default = %d]\n", pPars->nTfoLevMax );
Abc_Print( -2, "\t-W <num> : the max number of nodes in the window (1 <= num) [default = %d]\n", pPars->nWinNodeMax );
Abc_Print( -2, "\t-F <num> : the max number of fanouts to skip (1 <= num) [default = %d]\n", pPars->nFanoutMax );
Abc_Print( -2, "\t-L <num> : the max increase in node level after resynthesis (0 <= num) [default = %d]\n", pPars->nGrowthLevel );
Abc_Print( -2, "\t-C <num> : the max number of conflicts in one SAT run (0 = no limit) [default = %d]\n", pPars->nBTLimit );
+4 -1
View File
@@ -503,7 +503,10 @@ static inline void Acb_ObjRemoveFaninFanout( Acb_Ntk_t * p, int iObj )
{
int k, iFanin, * pFanins;
Acb_ObjForEachFaninFast( p, iObj, pFanins, iFanin, k )
Vec_IntRemove( Vec_WecEntry(&p->vFanouts, iFanin), iObj );
{
int RetValue = Vec_IntRemove( Vec_WecEntry(&p->vFanouts, iFanin), iObj );
assert( RetValue );
}
}
static inline void Acb_NtkCreateFanout( Acb_Ntk_t * p )
{
+2 -3
View File
@@ -210,10 +210,9 @@ void Acb_ParSetDefault( Acb_Par_t * pPars )
memset( pPars, 0, sizeof(Acb_Par_t) );
pPars->nLutSize = 4; // LUT size
pPars->nTfoLevMax = 2; // the maximum fanout levels
pPars->nTfiLevMax = 2; // the maximum fanin levels
pPars->nTfiLevMax = 3; // the maximum fanin levels
pPars->nFanoutMax = 20; // the maximum number of fanouts
pPars->nDivMax = 24; // the maximum divisor count
pPars->nTabooMax = 1; // the minimum MFFC size
pPars->nWinNodeMax = 100; // the maximum number of nodes in the window
pPars->nGrowthLevel = 0; // the maximum allowed growth in level
pPars->nBTLimit = 0; // the maximum number of conflicts in one SAT run
pPars->nNodesMax = 0; // the maximum number of nodes to try
+549 -303
View File
File diff suppressed because it is too large Load Diff
+1 -2
View File
@@ -42,8 +42,7 @@ struct Acb_Par_t_
int nTfoLevMax; // the maximum fanout levels
int nTfiLevMax; // the maximum fanin levels
int nFanoutMax; // the maximum number of fanouts
int nDivMax; // the maximum divisor count
int nTabooMax; // the minimum MFFC size
int nWinNodeMax; // the maximum number of nodes in the window
int nGrowthLevel; // the maximum allowed growth in level
int nBTLimit; // the maximum number of conflicts in one SAT run
int nNodesMax; // the maximum number of nodes to try
+27 -3
View File
@@ -308,14 +308,38 @@ void Acb_NtkCreateNode( Acb_Ntk_t * p, word uTruth, Vec_Int_t * vSupp )
Acb_ObjAddFaninFanout( p, Pivot );
Acb_ObjComputeLevelD( p, Pivot );
}
void Acb_NtkUpdateNode( Acb_Ntk_t * p, int Pivot, word uTruth, Vec_Int_t * vSupp )
void Acb_NtkResetNode( Acb_Ntk_t * p, int Pivot, word uTruth, Vec_Int_t * vSupp )
{
// remember old fanins
int k, iFanin, * pFanins;
Vec_Int_t * vFanins = Vec_IntAlloc( 6 );
assert( !Acb_ObjIsCio(p, Pivot) );
Acb_ObjForEachFaninFast( p, Pivot, pFanins, iFanin, k )
Vec_IntPush( vFanins, iFanin );
// update function
Vec_WrdSetEntry( &p->vObjTruth, Pivot, uTruth );
Vec_IntErase( Vec_WecEntry(&p->vCnfs, Pivot) );
// remove old fanins
Acb_ObjRemoveFaninFanout( p, Pivot );
Acb_ObjRemoveFanins( p, Pivot );
Acb_ObjAddFanins( p, Pivot, vSupp );
Acb_ObjAddFaninFanout( p, Pivot );
// add new fanins
if ( vSupp != NULL )
{
assert( Acb_ObjFanoutNum(p, Pivot) > 0 );
Acb_ObjAddFanins( p, Pivot, vSupp );
Acb_ObjAddFaninFanout( p, Pivot );
}
else if ( Acb_ObjFanoutNum(p, Pivot) == 0 )
Acb_ObjCleanType( p, Pivot );
// delete dangling fanins
Vec_IntForEachEntry( vFanins, iFanin, k )
if ( !Acb_ObjIsCio(p, iFanin) && Acb_ObjFanoutNum(p, iFanin) == 0 )
Acb_NtkResetNode( p, iFanin, 0, NULL );
Vec_IntFree( vFanins );
}
void Acb_NtkUpdateNode( Acb_Ntk_t * p, int Pivot, word uTruth, Vec_Int_t * vSupp )
{
Acb_NtkResetNode( p, Pivot, uTruth, vSupp );
if ( p->vQue == NULL )
Acb_NtkUpdateLevelD( p, Pivot );
else