diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2012-09-15 23:27:46 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2012-09-15 23:27:46 -0700 |
commit | 69bbfa98564efc7a8b865f06b01c0e404ac1e658 (patch) | |
tree | 188c18f4c23b986b1b1647738e4e14fe63513ec5 /src/aig/gia/giaMan.c | |
parent | ec95f569dd543d6a6acc8b9910cb605f14e59e61 (diff) | |
download | abc-69bbfa98564efc7a8b865f06b01c0e404ac1e658.tar.gz abc-69bbfa98564efc7a8b865f06b01c0e404ac1e658.tar.bz2 abc-69bbfa98564efc7a8b865f06b01c0e404ac1e658.zip |
Created new abstraction package from the code that was all over the place.
Diffstat (limited to 'src/aig/gia/giaMan.c')
-rw-r--r-- | src/aig/gia/giaMan.c | 150 |
1 files changed, 1 insertions, 149 deletions
diff --git a/src/aig/gia/giaMan.c b/src/aig/gia/giaMan.c index 2b16f326..6b57e292 100644 --- a/src/aig/gia/giaMan.c +++ b/src/aig/gia/giaMan.c @@ -20,6 +20,7 @@ #include "gia.h" #include "misc/tim/tim.h" +#include "proof/abs/abs.h" ABC_NAMESPACE_IMPL_START @@ -176,155 +177,6 @@ void Gia_ManPrintClasses_old( Gia_Man_t * p ) SeeAlso [] ***********************************************************************/ -void Gia_ManPrintFlopClasses( Gia_Man_t * p ) -{ - int Counter0, Counter1; - if ( p->vFlopClasses == NULL ) - return; - if ( Vec_IntSize(p->vFlopClasses) != Gia_ManRegNum(p) ) - { - printf( "Gia_ManPrintFlopClasses(): The number of flop map entries differs from the number of flops.\n" ); - return; - } - Counter0 = Vec_IntCountEntry( p->vFlopClasses, 0 ); - Counter1 = Vec_IntCountEntry( p->vFlopClasses, 1 ); - printf( "Flop-level abstraction: Excluded FFs = %d Included FFs = %d (%.2f %%) ", - Counter0, Counter1, 100.0*Counter1/(Counter0 + Counter1 + 1) ); - if ( Counter0 + Counter1 < Gia_ManRegNum(p) ) - printf( "and there are other FF classes..." ); - printf( "\n" ); -} - -/**Function************************************************************* - - Synopsis [Prints stats for the AIG.] - - Description [] - - SideEffects [] - - SeeAlso [] - -***********************************************************************/ -void Gia_ManPrintGateClasses( Gia_Man_t * p ) -{ - Vec_Int_t * vPis, * vPPis, * vFlops, * vNodes; - int nTotal; - if ( p->vGateClasses == NULL ) - return; - if ( Vec_IntSize(p->vGateClasses) != Gia_ManObjNum(p) ) - { - printf( "Gia_ManPrintGateClasses(): The number of flop map entries differs from the number of flops.\n" ); - return; - } - // create additional arrays - Gia_ManGlaCollect( p, p->vGateClasses, &vPis, &vPPis, &vFlops, &vNodes ); - nTotal = 1 + Vec_IntSize(vFlops) + Vec_IntSize(vNodes); - printf( "Gate-level abstraction: PI = %d PPI = %d FF = %d (%.2f %%) AND = %d (%.2f %%) Obj = %d (%.2f %%)\n", - Vec_IntSize(vPis), Vec_IntSize(vPPis), - Vec_IntSize(vFlops), 100.0*Vec_IntSize(vFlops)/(Gia_ManRegNum(p)+1), - Vec_IntSize(vNodes), 100.0*Vec_IntSize(vNodes)/(Gia_ManAndNum(p)+1), - nTotal, 100.0*nTotal /(Gia_ManRegNum(p)+Gia_ManAndNum(p)+1) ); - Vec_IntFree( vPis ); - Vec_IntFree( vPPis ); - Vec_IntFree( vFlops ); - Vec_IntFree( vNodes ); -} - -/**Function************************************************************* - - Synopsis [Prints stats for the AIG.] - - Description [] - - SideEffects [] - - SeeAlso [] - -***********************************************************************/ -void Gia_ManPrintObjClasses( Gia_Man_t * p ) -{ - Vec_Int_t * vSeens; // objects seen so far - Vec_Int_t * vAbs = p->vObjClasses; - int i, k, Entry, iStart, iStop = -1, nFrames; - int nObjBits, nObjMask, iObj, iFrame, nWords; - unsigned * pInfo; - int * pCountAll, * pCountUni; - if ( vAbs == NULL ) - return; - nFrames = Vec_IntEntry( vAbs, 0 ); - assert( Vec_IntEntry(vAbs, nFrames+1) == Vec_IntSize(vAbs) ); - pCountAll = ABC_ALLOC( int, nFrames + 1 ); - pCountUni = ABC_ALLOC( int, nFrames + 1 ); - // start storage for seen objects - nWords = Abc_BitWordNum( nFrames ); - vSeens = Vec_IntStart( Gia_ManObjNum(p) * nWords ); - // get the bitmasks - nObjBits = Abc_Base2Log( Gia_ManObjNum(p) ); - nObjMask = (1 << nObjBits) - 1; - assert( Gia_ManObjNum(p) <= nObjMask ); - // print info about frames - printf( "Frame Core F0 F1 F2 F3 ...\n" ); - for ( i = 0; i < nFrames; i++ ) - { - iStart = Vec_IntEntry( vAbs, i+1 ); - iStop = Vec_IntEntry( vAbs, i+2 ); - memset( pCountAll, 0, sizeof(int) * (nFrames + 1) ); - memset( pCountUni, 0, sizeof(int) * (nFrames + 1) ); - Vec_IntForEachEntryStartStop( vAbs, Entry, k, iStart, iStop ) - { - iObj = (Entry & nObjMask); - iFrame = (Entry >> nObjBits); - pInfo = (unsigned *)Vec_IntEntryP( vSeens, nWords * iObj ); - if ( Abc_InfoHasBit(pInfo, iFrame) == 0 ) - { - Abc_InfoSetBit( pInfo, iFrame ); - pCountUni[iFrame+1]++; - pCountUni[0]++; - } - pCountAll[iFrame+1]++; - pCountAll[0]++; - } - assert( pCountAll[0] == (iStop - iStart) ); -// printf( "%5d%5d ", pCountAll[0], pCountUni[0] ); - printf( "%3d :", i ); - printf( "%7d", pCountAll[0] ); - if ( i >= 10 ) - { - for ( k = 0; k < 4; k++ ) - printf( "%5d", pCountAll[k+1] ); - printf( " ..." ); - for ( k = i-4; k <= i; k++ ) - printf( "%5d", pCountAll[k+1] ); - } - else - { - for ( k = 0; k <= i; k++ ) - if ( k <= i ) - printf( "%5d", pCountAll[k+1] ); - } -// for ( k = 0; k < nFrames; k++ ) -// if ( k <= i ) -// printf( "%5d", pCountAll[k+1] ); - printf( "\n" ); - } - assert( iStop == Vec_IntSize(vAbs) ); - Vec_IntFree( vSeens ); - ABC_FREE( pCountAll ); - ABC_FREE( pCountUni ); -} - -/**Function************************************************************* - - Synopsis [Prints stats for the AIG.] - - Description [] - - SideEffects [] - - SeeAlso [] - -***********************************************************************/ void Gia_ManPrintPlacement( Gia_Man_t * p ) { int i, nFixed = 0, nUndef = 0; |