summaryrefslogtreecommitdiffstats
path: root/src/aig/nwk
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2010-11-01 01:35:04 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2010-11-01 01:35:04 -0700
commit6130e39b18b5f53902e4eab14f6d5cdde5219563 (patch)
tree0db0628479a1b750e9af1f66cb8379ebd0913d31 /src/aig/nwk
parentf0e77f6797c0504b0da25a56152b707d3357f386 (diff)
downloadabc-6130e39b18b5f53902e4eab14f6d5cdde5219563.tar.gz
abc-6130e39b18b5f53902e4eab14f6d5cdde5219563.tar.bz2
abc-6130e39b18b5f53902e4eab14f6d5cdde5219563.zip
initial commit of public abc
Diffstat (limited to 'src/aig/nwk')
-rw-r--r--src/aig/nwk/nwk.h42
-rw-r--r--src/aig/nwk/nwkAig.c13
-rw-r--r--src/aig/nwk/nwkBidec.c7
-rw-r--r--src/aig/nwk/nwkCheck.c5
-rw-r--r--src/aig/nwk/nwkDfs.c5
-rw-r--r--src/aig/nwk/nwkFanio.c7
-rw-r--r--src/aig/nwk/nwkFlow.c11
-rw-r--r--src/aig/nwk/nwkFlow_depth.c9
-rw-r--r--src/aig/nwk/nwkMan.c25
-rw-r--r--src/aig/nwk/nwkMap.c41
-rw-r--r--src/aig/nwk/nwkMerge.c18
-rw-r--r--src/aig/nwk/nwkMerge.h16
-rw-r--r--src/aig/nwk/nwkObj.c9
-rw-r--r--src/aig/nwk/nwkSpeedup.c62
-rw-r--r--src/aig/nwk/nwkStrash.c19
-rw-r--r--src/aig/nwk/nwkTiming.c27
-rw-r--r--src/aig/nwk/nwkUtil.c11
-rw-r--r--src/aig/nwk/nwk_.c5
18 files changed, 219 insertions, 113 deletions
diff --git a/src/aig/nwk/nwk.h b/src/aig/nwk/nwk.h
index c8cc91cb..acbcbf4a 100644
--- a/src/aig/nwk/nwk.h
+++ b/src/aig/nwk/nwk.h
@@ -20,6 +20,7 @@
#ifndef __NWK_H__
#define __NWK_H__
+
////////////////////////////////////////////////////////////////////////
/// INCLUDES ///
@@ -31,19 +32,20 @@
#include "if.h"
#include "bdc.h"
+#include "fra.h"
+#include "ssw.h"
+#include "ntlnwk.h"
+
////////////////////////////////////////////////////////////////////////
/// PARAMETERS ///
////////////////////////////////////////////////////////////////////////
-#ifdef __cplusplus
-extern "C" {
-#endif
+ABC_NAMESPACE_HEADER_START
////////////////////////////////////////////////////////////////////////
/// BASIC TYPES ///
////////////////////////////////////////////////////////////////////////
-typedef struct Nwk_Man_t_ Nwk_Man_t;
typedef struct Nwk_Obj_t_ Nwk_Obj_t;
// object types
@@ -175,23 +177,23 @@ static inline int Nwk_ManTimeMore( float f1, float f2, float Eps ) { r
////////////////////////////////////////////////////////////////////////
#define Nwk_ManForEachCi( p, pObj, i ) \
- Vec_PtrForEachEntry( p->vCis, pObj, i )
+ Vec_PtrForEachEntry( Nwk_Obj_t *, p->vCis, pObj, i )
#define Nwk_ManForEachCo( p, pObj, i ) \
- Vec_PtrForEachEntry( p->vCos, pObj, i )
+ Vec_PtrForEachEntry( Nwk_Obj_t *, p->vCos, pObj, i )
#define Nwk_ManForEachPi( p, pObj, i ) \
- Vec_PtrForEachEntry( p->vCis, pObj, i ) \
+ Vec_PtrForEachEntry( Nwk_Obj_t *, p->vCis, pObj, i ) \
if ( !Nwk_ObjIsPi(pObj) ) {} else
#define Nwk_ManForEachPo( p, pObj, i ) \
- Vec_PtrForEachEntry( p->vCos, pObj, i ) \
+ Vec_PtrForEachEntry( Nwk_Obj_t *, p->vCos, pObj, i ) \
if ( !Nwk_ObjIsPo(pObj) ) {} else
#define Nwk_ManForEachObj( p, pObj, i ) \
- for ( i = 0; (i < Vec_PtrSize(p->vObjs)) && (((pObj) = Vec_PtrEntry(p->vObjs, i)), 1); i++ ) \
+ for ( i = 0; (i < Vec_PtrSize(p->vObjs)) && (((pObj) = (Nwk_Obj_t *)Vec_PtrEntry(p->vObjs, i)), 1); i++ ) \
if ( pObj == NULL ) {} else
#define Nwk_ManForEachNode( p, pObj, i ) \
- for ( i = 0; (i < Vec_PtrSize(p->vObjs)) && (((pObj) = Vec_PtrEntry(p->vObjs, i)), 1); i++ ) \
+ for ( i = 0; (i < Vec_PtrSize(p->vObjs)) && (((pObj) = (Nwk_Obj_t *)Vec_PtrEntry(p->vObjs, i)), 1); i++ ) \
if ( (pObj) == NULL || !Nwk_ObjIsNode(pObj) ) {} else
#define Nwk_ManForEachLatch( p, pObj, i ) \
- for ( i = 0; (i < Vec_PtrSize(p->vObjs)) && (((pObj) = Vec_PtrEntry(p->vObjs, i)), 1); i++ ) \
+ for ( i = 0; (i < Vec_PtrSize(p->vObjs)) && (((pObj) = (Nwk_Obj_t *)Vec_PtrEntry(p->vObjs, i)), 1); i++ ) \
if ( (pObj) == NULL || !Nwk_ObjIsLatch(pObj) ) {} else
#define Nwk_ObjForEachFanin( pObj, pFanin, i ) \
@@ -201,13 +203,13 @@ static inline int Nwk_ManTimeMore( float f1, float f2, float Eps ) { r
// sequential iterators
#define Nwk_ManForEachPiSeq( p, pObj, i ) \
- Vec_PtrForEachEntryStop( p->vCis, pObj, i, (p)->nTruePis )
+ Vec_PtrForEachEntryStop( Nwk_Obj_t *, p->vCis, pObj, i, (p)->nTruePis )
#define Nwk_ManForEachPoSeq( p, pObj, i ) \
- Vec_PtrForEachEntryStop( p->vCos, pObj, i, (p)->nTruePos )
+ Vec_PtrForEachEntryStop( Nwk_Obj_t *, p->vCos, pObj, i, (p)->nTruePos )
#define Nwk_ManForEachLoSeq( p, pObj, i ) \
- for ( i = 0; (i < (p)->nLatches) && (((pObj) = Vec_PtrEntry(p->vCis, i+(p)->nTruePis)), 1); i++ )
+ for ( i = 0; (i < (p)->nLatches) && (((pObj) = (Nwk_Obj_t *)Vec_PtrEntry(p->vCis, i+(p)->nTruePis)), 1); i++ )
#define Nwk_ManForEachLiSeq( p, pObj, i ) \
- for ( i = 0; (i < (p)->nLatches) && (((pObj) = Vec_PtrEntry(p->vCos, i+(p)->nTruePos)), 1); i++ )
+ for ( i = 0; (i < (p)->nLatches) && (((pObj) = (Nwk_Obj_t *)Vec_PtrEntry(p->vCos, i+(p)->nTruePos)), 1); i++ )
#define Nwk_ManForEachLiLoSeq( p, pObjLi, pObjLo, i ) \
for ( i = 0; (i < (p)->nLatches) && (((pObjLi) = Nwk_ManCo(p, i+(p)->nTruePos)), 1) \
&& (((pObjLo) = Nwk_ManCi(p, i+(p)->nTruePis)), 1); i++ )
@@ -253,7 +255,7 @@ extern ABC_DLL Vec_Ptr_t * Nwk_ManRetimeCutBackward( Nwk_Man_t * pMan, int n
extern ABC_DLL Nwk_Man_t * Nwk_ManAlloc();
extern ABC_DLL void Nwk_ManFree( Nwk_Man_t * p );
extern ABC_DLL float Nwl_ManComputeTotalSwitching( Nwk_Man_t * pNtk );
-extern ABC_DLL void Nwk_ManPrintStats( Nwk_Man_t * p, If_Lib_t * pLutLib, int fSaveBest, int fDumpResult, int fPower, void * pNtl );
+extern ABC_DLL void Nwk_ManPrintStats( Nwk_Man_t * p, If_Lib_t * pLutLib, int fSaveBest, int fDumpResult, int fPower, Ntl_Man_t * pNtl );
/*=== nwkMap.c ============================================================*/
extern ABC_DLL Nwk_Man_t * Nwk_MappingIf( Aig_Man_t * p, Tim_Man_t * pManTime, If_Par_t * pPars );
/*=== nwkObj.c ============================================================*/
@@ -291,9 +293,11 @@ extern ABC_DLL void Nwk_ManCleanMarks( Nwk_Man_t * pNtk );
extern ABC_DLL void Nwk_ManMinimumBase( Nwk_Man_t * pNtk, int fVerbose );
extern ABC_DLL void Nwk_ManRemoveDupFanins( Nwk_Man_t * pNtk, int fVerbose );
-#ifdef __cplusplus
-}
-#endif
+
+
+ABC_NAMESPACE_HEADER_END
+
+
#endif
diff --git a/src/aig/nwk/nwkAig.c b/src/aig/nwk/nwkAig.c
index 7421348a..54e84237 100644
--- a/src/aig/nwk/nwkAig.c
+++ b/src/aig/nwk/nwkAig.c
@@ -20,6 +20,9 @@
#include "nwk.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -57,13 +60,13 @@ Nwk_Man_t * Nwk_ManDeriveFromAig( Aig_Man_t * p )
Aig_ManForEachNode( p, pObj, i )
{
pObj->pData = Nwk_ManCreateNode( pNtk, 2, pObj->nRefs );
- Nwk_ObjAddFanin( pObj->pData, Aig_ObjFanin0(pObj)->pData );
- Nwk_ObjAddFanin( pObj->pData, Aig_ObjFanin1(pObj)->pData );
+ Nwk_ObjAddFanin( (Nwk_Obj_t *)pObj->pData, (Nwk_Obj_t *)Aig_ObjFanin0(pObj)->pData );
+ Nwk_ObjAddFanin( (Nwk_Obj_t *)pObj->pData, (Nwk_Obj_t *)Aig_ObjFanin1(pObj)->pData );
}
Aig_ManForEachPo( p, pObj, i )
{
pObj->pData = Nwk_ManCreateCo( pNtk );
- Nwk_ObjAddFanin( pObj->pData, Aig_ObjFanin0(pObj)->pData );
+ Nwk_ObjAddFanin( (Nwk_Obj_t *)pObj->pData, (Nwk_Obj_t *)Aig_ObjFanin0(pObj)->pData );
}
return pNtk;
}
@@ -93,7 +96,7 @@ Vec_Ptr_t * Nwk_ManDeriveRetimingCut( Aig_Man_t * p, int fForward, int fVerbose
vNodes = Nwk_ManRetimeCutBackward( pNtk, Aig_ManRegNum(p), fVerbose );
Aig_ManForEachObj( p, pObj, i )
((Nwk_Obj_t *)pObj->pData)->pCopy = pObj;
- Vec_PtrForEachEntry( vNodes, pNode, i )
+ Vec_PtrForEachEntry( Nwk_Obj_t *, vNodes, pNode, i )
Vec_PtrWriteEntry( vNodes, i, pNode->pCopy );
Nwk_ManFree( pNtk );
assert( Vec_PtrSize(vNodes) <= Aig_ManRegNum(p) );
@@ -105,3 +108,5 @@ Vec_Ptr_t * Nwk_ManDeriveRetimingCut( Aig_Man_t * p, int fForward, int fVerbose
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/aig/nwk/nwkBidec.c b/src/aig/nwk/nwkBidec.c
index 13abf81f..567b904b 100644
--- a/src/aig/nwk/nwkBidec.c
+++ b/src/aig/nwk/nwkBidec.c
@@ -20,6 +20,9 @@
#include "nwk.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -44,7 +47,7 @@ static inline void Extra_TruthSharp( unsigned * pOut, unsigned * pIn0, unsigned
pOut[w] = pIn0[w] & ~pIn1[w];
}
-static inline Hop_Obj_t * Bdc_FunCopyHop( Bdc_Fun_t * pObj ) { return Hop_NotCond( Bdc_FuncCopy(Bdc_Regular(pObj)), Bdc_IsComplement(pObj) ); }
+static inline Hop_Obj_t * Bdc_FunCopyHop( Bdc_Fun_t * pObj ) { return Hop_NotCond( (Hop_Obj_t *)Bdc_FuncCopy(Bdc_Regular(pObj)), Bdc_IsComplement(pObj) ); }
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
@@ -170,3 +173,5 @@ void Nwk_ManBidecResyn( Nwk_Man_t * pNtk, int fVerbose )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/aig/nwk/nwkCheck.c b/src/aig/nwk/nwkCheck.c
index f20d61f2..24a0d513 100644
--- a/src/aig/nwk/nwkCheck.c
+++ b/src/aig/nwk/nwkCheck.c
@@ -20,6 +20,9 @@
#include "nwk.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -69,3 +72,5 @@ int Nwk_ManCheck( Nwk_Man_t * p )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/aig/nwk/nwkDfs.c b/src/aig/nwk/nwkDfs.c
index ec4ad440..59752c59 100644
--- a/src/aig/nwk/nwkDfs.c
+++ b/src/aig/nwk/nwkDfs.c
@@ -20,6 +20,9 @@
#include "nwk.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -657,3 +660,5 @@ int Nwk_ObjMffcLabel( Nwk_Obj_t * pNode )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/aig/nwk/nwkFanio.c b/src/aig/nwk/nwkFanio.c
index daea19d5..2a12f5bf 100644
--- a/src/aig/nwk/nwkFanio.c
+++ b/src/aig/nwk/nwkFanio.c
@@ -20,6 +20,9 @@
#include "nwk.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -279,7 +282,7 @@ void Nwk_ObjTransferFanout( Nwk_Obj_t * pNodeFrom, Nwk_Obj_t * pNodeTo )
nFanoutsOld = Nwk_ObjFanoutNum(pNodeTo);
Nwk_ObjCollectFanouts( pNodeFrom, vFanouts );
// patch the fanin of each of them
- Vec_PtrForEachEntry( vFanouts, pTemp, i )
+ Vec_PtrForEachEntry( Nwk_Obj_t *, vFanouts, pTemp, i )
Nwk_ObjPatchFanin( pTemp, pNodeFrom, pNodeTo );
assert( Nwk_ObjFanoutNum(pNodeFrom) == 0 );
assert( Nwk_ObjFanoutNum(pNodeTo) == nFanoutsOld + Vec_PtrSize(vFanouts) );
@@ -313,3 +316,5 @@ void Nwk_ObjReplace( Nwk_Obj_t * pNodeOld, Nwk_Obj_t * pNodeNew )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/aig/nwk/nwkFlow.c b/src/aig/nwk/nwkFlow.c
index 5efd0233..3961e5c2 100644
--- a/src/aig/nwk/nwkFlow.c
+++ b/src/aig/nwk/nwkFlow.c
@@ -20,6 +20,9 @@
#include "nwk.h"
+ABC_NAMESPACE_IMPL_START
+
+
/*
This code is based on the papers:
A. Hurst, A. Mishchenko, and R. Brayton, "Fast minimum-register retiming
@@ -33,7 +36,7 @@
////////////////////////////////////////////////////////////////////////
// predecessors
-static inline Nwk_Obj_t * Nwk_ObjPred( Nwk_Obj_t * pObj ) { return pObj->pCopy; }
+static inline Nwk_Obj_t * Nwk_ObjPred( Nwk_Obj_t * pObj ) { return (Nwk_Obj_t *)pObj->pCopy; }
static inline int Nwk_ObjSetPred( Nwk_Obj_t * pObj, Nwk_Obj_t * p ) { pObj->pCopy = p; return 1; }
// sink
static inline int Nwk_ObjIsSink( Nwk_Obj_t * pObj ) { return pObj->MarkA; }
@@ -393,7 +396,7 @@ int Nwk_ManRetimeVerifyCutForward( Nwk_Man_t * pMan, Vec_Ptr_t * vNodes )
Nwk_Obj_t * pObj;
int i;
// mark the nodes
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Nwk_Obj_t *, vNodes, pObj, i )
{
assert( pObj->MarkA == 0 );
pObj->MarkA = 1;
@@ -404,7 +407,7 @@ int Nwk_ManRetimeVerifyCutForward( Nwk_Man_t * pMan, Vec_Ptr_t * vNodes )
if ( !Nwk_ManVerifyCut_rec( pObj ) )
printf( "Nwk_ManRetimeVerifyCutForward(): Internal cut verification failed.\n" );
// unmark the nodes
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Nwk_Obj_t *, vNodes, pObj, i )
pObj->MarkA = 0;
return 1;
}
@@ -599,3 +602,5 @@ Vec_Ptr_t * Nwk_ManRetimeCutBackward( Nwk_Man_t * pMan, int nLatches, int fVerbo
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/aig/nwk/nwkFlow_depth.c b/src/aig/nwk/nwkFlow_depth.c
index a457631c..6c2e7eb9 100644
--- a/src/aig/nwk/nwkFlow_depth.c
+++ b/src/aig/nwk/nwkFlow_depth.c
@@ -20,6 +20,9 @@
#include "nwk.h"
+ABC_NAMESPACE_IMPL_START
+
+
/*
This code is based on the papers:
A. Hurst, A. Mishchenko, and R. Brayton, "Fast minimum-register retiming
@@ -414,7 +417,7 @@ int Nwk_ManRetimeVerifyCutForward( Nwk_Man_t * pMan, Vec_Ptr_t * vNodes )
Nwk_Obj_t * pObj;
int i;
// mark the nodes
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Nwk_Obj_t *, vNodes, pObj, i )
{
assert( pObj->MarkA == 0 );
pObj->MarkA = 1;
@@ -425,7 +428,7 @@ int Nwk_ManRetimeVerifyCutForward( Nwk_Man_t * pMan, Vec_Ptr_t * vNodes )
if ( !Nwk_ManVerifyCut_rec( pObj ) )
printf( "Nwk_ManRetimeVerifyCutForward(): Internal cut verification failed.\n" );
// unmark the nodes
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Nwk_Obj_t *, vNodes, pObj, i )
pObj->MarkA = 0;
return 1;
}
@@ -624,3 +627,5 @@ Vec_Ptr_t * Nwk_ManRetimeCutBackward( Nwk_Man_t * pMan, int nLatches, int fVerbo
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/aig/nwk/nwkMan.c b/src/aig/nwk/nwkMan.c
index 8f971871..2e2a3e56 100644
--- a/src/aig/nwk/nwkMan.c
+++ b/src/aig/nwk/nwkMan.c
@@ -20,6 +20,9 @@
#include "nwk.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -117,7 +120,7 @@ void Nwk_ManPrintLutSizes( Nwk_Man_t * p, If_Lib_t * pLutLib )
***********************************************************************/
int Nwk_ManCompareAndSaveBest( Nwk_Man_t * pNtk, void * pNtl )
{
- extern void Ioa_WriteBlifLogic( Nwk_Man_t * pNtk, void * pNtl, char * pFileName );
+// extern void Ntl_WriteBlifLogic( Nwk_Man_t * pNtk, void * pNtl, char * pFileName );
extern void Nwk_ManDumpBlif( Nwk_Man_t * pNtk, char * pFileName, Vec_Ptr_t * vPiNames, Vec_Ptr_t * vPoNames );
static struct ParStruct {
char * pName; // name of the best saved network
@@ -154,7 +157,7 @@ int Nwk_ManCompareAndSaveBest( Nwk_Man_t * pNtk, void * pNtl )
ParsBest.nPis = ParsNew.nPis;
ParsBest.nPos = ParsNew.nPos;
// write the network
-// Ioa_WriteBlifLogic( pNtk, pNtl, "best.blif" );
+// Ntl_WriteBlifLogic( pNtk, pNtl, "best.blif" );
// Nwk_ManDumpBlif( pNtk, "best_map.blif", NULL, NULL );
return 1;
}
@@ -209,14 +212,14 @@ float Nwl_ManComputeTotalSwitching( Nwk_Man_t * pNtk )
pSwitching = (float *)vSwitching->pArray;
Nwk_ManForEachObj( pNtk, pObjAbc, i )
{
- if ( (pObjAig = Aig_Regular(pObjAbc->pCopy)) )
+ if ( (pObjAig = Aig_Regular((Aig_Obj_t *)pObjAbc->pCopy)) )
Result += Nwk_ObjFanoutNum(pObjAbc) * pSwitching[pObjAig->Id];
}
Vec_IntFree( vSwitching );
Aig_ManStop( pAig );
return Result;
}
-
+
/**Function*************************************************************
Synopsis [Prints stats of the manager.]
@@ -228,18 +231,18 @@ float Nwl_ManComputeTotalSwitching( Nwk_Man_t * pNtk )
SeeAlso []
***********************************************************************/
-void Nwk_ManPrintStats( Nwk_Man_t * pNtk, If_Lib_t * pLutLib, int fSaveBest, int fDumpResult, int fPower, void * pNtl )
+void Nwk_ManPrintStats( Nwk_Man_t * pNtk, If_Lib_t * pLutLib, int fSaveBest, int fDumpResult, int fPower, Ntl_Man_t * pNtl )
{
- extern int Ntl_ManLatchNum( void * p );
- extern void Ioa_WriteBlifLogic( Nwk_Man_t * pNtk, void * pNtl, char * pFileName );
+// extern int Ntl_ManLatchNum( Ntl_Man_t * p );
+// extern void Ntl_ManWriteBlifLogic( Nwk_Man_t * pNtk, void * pNtl, char * pFileName );
if ( fSaveBest )
Nwk_ManCompareAndSaveBest( pNtk, pNtl );
if ( fDumpResult )
{
char Buffer[1000] = {0};
- char * pNameGen = pNtk->pSpec? Nwk_FileNameGeneric( pNtk->pSpec ) : "nameless_";
+ const char * pNameGen = pNtk->pSpec? Nwk_FileNameGeneric( pNtk->pSpec ) : "nameless_";
sprintf( Buffer, "%s_dump.blif", pNameGen );
- Ioa_WriteBlifLogic( pNtk, pNtl, Buffer );
+// Ntl_ManWriteBlifLogic( pNtk, pNtl, Buffer );
// sprintf( Buffer, "%s_dump_map.blif", pNameGen );
// Nwk_ManDumpBlif( pNtk, Buffer, NULL, NULL );
if ( pNtk->pSpec ) ABC_FREE( pNameGen );
@@ -251,7 +254,7 @@ void Nwk_ManPrintStats( Nwk_Man_t * pNtk, If_Lib_t * pLutLib, int fSaveBest, int
printf( "po = %5d ", Nwk_ManPoNum(pNtk) );
printf( "ci = %5d ", Nwk_ManCiNum(pNtk) );
printf( "co = %5d ", Nwk_ManCoNum(pNtk) );
- printf( "lat = %5d ", Ntl_ManLatchNum(pNtl) );
+// printf( "lat = %5d ", Ntl_ManLatchNum(pNtl) );
printf( "node = %5d ", Nwk_ManNodeNum(pNtk) );
printf( "edge = %5d ", Nwk_ManGetTotalFanins(pNtk) );
printf( "aig = %6d ", Nwk_ManGetAigNodeNum(pNtk) );
@@ -271,3 +274,5 @@ void Nwk_ManPrintStats( Nwk_Man_t * pNtk, If_Lib_t * pLutLib, int fSaveBest, int
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/aig/nwk/nwkMap.c b/src/aig/nwk/nwkMap.c
index 5812358b..22f25dbc 100644
--- a/src/aig/nwk/nwkMap.c
+++ b/src/aig/nwk/nwkMap.c
@@ -21,6 +21,9 @@
#include "nwk.h"
#include "if.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -126,21 +129,24 @@ If_Man_t * Nwk_ManToIf( Aig_Man_t * p, If_Par_t * pPars, Vec_Ptr_t * vAigToIf )
Aig_ManForEachObj( p, pNode, i )
{
if ( Aig_ObjIsAnd(pNode) )
+ {
pIfObj = If_ManCreateAnd( pIfMan,
- If_NotCond( Aig_ObjFanin0(pNode)->pData, Aig_ObjFaninC0(pNode) ),
- If_NotCond( Aig_ObjFanin1(pNode)->pData, Aig_ObjFaninC1(pNode) ) );
+ If_NotCond( (If_Obj_t *)Aig_ObjFanin0(pNode)->pData, Aig_ObjFaninC0(pNode) ),
+ If_NotCond( (If_Obj_t *)Aig_ObjFanin1(pNode)->pData, Aig_ObjFaninC1(pNode) ) );
+// printf( "no%d=%d\n ", If_ObjId(pIfObj), If_ObjLevel(pIfObj) );
+ }
else if ( Aig_ObjIsPi(pNode) )
{
pIfObj = If_ManCreateCi( pIfMan );
If_ObjSetLevel( pIfObj, Aig_ObjLevel(pNode) );
-// printf( "pi=%d ", pIfObj->Level );
+// printf( "pi%d=%d\n ", If_ObjId(pIfObj), If_ObjLevel(pIfObj) );
if ( pIfMan->nLevelMax < (int)pIfObj->Level )
pIfMan->nLevelMax = (int)pIfObj->Level;
}
else if ( Aig_ObjIsPo(pNode) )
{
- pIfObj = If_ManCreateCo( pIfMan, If_NotCond( Aig_ObjFanin0(pNode)->pData, Aig_ObjFaninC0(pNode) ) );
-// printf( "po=%d ", pIfObj->Level );
+ pIfObj = If_ManCreateCo( pIfMan, If_NotCond( (If_Obj_t *)Aig_ObjFanin0(pNode)->pData, Aig_ObjFaninC0(pNode) ) );
+// printf( "po%d=%d\n ", If_ObjId(pIfObj), If_ObjLevel(pIfObj) );
}
else if ( Aig_ObjIsConst1(pNode) )
pIfObj = If_ManConst1( pIfMan );
@@ -157,8 +163,8 @@ If_Man_t * Nwk_ManToIf( Aig_Man_t * p, If_Par_t * pPars, Vec_Ptr_t * vAigToIf )
{
pIfMan->nChoices++;
for ( pPrev = pNode, pFanin = Aig_ObjEquiv(p, pNode); pFanin; pPrev = pFanin, pFanin = Aig_ObjEquiv(p, pFanin) )
- If_ObjSetChoice( pPrev->pData, pFanin->pData );
- If_ManCreateChoice( pIfMan, pNode->pData );
+ If_ObjSetChoice( (If_Obj_t *)pPrev->pData, (If_Obj_t *)pFanin->pData );
+ If_ManCreateChoice( pIfMan, (If_Obj_t *)pNode->pData );
}
// assert( If_ObjLevel(pIfObj) == Aig_ObjLevel(pNode) );
}
@@ -188,14 +194,14 @@ Hop_Obj_t * Nwk_NodeIfToHop2_rec( Hop_Man_t * pHopMan, If_Man_t * pIfMan, If_Obj
pCut = If_ObjCutBest(pIfObj);
// if the cut is visited, return the result
if ( If_CutData(pCut) )
- return If_CutData(pCut);
+ return (Hop_Obj_t *)If_CutData(pCut);
// mark the node as visited
Vec_PtrPush( vVisited, pCut );
// insert the worst case
If_CutSetData( pCut, (void *)1 );
// skip in case of primary input
if ( If_ObjIsCi(pIfObj) )
- return If_CutData(pCut);
+ return (Hop_Obj_t *)If_CutData(pCut);
// compute the functions of the children
for ( pTemp = pIfObj; pTemp; pTemp = pTemp->pEquiv )
{
@@ -212,7 +218,7 @@ Hop_Obj_t * Nwk_NodeIfToHop2_rec( Hop_Man_t * pHopMan, If_Man_t * pIfMan, If_Obj
If_CutSetData( pCut, gFunc );
break;
}
- return If_CutData(pCut);
+ return (Hop_Obj_t *)If_CutData(pCut);
}
/**Function*************************************************************
@@ -250,7 +256,7 @@ Hop_Obj_t * Nwk_NodeIfToHop( Hop_Man_t * pHopMan, If_Man_t * pIfMan, If_Obj_t *
// clean the cuts
If_CutForEachLeaf( pIfMan, pCut, pLeaf, i )
If_CutSetData( If_ObjCutBest(pLeaf), NULL );
- Vec_PtrForEachEntry( pIfMan->vTemp, pCut, i )
+ Vec_PtrForEachEntry( If_Cut_t *, pIfMan->vTemp, pCut, i )
If_CutSetData( pCut, NULL );
return gFunc;
}
@@ -284,7 +290,7 @@ Nwk_Man_t * Nwk_ManFromIf( If_Man_t * pIfMan, Aig_Man_t * p, Vec_Ptr_t * vAigToI
vIfToAig = Vec_PtrStart( If_ManObjNum(pIfMan) );
Aig_ManForEachObj( p, pObj, i )
{
- pIfObj = Vec_PtrEntry( vAigToIf, i );
+ pIfObj = (If_Obj_t *)Vec_PtrEntry( vAigToIf, i );
Vec_PtrWriteEntry( vIfToAig, pIfObj->Id, pObj );
}
// construct the network
@@ -296,7 +302,7 @@ Nwk_Man_t * Nwk_ManFromIf( If_Man_t * pIfMan, Aig_Man_t * p, Vec_Ptr_t * vAigToI
// pNtk->nTruePos = Nwk_ManCoNum(pNtk) - pNtk->nLatches;
Aig_ManForEachObj( p, pObj, i )
{
- pIfObj = Vec_PtrEntry( vAigToIf, i );
+ pIfObj = (If_Obj_t *)Vec_PtrEntry( vAigToIf, i );
if ( pIfObj->nRefs == 0 && !If_ObjIsTerm(pIfObj) )
continue;
if ( Aig_ObjIsNode(pObj) )
@@ -308,8 +314,8 @@ Nwk_Man_t * Nwk_ManFromIf( If_Man_t * pIfMan, Aig_Man_t * p, Vec_Ptr_t * vAigToI
pObjNew = Nwk_ManCreateNode( pNtk, nLeaves, pIfObj->nRefs );
for ( k = 0; k < nLeaves; k++ )
{
- pObjRepr = Vec_PtrEntry( vIfToAig, ppLeaves[k] );
- Nwk_ObjAddFanin( pObjNew, pObjRepr->pData );
+ pObjRepr = (Aig_Obj_t *)Vec_PtrEntry( vIfToAig, ppLeaves[k] );
+ Nwk_ObjAddFanin( pObjNew, (Nwk_Obj_t *)pObjRepr->pData );
}
// get the functionality
pObjNew->pFunc = Nwk_NodeIfToHop( pNtk->pManHop, pIfMan, pIfObj );
@@ -320,7 +326,7 @@ Nwk_Man_t * Nwk_ManFromIf( If_Man_t * pIfMan, Aig_Man_t * p, Vec_Ptr_t * vAigToI
{
pObjNew = Nwk_ManCreateCo( pNtk );
pObjNew->fInvert = Aig_ObjFaninC0(pObj);
- Nwk_ObjAddFanin( pObjNew, Aig_ObjFanin0(pObj)->pData );
+ Nwk_ObjAddFanin( pObjNew, (Nwk_Obj_t *)Aig_ObjFanin0(pObj)->pData );
//printf( "%d ", pObjNew->Id );
}
else if ( Aig_ObjIsConst1(pObj) )
@@ -365,6 +371,7 @@ Nwk_Man_t * Nwk_MappingIf( Aig_Man_t * p, Tim_Man_t * pManTime, If_Par_t * pPars
if ( pIfMan == NULL )
return NULL;
pIfMan->pManTim = Tim_ManDup( pManTime, 0 );
+ pIfMan->pPars->fCutMin = 0; // is not compatible with deriving result
if ( !If_ManPerformMapping( pIfMan ) )
{
If_ManStop( pIfMan );
@@ -385,3 +392,5 @@ Nwk_Man_t * Nwk_MappingIf( Aig_Man_t * p, Tim_Man_t * pManTime, If_Par_t * pPars
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/aig/nwk/nwkMerge.c b/src/aig/nwk/nwkMerge.c
index bc7826e1..9a4f2f8c 100644
--- a/src/aig/nwk/nwkMerge.c
+++ b/src/aig/nwk/nwkMerge.c
@@ -21,6 +21,9 @@
#include "nwk.h"
#include "nwkMerge.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -787,7 +790,7 @@ void Nwk_ManCollectCircle( Vec_Ptr_t * vStart, Vec_Ptr_t * vNext, int nFanMax )
Nwk_Obj_t * pObj, * pNext;
int i, k;
Vec_PtrClear( vNext );
- Vec_PtrForEachEntry( vStart, pObj, i )
+ Vec_PtrForEachEntry( Nwk_Obj_t *, vStart, pObj, i )
{
Nwk_ObjForEachFanin( pObj, pNext, k )
{
@@ -845,7 +848,7 @@ void Nwk_ManCollectNonOverlapCands( Nwk_Obj_t * pLut, Vec_Ptr_t * vStart, Vec_Pt
vStart = vNext;
vNext = vTemp;
// collect the nodes in vStart
- Vec_PtrForEachEntry( vStart, pObj, k )
+ Vec_PtrForEachEntry( Nwk_Obj_t *, vStart, pObj, k )
Vec_PtrPush( vCands, pObj );
}
@@ -867,7 +870,7 @@ void Nwk_ManCollectNonOverlapCands( Nwk_Obj_t * pLut, Vec_Ptr_t * vStart, Vec_Pt
// - they have no more than the given number of fanins
// - they have no more than the given diff in delay
k = 0;
- Vec_PtrForEachEntry( vCands, pObj, i )
+ Vec_PtrForEachEntry( Nwk_Obj_t *, vCands, pObj, i )
{
if ( Nwk_ObjIsTravIdCurrent(pObj) )
continue;
@@ -963,8 +966,9 @@ void Nwk_ManCollectOverlapCands( Nwk_Obj_t * pLut, Vec_Ptr_t * vCands, Nwk_LMPar
SeeAlso []
***********************************************************************/
-Vec_Int_t * Nwk_ManLutMerge( Nwk_Man_t * pNtk, Nwk_LMPars_t * pPars )
+Vec_Int_t * Nwk_ManLutMerge( Nwk_Man_t * pNtk, void * pParsInit )
{
+ Nwk_LMPars_t * pPars = (Nwk_LMPars_t *)pParsInit;
Nwk_Grf_t * p;
Vec_Int_t * vResult;
Vec_Ptr_t * vStart, * vNext, * vCands1, * vCands2;
@@ -992,9 +996,9 @@ Vec_Int_t * Nwk_ManLutMerge( Nwk_Man_t * pNtk, Nwk_LMPars_t * pPars )
continue;
nCands += Vec_PtrSize(vCands1) + Vec_PtrSize(vCands2);
// save candidates
- Vec_PtrForEachEntry( vCands1, pCand, k )
+ Vec_PtrForEachEntry( Nwk_Obj_t *, vCands1, pCand, k )
Nwk_ManGraphHashEdge( p, Nwk_ObjId(pLut), Nwk_ObjId(pCand) );
- Vec_PtrForEachEntry( vCands2, pCand, k )
+ Vec_PtrForEachEntry( Nwk_Obj_t *, vCands2, pCand, k )
Nwk_ManGraphHashEdge( p, Nwk_ObjId(pLut), Nwk_ObjId(pCand) );
// print statistics about this node
if ( pPars->fVeryVerbose )
@@ -1036,3 +1040,5 @@ Vec_Int_t * Nwk_ManLutMerge( Nwk_Man_t * pNtk, Nwk_LMPars_t * pPars )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/aig/nwk/nwkMerge.h b/src/aig/nwk/nwkMerge.h
index ab39ec39..f6be760f 100644
--- a/src/aig/nwk/nwkMerge.h
+++ b/src/aig/nwk/nwkMerge.h
@@ -21,6 +21,7 @@
#ifndef __NWK_MERGE_H__
#define __NWK_MERGE_H__
+
////////////////////////////////////////////////////////////////////////
/// INCLUDES ///
////////////////////////////////////////////////////////////////////////
@@ -29,9 +30,10 @@
/// PARAMETERS ///
////////////////////////////////////////////////////////////////////////
-#ifdef __cplusplus
-extern "C" {
-#endif
+
+
+ABC_NAMESPACE_HEADER_START
+
#define NWK_MAX_LIST 16
@@ -137,9 +139,11 @@ extern ABC_DLL void Nwk_ManGraphHashEdge( Nwk_Grf_t * p, int iLut1, int
extern ABC_DLL void Nwk_ManGraphSolve( Nwk_Grf_t * p );
extern ABC_DLL int Nwk_ManLutMergeGraphTest( char * pFileName );
-#ifdef __cplusplus
-}
-#endif
+
+
+ABC_NAMESPACE_HEADER_END
+
+
#endif
diff --git a/src/aig/nwk/nwkObj.c b/src/aig/nwk/nwkObj.c
index 58587f07..e5930087 100644
--- a/src/aig/nwk/nwkObj.c
+++ b/src/aig/nwk/nwkObj.c
@@ -20,6 +20,9 @@
#include "nwk.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -157,7 +160,7 @@ void Nwk_ManDeleteNode( Nwk_Obj_t * pObj )
assert( Nwk_ObjFanoutNum(pObj) == 0 );
// delete fanins
Nwk_ObjCollectFanins( pObj, vNodes );
- Vec_PtrForEachEntry( vNodes, pTemp, i )
+ Vec_PtrForEachEntry( Nwk_Obj_t *, vNodes, pTemp, i )
Nwk_ObjDeleteFanin( pObj, pTemp );
// remove from the list of objects
Vec_PtrWriteEntry( pObj->pMan->vObjs, pObj->Id, NULL );
@@ -186,7 +189,7 @@ void Nwk_ManDeleteNode_rec( Nwk_Obj_t * pObj )
vNodes = Vec_PtrAlloc( 100 );
Nwk_ObjCollectFanins( pObj, vNodes );
Nwk_ManDeleteNode( pObj );
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Nwk_Obj_t *, vNodes, pObj, i )
if ( Nwk_ObjIsNode(pObj) && Nwk_ObjFanoutNum(pObj) == 0 )
Nwk_ManDeleteNode_rec( pObj );
Vec_PtrFree( vNodes );
@@ -197,3 +200,5 @@ void Nwk_ManDeleteNode_rec( Nwk_Obj_t * pObj )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/aig/nwk/nwkSpeedup.c b/src/aig/nwk/nwkSpeedup.c
index 54e4d414..335d50f8 100644
--- a/src/aig/nwk/nwkSpeedup.c
+++ b/src/aig/nwk/nwkSpeedup.c
@@ -20,6 +20,9 @@
#include "nwk.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -74,9 +77,9 @@ void Aig_ManSpeedupNode( Nwk_Man_t * pNtk, Aig_Man_t * pAig, Nwk_Obj_t * pNode,
int nCofs, i, k, nSkip;
// quit of regulars are the same
- Vec_PtrForEachEntry( vLeaves, pObj, i )
- Vec_PtrForEachEntry( vLeaves, pObj2, k )
- if ( i != k && Aig_Regular(pObj->pCopy) == Aig_Regular(pObj2->pCopy) )
+ Vec_PtrForEachEntry( Nwk_Obj_t *, vLeaves, pObj, i )
+ Vec_PtrForEachEntry( Nwk_Obj_t *, vLeaves, pObj2, k )
+ if ( i != k && Aig_Regular((Aig_Obj_t *)pObj->pCopy) == Aig_Regular((Aig_Obj_t *)pObj2->pCopy) )
{
// printf( "Identical after structural hashing!!!\n" );
return;
@@ -86,13 +89,13 @@ void Aig_ManSpeedupNode( Nwk_Man_t * pNtk, Aig_Man_t * pAig, Nwk_Obj_t * pNode,
vNodes = Vec_PtrAlloc( 100 );
Aig_ManIncrementTravId( pAig );
Aig_ObjSetTravIdCurrent( pAig, Aig_ManConst1(pAig) );
- Vec_PtrForEachEntry( vLeaves, pObj, i )
+ Vec_PtrForEachEntry( Nwk_Obj_t *, vLeaves, pObj, i )
{
- pAnd = pObj->pCopy;
+ pAnd = (Aig_Obj_t *)pObj->pCopy;
Aig_ObjSetTravIdCurrent( pAig, Aig_Regular(pAnd) );
}
// traverse from the root node
- pAnd = pNode->pCopy;
+ pAnd = (Aig_Obj_t *)pNode->pCopy;
if ( !Aig_ManSpeedupNode_rec( pAig, Aig_Regular(pAnd), vNodes ) )
{
// printf( "Bad node!!!\n" );
@@ -104,21 +107,21 @@ void Aig_ManSpeedupNode( Nwk_Man_t * pNtk, Aig_Man_t * pAig, Nwk_Obj_t * pNode,
nCofs = (1 << Vec_PtrSize(vTimes));
for ( i = 0; i < nCofs; i++ )
{
- Vec_PtrForEachEntry( vLeaves, pObj, k )
+ Vec_PtrForEachEntry( Nwk_Obj_t *, vLeaves, pObj, k )
{
- pAnd = pObj->pCopy;
+ pAnd = (Aig_Obj_t *)pObj->pCopy;
Aig_Regular(pAnd)->pData = Aig_Regular(pAnd);
}
- Vec_PtrForEachEntry( vTimes, pObj, k )
+ Vec_PtrForEachEntry( Nwk_Obj_t *, vTimes, pObj, k )
{
- pAnd = pObj->pCopy;
+ pAnd = (Aig_Obj_t *)pObj->pCopy;
Aig_Regular(pAnd)->pData = Aig_NotCond( Aig_ManConst1(pAig), ((i & (1<<k)) == 0) );
}
- Vec_PtrForEachEntry( vNodes, pTemp, k )
+ Vec_PtrForEachEntry( Aig_Obj_t *, vNodes, pTemp, k )
pTemp->pData = Aig_And( pAig, Aig_ObjChild0Copy(pTemp), Aig_ObjChild1Copy(pTemp) );
// save the result
- pAnd = pNode->pCopy;
- ppCofs[i] = Aig_NotCond( Aig_Regular(pAnd)->pData, Aig_IsComplement(pAnd) );
+ pAnd = (Aig_Obj_t *)pNode->pCopy;
+ ppCofs[i] = Aig_NotCond( (Aig_Obj_t *)Aig_Regular(pAnd)->pData, Aig_IsComplement(pAnd) );
}
Vec_PtrFree( vNodes );
@@ -126,16 +129,16 @@ void Aig_ManSpeedupNode( Nwk_Man_t * pNtk, Aig_Man_t * pAig, Nwk_Obj_t * pNode,
//Nwk_ObjAddFanin( Nwk_ManCreatePo(pAig), ppCofs[1] );
// collect the resulting tree
- Vec_PtrForEachEntry( vTimes, pObj, k )
+ Vec_PtrForEachEntry( Nwk_Obj_t *, vTimes, pObj, k )
for ( nSkip = (1<<k), i = 0; i < nCofs; i += 2*nSkip )
{
- pAnd = pObj->pCopy;
+ pAnd = (Aig_Obj_t *)pObj->pCopy;
ppCofs[i] = Aig_Mux( pAig, Aig_Regular(pAnd), ppCofs[i+nSkip], ppCofs[i] );
}
//Nwk_ObjAddFanin( Nwk_ManCreatePo(pAig), ppCofs[0] );
// create choice node
- pAnd = Aig_Regular(pNode->pCopy); // repr
+ pAnd = Aig_Regular((Aig_Obj_t *)pNode->pCopy); // repr
pTemp = Aig_Regular(ppCofs[0]); // new
if ( Aig_ObjEquiv(pAig, pAnd) == NULL && Aig_ObjEquiv(pAig, pTemp) == NULL && !Aig_ObjCheckTfi(pAig, pTemp, pAnd) )
pAig->pEquivs[pAnd->Id] = pTemp;
@@ -204,12 +207,20 @@ Aig_Man_t * Nwk_ManSpeedup( Nwk_Man_t * pNtk, int fUseLutLib, int Percentage, in
Nwk_Obj_t * pNode, * pFanin, * pFanin2;
Aig_Obj_t * pAnd;
If_Lib_t * pTempLib = pNtk->pLutLib;
+ Tim_Man_t * pTempTim = NULL;
float tDelta, tArrival;
int i, k, k2, Counter, CounterRes, nTimeCris;
unsigned * puTCEdges;
// perform delay trace
if ( !fUseLutLib )
+ {
pNtk->pLutLib = NULL;
+ if ( pNtk->pManTime )
+ {
+ pTempTim = pNtk->pManTime;
+ pNtk->pManTime = Tim_ManDup( pTempTim, 1 );
+ }
+ }
tArrival = Nwk_ManDelayTraceLut( pNtk );
tDelta = fUseLutLib ? tArrival*Percentage/100.0 : 1.0;
if ( fVerbose )
@@ -302,8 +313,8 @@ Aig_Man_t * Nwk_ManSpeedup( Nwk_Man_t * pNtk, int fUseLutLib, int Percentage, in
// order the fanins in the increasing order of criticalily
if ( Vec_PtrSize(vTimeCries) > 1 )
{
- pFanin = Vec_PtrEntry( vTimeCries, 0 );
- pFanin2 = Vec_PtrEntry( vTimeCries, 1 );
+ pFanin = (Nwk_Obj_t *)Vec_PtrEntry( vTimeCries, 0 );
+ pFanin2 = (Nwk_Obj_t *)Vec_PtrEntry( vTimeCries, 1 );
if ( Nwk_ObjSlack(pFanin) < Nwk_ObjSlack(pFanin2) )
{
Vec_PtrWriteEntry( vTimeCries, 0, pFanin2 );
@@ -312,15 +323,15 @@ Aig_Man_t * Nwk_ManSpeedup( Nwk_Man_t * pNtk, int fUseLutLib, int Percentage, in
}
if ( Vec_PtrSize(vTimeCries) > 2 )
{
- pFanin = Vec_PtrEntry( vTimeCries, 1 );
- pFanin2 = Vec_PtrEntry( vTimeCries, 2 );
+ pFanin = (Nwk_Obj_t *)Vec_PtrEntry( vTimeCries, 1 );
+ pFanin2 = (Nwk_Obj_t *)Vec_PtrEntry( vTimeCries, 2 );
if ( Nwk_ObjSlack(pFanin) < Nwk_ObjSlack(pFanin2) )
{
Vec_PtrWriteEntry( vTimeCries, 1, pFanin2 );
Vec_PtrWriteEntry( vTimeCries, 2, pFanin );
}
- pFanin = Vec_PtrEntry( vTimeCries, 0 );
- pFanin2 = Vec_PtrEntry( vTimeCries, 1 );
+ pFanin = (Nwk_Obj_t *)Vec_PtrEntry( vTimeCries, 0 );
+ pFanin2 = (Nwk_Obj_t *)Vec_PtrEntry( vTimeCries, 1 );
if ( Nwk_ObjSlack(pFanin) < Nwk_ObjSlack(pFanin2) )
{
Vec_PtrWriteEntry( vTimeCries, 0, pFanin2 );
@@ -348,6 +359,11 @@ Aig_Man_t * Nwk_ManSpeedup( Nwk_Man_t * pNtk, int fUseLutLib, int Percentage, in
// put back the library
if ( !fUseLutLib )
pNtk->pLutLib = pTempLib;
+ if ( pTempTim )
+ {
+ Tim_ManStop( pNtk->pManTime );
+ pNtk->pManTime = pTempTim;
+ }
// reconstruct the network
pAig = Aig_ManDupDfs( pTemp = pAig );
@@ -362,3 +378,5 @@ Aig_Man_t * Nwk_ManSpeedup( Nwk_Man_t * pNtk, int fUseLutLib, int Percentage, in
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/aig/nwk/nwkStrash.c b/src/aig/nwk/nwkStrash.c
index 6c2a3677..54f1f027 100644
--- a/src/aig/nwk/nwkStrash.c
+++ b/src/aig/nwk/nwkStrash.c
@@ -20,6 +20,9 @@
#include "nwk.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -79,7 +82,7 @@ Aig_Obj_t * Nwk_ManStrashNode( Aig_Man_t * p, Nwk_Obj_t * pObj )
Nwk_ManStrashNode_rec( p, Hop_Regular(pRoot) );
Hop_ConeUnmark_rec( Hop_Regular(pRoot) );
// return the final node
- return Aig_NotCond( Hop_Regular(pRoot)->pData, Hop_IsComplement(pRoot) );
+ return Aig_NotCond( (Aig_Obj_t *)Hop_Regular(pRoot)->pData, Hop_IsComplement(pRoot) );
}
/**Function*************************************************************
@@ -103,25 +106,25 @@ Aig_Man_t * Nwk_ManStrash( Nwk_Man_t * pNtk )
pMan = Aig_ManStart( Nwk_ManGetAigNodeNum(pNtk) );
pMan->pName = Aig_UtilStrsav( pNtk->pName );
pMan->pSpec = Aig_UtilStrsav( pNtk->pSpec );
- pMan->pManTime = Tim_ManDup( pNtk->pManTime, 1 );
- Tim_ManIncrementTravId( pMan->pManTime );
+ pMan->pManTime = Tim_ManDup( (Tim_Man_t *)pNtk->pManTime, 1 );
+ Tim_ManIncrementTravId( (Tim_Man_t *)pMan->pManTime );
Nwk_ManForEachObj( pNtk, pObj, i )
pObj->pCopy = NULL;
// Nwk_ManForEachObj( pNtk, pObj, i )
vObjs = Nwk_ManDfs( pNtk );
- Vec_PtrForEachEntry( vObjs, pObj, i )
+ Vec_PtrForEachEntry( Nwk_Obj_t *, vObjs, pObj, i )
{
if ( Nwk_ObjIsCi(pObj) )
{
pObjNew = Aig_ObjCreatePi(pMan);
- Level = Tim_ManGetCiArrival( pMan->pManTime, pObj->PioId );
+ Level = Tim_ManGetCiArrival( (Tim_Man_t *)pMan->pManTime, pObj->PioId );
Aig_ObjSetLevel( pObjNew, Level );
}
else if ( Nwk_ObjIsCo(pObj) )
{
- pObjNew = Aig_ObjCreatePo( pMan, Aig_NotCond(Nwk_ObjFanin0(pObj)->pCopy, pObj->fInvert) );
+ pObjNew = Aig_ObjCreatePo( pMan, Aig_NotCond((Aig_Obj_t *)Nwk_ObjFanin0(pObj)->pCopy, pObj->fInvert) );
Level = Aig_ObjLevel( pObjNew );
- Tim_ManSetCoArrival( pMan->pManTime, pObj->PioId, (float)Level );
+ Tim_ManSetCoArrival( (Tim_Man_t *)pMan->pManTime, pObj->PioId, (float)Level );
}
else if ( Nwk_ObjIsNode(pObj) )
{
@@ -142,3 +145,5 @@ Aig_Man_t * Nwk_ManStrash( Nwk_Man_t * pNtk )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/aig/nwk/nwkTiming.c b/src/aig/nwk/nwkTiming.c
index 5c53038c..53591ee8 100644
--- a/src/aig/nwk/nwkTiming.c
+++ b/src/aig/nwk/nwkTiming.c
@@ -20,6 +20,9 @@
#include "nwk.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -349,13 +352,13 @@ float Nwk_ManDelayTraceLut( Nwk_Man_t * pNtk )
Tim_ManIncrementTravId( pNtk->pManTime );
// Nwk_ManForEachObj( pNtk, pObj, i )
vObjs = Nwk_ManDfs( pNtk );
- Vec_PtrForEachEntry( vObjs, pObj, i )
+ Vec_PtrForEachEntry( Nwk_Obj_t *, vObjs, pObj, i )
{
tArrival = Nwk_NodeComputeArrival( pObj, fUseSorting );
- if ( Nwk_ObjIsCo(pObj) && pNtk->pManTime )
- Tim_ManSetCoArrival( pNtk->pManTime, pObj->PioId, tArrival );
if ( Nwk_ObjIsCi(pObj) && pNtk->pManTime )
tArrival = Tim_ManGetCiArrival( pNtk->pManTime, pObj->PioId );
+ if ( Nwk_ObjIsCo(pObj) && pNtk->pManTime )
+ Tim_ManSetCoArrival( pNtk->pManTime, pObj->PioId, tArrival );
Nwk_ObjSetArrival( pObj, tArrival );
}
Vec_PtrFree( vObjs );
@@ -379,7 +382,7 @@ float Nwk_ManDelayTraceLut( Nwk_Man_t * pNtk )
}
// propagate the required times
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Nwk_Obj_t *, vNodes, pObj, i )
{
if ( Nwk_ObjIsNode(pObj) )
{
@@ -518,8 +521,8 @@ void Nwk_NodeUpdateAddToQueue( Vec_Ptr_t * vQueue, Nwk_Obj_t * pObj, int iCurren
Vec_PtrPush( vQueue, pObj );
for ( i = Vec_PtrSize(vQueue) - 1; i > iCurrent + 1; i-- )
{
- pTemp1 = vQueue->pArray[i];
- pTemp2 = vQueue->pArray[i-1];
+ pTemp1 = (Nwk_Obj_t *)vQueue->pArray[i];
+ pTemp2 = (Nwk_Obj_t *)vQueue->pArray[i-1];
if ( fArrival )
{
if ( Nwk_ObjLevel(pTemp2) <= Nwk_ObjLevel(pTemp1) )
@@ -536,8 +539,8 @@ void Nwk_NodeUpdateAddToQueue( Vec_Ptr_t * vQueue, Nwk_Obj_t * pObj, int iCurren
// verification
for ( i = iCurrent + 1; i < Vec_PtrSize(vQueue) - 1; i++ )
{
- pTemp1 = vQueue->pArray[i];
- pTemp2 = vQueue->pArray[i+1];
+ pTemp1 = (Nwk_Obj_t *)vQueue->pArray[i];
+ pTemp2 = (Nwk_Obj_t *)vQueue->pArray[i+1];
if ( fArrival )
assert( Nwk_ObjLevel(pTemp1) <= Nwk_ObjLevel(pTemp2) );
else
@@ -575,7 +578,7 @@ void Nwk_NodeUpdateArrival( Nwk_Obj_t * pObj )
// process objects
if ( pManTime )
Tim_ManIncrementTravId( pManTime );
- Vec_PtrForEachEntry( vQueue, pTemp, iCur )
+ Vec_PtrForEachEntry( Nwk_Obj_t *, vQueue, pTemp, iCur )
{
pTemp->MarkA = 0;
tArrival = Nwk_NodeComputeArrival( pTemp, 1 );
@@ -659,7 +662,7 @@ void Nwk_NodeUpdateRequired( Nwk_Obj_t * pObj )
// process objects
if ( pManTime )
Tim_ManIncrementTravId( pManTime );
- Vec_PtrForEachEntry( vQueue, pTemp, iCur )
+ Vec_PtrForEachEntry( Nwk_Obj_t *, vQueue, pTemp, iCur )
{
pTemp->MarkA = 0;
tRequired = Nwk_NodeComputeRequired( pTemp, 1 );
@@ -773,7 +776,7 @@ void Nwk_ManUpdateLevel( Nwk_Obj_t * pObj )
Vec_PtrPush( vQueue, pObj );
pObj->MarkA = 1;
// process objects
- Vec_PtrForEachEntry( vQueue, pTemp, iCur )
+ Vec_PtrForEachEntry( Nwk_Obj_t *, vQueue, pTemp, iCur )
{
pTemp->MarkA = 0;
LevelNew = Nwk_ObjLevelNew( pTemp );
@@ -887,3 +890,5 @@ void Nwk_ManUpdate( Nwk_Obj_t * pObj, Nwk_Obj_t * pObjNew, Vec_Vec_t * vLevels )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/aig/nwk/nwkUtil.c b/src/aig/nwk/nwkUtil.c
index 9fc292ea..a1948031 100644
--- a/src/aig/nwk/nwkUtil.c
+++ b/src/aig/nwk/nwkUtil.c
@@ -18,9 +18,12 @@
***********************************************************************/
+#include <math.h>
#include "nwk.h"
#include "kit.h"
-#include <math.h>
+
+ABC_NAMESPACE_IMPL_START
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
@@ -295,7 +298,7 @@ void Nwk_ManDumpBlif( Nwk_Man_t * pNtk, char * pFileName, Vec_Ptr_t * vPiNames,
vTruth = Vec_IntAlloc( 1 << 16 );
vCover = Vec_IntAlloc( 1 << 16 );
vNodes = Nwk_ManDfs( pNtk );
- Vec_PtrForEachEntry( vNodes, pObj, i )
+ Vec_PtrForEachEntry( Nwk_Obj_t *, vNodes, pObj, i )
{
if ( !Nwk_ObjIsNode(pObj) )
continue;
@@ -425,7 +428,7 @@ void Nwk_ManPrintFanioNew( Nwk_Man_t * pNtk )
printf( "%15d : ", k );
else
{
- sprintf( Buffer, "%d - %d", (int)pow(10, k/10) * (k%10), (int)pow(10, k/10) * (k%10+1) - 1 );
+ sprintf( Buffer, "%d - %d", (int)pow((double)10, k/10) * (k%10), (int)pow((double)10, k/10) * (k%10+1) - 1 );
printf( "%15s : ", Buffer );
}
if ( vFanins->pArray[k] == 0 )
@@ -636,3 +639,5 @@ void Nwk_ManRemoveDupFanins( Nwk_Man_t * pNtk, int fVerbose )
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+
diff --git a/src/aig/nwk/nwk_.c b/src/aig/nwk/nwk_.c
index 81cffbbf..882b077c 100644
--- a/src/aig/nwk/nwk_.c
+++ b/src/aig/nwk/nwk_.c
@@ -20,6 +20,9 @@
#include "nwk.h"
+ABC_NAMESPACE_IMPL_START
+
+
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
@@ -45,3 +48,5 @@
////////////////////////////////////////////////////////////////////////
+ABC_NAMESPACE_IMPL_END
+