summaryrefslogtreecommitdiffstats
path: root/src/opt/res/resDivs.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2007-01-24 08:01:00 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2007-01-24 08:01:00 -0800
commit1c26e2d29768c64315447969f137e3bf9ffa7dac (patch)
treec8aaab3a85e0065b39adc66358f4aa29bb8b1929 /src/opt/res/resDivs.c
parentb1a913fb5e85ba04646632f3d771ad79bfd8a720 (diff)
downloadabc-1c26e2d29768c64315447969f137e3bf9ffa7dac.tar.gz
abc-1c26e2d29768c64315447969f137e3bf9ffa7dac.tar.bz2
abc-1c26e2d29768c64315447969f137e3bf9ffa7dac.zip
Version abc70124
Diffstat (limited to 'src/opt/res/resDivs.c')
-rw-r--r--src/opt/res/resDivs.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/opt/res/resDivs.c b/src/opt/res/resDivs.c
index 0739b81b..a18764ed 100644
--- a/src/opt/res/resDivs.c
+++ b/src/opt/res/resDivs.c
@@ -19,7 +19,7 @@
***********************************************************************/
#include "abc.h"
-#include "res.h"
+#include "resInt.h"
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
@@ -56,11 +56,12 @@ void Res_WinDivisors( Res_Win_t * p, int nLevDivMax )
// prepare the new trav ID
Abc_NtkIncrementTravId( p->pNode->pNtk );
// mark the TFO of the node (does not increment trav ID)
- Res_WinVisitNodeTfo( p );
+ Res_WinSweepLeafTfo_rec( p->pNode, p->nLevDivMax, NULL );
// mark the MFFC of the node (does not increment trav ID)
Res_WinVisitMffc( p );
// go through all the legal levels and check if their fanouts can be divisors
+ p->nDivsPlus = 0;
Vec_VecForEachEntryStartStop( p->vLevels, pObj, i, k, 0, p->nLevDivMax - 1 )
{
// skip nodes in the TFO or in the MFFC of node
@@ -69,15 +70,15 @@ void Res_WinDivisors( Res_Win_t * p, int nLevDivMax )
// consider fanouts of this node
Abc_ObjForEachFanout( pObj, pFanout, f )
{
+ // skip nodes that are already added
+ if ( pFanout->fMarkA )
+ continue;
// skip COs
if ( !Abc_ObjIsNode(pFanout) )
continue;
// skip nodes in the TFO or in the MFFC of node
if ( Abc_NodeIsTravIdCurrent(pFanout) )
continue;
- // skip nodes that are already added
- if ( pFanout->fMarkA )
- continue;
// skip nodes with large level
if ( (int)pFanout->Level > p->nLevDivMax )
continue;
@@ -85,10 +86,11 @@ void Res_WinDivisors( Res_Win_t * p, int nLevDivMax )
Abc_ObjForEachFanin( pFanout, pFanin, m )
if ( !pFanin->fMarkA )
break;
- if ( m < Abc_ObjFaninNum(pFanin) )
+ if ( m < Abc_ObjFaninNum(pFanout) )
continue;
// add the node
Res_WinAddNode( p, pFanout );
+ p->nDivsPlus++;
}
}
@@ -100,8 +102,8 @@ void Res_WinDivisors( Res_Win_t * p, int nLevDivMax )
// collect the divisors below the line
Vec_PtrClear( p->vDivs );
- // collect the node fanins first
- Abc_ObjForEachFanin( pObj, pFanin, m )
+ // collect the node fanins first and mark the fanins
+ Abc_ObjForEachFanin( p->pNode, pFanin, m )
{
Vec_PtrPush( p->vDivs, pFanin );
Abc_NodeSetTravIdCurrent( pFanin );
@@ -114,6 +116,9 @@ void Res_WinDivisors( Res_Win_t * p, int nLevDivMax )
Vec_VecForEachEntryStartStop( p->vLevels, pObj, i, k, p->nLevLeaves, p->nLevDivMax )
if ( !Abc_NodeIsTravIdCurrent(pObj) )
Vec_PtrPush( p->vDivs, pObj );
+
+ // verify the resulting window
+// Res_WinVerify( p );
}
/**Function*************************************************************