abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
darMan.c File Reference
#include "darInt.h"

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START
Dar_Man_t
Dar_ManStart (Aig_Man_t *pAig, Dar_RwrPar_t *pPars)
 DECLARATIONS ///. More...
 
void Dar_ManStop (Dar_Man_t *p)
 
void Dar_ManPrintStats (Dar_Man_t *p)
 

Function Documentation

void Dar_ManPrintStats ( Dar_Man_t p)

Function*************************************************************

Synopsis [Stops the AIG manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 93 of file darMan.c.

94 {
95  unsigned pCanons[222];
96  int Gain, i;
97  extern void Kit_DsdPrintFromTruth( unsigned * pTruth, int nVars );
98 
99  Gain = p->nNodesInit - Aig_ManNodeNum(p->pAig);
100  printf( "Tried = %8d. Beg = %8d. End = %8d. Gain = %6d. (%6.2f %%). Cut mem = %d MB\n",
101  p->nNodesTried, p->nNodesInit, Aig_ManNodeNum(p->pAig), Gain, 100.0*Gain/p->nNodesInit, p->nCutMemUsed );
102  printf( "Cuts = %8d. Tried = %8d. Used = %8d. Bad = %5d. Skipped = %5d. Ave = %.2f.\n",
103  p->nCutsAll, p->nCutsTried, p->nCutsUsed, p->nCutsBad, p->nCutsSkipped,
104  (float)p->nCutsUsed/Aig_ManNodeNum(p->pAig) );
105 
106  printf( "Bufs = %5d. BufMax = %5d. BufReplace = %6d. BufFix = %6d. Levels = %4d.\n",
107  Aig_ManBufNum(p->pAig), p->pAig->nBufMax, p->pAig->nBufReplaces, p->pAig->nBufFixes, Aig_ManLevels(p->pAig) );
108  ABC_PRT( "Cuts ", p->timeCuts );
109  ABC_PRT( "Eval ", p->timeEval );
110  ABC_PRT( "Other ", p->timeOther );
111  ABC_PRT( "TOTAL ", p->timeTotal );
112 
113  if ( !p->pPars->fVeryVerbose )
114  return;
115  Dar_LibReturnCanonicals( pCanons );
116  for ( i = 0; i < 222; i++ )
117  {
118  if ( p->ClassGains[i] == 0 && p->ClassTimes[i] == 0 )
119  continue;
120  printf( "%3d : ", i );
121  printf( "G = %6d (%5.2f %%) ", p->ClassGains[i], Gain? 100.0*p->ClassGains[i]/Gain : 0.0 );
122  printf( "S = %8d (%5.2f %%) ", p->ClassSubgs[i], p->nTotalSubgs? 100.0*p->ClassSubgs[i]/p->nTotalSubgs : 0.0 );
123  printf( "R = %7d ", p->ClassGains[i]? p->ClassSubgs[i]/p->ClassGains[i] : 9999999 );
124 // Kit_DsdPrintFromTruth( pCanons + i, 4 );
125 // ABC_PRTP( "T", p->ClassTimes[i], p->timeEval );
126  printf( "\n" );
127  }
128  fflush( stdout );
129 }
Aig_Man_t * pAig
Definition: llb3Image.c:49
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Kit_DsdPrintFromTruth(unsigned *pTruth, int nVars)
Definition: kitDsd.c:490
static int Aig_ManNodeNum(Aig_Man_t *p)
Definition: aig.h:256
static int Aig_ManBufNum(Aig_Man_t *p)
Definition: aig.h:253
void Dar_LibReturnCanonicals(unsigned *pCanons)
Definition: darLib.c:211
#define ABC_PRT(a, t)
Definition: abc_global.h:220
int Aig_ManLevels(Aig_Man_t *p)
Definition: aigUtil.c:102
ABC_NAMESPACE_IMPL_START Dar_Man_t* Dar_ManStart ( Aig_Man_t pAig,
Dar_RwrPar_t pPars 
)

DECLARATIONS ///.

CFile****************************************************************

FileName [darMan.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [DAG-aware AIG rewriting.]

Synopsis [AIG manager.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - April 28, 2007.]

Revision [

Id:
darMan.c,v 1.00 2007/04/28 00:00:00 alanmi Exp

]FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis [Starts the rewriting manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 44 of file darMan.c.

45 {
46  Dar_Man_t * p;
47  Aig_ManCleanData( pAig );
48  p = ABC_ALLOC( Dar_Man_t, 1 );
49  memset( p, 0, sizeof(Dar_Man_t) );
50  p->pPars = pPars;
51  p->pAig = pAig;
52  p->vCutNodes = Vec_PtrAlloc( 1000 );
53  p->pMemCuts = Aig_MmFixedStart( p->pPars->nCutsMax * sizeof(Dar_Cut_t), 1024 );
54  p->vLeavesBest = Vec_PtrAlloc( 4 );
55  return p;
56 }
char * memset()
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
Aig_MmFixed_t * Aig_MmFixedStart(int nEntrySize, int nEntriesMax)
FUNCTION DEFINITIONS ///.
Definition: aigMem.c:96
typedefABC_NAMESPACE_HEADER_START struct Dar_Man_t_ Dar_Man_t
INCLUDES ///.
Definition: darInt.h:51
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
void Aig_ManCleanData(Aig_Man_t *p)
Definition: aigUtil.c:205
void Dar_ManStop ( Dar_Man_t p)

Function*************************************************************

Synopsis [Stops the rewriting manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 69 of file darMan.c.

70 {
71  if ( p->pPars->fVerbose )
73  if ( p->vCutNodes )
74  Vec_PtrFree( p->vCutNodes );
75  if ( p->pMemCuts )
76  Aig_MmFixedStop( p->pMemCuts, 0 );
77  if ( p->vLeavesBest )
78  Vec_PtrFree( p->vLeavesBest );
79  ABC_FREE( p );
80 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Aig_MmFixedStop(Aig_MmFixed_t *p, int fVerbose)
Definition: aigMem.c:132
void Dar_ManPrintStats(Dar_Man_t *p)
Definition: darMan.c:93
#define ABC_FREE(obj)
Definition: abc_global.h:232
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223