summaryrefslogtreecommitdiffstats
path: root/src/opt
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2013-06-04 21:04:56 -0500
committerAlan Mishchenko <alanmi@berkeley.edu>2013-06-04 21:04:56 -0500
commit8108655263fb5167840cea12c069ff64676ee996 (patch)
treed1d5e8f3983f8a4098568f363acc946b6e52a673 /src/opt
parent90a88462c4140aad870ad7ab4c23e953131afdfd (diff)
downloadabc-8108655263fb5167840cea12c069ff64676ee996.tar.gz
abc-8108655263fb5167840cea12c069ff64676ee996.tar.bz2
abc-8108655263fb5167840cea12c069ff64676ee996.zip
Integrating new MFS package with GIA manager.
Diffstat (limited to 'src/opt')
-rw-r--r--src/opt/sfm/sfm.h3
-rw-r--r--src/opt/sfm/sfmInt.h2
-rw-r--r--src/opt/sfm/sfmWin.c34
3 files changed, 38 insertions, 1 deletions
diff --git a/src/opt/sfm/sfm.h b/src/opt/sfm/sfm.h
index 078026c5..cc797afc 100644
--- a/src/opt/sfm/sfm.h
+++ b/src/opt/sfm/sfm.h
@@ -75,7 +75,8 @@ extern Vec_Int_t * Sfm_NodeReadFanins( Sfm_Ntk_t * p, int i );
extern word * Sfm_NodeReadTruth( Sfm_Ntk_t * p, int i );
extern int Sfm_NodeReadFixed( Sfm_Ntk_t * p, int i );
extern int Sfm_NodeReadUsed( Sfm_Ntk_t * p, int i );
-/*=== sfmSat.c ==========================================================*/
+/*=== sfmWin.c ==========================================================*/
+extern Vec_Int_t * Sfm_NtkDfs( Sfm_Ntk_t * p );
ABC_NAMESPACE_HEADER_END
diff --git a/src/opt/sfm/sfmInt.h b/src/opt/sfm/sfmInt.h
index b193fd9e..b3e1909d 100644
--- a/src/opt/sfm/sfmInt.h
+++ b/src/opt/sfm/sfmInt.h
@@ -162,6 +162,8 @@ extern void Kit_DsdPrintFromTruth( unsigned * pTruth, int nVars );
/// MACRO DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
+#define Sfm_NtkForEachPi( p, i ) for ( i = 0; i < p->nPis; i++ )
+#define Sfm_NtkForEachPo( p, i ) for ( i = p->nObjs - p->nPos; i < p->nObjs; i++ )
#define Sfm_NtkForEachNode( p, i ) for ( i = p->nPis; i + p->nPos < p->nObjs; i++ )
#define Sfm_NtkForEachNodeReverse( p, i ) for ( i = p->nObjs - p->nPos - 1; i >= p->nPis; i-- )
#define Sfm_ObjForEachFanin( p, Node, Fan, i ) for ( i = 0; i < Sfm_ObjFaninNum(p, Node) && ((Fan = Sfm_ObjFanin(p, Node, i)), 1); i++ )
diff --git a/src/opt/sfm/sfmWin.c b/src/opt/sfm/sfmWin.c
index fa0b484b..e39516b1 100644
--- a/src/opt/sfm/sfmWin.c
+++ b/src/opt/sfm/sfmWin.c
@@ -123,6 +123,40 @@ static inline int Sfm_ObjIsTravIdCurrent2( Sfm_Ntk_t * p, int Id ) { return
/**Function*************************************************************
+ Synopsis [Collects used internal nodes in a topological order.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Sfm_NtkDfs_rec( Sfm_Ntk_t * p, int iNode, Vec_Int_t * vNodes )
+{
+ int i, iFanin;
+ if ( Sfm_ObjIsPi(p, iNode) )
+ return;
+ if ( Sfm_ObjIsTravIdCurrent(p, iNode) )
+ return;
+ Sfm_ObjSetTravIdCurrent(p, iNode);
+ Sfm_ObjForEachFanin( p, iNode, iFanin, i )
+ Sfm_NtkDfs_rec( p, iFanin, vNodes );
+ Vec_IntPush( vNodes, iNode );
+}
+Vec_Int_t * Sfm_NtkDfs( Sfm_Ntk_t * p )
+{
+ Vec_Int_t * vNodes;
+ int i;
+ vNodes = Vec_IntAlloc( p->nObjs );
+ Sfm_NtkIncrementTravId( p );
+ Sfm_NtkForEachPo( p, i )
+ Sfm_NtkDfs_rec( p, Sfm_ObjFanin(p, i, 0), vNodes );
+ return vNodes;
+}
+
+/**Function*************************************************************
+
Synopsis [Check if this fanout overlaps with TFI cone of the node.]
Description []