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

Go to the source code of this file.

Data Structures

struct  Gli_Obj_t_
 
struct  Gli_Man_t_
 

Macros

#define Gli_ManForEachObj(p, pObj, i)   for ( i = 0; (i < p->nObjData) && (pObj = Gli_ManObj(p,i)); i += Gli_ObjSize(pObj) )
 
#define Gli_ManForEachNode(p, pObj, i)   for ( i = 0; (i < p->nObjData) && (pObj = Gli_ManObj(p,i)); i += Gli_ObjSize(pObj) ) if ( Gli_ObjIsTerm(pObj) ) {} else
 
#define Gli_ManForEachEntry(vVec, p, pObj, i)   for ( i = 0; (i < Vec_IntSize(vVec)) && (pObj = Gli_ManObj(p,Vec_IntEntry(vVec,i))); i++ )
 
#define Gli_ManForEachCi(p, pObj, i)   for ( i = 0; (i < Vec_IntSize(p->vCis)) && (pObj = Gli_ManObj(p,Vec_IntEntry(p->vCis,i))); i++ )
 
#define Gli_ManForEachCo(p, pObj, i)   for ( i = 0; (i < Vec_IntSize(p->vCos)) && (pObj = Gli_ManObj(p,Vec_IntEntry(p->vCos,i))); i++ )
 
#define Gli_ManForEachPi(p, pObj, i)   for ( i = 0; (i < Gli_ManPiNum(p)) && ((pObj) = Gli_ManCi(p, i)); i++ )
 
#define Gli_ManForEachPo(p, pObj, i)   for ( i = 0; (i < Gli_ManPoNum(p)) && ((pObj) = Gli_ManCo(p, i)); i++ )
 
#define Gli_ManForEachRo(p, pObj, i)   for ( i = 0; (i < Gli_ManRegNum(p)) && ((pObj) = Gli_ManCi(p, Gli_ManPiNum(p)+i)); i++ )
 
#define Gli_ManForEachRi(p, pObj, i)   for ( i = 0; (i < Gli_ManRegNum(p)) && ((pObj) = Gli_ManCo(p, Gli_ManPoNum(p)+i)); i++ )
 
#define Gli_ManForEachRiRo(p, pObjRi, pObjRo, i)   for ( i = 0; (i < Gli_ManRegNum(p)) && ((pObjRi) = Gli_ManCo(p, Gli_ManPoNum(p)+i)) && ((pObjRo) = Gli_ManCi(p, Gli_ManPiNum(p)+i)); i++ )
 
#define Gli_ObjForEachFanin(pObj, pNext, i)   for ( i = 0; (i < (int)pObj->nFanins) && (pNext = Gli_ObjFanin(pObj,i)); i++ )
 
#define Gli_ObjForEachFanout(pObj, pNext, i)   for ( i = 0; (i < (int)pObj->nFanouts) && (pNext = Gli_ObjFanout(pObj,i)); i++ )
 

Typedefs

typedef
typedefABC_NAMESPACE_IMPL_START
struct Gli_Obj_t_ 
Gli_Obj_t
 DECLARATIONS ///. More...
 
typedef struct Gli_Man_t_ Gli_Man_t
 

Functions

static int Gli_ManCiNum (Gli_Man_t *p)
 
static int Gli_ManCoNum (Gli_Man_t *p)
 
static int Gli_ManPiNum (Gli_Man_t *p)
 
static int Gli_ManPoNum (Gli_Man_t *p)
 
static int Gli_ManRegNum (Gli_Man_t *p)
 
static int Gli_ManObjNum (Gli_Man_t *p)
 
static int Gli_ManNodeNum (Gli_Man_t *p)
 
static Gli_Obj_tGli_ManObj (Gli_Man_t *p, int v)
 
static Gli_Obj_tGli_ManCi (Gli_Man_t *p, int v)
 
static Gli_Obj_tGli_ManCo (Gli_Man_t *p, int v)
 
static Gli_Obj_tGli_ManPi (Gli_Man_t *p, int v)
 
static Gli_Obj_tGli_ManPo (Gli_Man_t *p, int v)
 
static Gli_Obj_tGli_ManRo (Gli_Man_t *p, int v)
 
static Gli_Obj_tGli_ManRi (Gli_Man_t *p, int v)
 
static int Gli_ObjIsTerm (Gli_Obj_t *pObj)
 
static int Gli_ObjIsCi (Gli_Obj_t *pObj)
 
static int Gli_ObjIsCo (Gli_Obj_t *pObj)
 
static int Gli_ObjIsNode (Gli_Obj_t *pObj)
 
static int Gli_ObjFaninNum (Gli_Obj_t *pObj)
 
static int Gli_ObjFanoutNum (Gli_Obj_t *pObj)
 
static int Gli_ObjSize (Gli_Obj_t *pObj)
 
static Gli_Obj_tGli_ObjFanin (Gli_Obj_t *pObj, int i)
 
static Gli_Obj_tGli_ObjFanout (Gli_Obj_t *pObj, int i)
 
Gli_Man_tGli_ManAlloc (int nObjs, int nRegs, int nFanioPairs)
 FUNCTION DEFINITIONS ///. More...
 
void Gli_ManStop (Gli_Man_t *p)
 
void Gli_ManPrintObjects (Gli_Man_t *p)
 
void Gli_ManFinalize (Gli_Man_t *p)
 
void Gli_ObjAddFanin (Gli_Obj_t *pObj, Gli_Obj_t *pFanin)
 
Gli_Obj_tGli_ObjAlloc (Gli_Man_t *p, int nFanins, int nFanouts)
 
int Gli_ManCreateCi (Gli_Man_t *p, int nFanouts)
 
int Gli_ManCreateCo (Gli_Man_t *p, int iFanin)
 
static int Gli_NodeComputeValue (Gli_Obj_t *pNode)
 
static int Gli_NodeComputeValue2 (Gli_Obj_t *pNode)
 
int Gli_ManCreateNode (Gli_Man_t *p, Vec_Int_t *vFanins, int nFanouts, unsigned *puTruth)
 
int Gli_ObjNumSwitches (Gli_Man_t *p, int iNode)
 
int Gli_ObjNumGlitches (Gli_Man_t *p, int iNode)
 
void Gli_ManSetPiRandom (Gli_Man_t *p, float PiTransProb)
 
void Gli_ManSetPiFromSaved (Gli_Man_t *p, int iBit)
 
void Gli_ManSwitching (Gli_Man_t *p)
 
void Gli_ManGlitching (Gli_Man_t *p)
 
