diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2012-09-19 17:35:04 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2012-09-19 17:35:04 -0700 |
commit | 480ca14c75e9f8c54ca9b55c39162324aaa1e288 (patch) | |
tree | 446dc0fd3a98d5d60c01f01f5b95e380b002ce34 /src/base/abci | |
parent | 3af0f719afa368cafbe7c8178d0995819b47be90 (diff) | |
download | abc-480ca14c75e9f8c54ca9b55c39162324aaa1e288.tar.gz abc-480ca14c75e9f8c54ca9b55c39162324aaa1e288.tar.bz2 abc-480ca14c75e9f8c54ca9b55c39162324aaa1e288.zip |
Extending Liberty parser to handle multi-output cells.
Diffstat (limited to 'src/base/abci')
-rw-r--r-- | src/base/abci/abcMap.c | 29 | ||||
-rw-r--r-- | src/base/abci/abcPrint.c | 2 |
2 files changed, 30 insertions, 1 deletions
diff --git a/src/base/abci/abcMap.c b/src/base/abci/abcMap.c index c9d743eb..fb8c87ed 100644 --- a/src/base/abci/abcMap.c +++ b/src/base/abci/abcMap.c @@ -682,6 +682,35 @@ Abc_Obj_t * Abc_NodeFromMapSuperChoice_rec( Abc_Ntk_t * pNtkNew, Map_Super_t * p return pNodeNew; } +/**Function************************************************************* + + Synopsis [Returns the twin node if it exists.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +Abc_Obj_t * Abc_NtkFetchTwinNode( Abc_Obj_t * pNode ) +{ + Abc_Obj_t * pNode2; + Mio_Gate_t * pGate = (Mio_Gate_t *)pNode->pData; + assert( Abc_NtkHasMapping(pNode->pNtk) ); + if ( pGate == NULL || Mio_GateReadTwin(pGate) == NULL ) + return NULL; + // assuming the twin node is following next + if ( (int)Abc_ObjId(pNode) == Abc_NtkObjNumMax(pNode->pNtk) - 1 ) + return NULL; + pNode2 = Abc_NtkObj( pNode->pNtk, Abc_ObjId(pNode) + 1 ); + if ( pNode2 == NULL || !Abc_ObjIsNode(pNode2) || Abc_ObjFaninNum(pNode) != Abc_ObjFaninNum(pNode2) ) + return NULL; + if ( Mio_GateReadTwin(pGate) != (Mio_Gate_t *)pNode2->pData ) + return NULL; + return pNode2; +} + //////////////////////////////////////////////////////////////////////// /// END OF FILE /// diff --git a/src/base/abci/abcPrint.c b/src/base/abci/abcPrint.c index 5f151b49..71900771 100644 --- a/src/base/abci/abcPrint.c +++ b/src/base/abci/abcPrint.c @@ -1025,7 +1025,7 @@ void Abc_NtkPrintGates( Abc_Ntk_t * pNtk, int fUseLibrary ) Mio_GateSetValue( (Mio_Gate_t *)pObj->pData, 1 + Mio_GateReadValue((Mio_Gate_t *)pObj->pData) ); CounterTotal++; // assuming that twin gates follow each other - if ( Mio_GateReadTwin(((Mio_Gate_t *)pObj->pData)) != NULL ) + if ( Abc_NtkFetchTwinNode(pObj) ) i++; } |