abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
cgt.h File Reference

Go to the source code of this file.

Data Structures

struct  Cgt_Par_t_
 

Typedefs

typedef
typedefABC_NAMESPACE_HEADER_START
struct Cgt_Par_t_ 
Cgt_Par_t
 INCLUDES ///. More...
 

Functions

void Cgt_SetDefaultParams (Cgt_Par_t *p)
 MACRO DEFINITIONS ///. More...
 
Vec_Vec_tCgt_ClockGatingCandidates (Aig_Man_t *pAig, Aig_Man_t *pCare, Cgt_Par_t *pPars, Vec_Int_t *vUseful)
 
Vec_Vec_tCgt_ClockGatingInt (Aig_Man_t *pAig, Aig_Man_t *pCare, Cgt_Par_t *pPars, Vec_Int_t *vUseful)
 
Aig_Man_tCgt_ClockGating (Aig_Man_t *pAig, Aig_Man_t *pCare, Cgt_Par_t *pPars)
 

Typedef Documentation

typedef typedefABC_NAMESPACE_HEADER_START struct Cgt_Par_t_ Cgt_Par_t

INCLUDES ///.

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

FileName [cgt.h]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Clock gating package.]

Synopsis [External declarations.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 20, 2005.]

Revision [

Id:
cgt.h,v 1.00 2005/06/20 00:00:00 alanmi Exp

]PARAMETERS ///BASIC TYPES ///

Definition at line 48 of file cgt.h.

Function Documentation

Aig_Man_t* Cgt_ClockGating ( Aig_Man_t pAig,
Aig_Man_t pCare,
Cgt_Par_t pPars 
)

Definition at line 298 of file cgtCore.c.