void Gli_ManVerify (Gli_Man_t *p)
 
unsigned Gli_ManSimulateSeqNode (Gli_Man_t *p, Gli_Obj_t *pNode)
 
static unsigned Gli_ManUpdateRandomInput (unsigned uInfo, float PiTransProb)
 
void Gli_ManSimulateSeqPref (Gli_Man_t *p, int nPref)
 
void Gli_ManSetDataSaved (Gli_Man_t *p, int iBit)
 
void Gli_ManSetPiRandomSeq (Gli_Man_t *p, float PiTransProb)
 
void Gli_ManSwitchesAndGlitches (Gli_Man_t *p, int nPatterns, float PiTransProb, int fVerbose)
 

Macro Definition Documentation

#define Gli_ManForEachCi (   p,
  pObj,
 
)    for ( i = 0; (i < Vec_IntSize(p->vCis)) && (pObj = Gli_ManObj(p,Vec_IntEntry(p->vCis,i))); i++ )

Definition at line 108 of file giaGlitch.c.

#define Gli_ManForEachCo (   p,
  pObj,
 
)    for ( i = 0; (i < Vec_IntSize(p->vCos)) && (pObj = Gli_ManObj(p,Vec_IntEntry(p->vCos,i))); i++ )

Definition at line 110 of file giaGlitch.c.

#define Gli_ManForEachEntry (   vVec,
  p,
  pObj,
 
)    for ( i = 0; (i < Vec_IntSize(vVec)) && (pObj = Gli_ManObj(p,Vec_IntEntry(vVec,i))); i++ )

Definition at line 106 of file giaGlitch.c.

#define Gli_ManForEachNode (   p,
  pObj,
 
)    for ( i = 0; (i < p->nObjData) && (pObj = Gli_ManObj(p,i)); i += Gli_ObjSize(pObj) ) if ( Gli_ObjIsTerm(pObj) ) {} else

Definition at line 103 of file giaGlitch.c.

#define Gli_ManForEachObj (   p,
  pObj,
 
)    for ( i = 0; (i < p->nObjData) && (pObj = Gli_ManObj(p,i)); i += Gli_ObjSize(pObj) )

Definition at line 101 of file giaGlitch.c.

#define Gli_ManForEachPi (   p,
  pObj,
 
)    for ( i = 0; (i < Gli_ManPiNum(p)) && ((pObj) = Gli_ManCi(p, i)); i++ )

Definition at line 113 of file giaGlitch.c.

#define Gli_ManForEachPo (   p,
  pObj,
 
)    for ( i = 0; (i < Gli_ManPoNum(p)) && ((pObj) = Gli_ManCo(p, i)); i++ )

Definition at line 115 of file giaGlitch.c.

#define Gli_ManForEachRi (   p,
  pObj,
 
)    for ( i = 0; (i < Gli_ManRegNum(p)) && ((pObj) = Gli_ManCo(p, Gli_ManPoNum(p)+i)); i++ )

Definition at line 119 of file giaGlitch.c.

#define Gli_ManForEachRiRo (   p,
  pObjRi,
  pObjRo,
 
)    for ( i = 0; (i < Gli_ManRegNum(p)) && ((pObjRi) = Gli_ManCo(p, Gli_ManPoNum(p)+i)) && ((pObjRo) = Gli_ManCi(p, Gli_ManPiNum(p)+i)); i++ )

Definition at line 121 of file giaGlitch.c.

#define Gli_ManForEachRo (   p,
  pObj,
 
)    for ( i = 0; (i < Gli_ManRegNum(p)) && ((pObj) = Gli_ManCi(p, Gli_ManPiNum(p)+i)); i++ )

Definition at line 117 of file giaGlitch.c.

#define Gli_ObjForEachFanin (   pObj,
  pNext,
 
)    for ( i = 0; (i < (int)pObj->nFanins) && (pNext = Gli_ObjFanin(pObj,i)); i++ )

Definition at line 124 of file giaGlitch.c.

#define Gli_ObjForEachFanout (   pObj,
  pNext,
 
)    for ( i = 0; (i < (int)pObj->nFanouts) && (pNext = Gli_ObjFanout(pObj,i)); i++ )

Definition at line 126 of file giaGlitch.c.

Typedef Documentation

typedef struct Gli_Man_t_ Gli_Man_t

Definition at line 55 of file giaGlitch.c.

typedef typedefABC_NAMESPACE_IMPL_START struct Gli_Obj_t_ Gli_Obj_t

DECLARATIONS ///.

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

FileName [giaGlitch.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Scalable AIG package.]

Synopsis [Glitch simulation.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

]

Definition at line 30 of file giaGlitch.c.

Function Documentation

Gli_Man_t* Gli_ManAlloc ( int  nObjs,
int  nRegs,
int  nFanioPairs 
)

FUNCTION DEFINITIONS ///.

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

Synopsis [Creates logic network.]

Description []

SideEffects []

SeeAlso []

Definition at line 144 of file giaGlitch.c.

145 {
146  Gli_Man_t * p;
147  p = (Gli_Man_t *)ABC_CALLOC( int, (sizeof(Gli_Man_t) / 4) + (sizeof(Gli_Obj_t) / 4) * nObjs + 2 * nFanioPairs );
148  p->nRegs = nRegs;
149  p->vCis = Vec_IntAlloc( 1000 );
150  p->vCos = Vec_IntAlloc( 1000 );
151  p->vCisChanged = Vec_IntAlloc( 1000 );
152  p->vAffected = Vec_IntAlloc( 1000 );
153  p->vFrontier = Vec_IntAlloc( 1000 );
154  p->nObjData = (sizeof(Gli_Obj_t) / 4) * nObjs + 2 * nFanioPairs;
155  p->pObjData = (int *)(p + 1);
156  return p;
157 }
int * pObjData
Definition: giaGlitch.c:68
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Vec_Int_t * vFrontier
Definition: giaGlitch.c:62
Vec_Int_t * vCis
Definition: giaGlitch.c:58
Vec_Int_t * vAffected
Definition: giaGlitch.c:61
Vec_Int_t * vCos
Definition: giaGlitch.c:59
int nRegs
Definition: giaGlitch.c:64
typedefABC_NAMESPACE_IMPL_START struct Gli_Obj_t_ Gli_Obj_t
DECLARATIONS ///.
Definition: giaGlitch.c:30
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
Vec_Int_t * vCisChanged
Definition: giaGlitch.c:60
int nObjData
Definition: giaGlitch.c:67
#define ABC_CALLOC(type, num)
Definition: abc_global.h:230
static Gli_Obj_t* Gli_ManCi ( Gli_Man_t p,
int  v 
)
inlinestatic

