diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2008-04-30 08:01:00 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2008-04-30 08:01:00 -0700 |
commit | de81a1a1fb5d2cfff636a237a0a7008dcf196bcd (patch) | |
tree | 0ae940cc977896662e60a9050fe743ba5cd7b438 /src/aig/saig/saigScl.c | |
parent | 2b98b81837011f26d130ad0f44d4bc7b298f9cd7 (diff) | |
download | abc-de81a1a1fb5d2cfff636a237a0a7008dcf196bcd.tar.gz abc-de81a1a1fb5d2cfff636a237a0a7008dcf196bcd.tar.bz2 abc-de81a1a1fb5d2cfff636a237a0a7008dcf196bcd.zip |
Version abc80430
Diffstat (limited to 'src/aig/saig/saigScl.c')
-rw-r--r-- | src/aig/saig/saigScl.c | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/src/aig/saig/saigScl.c b/src/aig/saig/saigScl.c new file mode 100644 index 00000000..b747eff9 --- /dev/null +++ b/src/aig/saig/saigScl.c @@ -0,0 +1,74 @@ +/**CFile**************************************************************** + + FileName [saigScl.c] + + SystemName [ABC: Logic synthesis and verification system.] + + PackageName [Sequential AIG package.] + + Synopsis [Sequential cleanup.] + + Author [Alan Mishchenko] + + Affiliation [UC Berkeley] + + Date [Ver. 1.0. Started - June 20, 2005.] + + Revision [$Id: saigScl.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $] + +***********************************************************************/ + +#include "saig.h" + +//////////////////////////////////////////////////////////////////////// +/// DECLARATIONS /// +//////////////////////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////////////////// +/// FUNCTION DEFINITIONS /// +//////////////////////////////////////////////////////////////////////// + +/**Function************************************************************* + + Synopsis [Report registers useless for SEC.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +void Saig_ManReportUselessRegisters( Aig_Man_t * pAig ) +{ + Aig_Obj_t * pObj, * pDriver; + int i, Counter1, Counter2; + // set PIO numbers + Aig_ManSetPioNumbers( pAig ); + // check how many POs are driven by a register whose ref count is 1 + Counter1 = 0; + Saig_ManForEachPo( pAig, pObj, i ) + { + pDriver = Aig_ObjFanin0(pObj); + if ( Saig_ObjIsLo(pAig, pDriver) && Aig_ObjRefs(pDriver) == 1 ) + Counter1++; + } + // check how many PIs have ref count 1 and drive a register + Counter2 = 0; + Saig_ManForEachLi( pAig, pObj, i ) + { + pDriver = Aig_ObjFanin0(pObj); + if ( Saig_ObjIsPi(pAig, pDriver) && Aig_ObjRefs(pDriver) == 1 ) + Counter2++; + } + if ( Counter1 ) + printf( "Network has %d (out of %d) registers driving POs.\n", Counter1, Saig_ManRegNum(pAig) ); + if ( Counter2 ) + printf( "Network has %d (out of %d) registers driven by PIs.\n", Counter2, Saig_ManRegNum(pAig) ); +} + +//////////////////////////////////////////////////////////////////////// +/// END OF FILE /// +//////////////////////////////////////////////////////////////////////// + + |