diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2005-09-16 08:01:00 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2005-09-16 08:01:00 -0700 |
commit | 0af9acd0cd07dcb37c195c6a0832b82c0eca1193 (patch) | |
tree | b33ce97c1e61493984c9640e5ee648c244adcb33 /src/base/abcs/abcUtils.c | |
parent | 2d782f7bc966fb19c9d849ac70366709f04d25d8 (diff) | |
download | abc-0af9acd0cd07dcb37c195c6a0832b82c0eca1193.tar.gz abc-0af9acd0cd07dcb37c195c6a0832b82c0eca1193.tar.bz2 abc-0af9acd0cd07dcb37c195c6a0832b82c0eca1193.zip |
Version abc50916
Diffstat (limited to 'src/base/abcs/abcUtils.c')
-rw-r--r-- | src/base/abcs/abcUtils.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/base/abcs/abcUtils.c b/src/base/abcs/abcUtils.c index 6b42b9a9..5bd0f1da 100644 --- a/src/base/abcs/abcUtils.c +++ b/src/base/abcs/abcUtils.c @@ -78,6 +78,59 @@ int Abc_NtkSeqLatchNumShared( Abc_Ntk_t * pNtk ) /**Function************************************************************* + Synopsis [Counts the number of latches in the sequential AIG.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +void Abc_ObjLatchGetInitNums( Abc_Obj_t * pObj, int Edge, int * pInits ) +{ + Abc_InitType_t Init; + int nLatches, i; + nLatches = Abc_ObjFaninL( pObj, Edge ); + assert( nLatches <= ABC_MAX_EDGE_LATCH ); + for ( i = 0; i < nLatches; i++ ) + { + Init = Abc_ObjFaninLGetInitOne( pObj, Edge, i ); + pInits[Init]++; + } +} + +/**Function************************************************************* + + Synopsis [Counts the number of latches in the sequential AIG.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +void Abc_NtkSeqLatchGetInitNums( Abc_Ntk_t * pNtk, int * pInits ) +{ + Abc_Obj_t * pObj; + int i; + assert( Abc_NtkIsSeq( pNtk ) ); + for ( i = 0; i < 4; i++ ) + pInits[i] = 0; + Abc_NtkForEachPo( pNtk, pObj, i ) + Abc_ObjLatchGetInitNums( pObj, 0, pInits ); + Abc_NtkForEachNode( pNtk, pObj, i ) + { + if ( Abc_ObjFaninNum(pObj) > 0 ) + Abc_ObjLatchGetInitNums( pObj, 0, pInits ); + if ( Abc_ObjFaninNum(pObj) > 1 ) + Abc_ObjLatchGetInitNums( pObj, 1, pInits ); + } +} + +/**Function************************************************************* + Synopsis [Generates the printable edge label with the initial state.] Description [] |