Definition at line 82 of file giaGlitch.c.

82 { return Gli_ManObj( p, Vec_IntEntry(p->vCis,v) ); }
Vec_Int_t * vCis
Definition: giaGlitch.c:58
static Gli_Obj_t * Gli_ManObj(Gli_Man_t *p, int v)
Definition: giaGlitch.c:81
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
static int Gli_ManCiNum ( Gli_Man_t p)
inlinestatic

Definition at line 73 of file giaGlitch.c.

73 { return Vec_IntSize(p->vCis); }
Vec_Int_t * vCis
Definition: giaGlitch.c:58
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
static Gli_Obj_t* Gli_ManCo ( Gli_Man_t p,
int  v 
)
inlinestatic

Definition at line 83 of file giaGlitch.c.

83 { return Gli_ManObj( p, Vec_IntEntry(p->vCos,v) ); }
static Gli_Obj_t * Gli_ManObj(Gli_Man_t *p, int v)
Definition: giaGlitch.c:81
Vec_Int_t * vCos
Definition: giaGlitch.c:59
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
static int Gli_ManCoNum ( Gli_Man_t p)
inlinestatic

Definition at line 74 of file giaGlitch.c.

74 { return Vec_IntSize(p->vCos); }
Vec_Int_t * vCos
Definition: giaGlitch.c:59
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
int Gli_ManCreateCi ( Gli_Man_t p,
int  nFanouts 
)

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

Synopsis [Creates CI.]

Description []

SideEffects []

SeeAlso []

Definition at line 288 of file giaGlitch.c.

289 {
290  Gli_Obj_t * pObj;
291  pObj = Gli_ObjAlloc( p, 0, nFanouts );
292  pObj->fTerm = 1;
293  Vec_IntPush( p->vCis, pObj->Handle );
294  return pObj->Handle;
295 }
Vec_Int_t * vCis
Definition: giaGlitch.c:58
typedefABC_NAMESPACE_IMPL_START struct Gli_Obj_t_ Gli_Obj_t
DECLARATIONS ///.
Definition: giaGlitch.c:30
Gli_Obj_t * Gli_ObjAlloc(Gli_Man_t *p, int nFanins, int nFanouts)
Definition: giaGlitch.c:265
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
int Gli_ManCreateCo ( Gli_Man_t p,
int  iFanin 
)

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

Synopsis [Creates CO.]

Description []

SideEffects []

SeeAlso []

Definition at line 308 of file giaGlitch.c.

309 {
310  Gli_Obj_t * pObj, * pFanin;
311  pObj = Gli_ObjAlloc( p, 1, 0 );
312  pObj->fTerm = 1;
313  pFanin = Gli_ManObj( p, iFanin );
314  Gli_ObjAddFanin( pObj, pFanin );
315  pObj->fPhase = pObj->fPhase2 = pFanin->fPhase;
316  Vec_IntPush( p->vCos, pObj->Handle );
317  return pObj->Handle;
318 }
static Gli_Obj_t * Gli_ManObj(Gli_Man_t *p, int v)
Definition: giaGlitch.c:81
Vec_Int_t * vCos
Definition: giaGlitch.c:59
typedefABC_NAMESPACE_IMPL_START struct Gli_Obj_t_ Gli_Obj_t
DECLARATIONS ///.
Definition: giaGlitch.c:30
void Gli_ObjAddFanin(Gli_Obj_t *pObj, Gli_Obj_t *pFanin)
Definition: giaGlitch.c:246
Gli_Obj_t * Gli_ObjAlloc(Gli_Man_t *p, int nFanins, int nFanouts)
Definition: giaGlitch.c:265
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
int Gli_ManCreateNode ( Gli_Man_t p,
Vec_Int_t vFanins,
int  nFanouts,
unsigned *  puTruth 
)

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

Synopsis [Creates node.]

Description []

SideEffects []

SeeAlso []

Definition at line 369 of file giaGlitch.c.

370 {
371  Gli_Obj_t * pObj, * pFanin;
372  int i;
373  assert( Vec_IntSize(vFanins) <= 6 );
374  pObj = Gli_ObjAlloc( p, Vec_IntSize(vFanins), nFanouts );
375  Gli_ManForEachEntry( vFanins, p, pFanin, i )
376  Gli_ObjAddFanin( pObj, pFanin );
377  pObj->uTruth[0] = puTruth[0];
378  pObj->uTruth[1] = puTruth[Vec_IntSize(vFanins) == 6];
379  pObj->fPhase = pObj->fPhase2 = Gli_NodeComputeValue( pObj );
380  return pObj->Handle;
381 }
static int Gli_NodeComputeValue(Gli_Obj_t *pNode)
Definition: giaGlitch.c:331
typedefABC_NAMESPACE_IMPL_START struct Gli_Obj_t_ Gli_Obj_t
DECLARATIONS ///.
Definition: giaGlitch.c:30
void Gli_ObjAddFanin(Gli_Obj_t *pObj, Gli_Obj_t *pFanin)
Definition: giaGlitch.c:246
Gli_Obj_t * Gli_ObjAlloc(Gli_Man_t *p, int nFanins, int nFanouts)
Definition: giaGlitch.c:265
#define Gli_ManForEachEntry(vVec, p, pObj, i)
Definition: giaGlitch.c:106
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
#define assert(ex)
Definition: util_old.h:213
void Gli_ManFinalize ( Gli_Man_t p)

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

Synopsis [Checks logic network.]

Description []

SideEffects []

SeeAlso []

Definition at line 221 of file giaGlitch.c.

222 {
223  Gli_Obj_t * pObj;
224  int i;
225  assert( p->iObjData == p->nObjData );
226  Gli_ManForEachObj( p, pObj, i )
227  {
228  assert( pObj->iFanin == (int)pObj->nFanins );
229  assert( pObj->iFanout == (int)pObj->nFanouts );
230  pObj->iFanin = 0;
231  pObj->iFanout = 0;
232  }
233 }
int iObjData
Definition: giaGlitch.c:66
typedefABC_NAMESPACE_IMPL_START struct Gli_Obj_t_ Gli_Obj_t
DECLARATIONS ///.
Definition: giaGlitch.c:30
#define Gli_ManForEachObj(p, pObj, i)
Definition: giaGlitch.c:101
int nObjData
Definition: giaGlitch.c:67
#define assert(ex)
Definition: util_old.h:213
void Gli_ManGlitching ( Gli_Man_t p)

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

