diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2018-12-11 16:52:46 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2018-12-11 16:52:46 -0800 |
commit | d071e0261630142b97c50ffc7740375c6b671da7 (patch) | |
tree | 967f6ef86f28bac9d425fb04d989c2bf55e43bae | |
parent | 36585eff57d16171bb4a53fdc6348613d44eabe6 (diff) | |
download | abc-d071e0261630142b97c50ffc7740375c6b671da7.tar.gz abc-d071e0261630142b97c50ffc7740375c6b671da7.tar.bz2 abc-d071e0261630142b97c50ffc7740375c6b671da7.zip |
Updated for memory abstraction.
-rw-r--r-- | src/base/wlc/wlcNdr.c | 15 | ||||
-rw-r--r-- | src/base/wlc/wlcNtk.c | 4 | ||||
-rw-r--r-- | src/base/wlc/wlcReadVer.c | 8 |
3 files changed, 18 insertions, 9 deletions
diff --git a/src/base/wlc/wlcNdr.c b/src/base/wlc/wlcNdr.c index 7591aaf3..43827b53 100644 --- a/src/base/wlc/wlcNdr.c +++ b/src/base/wlc/wlcNdr.c @@ -176,8 +176,8 @@ int Ndr_TypeWlc2Ndr( int Type ) ***********************************************************************/ char * Ndr_ObjWriteConstant( unsigned * pBits, int nBits ) { - static char Buffer[1000]; int i, Len; - assert( nBits + 10 < 1000 ); + static char Buffer[10000]; int i, Len; + assert( nBits + 10 < 10000 ); sprintf( Buffer, "%d\'b", nBits ); Len = strlen(Buffer); for ( i = nBits-1; i >= 0; i-- ) @@ -205,7 +205,7 @@ void * Wlc_NtkToNdr( Wlc_Ntk_t * pNtk ) Wlc_NtkForEachObj( pNtk, pObj, iOutId ) { char * pFunction = NULL; - if ( Wlc_ObjIsPi(pObj) ) + if ( Wlc_ObjIsPi(pObj) || pObj->Type == 0 ) continue; Vec_IntClear( vFanins ); Wlc_ObjForEachFanin( pObj, iFanin, k ) @@ -214,8 +214,17 @@ void * Wlc_NtkToNdr( Wlc_Ntk_t * pNtk ) pFunction = Ndr_ObjWriteConstant( (unsigned *)Wlc_ObjFanins(pObj), Wlc_ObjRange(pObj) ); if ( pObj->Type == WLC_OBJ_MUX && Wlc_ObjRange(Wlc_ObjFanin0(pNtk, pObj)) > 1 ) Type = ABC_OPER_SEL_NMUX; + else if ( pObj->Type == WLC_OBJ_FO ) + { + Wlc_Obj_t * pFi = Wlc_ObjFo2Fi( pNtk, pObj ); + assert( Vec_IntSize(vFanins) == 0 ); + Vec_IntPush( vFanins, Wlc_ObjId(pNtk, pFi) ); + Vec_IntFillExtra( vFanins, 7, 0 ); + Type = ABC_OPER_DFFRSE; + } else Type = Ndr_TypeWlc2Ndr(pObj->Type); + assert( Type > 0 ); Ndr_AddObject( pDesign, ModId, Type, 0, pObj->End, pObj->Beg, pObj->Signed, Vec_IntSize(vFanins), Vec_IntArray(vFanins), 1, &iOutId, pFunction ); diff --git a/src/base/wlc/wlcNtk.c b/src/base/wlc/wlcNtk.c index 8038d9e6..b7743ba5 100644 --- a/src/base/wlc/wlcNtk.c +++ b/src/base/wlc/wlcNtk.c @@ -521,7 +521,7 @@ void Wlc_NtkPrintDistrib( Wlc_Ntk_t * p, int fTwoSides, int fVerbose ) else { assert( Wlc_ObjFaninNum(pObj) >= 2 ); - Sign = Wlc_NtkPrintDistribMakeSign( Wlc_ObjSign(pObj), Wlc_ObjSign(Wlc_ObjFanin0(p, pObj)), Wlc_ObjSign(Wlc_ObjFanin1(p, pObj)) ); + Sign = Wlc_NtkPrintDistribMakeSign( Wlc_ObjSign(pObj), Wlc_ObjFaninId(pObj, 0) ? Wlc_ObjSign(Wlc_ObjFanin0(p, pObj)) : 0, Wlc_ObjFaninId(pObj, 1) ? Wlc_ObjSign(Wlc_ObjFanin1(p, pObj)) : 0 ); } // add to storage Wlc_NtkPrintDistribAddOne( vTypes, vOccurs, pObj->Type, Sign ); @@ -991,7 +991,7 @@ Wlc_Ntk_t * Wlc_NtkDupDfs( Wlc_Ntk_t * p, int fMarked, int fSeq ) pObjNew->fXConst = pObj->fXConst; } Vec_IntFree( vFanins ); - if ( fSeq ) + if ( fSeq && p->vInits ) { if ( fMarked ) { diff --git a/src/base/wlc/wlcReadVer.c b/src/base/wlc/wlcReadVer.c index e2b61c6f..db2cf3b2 100644 --- a/src/base/wlc/wlcReadVer.c +++ b/src/base/wlc/wlcReadVer.c @@ -892,7 +892,7 @@ int Wlc_PrsReadDeclaration( Wlc_Prs_t * p, char * pStart ) } while ( 1 ) { - char * pName; int XValue; + char * pName; int XValue, TypeNew; // read name pStart = Wlc_PrsFindName( pStart, &pName ); if ( pStart == NULL ) @@ -911,11 +911,11 @@ int Wlc_PrsReadDeclaration( Wlc_Prs_t * p, char * pStart ) continue; } // check definition - Type = Wlc_PrsFindDefinition( p, pStart, p->vFanins, &XValue ); - if ( Type ) + TypeNew = Wlc_PrsFindDefinition( p, pStart, p->vFanins, &XValue ); + if ( TypeNew ) { Wlc_Obj_t * pObj = Wlc_NtkObj( p->pNtk, iObj ); - Wlc_ObjUpdateType( p->pNtk, pObj, Type ); + Wlc_ObjUpdateType( p->pNtk, pObj, TypeNew ); Wlc_ObjAddFanins( p->pNtk, pObj, p->vFanins ); pObj->fXConst = XValue; } |