diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2005-11-21 08:01:00 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2005-11-21 08:01:00 -0800 |
commit | 08d2b31046bfccdfe1239344eb5114ea01301f06 (patch) | |
tree | 99b2bd61fb70e0ecae0fd0292541eedf7d0cb8a4 /src/base/seq/seqShare.c | |
parent | 69643dfe9285efae78ba94ff6b75a362c9150d8a (diff) | |
download | abc-08d2b31046bfccdfe1239344eb5114ea01301f06.tar.gz abc-08d2b31046bfccdfe1239344eb5114ea01301f06.tar.bz2 abc-08d2b31046bfccdfe1239344eb5114ea01301f06.zip |
Version abc51121
Diffstat (limited to 'src/base/seq/seqShare.c')
-rw-r--r-- | src/base/seq/seqShare.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/base/seq/seqShare.c b/src/base/seq/seqShare.c index aafc7dc5..818dca23 100644 --- a/src/base/seq/seqShare.c +++ b/src/base/seq/seqShare.c @@ -82,7 +82,7 @@ void Seq_NodeShareFanouts( Abc_Obj_t * pNode, Vec_Ptr_t * vNodes ) // find the number of fanouts having latches of each type Abc_ObjForEachFanout( pNode, pFanout, i ) { - if ( Abc_ObjFanoutL(pNode, pFanout) == 0 ) + if ( Seq_ObjFanoutL(pNode, pFanout) == 0 ) continue; Type = Seq_NodeGetInitLast( pFanout, Abc_ObjFanoutEdgeNum(pNode, pFanout) ); nLatches[Type]++; @@ -119,6 +119,7 @@ void Seq_NodeShareFanouts( Abc_Obj_t * pNode, Vec_Ptr_t * vNodes ) ***********************************************************************/ void Seq_NodeShareOne( Abc_Obj_t * pNode, Abc_InitType_t Init, Vec_Ptr_t * vNodes ) { + Vec_Int_t * vNums = Seq_ObjLNums( pNode ); Vec_Ptr_t * vInits = Seq_NodeLats( pNode ); Abc_Obj_t * pFanout, * pBuffer; Abc_InitType_t Type, InitNew; @@ -128,7 +129,7 @@ void Seq_NodeShareOne( Abc_Obj_t * pNode, Abc_InitType_t Init, Vec_Ptr_t * vNode Vec_PtrClear( vNodes ); Abc_ObjForEachFanout( pNode, pFanout, i ) { - if ( Abc_ObjFanoutL(pNode, pFanout) == 0 ) + if ( Seq_ObjFanoutL(pNode, pFanout) == 0 ) continue; Type = Seq_NodeGetInitLast( pFanout, Abc_ObjFanoutEdgeNum(pNode, pFanout) ); if ( Type == Init ) @@ -147,6 +148,11 @@ void Seq_NodeShareOne( Abc_Obj_t * pNode, Abc_InitType_t Init, Vec_Ptr_t * vNode Vec_PtrGrow( vInits, 2 * pBuffer->Id + 2 ); for ( i = Vec_PtrSize(vInits); i < 2 * (int)pBuffer->Id + 2; i++ ) Vec_PtrPush( vInits, NULL ); + // grow storage for numbers of latches + Vec_IntGrow( vNums, 2 * pBuffer->Id + 2 ); + for ( i = Vec_IntSize(vNums); i < 2 * (int)pBuffer->Id + 2; i++ ) + Vec_IntPush( vNums, 0 ); + // insert the new latch Seq_NodeInsertFirst( pBuffer, 0, InitNew ); // redirect the fanouts |