Synopsis [Computes glitching activity of each node.]

Description []

SideEffects []

SeeAlso []

Definition at line 507 of file giaGlitch.c.

508 {
509  Gli_Obj_t * pThis, * pFanout;//, * pOther = Gli_ManObj(p, 41);
510  int i, k, Handle;
511 // Gli_ManForEachObj( p, pThis, i )
512 // assert( pThis->fMark == 0 );
513  // start the array of affected nodes
514  Vec_IntClear( p->vAffected );
515  Vec_IntForEachEntry( p->vCisChanged, Handle, i )
516  Vec_IntPush( p->vAffected, Handle );
517  // iteration propagation
518  while ( Vec_IntSize(p->vAffected) > 0 )
519  {
520  // compute the frontier
521  Vec_IntClear( p->vFrontier );
522  Gli_ManForEachEntry( p->vAffected, p, pThis, i )
523  {
524  Gli_ObjForEachFanout( pThis, pFanout, k )
525  {
526  if ( Gli_ObjIsCo(pFanout) )
527  continue;
528  if ( pFanout->fMark )
529  continue;
530  pFanout->fMark = 1;
531  Vec_IntPush( p->vFrontier, pFanout->Handle );
532  }
533  }
534  // compute the next set of affected nodes
535  Vec_IntClear( p->vAffected );
536  Gli_ManForEachEntry( p->vFrontier, p, pThis, i )
537  {
538  pThis->fMark = 0;
539  if ( ((int)pThis->fPhase2) == Gli_NodeComputeValue2(pThis) )
540  continue;
541  pThis->fPhase2 ^= 1;
542  pThis->nGlitches++;
543  Vec_IntPush( p->vAffected, pThis->Handle );
544  }
545  }
546 }
Vec_Int_t * vFrontier
Definition: giaGlitch.c:62
Vec_Int_t * vAffected
Definition: giaGlitch.c:61
typedefABC_NAMESPACE_IMPL_START struct Gli_Obj_t_ Gli_Obj_t
DECLARATIONS ///.
Definition: giaGlitch.c:30
#define Gli_ObjForEachFanout(pObj, pNext, i)
Definition: giaGlitch.c:126
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
static int Gli_NodeComputeValue2(Gli_Obj_t *pNode)
Definition: giaGlitch.c:350
Vec_Int_t * vCisChanged
Definition: giaGlitch.c:60
#define Gli_ManForEachEntry(vVec, p, pObj, i)
Definition: giaGlitch.c:106
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
static int Gli_ObjIsCo(Gli_Obj_t *pObj)
Definition: giaGlitch.c:91
static void Vec_IntClear(Vec_Int_t *p)
Definition: bblif.c:452
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition: vecInt.h:54
static int Gli_ManNodeNum ( Gli_Man_t p)
inlinestatic

Definition at line 79 of file giaGlitch.c.

79 { return p->nObjs - Vec_IntSize(p->vCis) - Vec_IntSize(p->vCos); }
Vec_Int_t * vCis
Definition: giaGlitch.c:58
Vec_Int_t * vCos
Definition: giaGlitch.c:59
int nObjs
Definition: giaGlitch.c:63
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
static Gli_Obj_t* Gli_ManObj ( Gli_Man_t p,
int  v 
)
inlinestatic

Definition at line 81 of file giaGlitch.c.

81 { return (Gli_Obj_t *)(p->pObjData + v); }
int * pObjData
Definition: giaGlitch.c:68
typedefABC_NAMESPACE_IMPL_START struct Gli_Obj_t_ Gli_Obj_t
DECLARATIONS ///.
Definition: giaGlitch.c:30
static int Gli_ManObjNum ( Gli_Man_t p)
inlinestatic

Definition at line 78 of file giaGlitch.c.

78 { return p->nObjs; }
int nObjs
Definition: giaGlitch.c:63
static Gli_Obj_t* Gli_ManPi ( Gli_Man_t p,
int  v 
)
inlinestatic

Definition at line 84 of file giaGlitch.c.

84 { assert( v < Gli_ManPiNum(p) ); return Gli_ManCi( p, v ); }
static Gli_Obj_t * Gli_ManCi(Gli_Man_t *p, int v)
Definition: giaGlitch.c:82
#define assert(ex)
Definition: util_old.h:213
static int Gli_ManPiNum(Gli_Man_t *p)
Definition: giaGlitch.c:75
static int Gli_ManPiNum ( Gli_Man_t p)
inlinestatic

Definition at line 75 of file giaGlitch.c.

75 { return Vec_IntSize(p->vCis) - p->nRegs; }
Vec_Int_t * vCis
Definition: giaGlitch.c:58
int nRegs
Definition: giaGlitch.c:64
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
static Gli_Obj_t* Gli_ManPo ( Gli_Man_t p,
int  v 
)
inlinestatic

Definition at line 85 of file giaGlitch.c.

85 { assert( v < Gli_ManPoNum(p) ); return Gli_ManCo( p, v ); }
static Gli_Obj_t * Gli_ManCo(Gli_Man_t *p, int v)
Definition: giaGlitch.c:83
static int Gli_ManPoNum(Gli_Man_t *p)
Definition: giaGlitch.c:76
#define assert(ex)
Definition: util_old.h:213
static int Gli_ManPoNum ( Gli_Man_t p)
inlinestatic

Definition at line 76 of file giaGlitch.c.

76 { return Vec_IntSize(p->vCos) - p->nRegs; }
Vec_Int_t * vCos
Definition: giaGlitch.c:59
int nRegs
Definition: giaGlitch.c:64
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
void Gli_ManPrintObjects ( Gli_Man_t p)

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

Synopsis [Checks logic network.]

Description []

SideEffects []

SeeAlso []

Definition at line 192 of file giaGlitch.c.

193 {
194  Gli_Obj_t * pObj, * pNext;
195  int i, k;
196  Gli_ManForEachObj( p, pObj, i )
197  {
198  printf( "Node %d \n", pObj->Handle );
199  printf( "Fanins: " );
200  Gli_ObjForEachFanin( pObj, pNext, k )
201  printf( "%d ", pNext->Handle );
202  printf( "\n" );
203  printf( "Fanouts: " );
204  Gli_ObjForEachFanout( pObj, pNext, k )
205  printf( "%d ", pNext->Handle );
206  printf( "\n" );
207  }
208 }
#define Gli_ObjForEachFanin(pObj, pNext, i)
Definition: giaGlitch.c:124
typedefABC_NAMESPACE_IMPL_START struct Gli_Obj_t_ Gli_Obj_t
DECLARATIONS ///.
Definition: giaGlitch.c:30
#define Gli_ObjForEachFanout(pObj, pNext, i)
Definition: giaGlitch.c:126
#define Gli_ManForEachObj(p, pObj, i)
Definition: giaGlitch.c:101
static int Gli_ManRegNum ( Gli_Man_t p)
inlinestatic