299 {
300  Aig_Man_t * pGated;
301  Vec_Vec_t * vGates = Cgt_ClockGatingInt( pAig, pCare, pPars, NULL );
302  int nNodesUsed;
303  if ( pPars->fVerbose )
304  {
305 // printf( "Before CG: " );
306 // Aig_ManPrintStats( pAig );
307  }
308  pGated = Cgt_ManDeriveGatedAig( pAig, vGates, pPars->fAreaOnly, &nNodesUsed );
309  if ( pPars->fVerbose )
310  {
311 // printf( "After CG: " );
312 // Aig_ManPrintStats( pGated );
313  printf( "Nodes: Before CG = %6d. After CG = %6d. (%6.2f %%). Total after CG = %6d.\n",
314  Aig_ManNodeNum(pAig), nNodesUsed,
315  100.0*nNodesUsed/Aig_ManNodeNum(pAig),
316  Aig_ManNodeNum(pGated) );
317  }
318  Vec_VecFree( vGates );
319  return pGated;
320 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
Definition: vecVec.h:42
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
Vec_Vec_t * Cgt_ClockGatingInt(Aig_Man_t *pAig, Aig_Man_t *pCare, Cgt_Par_t *pPars, Vec_Int_t *vUseful)
Definition: cgtCore.c:287
static void Vec_VecFree(Vec_Vec_t *p)
Definition: vecVec.h:347
static int Aig_ManNodeNum(Aig_Man_t *p)
Definition: aig.h:256
Aig_Man_t * Cgt_ManDeriveGatedAig(Aig_Man_t *pAig, Vec_Vec_t *vGates, int fReduce, int *pnUsedNodes)
Definition: cgtAig.c:524
Vec_Vec_t* Cgt_ClockGatingCandidates ( Aig_Man_t pAig,
Aig_Man_t pCare,
Cgt_Par_t pPars,
Vec_Int_t vUseful 
)

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

Synopsis [Performs clock-gating for the AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 245 of file cgtCore.c.

246 {
247  Bar_Progress_t * pProgress = NULL;
248  Cgt_Par_t Pars;
249  Cgt_Man_t * p;
250  Vec_Vec_t * vGatesAll;
251  int iStart;
252  abctime clk = Abc_Clock(), clkTotal = Abc_Clock();
253  // reset random numbers
254  Aig_ManRandom( 1 );
255  if ( pPars == NULL )
256  Cgt_SetDefaultParams( pPars = &Pars );
257  p = Cgt_ManCreate( pAig, pCare, pPars );
258  p->vUseful = vUseful;
259  p->pFrame = Cgt_ManDeriveAigForGating( p );
260 p->timeAig += Abc_Clock() - clk;
261  assert( Aig_ManCoNum(p->pFrame) == Saig_ManRegNum(p->pAig) );
262  pProgress = Bar_ProgressStart( stdout, Aig_ManCoNum(p->pFrame) );
263  for ( iStart = 0; iStart < Aig_ManCoNum(p->pFrame); )
264  {
265  Bar_ProgressUpdate( pProgress, iStart, NULL );
266  iStart = Cgt_ClockGatingRange( p, iStart );
267  }
268  Bar_ProgressStop( pProgress );
269  vGatesAll = p->vGatesAll;
270  p->vGatesAll = NULL;
271 p->timeTotal = Abc_Clock() - clkTotal;
272  Cgt_ManStop( p );
273  return vGatesAll;
274 }
void Cgt_ManStop(Cgt_Man_t *p)
Definition: cgtMan.c:154
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
Definition: vecVec.h:42
static Llb_Mgr_t * p
Definition: llb3Image.c:950
ABC_NAMESPACE_IMPL_START void Cgt_SetDefaultParams(Cgt_Par_t *p)
DECLARATIONS ///.
Definition: cgtCore.c:46
unsigned Aig_ManRandom(int fReset)
Definition: aigUtil.c:1157
static abctime Abc_Clock()
Definition: abc_global.h:279
static int Aig_ManCoNum(Aig_Man_t *p)
Definition: aig.h:252
static void Bar_ProgressUpdate(Bar_Progress_t *p, int nItemsCur, char *pString)
Definition: bar.h:63
Cgt_Man_t * Cgt_ManCreate(Aig_Man_t *pAig, Aig_Man_t *pCare, Cgt_Par_t *pPars)
DECLARATIONS ///.
Definition: cgtMan.c:45
typedefABC_NAMESPACE_HEADER_START struct Cgt_Par_t_ Cgt_Par_t
INCLUDES ///.
Definition: cgt.h:48
DECLARATIONS ///.
Definition: bar.c:36
static int Saig_ManRegNum(Aig_Man_t *p)
Definition: saig.h:77
int Cgt_ClockGatingRange(Cgt_Man_t *p, int iStart)
Definition: cgtCore.c:201
Aig_Man_t * Cgt_ManDeriveAigForGating(Cgt_Man_t *p)
Definition: cgtAig.c:266
#define assert(ex)
Definition: util_old.h:213
ABC_INT64_T abctime
Definition: abc_global.h:278
void Bar_ProgressStop(Bar_Progress_t *p)
Definition: bar.c:126
Bar_Progress_t * Bar_ProgressStart(FILE *pFile, int nItemsTotal)
FUNCTION DEFINITIONS ///.
Definition: bar.c:66
typedefABC_NAMESPACE_HEADER_START struct Cgt_Man_t_ Cgt_Man_t
INCLUDES ///.
Definition: cgtInt.h:47
Vec_Vec_t* Cgt_ClockGatingInt ( Aig_Man_t pAig,
Aig_Man_t pCare,
Cgt_Par_t pPars,
Vec_Int_t vUseful 
)

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

Synopsis [Performs clock-gating for the AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 287 of file cgtCore.c.

288 {
289  Vec_Vec_t * vGatesAll, * vGates;
290  vGatesAll = Cgt_ClockGatingCandidates( pAig, pCare, pPars, vUseful );
291  if ( pPars->fAreaOnly )
292  vGates = Cgt_ManDecideArea( pAig, vGatesAll, pPars->nOdcMax, pPars->fVerbose );
293  else
294  vGates = Cgt_ManDecideSimple( pAig, vGatesAll, pPars->nOdcMax, pPars->fVerbose );
295  Vec_VecFree( vGatesAll );
296  return vGates;
297 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
Definition: vecVec.h:42
static void Vec_VecFree(Vec_Vec_t *p)
Definition: vecVec.h:347
Vec_Vec_t * Cgt_ManDecideSimple(Aig_Man_t *pAig, Vec_Vec_t *vGatesAll, int nOdcMax, int fVerbose)
Definition: cgtDecide.c:184
Vec_Vec_t * Cgt_ManDecideArea(Aig_Man_t *pAig, Vec_Vec_t *vGatesAll, int nOdcMax, int fVerbose)
Definition: cgtDecide.c:255
Vec_Vec_t * Cgt_ClockGatingCandidates(Aig_Man_t *pAig, Aig_Man_t *pCare, Cgt_Par_t *pPars, Vec_Int_t *vUseful)
Definition: cgtCore.c:245
void Cgt_SetDefaultParams ( Cgt_Par_t p)

MACRO DEFINITIONS ///.

FUNCTION DECLARATIONS ///

MACRO DEFINITIONS ///.

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

FileName [cgtCore.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Clock gating package.]

Synopsis []

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 20, 2005.]

Revision [

Id:
cgtCore.c,v 1.00 2005/06/20 00:00:00 alanmi Exp

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

Synopsis [This procedure sets default parameters.]

Description []

SideEffects []

SeeAlso []

Definition at line 46 of file cgtCore.c.

47 {
48  memset( p, 0, sizeof(Cgt_Par_t) );
49  p->nLevelMax = 25; // the max number of levels to look for clock-gates
50  p->nCandMax = 1000; // the max number of candidates at each node
51  p->nOdcMax = 0; // the max number of ODC levels to consider
52  p->nConfMax = 10; // the max number of conflicts at a node
53  p->nVarsMin = 1000; // the min number of vars to recycle the SAT solver
54  p->nFlopsMin = 10; // the min number of flops to recycle the SAT solver
55  p->fAreaOnly = 0; // derive clock-gating to minimize area
56  p->fVerbose = 0; // verbosity flag
57 }
char * memset()
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_HEADER_START struct Cgt_Par_t_ Cgt_Par_t
INCLUDES ///.
Definition: cgt.h:48