diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2015-01-18 20:38:52 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2015-01-18 20:38:52 -0800 |
commit | dc8926a9286ba7ecc1e461081d2108c7a3e67333 (patch) | |
tree | 0f90825404a32dddeee330759a6b7fcf6ef64a95 /src/base | |
parent | d688af2601d5a7d4cb23ced5e25eeec0f046f40e (diff) | |
download | abc-dc8926a9286ba7ecc1e461081d2108c7a3e67333.tar.gz abc-dc8926a9286ba7ecc1e461081d2108c7a3e67333.tar.bz2 abc-dc8926a9286ba7ecc1e461081d2108c7a3e67333.zip |
Word-level extension of Cba_Ntk_t.
Diffstat (limited to 'src/base')
-rw-r--r-- | src/base/cba/cba.h | 80 | ||||
-rw-r--r-- | src/base/cba/cbaBlast.c | 13 | ||||
-rw-r--r-- | src/base/cba/cbaBuild.c | 2 | ||||
-rw-r--r-- | src/base/cba/cbaNtk.c | 2 | ||||
-rw-r--r-- | src/base/cba/cbaPrs.h | 6 | ||||
-rw-r--r-- | src/base/cba/cbaReadVer.c | 10 | ||||
-rw-r--r-- | src/base/cba/cbaSimple.c | 14 |
7 files changed, 91 insertions, 36 deletions
diff --git a/src/base/cba/cba.h b/src/base/cba/cba.h index cdf5cf29..64ae4a24 100644 --- a/src/base/cba/cba.h +++ b/src/base/cba/cba.h @@ -49,7 +49,7 @@ typedef enum { CBA_OBJ_BO, // 2: box output CBA_OBJ_PI, // 3: input CBA_OBJ_PO, // 4: output - CBA_OBJ_PIO, // 5: input + CBA_OBJ_PIO, // 5: ioput CBA_OBJ_NODE, // 6: node CBA_OBJ_BOX, // 7: box CBA_OBJ_LATCH, // 8: latch @@ -60,8 +60,8 @@ typedef enum { // Verilog predefined models typedef enum { CBA_NODE_NONE = 0, // 0: unused - CBA_NODE_C0, // 1: logic node - CBA_NODE_C1, // 2: logic node + CBA_NODE_C0, // 1: constant 0 + CBA_NODE_C1, // 2: constant 1 CBA_NODE_BUF, // 3: buffer CBA_NODE_INV, // 4: inverter CBA_NODE_AND, // 5: AND @@ -73,7 +73,53 @@ typedef enum { CBA_NODE_SHARP, // 11: SHARP CBA_NODE_MUX, // 12: MUX CBA_NODE_MAJ, // 13: MAJ - CBA_NODE_UNKNOWN // 14: unknown + CBA_NODE_LUT, // 14: LUT + + CBA_NODE_RAND, + CBA_NODE_RNAND, + CBA_NODE_ROR, + CBA_NODE_RNOR, + CBA_NODE_RXOR, + CBA_NODE_RXNOR, + + CBA_NODE_SEL, + CBA_NODE_PSEL, + CBA_NODE_ENC, + CBA_NODE_PENC, + CBA_NODE_DEC, + + CBA_NODE_C, + CBA_NODE_ADD, + CBA_NODE_SUB, + CBA_NODE_MUL, + CBA_NODE_DIV, + CBA_NODE_MOD, + CBA_NODE_REM, + CBA_NODE_POW, + CBA_NODE_ABS, + + CBA_NODE_LTHEN, + CBA_NODE_MTHEN, + CBA_NODE_EQU, + CBA_NODE_NEQU, + + CBA_NODE_SHIL, + CBA_NODE_SHIR, + CBA_NODE_ROTL, + CBA_NODE_ROTR, + + CBA_NODE_TRI, + CBA_NODE_RAM, + CBA_NODE_RAMR, + CBA_NODE_RAMW, + CBA_NODE_RAMWC, + + CBA_NODE_LATCH, + CBA_NODE_LATCHRS, + CBA_NODE_DFF, + CBA_NODE_DFFRS, + + CBA_NODE_UNKNOWN // 50 } Cba_NodeType_t; @@ -119,11 +165,12 @@ struct Cba_Ntk_t_ // objects Vec_Int_t vTypes; // types (used by parser to store Cba_PrsType_t) Vec_Int_t vFuncs; // functions (used by parser to store function) (node: function; box: model; CI/CO: index) - Vec_Int_t vInstIds; // instance names (used by parser to store instance name as NameId) Vec_Int_t vFanins; // fanins (used by parser to store fanin/fanout/range as NameId) (node: handle; CO/BI fanin0) // attributes + Vec_Int_t vInstIds; // instance names (used by parser to store instance name as NameId) Vec_Int_t vNameIds; // original names as NameId - Vec_Int_t vRanges; // ranges as NameId + Vec_Int_t vRangesL; // ranges as NameId + Vec_Int_t vRangesR; // ranges as NameId }; @@ -132,6 +179,7 @@ static inline char * Cba_ManSpec( Cba_Man_t * p ) { r static inline int Cba_ManNtkNum( Cba_Man_t * p ) { return Vec_PtrSize(&p->vNtks) - 1; } static inline int Cba_ManNtkId( Cba_Man_t * p, char * pName ) { return Abc_NamStrFind(p->pModels, pName); } static inline Cba_Ntk_t * Cba_ManNtk( Cba_Man_t * p, int i ) { assert( i > 0 ); return (Cba_Ntk_t *)Vec_PtrEntry(&p->vNtks, i); } +static inline Cba_Ntk_t * Cba_ManNtkFind( Cba_Man_t * p, char * pName ) { return Cba_ManNtk( p, Cba_ManNtkId(p, pName) ); } static inline Cba_Ntk_t * Cba_ManRoot( Cba_Man_t * p ) { return Cba_ManNtk(p, p->iRoot); } static inline Vec_Set_t * Cba_ManMem( Cba_Man_t * p ) { return &p->Mem; } static inline int Cba_ManMemSave( Cba_Man_t * p, int * d, int s ) { return Vec_SetAppend(Cba_ManMem(p), d, s); } @@ -141,11 +189,13 @@ static inline Cba_Man_t * Cba_NtkMan( Cba_Ntk_t * p ) { r static inline int Cba_NtkId( Cba_Ntk_t * p ) { return p->Id; } static inline char * Cba_NtkName( Cba_Ntk_t * p ) { return Abc_NamStr(Cba_NtkMan(p)->pModels, Cba_NtkId(p)); } static inline int Cba_NtkObjNum( Cba_Ntk_t * p ) { return Vec_IntSize(&p->vFanins); } +static inline int Cba_NtkPioNum( Cba_Ntk_t * p ) { return Vec_IntSize(&p->vInouts); } static inline int Cba_NtkPiNum( Cba_Ntk_t * p ) { return Vec_IntSize(&p->vInputs); } static inline int Cba_NtkPoNum( Cba_Ntk_t * p ) { return Vec_IntSize(&p->vOutputs); } static inline int Cba_NtkNodeNum( Cba_Ntk_t * p ) { return Vec_IntCountEntry(&p->vTypes, CBA_OBJ_NODE); } static inline int Cba_NtkBoxNum( Cba_Ntk_t * p ) { return Vec_IntCountEntry(&p->vTypes, CBA_OBJ_BOX); } +static inline int Cba_NtkPio( Cba_Ntk_t * p, int i ) { return Vec_IntEntry(&p->vInouts, i); } static inline int Cba_NtkPi( Cba_Ntk_t * p, int i ) { return Vec_IntEntry(&p->vInputs, i); } static inline int Cba_NtkPo( Cba_Ntk_t * p, int i ) { return Vec_IntEntry(&p->vOutputs, i); } static inline char * Cba_NtkStr( Cba_Ntk_t * p, int i ) { return Abc_NamStr(p->pDesign->pNames, i); } @@ -160,13 +210,15 @@ static inline void Cba_NtkSetHost( Cba_Ntk_t * p, int n, int i ) { p static inline Vec_Int_t * Cba_NtkCopies( Cba_Ntk_t * p ) { return &p->pDesign->vCopies; } static inline int Cba_NtkCopy( Cba_Ntk_t * p, int i ) { return Vec_IntEntry( Cba_NtkCopies(p), p->iObjStart + i ); } static inline void Cba_NtkSetCopy( Cba_Ntk_t * p, int i, int x ) { Vec_IntWriteEntry( Cba_NtkCopies(p), p->iObjStart + i, x ); } +static inline int Cba_NtkIsWordLevel( Cba_Ntk_t * p ) { return Vec_IntSize(&p->vRangesL) > 0; } -static inline Cba_ObjType_t Cba_ObjType( Cba_Ntk_t * p, int i ) { return Vec_IntEntry(&p->vTypes, i); } +static inline Cba_ObjType_t Cba_ObjType( Cba_Ntk_t * p, int i ) { return (Cba_ObjType_t)Vec_IntEntry(&p->vTypes, i); } static inline int Cba_ObjFuncId( Cba_Ntk_t * p, int i ) { return Vec_IntEntry(&p->vFuncs, i); } -static inline int Cba_ObjInstId( Cba_Ntk_t * p, int i ) { return Vec_IntEntry(&p->vInstIds, i); } static inline int Cba_ObjFaninId( Cba_Ntk_t * p, int i ) { return Vec_IntEntry(&p->vFanins, i); } +static inline int Cba_ObjInstId( Cba_Ntk_t * p, int i ) { return Vec_IntEntry(&p->vInstIds, i); } static inline int Cba_ObjNameId( Cba_Ntk_t * p, int i ) { return Vec_IntEntry(&p->vNameIds, i); } -static inline int Cba_ObjRangeId( Cba_Ntk_t * p, int i ) { return Vec_IntEntry(&p->vRanges, i); } +static inline int Cba_ObjRangeLId( Cba_Ntk_t * p, int i ) { return Vec_IntEntry(&p->vRangesL, i); } +static inline int Cba_ObjRangeRId( Cba_Ntk_t * p, int i ) { return Vec_IntEntry(&p->vRangesR, i); } static inline int Cba_ObjIsPi( Cba_Ntk_t * p, int i ) { return Cba_ObjType(p, i) == CBA_OBJ_PI; } static inline int Cba_ObjIsPo( Cba_Ntk_t * p, int i ) { return Cba_ObjType(p, i) == CBA_OBJ_PO; } @@ -186,7 +238,7 @@ static inline int Cba_ObjFaninNum( Cba_Ntk_t * p, int i ) { r static inline int * Cba_ObjFanins( Cba_Ntk_t * p, int i ) { return Cba_ObjFaninArray(p, i) + 1; } static inline Vec_Int_t * Cba_ObjFaninVec( Cba_Ntk_t * p, int i ) { static Vec_Int_t V; V.pArray = Cba_ObjFaninArray(p, i); V.nSize = V.nCap = V.pArray ? *V.pArray++ : 0; return &V; } static inline Vec_Int_t * Cba_ObjFaninVec2( Cba_Ntk_t * p, int i ) { static Vec_Int_t W; W.pArray = Cba_ObjFaninArray(p, i); W.nSize = W.nCap = W.pArray ? *W.pArray++ : 0; return &W; } -static inline Cba_NodeType_t Cba_ObjNodeType( Cba_Ntk_t * p, int i ) { assert(Cba_ObjIsNode(p, i)); return Cba_ObjFuncId(p, i); } +static inline Cba_NodeType_t Cba_ObjNodeType( Cba_Ntk_t * p, int i ) { assert(Cba_ObjIsNode(p, i)); return (Cba_NodeType_t)Cba_ObjFuncId(p, i); } static inline int Cba_ObjBoxModelId( Cba_Ntk_t * p, int i ) { assert(Cba_ObjIsBox(p, i)); return Cba_ObjFuncId(p, i); } static inline Cba_Ntk_t * Cba_ObjBoxModel( Cba_Ntk_t * p, int i ) { assert(Cba_ObjIsBox(p, i)); return Cba_ManNtk(p->pDesign, Cba_ObjBoxModelId(p, i)); } static inline int Cba_ObjBoxSize( Cba_Ntk_t * p, int i ) { return 1 + Cba_NtkPiNum(Cba_ObjBoxModel(p, i)) + Cba_NtkPoNum(Cba_ObjBoxModel(p, i)); } @@ -204,7 +256,6 @@ static inline int Cba_ObjCioIndex( Cba_Ntk_t * p, int i ) { a static inline char * Cba_ObjFuncStr( Cba_Ntk_t * p, int i ) { return Cba_NtkStr(p, Cba_ObjFuncId(p, i)); } static inline char * Cba_ObjInstStr( Cba_Ntk_t * p, int i ) { return Cba_NtkStr(p, Cba_ObjInstId(p, i)); } static inline char * Cba_ObjNameStr( Cba_Ntk_t * p, int i ) { return Cba_NtkStr(p, Cba_ObjNameId(p, i)); } -static inline char * Cba_ObjRangeStr( Cba_Ntk_t * p, int i ) { return Cba_NtkStr(p, Cba_ObjRangeId(p, i)); } //////////////////////////////////////////////////////////////////////// @@ -293,7 +344,7 @@ static inline void Cba_ManSetupArray( Cba_Man_t * p, Vec_Int_t * vTo, Vec_Int_t static inline Cba_Ntk_t * Cba_NtkAlloc( Cba_Man_t * p, char * pName ) { int iModelId = Abc_NamStrFindOrAdd( p->pModels, pName, NULL ); - Cba_Ntk_t * pNtk = Vec_SetFetch( Cba_ManMem(p), sizeof(Cba_Ntk_t) ); + Cba_Ntk_t * pNtk = (Cba_Ntk_t *)Vec_SetFetch( Cba_ManMem(p), sizeof(Cba_Ntk_t) ); memset( pNtk, 0, sizeof(Cba_Ntk_t) ); pNtk->pDesign = p; pNtk->Id = Vec_PtrSize(&p->vNtks); @@ -303,13 +354,16 @@ static inline Cba_Ntk_t * Cba_NtkAlloc( Cba_Man_t * p, char * pName ) printf( "Model with name %s already exists.\n", pName ); return pNtk; } -static inline void Cba_NtkResize( Cba_Ntk_t * p, int nObjs ) +static inline void Cba_NtkResize( Cba_Ntk_t * p, int nObjs, int fRange ) { assert( Vec_IntSize(&p->vTypes) == 0 ); Cba_ManFetchArray( p->pDesign, &p->vTypes, nObjs ); Cba_ManFetchArray( p->pDesign, &p->vFuncs, nObjs ); Cba_ManFetchArray( p->pDesign, &p->vFanins, nObjs ); Cba_ManFetchArray( p->pDesign, &p->vNameIds, nObjs ); + if ( !fRange ) return; + Cba_ManFetchArray( p->pDesign, &p->vRangesL, nObjs ); + Cba_ManFetchArray( p->pDesign, &p->vRangesR, nObjs ); } static inline Cba_Man_t * Cba_ManAlloc( Cba_Man_t * pOld, char * pFileName ) { diff --git a/src/base/cba/cbaBlast.c b/src/base/cba/cbaBlast.c index b0988632..bd120044 100644 --- a/src/base/cba/cbaBlast.c +++ b/src/base/cba/cbaBlast.c @@ -46,19 +46,20 @@ ABC_NAMESPACE_IMPL_START ***********************************************************************/ void Cba_ManPrepareGates( Cba_Man_t * p ) { - int i; + Dec_Graph_t ** ppGraphs; int i; if ( p->pMioLib == NULL ) return; - assert( p->ppGraphs == NULL ); - p->ppGraphs = (Dec_Graph_t **)ABC_ALLOC( Dec_Graph_t *, Abc_NamObjNumMax(p->pFuncs) ); - p->ppGraphs[0] = NULL; + ppGraphs = ABC_ALLOC( Dec_Graph_t *, Abc_NamObjNumMax(p->pFuncs) ); + ppGraphs[0] = NULL; for ( i = 1; i < Abc_NamObjNumMax(p->pFuncs); i++ ) { char * pGateName = Abc_NamStr( p->pFuncs, i ); Mio_Gate_t * pGate = Mio_LibraryReadGateByName( (Mio_Library_t *)p->pMioLib, pGateName, NULL ); char * pSop = Mio_GateReadSop( pGate ); - p->ppGraphs[i] = Dec_Factor( pSop ); + ppGraphs[i] = Dec_Factor( pSop ); } + assert( p->ppGraphs == NULL ); + p->ppGraphs = ppGraphs; } void Cba_ManUndoGates( Cba_Man_t * p ) { @@ -66,7 +67,7 @@ void Cba_ManUndoGates( Cba_Man_t * p ) if ( p->pMioLib == NULL ) return; for ( i = 1; i < Abc_NamObjNumMax(p->pFuncs); i++ ) - Dec_GraphFree( p->ppGraphs[i] ); + Dec_GraphFree( (Dec_Graph_t *)p->ppGraphs[i] ); ABC_FREE( p->ppGraphs ); } diff --git a/src/base/cba/cbaBuild.c b/src/base/cba/cbaBuild.c index 86d60983..c46584e8 100644 --- a/src/base/cba/cbaBuild.c +++ b/src/base/cba/cbaBuild.c @@ -169,7 +169,7 @@ Cba_Ntk_t * Cba_NtkBuild( Cba_Man_t * pNew, Cba_Ntk_t * pNtk, Vec_Int_t * vMap, // start network pNtkNew = Cba_ManNtk( pNew, Cba_NtkId(pNtk) ); - Cba_NtkResize( pNtkNew, nObjCount ); + Cba_NtkResize( pNtkNew, nObjCount, 0 ); // fill object information Cba_NtkForEachPi( pNtk, NameId, i ) diff --git a/src/base/cba/cbaNtk.c b/src/base/cba/cbaNtk.c index 257d39bb..2c1fa1e3 100644 --- a/src/base/cba/cbaNtk.c +++ b/src/base/cba/cbaNtk.c @@ -137,7 +137,7 @@ Cba_Man_t * Cba_ManDupStart( Cba_Man_t * p, Vec_Int_t * vNtkSizes ) Cba_Ntk_t * pNtk; int i; Cba_Man_t * pNew = Cba_ManClone( p ); Cba_ManForEachNtk( p, pNtk, i ) - Cba_NtkResize( Cba_ManNtk(pNew, i), vNtkSizes ? Vec_IntEntry(vNtkSizes, i) : Cba_NtkObjNum(pNtk) ); + Cba_NtkResize( Cba_ManNtk(pNew, i), vNtkSizes ? Vec_IntEntry(vNtkSizes, i) : Cba_NtkObjNum(pNtk), Cba_NtkIsWordLevel(pNtk) ); Vec_IntFill( &p->vCopies, Cba_ManObjNum(p), -1 ); Cba_ManForEachNtk( p, pNtk, i ) Cba_NtkDupStart( Cba_ManNtk(pNew, i), pNtk ); diff --git a/src/base/cba/cbaPrs.h b/src/base/cba/cbaPrs.h index 222a7534..38757641 100644 --- a/src/base/cba/cbaPrs.h +++ b/src/base/cba/cbaPrs.h @@ -69,8 +69,8 @@ struct Cba_Prs_t_ // objects collected by the parser Vec_Int_t vTypesCur; // Cba_PrsType_t Vec_Int_t vFuncsCur; // functions (node->func; box->module; gate->cell; latch->init; concat->unused) - Vec_Int_t vInstIdsCur; // instance names Vec_Int_t vFaninsCur; // instances + Vec_Int_t vInstIdsCur; // instance names // temporary data Vec_Str_t vCover; // one SOP cover Vec_Int_t vTemp; // array of tokens @@ -124,8 +124,8 @@ static inline Cba_Ntk_t * Cba_PrsAddCurrentModel( Cba_Prs_t * p, int iNameId ) Cba_ManSetupArray( p->pDesign, &pNtk->vWires, &p->vWiresCur ); Cba_ManSetupArray( p->pDesign, &pNtk->vTypes, &p->vTypesCur ); Cba_ManSetupArray( p->pDesign, &pNtk->vFuncs, &p->vFuncsCur ); - Cba_ManSetupArray( p->pDesign, &pNtk->vInstIds, &p->vInstIdsCur ); Cba_ManSetupArray( p->pDesign, &pNtk->vFanins, &p->vFaninsCur ); + Cba_ManSetupArray( p->pDesign, &pNtk->vInstIds, &p->vInstIdsCur ); return pNtk; } @@ -182,8 +182,8 @@ static inline void Cba_PrsFree( Cba_Prs_t * p ) Vec_IntErase( &p->vTypesCur ); Vec_IntErase( &p->vFuncsCur ); - Vec_IntErase( &p->vInstIdsCur ); Vec_IntErase( &p->vFaninsCur ); + Vec_IntErase( &p->vInstIdsCur ); // temporary Vec_StrErase( &p->vCover ); Vec_IntErase( &p->vTemp ); diff --git a/src/base/cba/cbaReadVer.c b/src/base/cba/cbaReadVer.c index 6eeb104f..09250eb0 100644 --- a/src/base/cba/cbaReadVer.c +++ b/src/base/cba/cbaReadVer.c @@ -369,8 +369,8 @@ static inline int Cba_PrsReadConcat( Cba_Prs_t * p, Vec_Int_t * vTemp2 ) // create new concatentation Vec_IntPush( &p->vTypesCur, CBA_OBJ_CONCAT ); Vec_IntPush( &p->vFuncsCur, 0 ); - Vec_IntPush( &p->vInstIdsCur, 0 ); Vec_IntPush( &p->vFaninsCur, Cba_ManHandleArray(p->pDesign, vTemp2) ); + Vec_IntPush( &p->vInstIdsCur, 0 ); return Vec_IntSize(&p->vFaninsCur); } static inline int Cba_PrsReadSignalOrConcat( Cba_Prs_t * p, int * pName, int * pRange ) @@ -499,8 +499,8 @@ static inline int Cba_PrsReadAssign( Cba_Prs_t * p ) { Vec_IntPush( &p->vTypesCur, CBA_OBJ_NODE ); Vec_IntPush( &p->vFuncsCur, fCompl ? CBA_NODE_INV : CBA_NODE_BUF ); - Vec_IntPush( &p->vInstIdsCur, 0 ); Vec_IntPush( &p->vFaninsCur, Cba_ManHandleArray(p->pDesign, &p->vTemp) ); + Vec_IntPush( &p->vInstIdsCur, 0 ); return 1; } if ( Cba_PrsIsChar(p, '&') ) @@ -534,8 +534,8 @@ static inline int Cba_PrsReadAssign( Cba_Prs_t * p ) // write binary operator Vec_IntPush( &p->vTypesCur, CBA_OBJ_NODE ); Vec_IntPush( &p->vFuncsCur, Oper ); - Vec_IntPush( &p->vInstIdsCur, 0 ); Vec_IntPush( &p->vFaninsCur, Cba_ManHandleArray(p->pDesign, &p->vTemp) ); + Vec_IntPush( &p->vInstIdsCur, 0 ); return 1; } static inline int Cba_PrsReadInstance( Cba_Prs_t * p, int Func ) @@ -564,8 +564,8 @@ static inline int Cba_PrsReadInstance( Cba_Prs_t * p, int Func ) // assign Vec_IntPush( &p->vTypesCur, Type ); Vec_IntPush( &p->vFuncsCur, Func ); - Vec_IntPush( &p->vInstIdsCur, InstId ); Vec_IntPush( &p->vFaninsCur, Cba_ManHandleArray(p->pDesign, &p->vTemp) ); + Vec_IntPush( &p->vInstIdsCur, InstId ); return 1; } @@ -633,9 +633,9 @@ static inline int Cba_PrsReadModule( Cba_Prs_t * p ) Vec_IntPush( &p->vFailed, p->iModuleName ); // cleanup Vec_IntClear( &p->vWiresCur ); - Vec_IntClear( &p->vFaninsCur ); Vec_IntClear( &p->vTypesCur ); Vec_IntClear( &p->vFuncsCur ); + Vec_IntClear( &p->vFaninsCur ); Vec_IntClear( &p->vInstIdsCur ); // add Cba_PrsAddCurrentModel( p, p->iModuleName ); diff --git a/src/base/cba/cbaSimple.c b/src/base/cba/cbaSimple.c index 702fa2b0..1370a0be 100644 --- a/src/base/cba/cbaSimple.c +++ b/src/base/cba/cbaSimple.c @@ -583,26 +583,26 @@ Vec_Int_t * Cba_PrsReadList( Cba_Man_t * p, Vec_Ptr_t * vNames, Vec_Int_t * vLis Vec_IntPush( vList, Abc_NamStrFindOrAdd(p->pNames, pName, NULL) ); return vList; } -void Cba_PrsReadNodes( Cba_Man_t * p, Vec_Ptr_t * vNodes, Vec_Int_t * vTypesCur, Vec_Int_t * vFuncsCur, Vec_Int_t * vInstIdsCur, Vec_Int_t * vFaninsCur, Vec_Int_t * vList ) +void Cba_PrsReadNodes( Cba_Man_t * p, Vec_Ptr_t * vNodes, Vec_Int_t * vTypesCur, Vec_Int_t * vFuncsCur, Vec_Int_t * vFaninsCur, Vec_Int_t * vInstIdsCur, Vec_Int_t * vList ) { Vec_Ptr_t * vNode; int i; Vec_PtrForEachEntry( Vec_Ptr_t *, vNodes, vNode, i ) { Vec_IntPush( vTypesCur, CBA_OBJ_NODE ); Vec_IntPush( vFuncsCur, (Cba_NodeType_t)Abc_Ptr2Int(Vec_PtrEntry(vNode, 1)) ); - Vec_IntPush( vInstIdsCur, 0 ); Vec_IntPush( vFaninsCur, Cba_ManHandleArray(p, Cba_PrsReadList(p, vNode, vList, 1, -1)) ); + Vec_IntPush( vInstIdsCur, 0 ); } } -void Cba_PrsReadBoxes( Cba_Man_t * p, Vec_Ptr_t * vBoxes, Vec_Int_t * vTypesCur, Vec_Int_t * vFuncsCur, Vec_Int_t * vInstIdsCur, Vec_Int_t * vFaninsCur, Vec_Int_t * vList ) +void Cba_PrsReadBoxes( Cba_Man_t * p, Vec_Ptr_t * vBoxes, Vec_Int_t * vTypesCur, Vec_Int_t * vFuncsCur, Vec_Int_t * vFaninsCur, Vec_Int_t * vInstIdsCur, Vec_Int_t * vList ) { Vec_Ptr_t * vBox; int i; Vec_PtrForEachEntry( Vec_Ptr_t *, vBoxes, vBox, i ) { Vec_IntPush( vTypesCur, CBA_OBJ_BOX ); Vec_IntPush( vFuncsCur, Abc_NamStrFindOrAdd(p->pModels, Vec_PtrEntry(vBox, 0), NULL) ); - Vec_IntPush( vInstIdsCur, Abc_NamStrFindOrAdd(p->pNames, Vec_PtrEntry(vBox, 1), NULL) ); Vec_IntPush( vFaninsCur, Cba_ManHandleArray(p, Cba_PrsReadList(p, vBox, vList, 0, 1)) ); + Vec_IntPush( vInstIdsCur, Abc_NamStrFindOrAdd(p->pNames, Vec_PtrEntry(vBox, 1), NULL) ); } } void Cba_PrsReadModule( Cba_Man_t * p, Cba_Ntk_t * pNtk, Vec_Ptr_t * vNtk, Vec_Int_t * vList ) @@ -616,13 +616,13 @@ void Cba_PrsReadModule( Cba_Man_t * p, Cba_Ntk_t * pNtk, Vec_Ptr_t * vNtk, Vec_I Cba_ManAllocArray( p, &pNtk->vOutputs, Vec_PtrSize(vOutputs) ); Cba_ManAllocArray( p, &pNtk->vTypes, Vec_PtrSize(vNodes) + Vec_PtrSize(vBoxes) ); Cba_ManAllocArray( p, &pNtk->vFuncs, Vec_PtrSize(vNodes) + Vec_PtrSize(vBoxes) ); - Cba_ManAllocArray( p, &pNtk->vInstIds, Vec_PtrSize(vNodes) + Vec_PtrSize(vBoxes) ); Cba_ManAllocArray( p, &pNtk->vFanins, Vec_PtrSize(vNodes) + Vec_PtrSize(vBoxes) ); + Cba_ManAllocArray( p, &pNtk->vInstIds, Vec_PtrSize(vNodes) + Vec_PtrSize(vBoxes) ); Cba_PrsReadList( p, vInputs, &pNtk->vInputs, -1, -1 ); Cba_PrsReadList( p, vOutputs, &pNtk->vOutputs, -1, -1 ); - Cba_PrsReadNodes( p, vNodes, &pNtk->vTypes, &pNtk->vFuncs, &pNtk->vInstIds, &pNtk->vFanins, vList ); - Cba_PrsReadBoxes( p, vBoxes, &pNtk->vTypes, &pNtk->vFuncs, &pNtk->vInstIds, &pNtk->vFanins, vList ); + Cba_PrsReadNodes( p, vNodes, &pNtk->vTypes, &pNtk->vFuncs, &pNtk->vFanins, &pNtk->vInstIds, vList ); + Cba_PrsReadBoxes( p, vBoxes, &pNtk->vTypes, &pNtk->vFuncs, &pNtk->vFanins, &pNtk->vInstIds, vList ); } Cba_Man_t * Cba_PrsReadPtr( Vec_Ptr_t * vDes ) { |