Definition at line 77 of file giaGlitch.c.

77 { return p->nRegs; }
int nRegs
Definition: giaGlitch.c:64
static Gli_Obj_t* Gli_ManRi ( Gli_Man_t p,
int  v 
)
inlinestatic

Definition at line 87 of file giaGlitch.c.

87 { assert( v < Gli_ManRegNum(p) ); return Gli_ManCo( p, Gli_ManRegNum(p)+v ); }
static Gli_Obj_t * Gli_ManCo(Gli_Man_t *p, int v)
Definition: giaGlitch.c:83
static int Gli_ManRegNum(Gli_Man_t *p)
Definition: giaGlitch.c:77
#define assert(ex)
Definition: util_old.h:213
static Gli_Obj_t* Gli_ManRo ( Gli_Man_t p,
int  v 
)
inlinestatic

Definition at line 86 of file giaGlitch.c.

86 { assert( v < Gli_ManRegNum(p) ); return Gli_ManCi( p, Gli_ManRegNum(p)+v ); }
static Gli_Obj_t * Gli_ManCi(Gli_Man_t *p, int v)
Definition: giaGlitch.c:82
static int Gli_ManRegNum(Gli_Man_t *p)
Definition: giaGlitch.c:77
#define assert(ex)
Definition: util_old.h:213
void Gli_ManSetDataSaved ( Gli_Man_t p,
int  iBit 
)

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

Synopsis [Initialized object values to be one pattern in the saved data.]

Description []

SideEffects []

SeeAlso []

Definition at line 676 of file giaGlitch.c.

677 {
678  Gli_Obj_t * pObj;
679  int i;
680  Gli_ManForEachCi( p, pObj, i )
681  pObj->fPhase = pObj->fPhase2 = ((p->pSimInfoPrev[i] >> iBit) & 1);
682  Gli_ManForEachNode( p, pObj, i )
683  pObj->fPhase = pObj->fPhase2 = Gli_NodeComputeValue( pObj );
684 }
static int Gli_NodeComputeValue(Gli_Obj_t *pNode)
Definition: giaGlitch.c:331
typedefABC_NAMESPACE_IMPL_START struct Gli_Obj_t_ Gli_Obj_t
DECLARATIONS ///.
Definition: giaGlitch.c:30
#define Gli_ManForEachCi(p, pObj, i)
Definition: giaGlitch.c:108
#define Gli_ManForEachNode(p, pObj, i)
Definition: giaGlitch.c:103
void Gli_ManSetPiFromSaved ( Gli_Man_t p,
int  iBit 
)

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

Synopsis [Sets random info at the PIs and collects changed PIs.]

Description []

SideEffects []

SeeAlso []

Definition at line 456 of file giaGlitch.c.

457 {
458  Gli_Obj_t * pObj;
459  int i;
461  Gli_ManForEachCi( p, pObj, i )
462  if ( (p->pSimInfoPrev[i] ^ pObj->uSimInfo) & (1 << iBit) )
463  {
464  Vec_IntPush( p->vCisChanged, pObj->Handle );
465  pObj->fPhase ^= 1;
466  pObj->fPhase2 ^= 1;
467  pObj->nSwitches++;
468  pObj->nGlitches++;
469  }
470 }
typedefABC_NAMESPACE_IMPL_START struct Gli_Obj_t_ Gli_Obj_t
DECLARATIONS ///.
Definition: giaGlitch.c:30
if(last==0)
Definition: sparse_int.h:34
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
#define Gli_ManForEachCi(p, pObj, i)
Definition: giaGlitch.c:108
Vec_Int_t * vCisChanged
Definition: giaGlitch.c:60
static void Vec_IntClear(Vec_Int_t *p)
Definition: bblif.c:452
void Gli_ManSetPiRandom ( Gli_Man_t p,
float  PiTransProb 
)

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

Synopsis [Sets random info at the PIs and collects changed PIs.]

Description []

SideEffects []

SeeAlso []

Definition at line 427 of file giaGlitch.c.

428 {
429  Gli_Obj_t * pObj;
430  float Multi = 1.0 / (1 << 16);
431  int i;
432  assert( 0.0 < PiTransProb && PiTransProb < 1.0 );
434  Gli_ManForEachCi( p, pObj, i )
435  if ( Multi * (Gia_ManRandom(0) & 0xffff) < PiTransProb )
436  {
437  Vec_IntPush( p->vCisChanged, pObj->Handle );
438  pObj->fPhase ^= 1;
439  pObj->fPhase2 ^= 1;
440  pObj->nSwitches++;
441  pObj->nGlitches++;
442  }
443 }
typedefABC_NAMESPACE_IMPL_START struct Gli_Obj_t_ Gli_Obj_t
DECLARATIONS ///.
Definition: giaGlitch.c:30
unsigned Gia_ManRandom(int fReset)
FUNCTION DEFINITIONS ///.
Definition: giaUtil.c:49
if(last==0)
Definition: sparse_int.h:34
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
#define Gli_ManForEachCi(p, pObj, i)
Definition: giaGlitch.c:108
Vec_Int_t * vCisChanged
Definition: giaGlitch.c:60
#define assert(ex)
Definition: util_old.h:213
static void Vec_IntClear(Vec_Int_t *p)
Definition: bblif.c:452
void Gli_ManSetPiRandomSeq ( Gli_Man_t p,
float  PiTransProb 
)

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

Synopsis [Sets random info at the PIs and collects changed PIs.]

Description []

SideEffects []

SeeAlso []

Definition at line 697 of file giaGlitch.c.

698 {
699  Gli_Obj_t * pObj, * pObjRi;
700  float Multi = 1.0 / (1 << 16);
701  int i;
702  assert( 0.0 < PiTransProb && PiTransProb < 1.0 );
703  // transfer data to the COs
704  Gli_ManForEachCo( p, pObj, i )
705  pObj->fPhase = pObj->fPhase2 = Gli_ObjFanin(pObj, 0)->fPhase;
706  // set changed PIs
707  Vec_IntClear( p->vCisChanged );
708  Gli_ManForEachPi( p, pObj, i )
709  if ( Multi * (Gia_ManRandom(0) & 0xffff) < PiTransProb )
710  {
711  Vec_IntPush( p->vCisChanged, pObj->Handle );
712  pObj->fPhase ^= 1;
713  pObj->fPhase2 ^= 1;
714  pObj->nSwitches++;
715  pObj->nGlitches++;
716  }
717  // set changed ROs
718  Gli_ManForEachRiRo( p, pObjRi, pObj, i )
719  if ( pObjRi->fPhase != pObj->fPhase )
720  {
721  Vec_IntPush( p->vCisChanged, pObj->Handle );
722  pObj->fPhase ^= 1;
723  pObj->fPhase2 ^= 1;
724  pObj->nSwitches++;
725  pObj->nGlitches++;
726  }
727 
728 }
static Gli_Obj_t * Gli_ObjFanin(Gli_Obj_t *pObj, int i)
Definition: giaGlitch.c:98
#define Gli_ManForEachCo(p, pObj, i)
Definition: giaGlitch.c:110
typedefABC_NAMESPACE_IMPL_START struct Gli_Obj_t_ Gli_Obj_t
DECLARATIONS ///.
Definition: giaGlitch.c:30
unsigned Gia_ManRandom(int fReset)
FUNCTION DEFINITIONS ///.
Definition: giaUtil.c:49
if(last==0)
Definition: sparse_int.h:34
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
Vec_Int_t * vCisChanged
Definition: giaGlitch.c:60
#define assert(ex)
Definition: util_old.h:213
#define Gli_ManForEachPi(p, pObj, i)
Definition: giaGlitch.c:113
static void Vec_IntClear(Vec_Int_t *p)
Definition: bblif.c:452
#define Gli_ManForEachRiRo(p, pObjRi, pObjRo, i)
Definition: giaGlitch.c:121
unsigned Gli_ManSimulateSeqNode ( Gli_Man_t p,
Gli_Obj_t pNode 
)

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

Synopsis [Simulates one node.]

Description []

SideEffects []

SeeAlso []

Definition at line 581 of file giaGlitch.c.

582 {
583  unsigned pSimInfos[6], Result = 0;
584  int nFanins = Gli_ObjFaninNum(pNode);
585  int i, k, Phase;
586  Gli_Obj_t * pFanin;
587  assert( nFanins <= 6 );
588  Gli_ObjForEachFanin( pNode, pFanin, i )
589  pSimInfos[i] = pFanin->uSimInfo;
590  for ( i = 0; i < 32; i++ )
591  {
592  Phase = 0;
593  for ( k = 0; k < nFanins; k++ )
594  if ( (pSimInfos[k] >> i) & 1 )
595  Phase |= (1 << k);
596  if ( Abc_InfoHasBit( pNode->uTruth, Phase ) )
597  Result |= (1 << i);
598  }
599  return Result;
600 }
static int Abc_InfoHasBit(unsigned *p, int i)
Definition: abc_global.h:258
#define Gli_ObjForEachFanin(pObj, pNext, i)
Definition: giaGlitch.c:124
for(p=first;p->value< newval;p=p->next)
typedefABC_NAMESPACE_IMPL_START struct Gli_Obj_t_ Gli_Obj_t
DECLARATIONS ///.
Definition: giaGlitch.c:30
static int Gli_ObjFaninNum(Gli_Obj_t *pObj)
Definition: giaGlitch.c:94
#define assert(ex)
Definition: util_old.h:213
void Gli_ManSimulateSeqPref ( Gli_Man_t p,
int  nPref 
)

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

Synopsis [Simulates sequential network randomly for the given number of frames.]

Description []

SideEffects []

SeeAlso []

Definition at line 636 of file giaGlitch.c.

637 {
638  Gli_Obj_t * pObj, * pObjRi, * pObjRo;
639  int i, f;
640  // initialize simulation data
641  Gli_ManForEachPi( p, pObj, i )
642  pObj->uSimInfo = Gli_ManUpdateRandomInput( pObj->uSimInfo, 0.5 );
643  Gli_ManForEachRo( p, pObj, i )
644  pObj->uSimInfo = 0;
645  for ( f = 0; f < nPref; f++ )
646  {
647  // simulate one frame
648  Gli_ManForEachNode( p, pObj, i )
649  pObj->uSimInfo = Gli_ManSimulateSeqNode( p, pObj );
650  Gli_ManForEachRi( p, pObj, i )
651  pObj->uSimInfo = Gli_ObjFanin(pObj, 0)->uSimInfo;
652  // initialize the next frame
653  Gli_ManForEachPi( p, pObj, i )
654  pObj->uSimInfo = Gli_ManUpdateRandomInput( pObj->uSimInfo, 0.5 );
655  Gli_ManForEachRiRo( p, pObjRi, pObjRo, i )
656  pObjRo->uSimInfo = pObjRi->uSimInfo;
657  }
658  // save simulation data after nPref timeframes
659  if ( p->pSimInfoPrev == NULL )
660  p->pSimInfoPrev = ABC_ALLOC( unsigned, Gli_ManCiNum(p) );
661  Gli_ManForEachCi( p, pObj, i )
662  p->pSimInfoPrev[i] = pObj->uSimInfo;
663 }
unsigned Gli_ManSimulateSeqNode(Gli_Man_t *p, Gli_Obj_t *pNode)
Definition: giaGlitch.c:581
static Gli_Obj_t * Gli_ObjFanin(Gli_Obj_t *pObj, int i)
Definition: giaGlitch.c:98
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
for(p=first;p->value< newval;p=p->next)
typedefABC_NAMESPACE_IMPL_START struct Gli_Obj_t_ Gli_Obj_t
DECLARATIONS ///.
Definition: giaGlitch.c:30
if(last==0)
Definition: sparse_int.h:34
static int Gli_ManCiNum(Gli_Man_t *p)
Definition: giaGlitch.c:73
#define Gli_ManForEachCi(p, pObj, i)
Definition: giaGlitch.c:108
static unsigned Gli_ManUpdateRandomInput(unsigned uInfo, float PiTransProb)
Definition: giaGlitch.c:613
#define Gli_ManForEachRi(p, pObj, i)
Definition: giaGlitch.c:119
#define Gli_ManForEachPi(p, pObj, i)
Definition: giaGlitch.c:113
#define Gli_ManForEachRiRo(p, pObjRi, pObjRo, i)
Definition: giaGlitch.c:121
#define Gli_ManForEachRo(p, pObj, i)
Definition: giaGlitch.c:117
#define Gli_ManForEachNode(p, pObj, i)
Definition: giaGlitch.c:103
void Gli_ManStop ( Gli_Man_t p)

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

Synopsis [Deletes logic network.]

Description []

SideEffects []

SeeAlso []

Definition at line 170 of file giaGlitch.c.

171 {
172  Vec_IntFree( p->vCis );
173  Vec_IntFree( p->vCos );
174  Vec_IntFree( p->vCisChanged );
175  Vec_IntFree( p->vAffected );
176  Vec_IntFree( p->vFrontier );
177  ABC_FREE( p->pSimInfoPrev );
178  ABC_FREE( p );
179 }
unsigned * pSimInfoPrev
Definition: giaGlitch.c:69
Vec_Int_t * vFrontier
Definition: giaGlitch.c:62
Vec_Int_t * vCis
Definition: giaGlitch.c:58
Vec_Int_t * vAffected
Definition: giaGlitch.c:61
Vec_Int_t * vCos
Definition: giaGlitch.c:59
Vec_Int_t * vCisChanged
Definition: giaGlitch.c:60
#define ABC_FREE(obj)
Definition: abc_global.h:232
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
void Gli_ManSwitchesAndGlitches ( Gli_Man_t p,
int  nPatterns,
float  PiTransProb,
int  fVerbose 
)

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

Synopsis [Computes glitching activity of each node.]

Description []

SideEffects []

SeeAlso []

Definition at line 741 of file giaGlitch.c.

742 {
743  int i, k;
744  abctime clk = Abc_Clock();
745  Gia_ManRandom( 1 );
746  Gli_ManFinalize( p );
747  if ( p->nRegs == 0 )
748  {
749  for ( i = 0; i < nPatterns; i++ )
750  {
751  Gli_ManSetPiRandom( p, PiTransProb );
752  Gli_ManSwitching( p );
753  Gli_ManGlitching( p );
754 // Gli_ManVerify( p );
755  }
756  }
757  else
758  {
759  int nIters = Abc_BitWordNum(nPatterns);
760  Gli_ManSimulateSeqPref( p, 16 );
761  for ( i = 0; i < 32; i++ )
762  {
763  Gli_ManSetDataSaved( p, i );
764  for ( k = 0; k < nIters; k++ )
765  {
766  Gli_ManSetPiRandomSeq( p, PiTransProb );
767  Gli_ManSwitching( p );
768  Gli_ManGlitching( p );
769 // Gli_ManVerify( p );
770  }
771  }
772  }
773  if ( fVerbose )
774  {
775  printf( "\nSimulated %d patterns. ", nPatterns );
776  ABC_PRMn( "Memory", 4*p->nObjData );
777  ABC_PRT( "Time", Abc_Clock() - clk );
778  }
779 }
#define ABC_PRMn(a, f)
Definition: abc_global.h:226
void Gli_ManGlitching(Gli_Man_t *p)
Definition: giaGlitch.c:507
void Gli_ManSwitching(Gli_Man_t *p)
Definition: giaGlitch.c:483
static abctime Abc_Clock()
Definition: abc_global.h:279
int nRegs
Definition: giaGlitch.c:64
void Gli_ManFinalize(Gli_Man_t *p)
Definition: giaGlitch.c:221
unsigned Gia_ManRandom(int fReset)
FUNCTION DEFINITIONS ///.
Definition: giaUtil.c:49
void Gli_ManSimulateSeqPref(Gli_Man_t *p, int nPref)
Definition: giaGlitch.c:636
void Gli_ManSetPiRandomSeq(Gli_Man_t *p, float PiTransProb)
Definition: giaGlitch.c:697
void Gli_ManSetDataSaved(Gli_Man_t *p, int iBit)
Definition: giaGlitch.c:676
int nObjData
Definition: giaGlitch.c:67
#define ABC_PRT(a, t)
Definition: abc_global.h:220
void Gli_ManSetPiRandom(Gli_Man_t *p, float PiTransProb)
Definition: giaGlitch.c:427
static int Abc_BitWordNum(int nBits)
Definition: abc_global.h:255
ABC_INT64_T abctime
Definition: abc_global.h:278
void Gli_ManSwitching ( Gli_Man_t p)

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

Synopsis [Computes switching activity of each node.]

Description []

SideEffects []

SeeAlso []

Definition at line 483 of file giaGlitch.c.

484 {
485  Gli_Obj_t * pThis;
486  int i;
487  Gli_ManForEachNode( p, pThis, i )
488  {
489  if ( ((int)pThis->fPhase) == Gli_NodeComputeValue(pThis) )
490  continue;
491  pThis->fPhase ^= 1;
492  pThis->nSwitches++;
493  }
494 }
static int Gli_NodeComputeValue(Gli_Obj_t *pNode)
Definition: giaGlitch.c:331
typedefABC_NAMESPACE_IMPL_START struct Gli_Obj_t_ Gli_Obj_t
DECLARATIONS ///.
Definition: giaGlitch.c:30
#define Gli_ManForEachNode(p, pObj, i)
Definition: giaGlitch.c:103
static unsigned Gli_ManUpdateRandomInput ( unsigned  uInfo,
float  PiTransProb 
)
inlinestatic

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

Synopsis [Simulates one node.]

Description []

SideEffects []

SeeAlso []

Definition at line 613 of file giaGlitch.c.

614 {
615  float Multi = 1.0 / (1 << 16);
616  int i;
617  if ( PiTransProb == 0.5 )
618  return Gia_ManRandom(0);
619  for ( i = 0; i < 32; i++ )
620  if ( Multi * (Gia_ManRandom(0) & 0xffff) < PiTransProb )
621  uInfo ^= (1 << i);
622  return uInfo;
623 }
unsigned Gia_ManRandom(int fReset)
FUNCTION DEFINITIONS ///.
Definition: giaUtil.c:49
void Gli_ManVerify ( Gli_Man_t p)

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

Synopsis [Checks that the resulting values are the same.]

Description []

SideEffects []

SeeAlso []

Definition at line 559 of file giaGlitch.c.

560 {
561  Gli_Obj_t * pObj;
562  int i;
563  Gli_ManForEachObj( p, pObj, i )
564  {
565  assert( pObj->fPhase == pObj->fPhase2 );
566  assert( pObj->nGlitches >= pObj->nSwitches );
567  }
568 }
typedefABC_NAMESPACE_IMPL_START struct Gli_Obj_t_ Gli_Obj_t
DECLARATIONS ///.
Definition: giaGlitch.c:30
#define Gli_ManForEachObj(p, pObj, i)
Definition: giaGlitch.c:101
#define assert(ex)
Definition: util_old.h:213
static int Gli_NodeComputeValue ( Gli_Obj_t pNode)
inlinestatic

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

