Commit d92bfbad by Alan Mishchenko

Experiments with new network data-structure.

parent bacc1bc1
...@@ -3123,7 +3123,6 @@ Vec_Wec_t * Abc_SopSynthesize( Vec_Ptr_t * vSops ) ...@@ -3123,7 +3123,6 @@ Vec_Wec_t * Abc_SopSynthesize( Vec_Ptr_t * vSops )
Abc_FrameReplaceCurrentNetwork( Abc_FrameReadGlobalFrame(), pNtk ); Abc_FrameReplaceCurrentNetwork( Abc_FrameReadGlobalFrame(), pNtk );
Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "fx; strash; balance; dc2; map -a" ); Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "fx; strash; balance; dc2; map -a" );
pNtkNew = Abc_FrameReadNtk( Abc_FrameReadGlobalFrame() ); pNtkNew = Abc_FrameReadNtk( Abc_FrameReadGlobalFrame() );
Abc_NtkDelete( pNtk );
vRes = Vec_WecStart( Abc_NtkPiNum(pNtkNew) + Abc_NtkNodeNum(pNtkNew) + Abc_NtkPoNum(pNtkNew) ); vRes = Vec_WecStart( Abc_NtkPiNum(pNtkNew) + Abc_NtkNodeNum(pNtkNew) + Abc_NtkPoNum(pNtkNew) );
Abc_NtkForEachPi( pNtkNew, pObj, i ) Abc_NtkForEachPi( pNtkNew, pObj, i )
pObj->iTemp = iNode++; pObj->iTemp = iNode++;
...@@ -3131,6 +3130,7 @@ Vec_Wec_t * Abc_SopSynthesize( Vec_Ptr_t * vSops ) ...@@ -3131,6 +3130,7 @@ Vec_Wec_t * Abc_SopSynthesize( Vec_Ptr_t * vSops )
{ {
Vec_Int_t * vNode = Vec_WecEntry(vRes, iNode); Vec_Int_t * vNode = Vec_WecEntry(vRes, iNode);
Vec_IntPush( vNode, Abc_GateToType(pObj) ); Vec_IntPush( vNode, Abc_GateToType(pObj) );
Vec_IntPush( vNode, iNode );
Abc_ObjForEachFanin( pObj, pFanin, k ) Abc_ObjForEachFanin( pObj, pFanin, k )
Vec_IntPush( vNode, pFanin->iTemp ); Vec_IntPush( vNode, pFanin->iTemp );
pObj->iTemp = iNode++; pObj->iTemp = iNode++;
......
...@@ -259,8 +259,8 @@ static inline int Acb_ObjRangeSign( Acb_Ntk_t * p, int i ) { r ...@@ -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_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_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_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_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_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 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++; } 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 ...@@ -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++ ) for ( i = 0; (i < Acb_NtkCiNum(p)) && (((iObj) = Acb_NtkCi(p, i)), 1); i++ )
#define Acb_NtkForEachCo( p, iObj, i ) \ #define Acb_NtkForEachCo( p, iObj, i ) \
for ( i = 0; (i < Acb_NtkCoNum(p)) && (((iObj) = Acb_NtkCo(p, i)), 1); 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 ) \ #define Acb_NtkForEachBoxSeq( p, iObj, i ) \
for ( i = 0; (i < Acb_NtkSeqNum(p)) && (((iObj) = Acb_NtkBoxSeq(p, i)), 1); i++ ) for ( i = 0; (i < Acb_NtkSeqNum(p)) && (((iObj) = Acb_NtkBoxSeq(p, i)), 1); i++ )
#define Acb_NtkForEachCioOrder( p, iObj, i ) \ #define Acb_NtkForEachCioOrder( p, iObj, i ) \
for ( i = 0; (i < Acb_NtkCioOrderNum(p)) && (((iObj) = Acb_NtkCioOrder(p, i)), 1); 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 ) \ #define Acb_NtkForEachObj( p, i ) \
for ( i = 1; i < Vec_StrSize(&p->vObjType); i++ ) if ( !Acb_ObjType(p, i) ) {} else 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 ) \ #define Acb_NtkForEachObjType( p, Type, i ) \
for ( i = 1; i < Vec_StrSize(&p->vObjType) && (((Type) = Acb_ObjType(p, i)), 1); i++ ) if ( !Type ) {} else for ( i = 1; i < Vec_StrSize(&p->vObjType) && (((Type) = Acb_ObjType(p, i)), 1); i++ ) if ( !Type ) {} else
#define Acb_NtkForEachBox( p, i ) \ #define Acb_NtkForEachBox( p, i ) \
......
...@@ -96,13 +96,7 @@ Acb_Ntk_t * Acb_NtkFromNdr( char * pFileName, void * pModule, Abc_Nam_t * pNames ...@@ -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 ); ObjId = Acb_ObjAlloc( pNtk, ABC_OPER_CI, 0, 0 );
Vec_IntWriteEntry( vMap, NameId, ObjId ); Vec_IntWriteEntry( vMap, NameId, ObjId );
Acb_ObjSetName( pNtk, ObjId, NameId ); Acb_ObjSetName( pNtk, ObjId, NameId );
} Acb_ObjSetWeight( pNtk, ObjId, vWeights ? Vec_IntEntry(vWeights, NameId) : 0 );
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 );
} }
Ndr_ModForEachTarget( p, Mod, Obj ) Ndr_ModForEachTarget( p, Mod, Obj )
{ {
......
...@@ -136,6 +136,7 @@ extern float Mio_LibraryReadAreaInv ( Mio_Library_t * pLib ); ...@@ -136,6 +136,7 @@ extern float Mio_LibraryReadAreaInv ( Mio_Library_t * pLib );
extern float Mio_LibraryReadAreaBuf ( Mio_Library_t * pLib ); extern float Mio_LibraryReadAreaBuf ( Mio_Library_t * pLib );
extern float Mio_LibraryReadAreaNand2 ( Mio_Library_t * pLib ); extern float Mio_LibraryReadAreaNand2 ( Mio_Library_t * pLib );
extern int Mio_LibraryReadGateNameMax( Mio_Library_t * pLib ); extern int Mio_LibraryReadGateNameMax( Mio_Library_t * pLib );
extern void Mio_LibrarySetName ( Mio_Library_t * pLib, char * pName );
extern char * Mio_GateReadName ( Mio_Gate_t * pGate ); extern char * Mio_GateReadName ( Mio_Gate_t * pGate );
extern char * Mio_GateReadOutName ( Mio_Gate_t * pGate ); extern char * Mio_GateReadOutName ( Mio_Gate_t * pGate );
extern double Mio_GateReadArea ( Mio_Gate_t * pGate ); extern double Mio_GateReadArea ( Mio_Gate_t * pGate );
......
...@@ -64,6 +64,7 @@ float Mio_LibraryReadDelayAigNode ( Mio_Library_t * pLib ) { retur ...@@ -64,6 +64,7 @@ float Mio_LibraryReadDelayAigNode ( Mio_Library_t * pLib ) { retur
float Mio_LibraryReadAreaInv ( Mio_Library_t * pLib ) { return (float)(pLib->pGateInv? pLib->pGateInv->dArea : 0.0); } float Mio_LibraryReadAreaInv ( Mio_Library_t * pLib ) { return (float)(pLib->pGateInv? pLib->pGateInv->dArea : 0.0); }
float Mio_LibraryReadAreaBuf ( Mio_Library_t * pLib ) { return (float)(pLib->pGateBuf? pLib->pGateBuf->dArea : 0.0); } float Mio_LibraryReadAreaBuf ( Mio_Library_t * pLib ) { return (float)(pLib->pGateBuf? pLib->pGateBuf->dArea : 0.0); }
float Mio_LibraryReadAreaNand2 ( Mio_Library_t * pLib ) { return (float)(pLib->pGateNand2? pLib->pGateNand2->dArea : 0.0); } float Mio_LibraryReadAreaNand2 ( Mio_Library_t * pLib ) { return (float)(pLib->pGateNand2? pLib->pGateNand2->dArea : 0.0); }
void Mio_LibrarySetName ( Mio_Library_t * pLib, char * pName ) { ABC_FREE(pLib->pName); pLib->pName = pName; }
/**Function************************************************************* /**Function*************************************************************
......
...@@ -71,6 +71,8 @@ struct Vec_Int_t_ ...@@ -71,6 +71,8 @@ struct Vec_Int_t_
for ( i = 0; (i+2 < Vec_IntSize(vVec)) && (((Entry1) = Vec_IntEntry(vVec, i)), 1) && (((Entry2) = Vec_IntEntry(vVec, i+1)), 1) && (((Entry3) = Vec_IntEntry(vVec, i+2)), 1); i += 3 ) for ( i = 0; (i+2 < Vec_IntSize(vVec)) && (((Entry1) = Vec_IntEntry(vVec, i)), 1) && (((Entry2) = Vec_IntEntry(vVec, i+1)), 1) && (((Entry3) = Vec_IntEntry(vVec, i+2)), 1); i += 3 )
#define Vec_IntForEachEntryThisNext( vVec, This, Next, i ) \ #define Vec_IntForEachEntryThisNext( vVec, This, Next, i ) \
for ( i = 0, (This) = (Next) = (Vec_IntSize(vVec) ? Vec_IntEntry(vVec, 0) : -1); (i+1 < Vec_IntSize(vVec)) && (((Next) = Vec_IntEntry(vVec, i+1)), 1); i += 2, (This) = (Next) ) for ( i = 0, (This) = (Next) = (Vec_IntSize(vVec) ? Vec_IntEntry(vVec, 0) : -1); (i+1 < Vec_IntSize(vVec)) && (((Next) = Vec_IntEntry(vVec, i+1)), 1); i += 2, (This) = (Next) )
#define Vec_IntForEachEntryInVec( vVec2, vVec, Entry, i ) \
for ( i = 0; (i < Vec_IntSize(vVec)) && (((Entry) = Vec_IntEntry(vVec2, Vec_IntEntry(vVec, i))), 1); i++ )
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS /// /// FUNCTION DEFINITIONS ///
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment