summaryrefslogtreecommitdiffstats
path: root/src/base/wlc
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2015-06-19 22:58:07 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2015-06-19 22:58:07 -0700
commit4b7dd69260f5347e3ae1c92b3d7f18a9ca1c05c0 (patch)
tree3338355502b43e4f582bd7017e5f273702898d2c /src/base/wlc
parent6e4ef76311923099a67df7dae5894dee574825c9 (diff)
downloadabc-4b7dd69260f5347e3ae1c92b3d7f18a9ca1c05c0.tar.gz
abc-4b7dd69260f5347e3ae1c92b3d7f18a9ca1c05c0.tar.bz2
abc-4b7dd69260f5347e3ae1c92b3d7f18a9ca1c05c0.zip
Adding new debugging feature to Wlc_Ntk_t.
Diffstat (limited to 'src/base/wlc')
-rw-r--r--src/base/wlc/wlc.h1
-rw-r--r--src/base/wlc/wlcCom.c4
-rw-r--r--src/base/wlc/wlcNtk.c53
3 files changed, 57 insertions, 1 deletions
diff --git a/src/base/wlc/wlc.h b/src/base/wlc/wlc.h
index 54dccc1f..57f17047 100644
--- a/src/base/wlc/wlc.h
+++ b/src/base/wlc/wlc.h
@@ -258,6 +258,7 @@ extern void Wlc_NtkPrintNodes( Wlc_Ntk_t * p, int Type );
extern void Wlc_NtkPrintStats( Wlc_Ntk_t * p, int fDistrib, int fVerbose );
extern Wlc_Ntk_t * Wlc_NtkDupDfs( Wlc_Ntk_t * p );
extern void Wlc_NtkTransferNames( Wlc_Ntk_t * pNew, Wlc_Ntk_t * p );
+extern Wlc_Ntk_t * Wlc_NtkDupSingleNodes( Wlc_Ntk_t * p );
/*=== wlcReadSmt.c ========================================================*/
extern Wlc_Ntk_t * Wlc_ReadSmtBuffer( char * pFileName, char * pBuffer, char * pLimit );
extern Wlc_Ntk_t * Wlc_ReadSmt( char * pFileName );
diff --git a/src/base/wlc/wlcCom.c b/src/base/wlc/wlcCom.c
index 16e2c497..0ce8613e 100644
--- a/src/base/wlc/wlcCom.c
+++ b/src/base/wlc/wlcCom.c
@@ -385,7 +385,9 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
//pNtk = Wlc_NtkAbstractNodes( pNtk, NULL );
//Wlc_AbcUpdateNtk( pAbc, pNtk );
//Wlc_GenerateSmtStdout( pAbc );
- Wlc_NtkSimulateTest( (Wlc_Ntk_t *)pAbc->pAbcWlc );
+ //Wlc_NtkSimulateTest( (Wlc_Ntk_t *)pAbc->pAbcWlc );
+ pNtk = Wlc_NtkDupSingleNodes( pNtk );
+ Wlc_AbcUpdateNtk( pAbc, pNtk );
return 0;
usage:
Abc_Print( -2, "usage: %%test [-vh]\n" );
diff --git a/src/base/wlc/wlcNtk.c b/src/base/wlc/wlcNtk.c
index 44a114f4..11f63d17 100644
--- a/src/base/wlc/wlcNtk.c
+++ b/src/base/wlc/wlcNtk.c
@@ -499,6 +499,59 @@ void Wlc_NtkTransferNames( Wlc_Ntk_t * pNew, Wlc_Ntk_t * p )
pNew->vTables = p->vTables; p->vTables = NULL;
}
+/**Function*************************************************************
+
+ Synopsis [Duplicates the network by copying each node.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Wlc_Ntk_t * Wlc_NtkDupSingleNodes( Wlc_Ntk_t * p )
+{
+ Wlc_Ntk_t * pNew;
+ Vec_Int_t * vFanins;
+ Wlc_Obj_t * pObj, * pObjNew;
+ Wlc_Obj_t * pFanin, * pFaninNew;
+ int i, k, iFanin, iFaninNew, iObjNew, Count = 0;
+ // count objects
+ Wlc_NtkForEachObj( p, pObj, i )
+ if ( !Wlc_ObjIsCi(pObj) )
+ Count += 1 + Wlc_ObjFaninNum(pObj);
+ // copy objects
+ Wlc_NtkCleanCopy( p );
+ vFanins = Vec_IntAlloc( 100 );
+ pNew = Wlc_NtkAlloc( p->pName, p->nObjsAlloc );
+ Wlc_NtkForEachObj( p, pObj, i )
+ {
+ if ( Wlc_ObjIsCi(pObj) )
+ continue;
+ if ( pObj->Type == WLC_OBJ_ARI_MULTI )
+ continue;
+ // create CIs for the fanins
+ Wlc_ObjForEachFanin( pObj, iFanin, k )
+ {
+ pFanin = Wlc_NtkObj(p, iFanin);
+ iFaninNew = Wlc_ObjAlloc( pNew, WLC_OBJ_PI, pFanin->Signed, pFanin->End, pFanin->Beg );
+ pFaninNew = Wlc_NtkObj(pNew, iFaninNew);
+ Wlc_ObjSetCopy( p, iFanin, iFaninNew );
+ //Wlc_ObjSetCi( pNew, pFaninNew );
+ }
+ // create object
+ iObjNew = Wlc_ObjDup( pNew, p, i, vFanins );
+ pObjNew = Wlc_NtkObj(pNew, iObjNew);
+ pObjNew->fIsPo = 1;
+ Vec_IntPush( &pNew->vPos, iObjNew );
+ }
+ Vec_IntFree( vFanins );
+ Wlc_NtkTransferNames( pNew, p );
+ return pNew;
+}
+
+
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////