summaryrefslogtreecommitdiffstats
path: root/src/base
diff options
context:
space:
mode:
Diffstat (limited to 'src/base')
-rw-r--r--src/base/abc/abc.h1
-rw-r--r--src/base/abc/abcNtk.c39
-rw-r--r--src/base/abci/abc.c7
3 files changed, 42 insertions, 5 deletions
diff --git a/src/base/abc/abc.h b/src/base/abc/abc.h
index 9ed546e6..0d34ef2f 100644
--- a/src/base/abc/abc.h
+++ b/src/base/abc/abc.h
@@ -705,6 +705,7 @@ extern ABC_DLL void Abc_NtkFinalize( Abc_Ntk_t * pNtk, Abc_Ntk_t *
extern ABC_DLL Abc_Ntk_t * Abc_NtkStartRead( char * pName );
extern ABC_DLL void Abc_NtkFinalizeRead( Abc_Ntk_t * pNtk );
extern ABC_DLL Abc_Ntk_t * Abc_NtkDup( Abc_Ntk_t * pNtk );
+extern ABC_DLL Abc_Ntk_t * Abc_NtkDupDfs( Abc_Ntk_t * pNtk );
extern ABC_DLL Abc_Ntk_t * Abc_NtkDupTransformMiter( Abc_Ntk_t * pNtk );
extern ABC_DLL Abc_Ntk_t * Abc_NtkCreateCone( Abc_Ntk_t * pNtk, Abc_Obj_t * pNode, char * pNodeName, int fUseAllCis );
extern ABC_DLL Abc_Ntk_t * Abc_NtkCreateConeArray( Abc_Ntk_t * pNtk, Vec_Ptr_t * vRoots, int fUseAllCis );
diff --git a/src/base/abc/abcNtk.c b/src/base/abc/abcNtk.c
index 2f28f54c..5f9c0f0d 100644
--- a/src/base/abc/abcNtk.c
+++ b/src/base/abc/abcNtk.c
@@ -350,9 +350,6 @@ Abc_Ntk_t * Abc_NtkDup( Abc_Ntk_t * pNtk )
return NULL;
// start the network
pNtkNew = Abc_NtkStartFrom( pNtk, pNtk->ntkType, pNtk->ntkFunc );
- // transfer level
- Abc_NtkForEachCi( pNtk, pObj, i )
- pObj->pCopy->Level = pObj->Level;
// copy the internal nodes
if ( Abc_NtkIsStrash(pNtk) )
{
@@ -406,6 +403,42 @@ Abc_Ntk_t * Abc_NtkDup( Abc_Ntk_t * pNtk )
pNtk->pCopy = pNtkNew;
return pNtkNew;
}
+Abc_Ntk_t * Abc_NtkDupDfs( Abc_Ntk_t * pNtk )
+{
+ Vec_Ptr_t * vNodes;
+ Abc_Ntk_t * pNtkNew;
+ Abc_Obj_t * pObj, * pFanin;
+ int i, k;
+ if ( pNtk == NULL )
+ return NULL;
+ assert( !Abc_NtkIsStrash(pNtk) && !Abc_NtkIsNetlist(pNtk) );
+ // start the network
+ pNtkNew = Abc_NtkStartFrom( pNtk, pNtk->ntkType, pNtk->ntkFunc );
+ // copy the internal nodes
+ vNodes = Abc_NtkDfs( pNtk, 0 );
+ Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
+ Abc_NtkDupObj( pNtkNew, pObj, 0 );
+ Vec_PtrFree( vNodes );
+ // reconnect all objects (no need to transfer attributes on edges)
+ Abc_NtkForEachObj( pNtk, pObj, i )
+ if ( !Abc_ObjIsBox(pObj) && !Abc_ObjIsBo(pObj) )
+ Abc_ObjForEachFanin( pObj, pFanin, k )
+ if ( pObj->pCopy && pFanin->pCopy )
+ Abc_ObjAddFanin( pObj->pCopy, pFanin->pCopy );
+ // duplicate the EXDC Ntk
+ if ( pNtk->pExdc )
+ pNtkNew->pExdc = Abc_NtkDup( pNtk->pExdc );
+ if ( pNtk->pExcare )
+ pNtkNew->pExcare = Abc_NtkDup( (Abc_Ntk_t *)pNtk->pExcare );
+ // duplicate timing manager
+ if ( pNtk->pManTime )
+ Abc_NtkTimeInitialize( pNtkNew, pNtk );
+ // check correctness
+ if ( !Abc_NtkCheck( pNtkNew ) )
+ fprintf( stdout, "Abc_NtkDup(): Network check has failed.\n" );
+ pNtk->pCopy = pNtkNew;
+ return pNtkNew;
+}
/**Function*************************************************************
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c
index 9c1bd720..c192b809 100644
--- a/src/base/abci/abc.c
+++ b/src/base/abci/abc.c
@@ -9385,14 +9385,17 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
extern Aig_Man_t * Abc_NtkToDarBmc( Abc_Ntk_t * pNtk, Vec_Int_t ** pvMap );
extern void Abc2_NtkTestGia( char * pFileName, int fVerbose );
extern void Saig_ManBmcTerSimTestPo( Aig_Man_t * p );
+ extern int Abc_SclCheckNtk( Abc_Ntk_t * p );
+ extern void Abc_SclPerformBuffering( Abc_Ntk_t * p, int Degree );
if ( pNtk )
{
-
+/*
Aig_Man_t * pAig = Abc_NtkToDar( pNtk, 0, 1 );
Saig_ManBmcTerSimTestPo( pAig );
Aig_ManStop( pAig );
-
+*/
+ Abc_SclPerformBuffering( pNtk, nDecMax );
/*
extern Abc_Ntk_t * Abc_NtkShareXor( Abc_Ntk_t * pNtk );
Abc_Ntk_t * pNtkRes = Abc_NtkShareXor( pNtk );