Synopsis [Creates node.]

Description []

SideEffects []

SeeAlso []

Definition at line 331 of file giaGlitch.c.

332 {
333  int i, Phase = 0;
334  for ( i = 0; i < (int)pNode->nFanins; i++ )
335  Phase |= (Gli_ObjFanin(pNode, i)->fPhase << i);
336  return Abc_InfoHasBit( pNode->uTruth, Phase );
337 }
static int Abc_InfoHasBit(unsigned *p, int i)
Definition: abc_global.h:258
static Gli_Obj_t * Gli_ObjFanin(Gli_Obj_t *pObj, int i)
Definition: giaGlitch.c:98
static int Gli_NodeComputeValue2 ( Gli_Obj_t pNode)
inlinestatic

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

Synopsis [Creates node.]

Description []

SideEffects []

SeeAlso []

Definition at line 350 of file giaGlitch.c.

351 {
352  int i, Phase = 0;
353  for ( i = 0; i < (int)pNode->nFanins; i++ )
354  Phase |= (Gli_ObjFanin(pNode, i)->fPhase2 << i);
355  return Abc_InfoHasBit( pNode->uTruth, Phase );
356 }
static int Abc_InfoHasBit(unsigned *p, int i)
Definition: abc_global.h:258
static Gli_Obj_t * Gli_ObjFanin(Gli_Obj_t *pObj, int i)
Definition: giaGlitch.c:98
void Gli_ObjAddFanin ( Gli_Obj_t pObj,
Gli_Obj_t pFanin 
)

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

Synopsis [Creates fanin/fanout pair.]

Description []

SideEffects []

SeeAlso []

Definition at line 246 of file giaGlitch.c.

247 {
248  assert( pObj->iFanin < (int)pObj->nFanins );
249  assert( pFanin->iFanout < (int)pFanin->nFanouts );
250  pFanin->Fanios[pFanin->nFanins + pFanin->iFanout++] =
251  pObj->Fanios[pObj->iFanin++] = pObj->Handle - pFanin->Handle;
252 }
#define assert(ex)
Definition: util_old.h:213
Gli_Obj_t* Gli_ObjAlloc ( Gli_Man_t p,
int  nFanins,
int  nFanouts 
)

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

Synopsis [Allocates object.]

Description []

SideEffects []

SeeAlso []

Definition at line 265 of file giaGlitch.c.

266 {
267  Gli_Obj_t * pObj;
268  pObj = Gli_ManObj( p, p->iObjData );
269  pObj->Handle = p->iObjData;
270  pObj->nFanins = nFanins;
271  pObj->nFanouts = nFanouts;
272  p->iObjData += Gli_ObjSize( pObj );
273  p->nObjs++;
274  return pObj;
275 }
int iObjData
Definition: giaGlitch.c:66
static Gli_Obj_t * Gli_ManObj(Gli_Man_t *p, int v)
Definition: giaGlitch.c:81
static int Gli_ObjSize(Gli_Obj_t *pObj)
Definition: giaGlitch.c:96
typedefABC_NAMESPACE_IMPL_START struct Gli_Obj_t_ Gli_Obj_t
DECLARATIONS ///.
Definition: giaGlitch.c:30
int nObjs
Definition: giaGlitch.c:63
static Gli_Obj_t* Gli_ObjFanin ( Gli_Obj_t pObj,
int  i 
)
inlinestatic

Definition at line 98 of file giaGlitch.c.

98 { return (Gli_Obj_t *)(((int *)pObj) - pObj->Fanios[i]); }
typedefABC_NAMESPACE_IMPL_START struct Gli_Obj_t_ Gli_Obj_t
DECLARATIONS ///.
Definition: giaGlitch.c:30
static int Gli_ObjFaninNum ( Gli_Obj_t pObj)
inlinestatic

Definition at line 94 of file giaGlitch.c.

94 { return pObj->nFanins; }
static Gli_Obj_t* Gli_ObjFanout ( Gli_Obj_t pObj,
int  i 
)
inlinestatic

Definition at line 99 of file giaGlitch.c.

99 { return (Gli_Obj_t *)(((int *)pObj) + pObj->Fanios[pObj->nFanins+i]); }
typedefABC_NAMESPACE_IMPL_START struct Gli_Obj_t_ Gli_Obj_t
DECLARATIONS ///.
Definition: giaGlitch.c:30
static int Gli_ObjFanoutNum ( Gli_Obj_t pObj)
inlinestatic

Definition at line 95 of file giaGlitch.c.

95 { return pObj->nFanouts; }
static int Gli_ObjIsCi ( Gli_Obj_t pObj)
inlinestatic

Definition at line 90 of file giaGlitch.c.

90 { return pObj->fTerm && pObj->nFanins == 0; }
static int Gli_ObjIsCo ( Gli_Obj_t pObj)
inlinestatic

Definition at line 91 of file giaGlitch.c.

91 { return pObj->fTerm && pObj->nFanins == 1; }
static int Gli_ObjIsNode ( Gli_Obj_t pObj)
inlinestatic

Definition at line 92 of file giaGlitch.c.

92 { return!pObj->fTerm; }
static int Gli_ObjIsTerm ( Gli_Obj_t pObj)
inlinestatic

Definition at line 89 of file giaGlitch.c.

89 { return pObj->fTerm; }
int Gli_ObjNumGlitches ( Gli_Man_t p,
int  iNode 
)

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

Synopsis [Returns the number of glitches of the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 410 of file giaGlitch.c.

411 {
412  return Gli_ManObj( p, iNode )->nGlitches;
413 }
static Gli_Obj_t * Gli_ManObj(Gli_Man_t *p, int v)
Definition: giaGlitch.c:81
int Gli_ObjNumSwitches ( Gli_Man_t p,
int  iNode 
)

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

Synopsis [Returns the number of switches of the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 394 of file giaGlitch.c.

395 {
396  return Gli_ManObj( p, iNode )->nSwitches;
397 }
static Gli_Obj_t * Gli_ManObj(Gli_Man_t *p, int v)
Definition: giaGlitch.c:81
static int Gli_ObjSize ( Gli_Obj_t pObj)
inlinestatic

Definition at line 96 of file giaGlitch.c.

96 { return sizeof(Gli_Obj_t) / 4 + pObj->nFanins + pObj->nFanouts; }
typedefABC_NAMESPACE_IMPL_START struct Gli_Obj_t_ Gli_Obj_t
DECLARATIONS ///.
Definition: giaGlitch.c:30