summaryrefslogtreecommitdiffstats
path: root/src/opt/mfs
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2015-06-22 23:05:06 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2015-06-22 23:05:06 -0700
commit4d1bc4a268ad0be95818c718eae82e0be5c9057c (patch)
tree69f26241fe2798f994afa02befdbc298eccdea6a /src/opt/mfs
parentb288bac6b3567c0eccde1cb3ed1b6f7eff1d6408 (diff)
downloadabc-4d1bc4a268ad0be95818c718eae82e0be5c9057c.tar.gz
abc-4d1bc4a268ad0be95818c718eae82e0be5c9057c.tar.bz2
abc-4d1bc4a268ad0be95818c718eae82e0be5c9057c.zip
Version abc90809
committer: Baruch Sterin <baruchs@gmail.com>
Diffstat (limited to 'src/opt/mfs')
-rw-r--r--src/opt/mfs/mfs.h1
-rw-r--r--src/opt/mfs/mfsCore.c6
-rw-r--r--src/opt/mfs/mfsDiv.c2
-rw-r--r--src/opt/mfs/mfsInt.h2
-rw-r--r--src/opt/mfs/mfsMan.c4
-rw-r--r--src/opt/mfs/mfsResub.c37
6 files changed, 36 insertions, 16 deletions
diff --git a/src/opt/mfs/mfs.h b/src/opt/mfs/mfs.h
index 375f93b7..8b49345e 100644
--- a/src/opt/mfs/mfs.h
+++ b/src/opt/mfs/mfs.h
@@ -55,6 +55,7 @@ struct Mfs_Par_t_
int fOneHotness; // adds one-hotness conditions
int fDelay; // performs optimization for delay
int fPower; // performs power-aware optimization
+ int fGiaSat; // use new SAT solver
int fVerbose; // enable basic stats
int fVeryVerbose; // enable detailed stats
};
diff --git a/src/opt/mfs/mfsCore.c b/src/opt/mfs/mfsCore.c
index 8f40d2f7..c598a19b 100644
--- a/src/opt/mfs/mfsCore.c
+++ b/src/opt/mfs/mfsCore.c
@@ -266,7 +266,8 @@ clk = clock();
return 1;
}
clk = clock();
-// Abc_NtkMfsConstructGia( p );
+ if ( p->pPars->fGiaSat )
+ Abc_NtkMfsConstructGia( p );
p->timeGia += clock() - clk;
// solve the SAT problem
if ( p->pPars->fPower )
@@ -280,7 +281,8 @@ p->timeGia += clock() - clk;
Abc_NtkMfsResubNode2( p, pNode );
}
p->timeSat += clock() - clk;
-// Abc_NtkMfsDeconstructGia( p );
+ if ( p->pPars->fGiaSat )
+ Abc_NtkMfsDeconstructGia( p );
return 1;
}
diff --git a/src/opt/mfs/mfsDiv.c b/src/opt/mfs/mfsDiv.c
index da6979d1..f5a07d31 100644
--- a/src/opt/mfs/mfsDiv.c
+++ b/src/opt/mfs/mfsDiv.c
@@ -255,7 +255,7 @@ Vec_Ptr_t * Abc_MfsComputeDivisors( Mfs_Man_t * p, Abc_Obj_t * pNode, int nLevDi
// skip nodes with large level
if ( (int)pFanout->Level > nLevDivMax )
continue;
- // skip nodes whose fanins are not divisors
+ // skip nodes whose fanins are not divisors -- here we skip more than we need to skip!!! (revise later) August 7, 2009
Abc_ObjForEachFanin( pFanout, pFanin, m )
if ( !Abc_NodeIsTravIdPrevious(pFanin) )
break;
diff --git a/src/opt/mfs/mfsInt.h b/src/opt/mfs/mfsInt.h
index 6a1d9688..8adffd44 100644
--- a/src/opt/mfs/mfsInt.h
+++ b/src/opt/mfs/mfsInt.h
@@ -68,7 +68,7 @@ struct Mfs_Man_t_
int nSatCexes;
// intermediate AIG data
Gia_Man_t * pGia; // replica of the AIG in the new package
- Gia_Obj_t ** pSat2Gia; // mapping of PO SAT var into internal GIA nodes
+// Gia_Obj_t ** pSat2Gia; // mapping of PO SAT var into internal GIA nodes
Tas_Man_t * pTas; // the SAT solver
Vec_Int_t * vCex; // the counter-example
Vec_Ptr_t * vGiaLits; // literals given as assumptions
diff --git a/src/opt/mfs/mfsMan.c b/src/opt/mfs/mfsMan.c
index 71595f6c..96a43368 100644
--- a/src/opt/mfs/mfsMan.c
+++ b/src/opt/mfs/mfsMan.c
@@ -136,10 +136,10 @@ void Mfs_ManPrint( Mfs_Man_t * p )
p->TotalSwitchingBeg - p->TotalSwitchingEnd,
100.0*(p->TotalSwitchingBeg-p->TotalSwitchingEnd)/p->TotalSwitchingBeg );
printf( "\n" );
-#if 0
+//#if 0
printf( "Nodes = %d. Try = %d. Resub = %d. Div = %d. SAT calls = %d. Timeouts = %d.\n",
Abc_NtkNodeNum(p->pNtk), p->nNodesTried, p->nNodesResub, p->nTotalDivs, p->nSatCalls, p->nTimeOuts );
-#endif
+//#endif
if ( p->pPars->fSwapEdge )
printf( "Swappable edges = %d. Total edges = %d. Ratio = %5.2f.\n",
p->nNodesResub, Abc_NtkGetTotalFanins(p->pNtk), 1.00 * p->nNodesResub / Abc_NtkGetTotalFanins(p->pNtk) );
diff --git a/src/opt/mfs/mfsResub.c b/src/opt/mfs/mfsResub.c
index b28e782a..7d0fccc0 100644
--- a/src/opt/mfs/mfsResub.c
+++ b/src/opt/mfs/mfsResub.c
@@ -27,7 +27,7 @@
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
-
+
/**Function*************************************************************
Synopsis [Updates the network after resubstitution.]
@@ -97,27 +97,41 @@ void Abc_NtkMfsPrintResubStats( Mfs_Man_t * p )
***********************************************************************/
int Abc_NtkMfsTryResubOnce( Mfs_Man_t * p, int * pCands, int nCands )
{
+ int fVeryVerbose = 0;
unsigned * pData;
- int RetValue, iVar, i;
-// int clk = clock(), RetValue2 = Abc_NtkMfsTryResubOnceGia( p, pCands, nCands );
-//p->timeGia += clock() - clk;
+ int RetValue, RetValue2 = -1, iVar, i, clk = clock();
+
+ if ( p->pPars->fGiaSat )
+ {
+ RetValue2 = Abc_NtkMfsTryResubOnceGia( p, pCands, nCands );
+p->timeGia += clock() - clk;
+ return RetValue2;
+ }
p->nSatCalls++;
RetValue = sat_solver_solve( p->pSat, pCands, pCands + nCands, (ABC_INT64_T)p->pPars->nBTLimit, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 );
-// assert( RetValue == l_False || RetValue == l_True );
+ assert( RetValue == l_False || RetValue == l_True );
-// if ( RetValue != l_Undef && RetValue2 != -1 )
-// {
-// assert( (RetValue == l_False) == (RetValue2 == 1) );
-// }
+ if ( RetValue != l_Undef && RetValue2 != -1 )
+ {
+ assert( (RetValue == l_False) == (RetValue2 == 1) );
+ }
if ( RetValue == l_False )
+ {
+ if ( fVeryVerbose )
+ printf( "U " );
return 1;
+ }
if ( RetValue != l_True )
{
+ if ( fVeryVerbose )
+ printf( "T " );
p->nTimeOuts++;
return -1;
}
+ if ( fVeryVerbose )
+ printf( "S " );
p->nSatCexes++;
// store the counter-example
Vec_IntForEachEntry( p->vProjVars, iVar, i )
@@ -131,6 +145,7 @@ int Abc_NtkMfsTryResubOnce( Mfs_Man_t * p, int * pCands, int nCands )
}
p->nCexes++;
return 0;
+
}
/**Function*************************************************************
@@ -146,7 +161,7 @@ int Abc_NtkMfsTryResubOnce( Mfs_Man_t * p, int * pCands, int nCands )
***********************************************************************/
int Abc_NtkMfsSolveSatResub( Mfs_Man_t * p, Abc_Obj_t * pNode, int iFanin, int fOnlyRemove, int fSkipUpdate )
{
- int fVeryVerbose = p->pPars->fVeryVerbose && Vec_PtrSize(p->vDivs) < 80;
+ int fVeryVerbose = p->pPars->fVeryVerbose && Vec_PtrSize(p->vDivs) < 80;// || pNode->Id == 556;
unsigned * pData;
int pCands[MFS_FANIN_MAX];
int RetValue, iVar, i, nCands, nWords, w, clk;
@@ -533,6 +548,7 @@ int Abc_NtkMfsResubNode( Mfs_Man_t * p, Abc_Obj_t * pNode )
}
if ( Abc_ObjFaninNum(pNode) == p->nFaninMax )
return 0;
+/*
// try replacing area critical fanins while adding two new fanins
Abc_ObjForEachFanin( pNode, pFanin, i )
if ( !Abc_ObjIsCi(pFanin) && Abc_ObjFanoutNum(pFanin) == 1 )
@@ -540,6 +556,7 @@ int Abc_NtkMfsResubNode( Mfs_Man_t * p, Abc_Obj_t * pNode )
if ( Abc_NtkMfsSolveSatResub2( p, pNode, i, -1 ) )
return 1;
}
+*/
return 0;
}