summaryrefslogtreecommitdiffstats
path: root/src/base
diff options
context:
space:
mode:
Diffstat (limited to 'src/base')
-rw-r--r--src/base/abc/abcUtil.c2
-rw-r--r--src/base/acb/acb.h17
-rw-r--r--src/base/acb/acbAbc.c8
3 files changed, 15 insertions, 12 deletions
diff --git a/src/base/abc/abcUtil.c b/src/base/abc/abcUtil.c
index 65e5e529..dc6cd3b3 100644
--- a/src/base/abc/abcUtil.c
+++ b/src/base/abc/abcUtil.c
@@ -3123,7 +3123,6 @@ Vec_Wec_t * Abc_SopSynthesize( Vec_Ptr_t * vSops )
Abc_FrameReplaceCurrentNetwork( Abc_FrameReadGlobalFrame(), pNtk );
Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "fx; strash; balance; dc2; map -a" );
pNtkNew = Abc_FrameReadNtk( Abc_FrameReadGlobalFrame() );
- Abc_NtkDelete( pNtk );
vRes = Vec_WecStart( Abc_NtkPiNum(pNtkNew) + Abc_NtkNodeNum(pNtkNew) + Abc_NtkPoNum(pNtkNew) );
Abc_NtkForEachPi( pNtkNew, pObj, i )
pObj->iTemp = iNode++;
@@ -3131,6 +3130,7 @@ Vec_Wec_t * Abc_SopSynthesize( Vec_Ptr_t * vSops )
{
Vec_Int_t * vNode = Vec_WecEntry(vRes, iNode);
Vec_IntPush( vNode, Abc_GateToType(pObj) );
+ Vec_IntPush( vNode, iNode );
Abc_ObjForEachFanin( pObj, pFanin, k )
Vec_IntPush( vNode, pFanin->iTemp );
pObj->iTemp = iNode++;
diff --git a/src/base/acb/acb.h b/src/base/acb/acb.h
index 0979c545..c9d2128d 100644
--- a/src/base/acb/acb.h
+++ b/src/base/acb/acb.h
@@ -259,8 +259,8 @@ static inline int Acb_ObjRangeSign( Acb_Ntk_t * p, int i ) { r
static inline int Acb_ObjTravId( Acb_Ntk_t * p, int i ) { return Vec_IntGetEntry(&p->vObjTrav, i); }
static inline int Acb_ObjIsTravIdCur( Acb_Ntk_t * p, int i ) { return Acb_ObjTravId(p, i) == p->nObjTravs; }
static inline int Acb_ObjIsTravIdPrev( Acb_Ntk_t * p, int i ) { return Acb_ObjTravId(p, i) == p->nObjTravs-1; }
-static inline int Acb_ObjSetTravIdCur( Acb_Ntk_t * p, int i ) { int r = Acb_ObjIsTravIdCur(p, i); Vec_IntWriteEntry(&p->vObjTrav, i, p->nObjTravs); return r; }
-static inline int Acb_ObjSetTravIdPrev( Acb_Ntk_t * p, int i ) { int r = Acb_ObjSetTravIdPrev(p, i); Vec_IntWriteEntry(&p->vObjTrav, i, p->nObjTravs-1); return r; }
+static inline int Acb_ObjSetTravIdCur( Acb_Ntk_t * p, int i ) { int r = Acb_ObjIsTravIdCur(p, i); Vec_IntWriteEntry(&p->vObjTrav, i, p->nObjTravs); return r; }
+static inline int Acb_ObjSetTravIdPrev( Acb_Ntk_t * p, int i ) { int r = Acb_ObjIsTravIdPrev(p, i); Vec_IntWriteEntry(&p->vObjTrav, i, p->nObjTravs-1); return r; }
static inline int Acb_NtkTravId( Acb_Ntk_t * p ) { return p->nObjTravs; }
static inline void Acb_NtkIncTravId( Acb_Ntk_t * p ) { if ( !Acb_NtkHasObjTravs(p) ) Acb_NtkCleanObjTravs(p); p->nObjTravs++; }
@@ -280,17 +280,26 @@ static inline void Acb_NtkIncTravId( Acb_Ntk_t * p ) { i
for ( i = 0; (i < Acb_NtkCiNum(p)) && (((iObj) = Acb_NtkCi(p, i)), 1); i++ )
#define Acb_NtkForEachCo( p, iObj, i ) \
for ( i = 0; (i < Acb_NtkCoNum(p)) && (((iObj) = Acb_NtkCo(p, i)), 1); i++ )
+#define Acb_NtkForEachCoDriver( p, iObj, i ) \
+ for ( i = 0; (i < Acb_NtkCoNum(p)) && (((iObj) = Acb_ObjFanin(p, Acb_NtkCo(p, i), 0)), 1); i++ )
+
+#define Acb_NtkForEachCiVec( vVec, p, iObj, i ) \
+ for ( i = 0; (i < Vec_IntSize(vVec)) && (((iObj) = Acb_NtkCi(p, Vec_IntEntry(vVec,i))), 1); i++ )
+#define Acb_NtkForEachCoVec( vVec, p, iObj, i ) \
+ for ( i = 0; (i < Vec_IntSize(vVec)) && (((iObj) = Acb_NtkCo(p, Vec_IntEntry(vVec,i))), 1); i++ )
+#define Acb_NtkForEachCoDriverVec( vVec, p, iObj, i ) \
+ for ( i = 0; (i < Vec_IntSize(vVec)) && (((iObj) = Acb_ObjFanin(p, Acb_NtkCo(p, Vec_IntEntry(vVec,i)), 0)), 1); i++ )
#define Acb_NtkForEachBoxSeq( p, iObj, i ) \
for ( i = 0; (i < Acb_NtkSeqNum(p)) && (((iObj) = Acb_NtkBoxSeq(p, i)), 1); i++ )
#define Acb_NtkForEachCioOrder( p, iObj, i ) \
for ( i = 0; (i < Acb_NtkCioOrderNum(p)) && (((iObj) = Acb_NtkCioOrder(p, i)), 1); i++ )
-#define Acb_NtkForEachCoDriver( p, iObj, i ) \
- for ( i = 0; (i < Acb_NtkCoNum(p)) && (((iObj) = Acb_ObjFanin(p, Acb_NtkCo(p, i), 0)), 1); i++ )
#define Acb_NtkForEachObj( p, i ) \
for ( i = 1; i < Vec_StrSize(&p->vObjType); i++ ) if ( !Acb_ObjType(p, i) ) {} else
+#define Acb_NtkForEachNode( p, i ) \
+ for ( i = 1; i < Vec_StrSize(&p->vObjType); i++ ) if ( !Acb_ObjType(p, i) || Acb_ObjIsCio(p, i) ) {} else
#define Acb_NtkForEachObjType( p, Type, i ) \
for ( i = 1; i < Vec_StrSize(&p->vObjType) && (((Type) = Acb_ObjType(p, i)), 1); i++ ) if ( !Type ) {} else
#define Acb_NtkForEachBox( p, i ) \
diff --git a/src/base/acb/acbAbc.c b/src/base/acb/acbAbc.c
index 7aba364e..c726ba73 100644
--- a/src/base/acb/acbAbc.c
+++ b/src/base/acb/acbAbc.c
@@ -96,13 +96,7 @@ Acb_Ntk_t * Acb_NtkFromNdr( char * pFileName, void * pModule, Abc_Nam_t * pNames
ObjId = Acb_ObjAlloc( pNtk, ABC_OPER_CI, 0, 0 );
Vec_IntWriteEntry( vMap, NameId, ObjId );
Acb_ObjSetName( pNtk, ObjId, NameId );
- }
- Ndr_ModForEachPi( p, Mod, Obj )
- {
- NameId = Ndr_ObjReadBody( p, Obj, NDR_OUTPUT );
- ObjId = Acb_ObjAlloc( pNtk, ABC_OPER_CI, 0, 0 );
- Vec_IntWriteEntry( vMap, NameId, ObjId );
- Acb_ObjSetName( pNtk, ObjId, NameId );
+ Acb_ObjSetWeight( pNtk, ObjId, vWeights ? Vec_IntEntry(vWeights, NameId) : 0 );
}
Ndr_ModForEachTarget( p, Mod, Obj )
{