abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
saigSwitch.c File Reference
#include "saig.h"
#include "base/main/main.h"

Go to the source code of this file.

Data Structures

struct  Saig_SimObj_t_
 
struct  Aig_CMan_t_
 

Typedefs

typedef
typedefABC_NAMESPACE_IMPL_START
struct Saig_SimObj_t_ 
Saig_SimObj_t
 DECLARATIONS ///. More...
 
typedef struct Aig_CMan_t_ Aig_CMan_t
 

Functions

static int Saig_SimObjFaninC0 (Saig_SimObj_t *pObj)
 
static int Saig_SimObjFaninC1 (Saig_SimObj_t *pObj)
 
static int Saig_SimObjFanin0 (Saig_SimObj_t *pObj)
 
static int Saig_SimObjFanin1 (Saig_SimObj_t *pObj)
 
Saig_SimObj_tSaig_ManCreateMan (Aig_Man_t *p)
 FUNCTION DEFINITIONS ///. More...
 
static void Saig_ManSimulateNode2 (Saig_SimObj_t *pAig, Saig_SimObj_t *pObj)
 
static void Saig_ManSimulateNode (Saig_SimObj_t *pAig, Saig_SimObj_t *pObj)
 
static void Saig_ManSimulateOneInput (Saig_SimObj_t *pAig, Saig_SimObj_t *pObj)
 
void Saig_ManSimulateFrames (Saig_SimObj_t *pAig, int nFrames, int nPref)
 
float Saig_ManComputeSwitching (int nOnes, int nSimWords)
 
float Saig_ManComputeProbOne (int nOnes, int nSimWords)
 
float Saig_ManComputeProbOnePlus (int nOnes, int nSimWords, int fCompl)
 
Vec_Int_tSaig_ManComputeSwitchProb4s (Aig_Man_t *p, int nFrames, int nPref, int fProbOne)
 
Aig_CMan_tAig_CManStart (int nIns, int nNodes, int nOuts)
 
void Aig_CManStop (Aig_CMan_t *p)
 
void Aig_CManRestart (Aig_CMan_t *p)
 
void Aig_CManStoreNum (Aig_CMan_t *p, unsigned x)
 
int Aig_CManRestoreNum (Aig_CMan_t *p)
 
void Aig_CManAddNode (Aig_CMan_t *p, int iFan0, int iFan1)
 
void Aig_CManAddPo (Aig_CMan_t *p, int iFan0)
 
void Aig_CManGetNode (Aig_CMan_t *p, int *piFan0, int *piFan1)
 
int Aig_CManGetPo (Aig_CMan_t *p)
 
Aig_CMan_tAig_CManCreate (Aig_Man_t *p)
 

Typedef Documentation

typedef struct Aig_CMan_t_ Aig_CMan_t

Definition at line 331 of file saigSwitch.c.

typedef typedefABC_NAMESPACE_IMPL_START struct Saig_SimObj_t_ Saig_SimObj_t

DECLARATIONS ///.

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

FileName [saigSwitch.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Sequential AIG package.]

Synopsis [Returns switching propabilities.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

]

Definition at line 32 of file saigSwitch.c.

Function Documentation

void Aig_CManAddNode ( Aig_CMan_t p,
int  iFan0,
int  iFan1 
)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 466 of file saigSwitch.c.

467 {
468  assert( iFan0 < iFan1 );
469  assert( iFan1 < (p->iNode << 1) );
470  Aig_CManStoreNum( p, (p->iNode++ << 1) - iFan1 );
471  Aig_CManStoreNum( p, iFan1 - iFan0 );
472 }
void Aig_CManStoreNum(Aig_CMan_t *p, unsigned x)
Definition: saigSwitch.c:425
#define assert(ex)
Definition: util_old.h:213
void Aig_CManAddPo ( Aig_CMan_t p,
int  iFan0 
)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 485 of file saigSwitch.c.

486 {
487  if ( p->iPrev == -1 )
488  Aig_CManStoreNum( p, p->iNode - iFan0 );
489  else if ( p->iPrev <= iFan0 )
490  Aig_CManStoreNum( p, (iFan0 - p->iPrev) << 1 );
491  else
492  Aig_CManStoreNum( p,((p->iPrev - iFan0) << 1) | 1 );
493  p->iPrev = iFan0;
494  p->iNode++;
495 }
void Aig_CManStoreNum(Aig_CMan_t *p, unsigned x)
Definition: saigSwitch.c:425
Aig_CMan_t* Aig_CManCreate ( Aig_Man_t p)

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

Synopsis [Compute switching probabilities of all nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 547 of file saigSwitch.c.

548 {
549  Aig_CMan_t * pCMan;
550  Aig_Obj_t * pObj;
551  int i;
553  Aig_ManForEachNode( p, pObj, i )
554  Aig_CManAddNode( pCMan,
555  (Aig_ObjFaninId0(pObj) << 1) | Aig_ObjFaninC0(pObj),
556  (Aig_ObjFaninId1(pObj) << 1) | Aig_ObjFaninC1(pObj) );
557  Aig_ManForEachCo( p, pObj, i )
558  Aig_CManAddPo( pCMan,
559  (Aig_ObjFaninId0(pObj) << 1) | Aig_ObjFaninC0(pObj) );
560  printf( "\nBytes alloc = %5d. Bytes used = %7d. Ave per node = %4.2f. \n",
561  pCMan->nBytes, (int)(pCMan->pCur - pCMan->Data),
562  1.0 * (pCMan->pCur - pCMan->Data) / (pCMan->nNodes + pCMan->nOuts ) );
563 // Aig_CManStop( pCMan );
564  return pCMan;
565 }
static int Aig_ObjFaninId0(Aig_Obj_t *pObj)
Definition: aig.h:304
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Aig_CManAddNode(Aig_CMan_t *p, int iFan0, int iFan1)
Definition: saigSwitch.c:466
Aig_CMan_t * Aig_CManStart(int nIns, int nNodes, int nOuts)
Definition: saigSwitch.c:361
#define Aig_ManForEachCo(p, pObj, i)
Definition: aig.h:398
static int Aig_ObjFaninId1(Aig_Obj_t *pObj)
Definition: aig.h:305
static int Aig_ManNodeNum(Aig_Man_t *p)
Definition: aig.h:256
static int Aig_ManCoNum(Aig_Man_t *p)
Definition: aig.h:252
#define Aig_ManForEachNode(p, pObj, i)
Definition: aig.h:413
static int Aig_ManCiNum(Aig_Man_t *p)
Definition: aig.h:251
Definition: aig.h:69
static int Aig_ObjFaninC0(Aig_Obj_t *pObj)
Definition: aig.h:306
static int Aig_ObjFaninC1(Aig_Obj_t *pObj)
Definition: aig.h:307
void Aig_CManAddPo(Aig_CMan_t *p, int iFan0)
Definition: saigSwitch.c:485
void Aig_CManGetNode ( Aig_CMan_t p,
int *  piFan0,
int *  piFan1 
)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 508 of file saigSwitch.c.

509 {
510  *piFan1 = (p->iNode++ << 1) - Aig_CManRestoreNum( p );
511  *piFan0 = *piFan1 - Aig_CManRestoreNum( p );
512 }
int Aig_CManRestoreNum(Aig_CMan_t *p)
Definition: saigSwitch.c:447
int Aig_CManGetPo ( Aig_CMan_t p)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 525 of file saigSwitch.c.

526 {
527  int Num = Aig_CManRestoreNum( p );
528  if ( p->iPrev == -1 )
529  p->iPrev = p->iNode;
530  p->iNode++;
531  if ( Num & 1 )
532  return p->iPrev = p->iPrev + (Num >> 1);
533  return p->iPrev = p->iPrev - (Num >> 1);
534 }
int Aig_CManRestoreNum(Aig_CMan_t *p)
Definition: saigSwitch.c:447
void Aig_CManRestart ( Aig_CMan_t p)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 405 of file saigSwitch.c.

406 {
407  assert( p->iNode == 1 + p->nIns + p->nNodes + p->nOuts );
408  p->iNode = 1 + p->nIns;
409  p->iPrev = -1;
410  p->pCur = p->Data;
411 }
unsigned char Data[0]
Definition: saigSwitch.c:346
#define assert(ex)
Definition: util_old.h:213
unsigned char * pCur
Definition: saigSwitch.c:342
int Aig_CManRestoreNum ( Aig_CMan_t p)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 447 of file saigSwitch.c.

448 {
449  int ch, i, x = 0;
450  for ( i = 0; (ch = *p->pCur++) & 0x80; i++ )
451  x |= (ch & 0x7f) << (7 * i);
452  return x | (ch << (7 * i));
453 }
unsigned char * pCur
Definition: saigSwitch.c:342
Aig_CMan_t* Aig_CManStart ( int  nIns,
int  nNodes,
int  nOuts 
)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 361 of file saigSwitch.c.

362 {
363  Aig_CMan_t * p;
364  p = (Aig_CMan_t *)ABC_ALLOC( char, sizeof(Aig_CMan_t) + 2*(2*nNodes + nOuts) );
365  memset( p, 0, sizeof(Aig_CMan_t) );
366  // set parameters
367  p->nIns = nIns;
368  p->nOuts = nOuts;
369  p->nNodes = nNodes;
370  p->nBytes = 2*(2*nNodes + nOuts);
371  // prepare the manager
372  p->iNode = 1 + p->nIns;
373  p->iPrev = -1;
374  p->pCur = p->Data;
375  return p;
376 }
char * memset()
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
unsigned char Data[0]
Definition: saigSwitch.c:346
unsigned char * pCur
Definition: saigSwitch.c:342
void Aig_CManStop ( Aig_CMan_t p)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 389 of file saigSwitch.c.

390 {
391  ABC_FREE( p );
392 }
#define ABC_FREE(obj)
Definition: abc_global.h:232
void Aig_CManStoreNum ( Aig_CMan_t p,
unsigned  x 
)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 425 of file saigSwitch.c.

426 {
427  while ( x & ~0x7f )
428  {
429  *p->pCur++ = (x & 0x7f) | 0x80;
430  x >>= 7;
431  }
432  *p->pCur++ = x;
433  assert( p->pCur - p->Data < p->nBytes - 10 );
434 }
unsigned char Data[0]
Definition: saigSwitch.c:346
#define assert(ex)
Definition: util_old.h:213
unsigned char * pCur
Definition: saigSwitch.c:342
float Saig_ManComputeProbOne ( int  nOnes,
int  nSimWords 
)

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

Synopsis [Computes switching activity of one node.]

Description [Uses the formula: Switching = 2 * nOnes * nZeros / (nTotal ^ 2) ]

SideEffects []

SeeAlso []

Definition at line 229 of file saigSwitch.c.

230 {
231  int nTotal = 32 * nSimWords;
232  return (float)nOnes / nTotal;
233 }
int nTotal
DECLARATIONS ///.
Definition: cutTruth.c:37
float Saig_ManComputeProbOnePlus ( int  nOnes,
int  nSimWords,
int  fCompl 
)

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

Synopsis [Computes switching activity of one node.]

Description [Uses the formula: Switching = 2 * nOnes * nZeros / (nTotal ^ 2) ]

SideEffects []

SeeAlso []

Definition at line 246 of file saigSwitch.c.

247 {
248  int nTotal = 32 * nSimWords;
249  if ( fCompl )
250  return (float)(nTotal-nOnes) / nTotal;
251  else
252  return (float)nOnes / nTotal;
253 }
int nTotal
DECLARATIONS ///.
Definition: cutTruth.c:37
float Saig_ManComputeSwitching ( int  nOnes,
int  nSimWords 
)

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

Synopsis [Computes switching activity of one node.]

Description [Uses the formula: Switching = 2 * nOnes * nZeros / (nTotal ^ 2) ]

SideEffects []

SeeAlso []

Definition at line 212 of file saigSwitch.c.

213 {
214  int nTotal = 32 * nSimWords;
215  return (float)2.0 * nOnes / nTotal * (nTotal - nOnes) / nTotal;
216 }
int nTotal
DECLARATIONS ///.
Definition: cutTruth.c:37
Vec_Int_t* Saig_ManComputeSwitchProb4s ( Aig_Man_t p,
int  nFrames,
int  nPref,
int  fProbOne 
)

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

Synopsis [Compute switching probabilities of all nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 266 of file saigSwitch.c.

267 {
268  Saig_SimObj_t * pAig, * pEntry;
269  Vec_Int_t * vSwitching;
270  float * pSwitching;
271  int nFramesReal;
272  abctime clk;//, clkTotal = Abc_Clock();
273  vSwitching = Vec_IntStart( Aig_ManObjNumMax(p) );
274  pSwitching = (float *)vSwitching->pArray;
275 clk = Abc_Clock();
276  pAig = Saig_ManCreateMan( p );
277 //ABC_PRT( "\nCreation ", Abc_Clock() - clk );
278 
279  Aig_ManRandom( 1 );
280  // get the number of frames to simulate
281  // if the parameter "seqsimframes" is defined, use it
282  // otherwise, use the given number of frames "nFrames"
283  nFramesReal = nFrames;
284  if ( Abc_FrameReadFlag("seqsimframes") )
285  nFramesReal = atoi( Abc_FrameReadFlag("seqsimframes") );
286  if ( nFramesReal <= nPref )
287  {
288  printf( "The total number of frames (%d) should exceed prefix (%d).\n", nFramesReal, nPref );\
289  printf( "Setting the total number of frames to be %d.\n", nFrames );
290  nFramesReal = nFrames;
291  }
292 //printf( "Simulating %d frames.\n", nFramesReal );
293 clk = Abc_Clock();
294  Saig_ManSimulateFrames( pAig, nFramesReal, nPref );
295 //ABC_PRT( "Simulation", Abc_Clock() - clk );
296 clk = Abc_Clock();
297  for ( pEntry = pAig; pEntry->Type != AIG_OBJ_VOID; pEntry++ )
298  {
299 /*
300  if ( pEntry->Type == AIG_OBJ_AND )
301  {
302  Saig_SimObj_t * pObj0 = pAig + Saig_SimObjFanin0( pEntry );
303  Saig_SimObj_t * pObj1 = pAig + Saig_SimObjFanin1( pEntry );
304  printf( "%5.2f = %5.2f * %5.2f (%7.4f)\n",
305  Saig_ManComputeProbOnePlus( pEntry->Number, nFrames - nPref, 0 ),
306  Saig_ManComputeProbOnePlus( pObj0->Number, nFrames - nPref, Saig_SimObjFaninC0(pEntry) ),
307  Saig_ManComputeProbOnePlus( pObj1->Number, nFrames - nPref, Saig_SimObjFaninC1(pEntry) ),
308  Saig_ManComputeProbOnePlus( pEntry->Number, nFrames - nPref, 0 ) -
309  Saig_ManComputeProbOnePlus( pObj0->Number, nFrames - nPref, Saig_SimObjFaninC0(pEntry) ) *
310  Saig_ManComputeProbOnePlus( pObj1->Number, nFrames - nPref, Saig_SimObjFaninC1(pEntry) )
311  );
312  }
313 */
314  if ( fProbOne )
315  pSwitching[pEntry-pAig] = Saig_ManComputeProbOne( pEntry->Number, nFramesReal - nPref );
316  else
317  pSwitching[pEntry-pAig] = Saig_ManComputeSwitching( pEntry->Number, nFramesReal - nPref );
318 //printf( "%3d : %7.2f\n", pEntry-pAig, pSwitching[pEntry-pAig] );
319  }
320  ABC_FREE( pAig );
321 //ABC_PRT( "Switch ", Abc_Clock() - clk );
322 //ABC_PRT( "TOTAL ", Abc_Clock() - clkTotal );
323 
324 // Aig_CManCreate( p );
325  return vSwitching;
326 }
float Saig_ManComputeSwitching(int nOnes, int nSimWords)
Definition: saigSwitch.c:212
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
float Saig_ManComputeProbOne(int nOnes, int nSimWords)
Definition: saigSwitch.c:229
unsigned Aig_ManRandom(int fReset)
Definition: aigUtil.c:1157
static abctime Abc_Clock()
Definition: abc_global.h:279
static Vec_Int_t * Vec_IntStart(int nSize)
Definition: bblif.c:172
typedefABC_NAMESPACE_IMPL_START struct Saig_SimObj_t_ Saig_SimObj_t
DECLARATIONS ///.
Definition: saigSwitch.c:32
void Saig_ManSimulateFrames(Saig_SimObj_t *pAig, int nFrames, int nPref)
Definition: saigSwitch.c:172
Saig_SimObj_t * Saig_ManCreateMan(Aig_Man_t *p)
FUNCTION DEFINITIONS ///.
Definition: saigSwitch.c:66
static int Aig_ManObjNumMax(Aig_Man_t *p)
Definition: aig.h:259
#define ABC_FREE(obj)
Definition: abc_global.h:232
ABC_DLL char * Abc_FrameReadFlag(char *pFlag)
Definition: mainFrame.c:64
ABC_INT64_T abctime
Definition: abc_global.h:278
Saig_SimObj_t* Saig_ManCreateMan ( Aig_Man_t p)

FUNCTION DEFINITIONS ///.

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

Synopsis [Creates fast simulation manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 66 of file saigSwitch.c.

67 {
68  Saig_SimObj_t * pAig, * pEntry;
69  Aig_Obj_t * pObj;
70  int i;
72 // printf( "Allocating %7.2f MB.\n", 1.0 * sizeof(Saig_SimObj_t) * (Aig_ManObjNumMax(p)+1)/(1<<20) );
73  Aig_ManForEachObj( p, pObj, i )
74  {
75  pEntry = pAig + i;
76  pEntry->Type = pObj->Type;
77  if ( Aig_ObjIsCi(pObj) || i == 0 )
78  {
79  if ( Saig_ObjIsLo(p, pObj) )
80  {
81  pEntry->iFan0 = (Saig_ObjLoToLi(p, pObj)->Id << 1);
82  pEntry->iFan1 = -1;
83  }
84  continue;
85  }
86  pEntry->iFan0 = (Aig_ObjFaninId0(pObj) << 1) | Aig_ObjFaninC0(pObj);
87  if ( Aig_ObjIsCo(pObj) )
88  continue;
89  assert( Aig_ObjIsNode(pObj) );
90  pEntry->iFan1 = (Aig_ObjFaninId1(pObj) << 1) | Aig_ObjFaninC1(pObj);
91  }
92  pEntry = pAig + Aig_ManObjNumMax(p);
93  pEntry->Type = AIG_OBJ_VOID;
94  return pAig;
95 }
static int Aig_ObjFaninId0(Aig_Obj_t *pObj)
Definition: aig.h:304
static int Saig_ObjIsLo(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition: saig.h:84
static Llb_Mgr_t * p
Definition: llb3Image.c:950
unsigned int Type
Definition: aig.h:77
static Aig_Obj_t * Saig_ObjLoToLi(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition: saig.h:86
static int Aig_ObjFaninId1(Aig_Obj_t *pObj)
Definition: aig.h:305
static int Aig_ObjIsNode(Aig_Obj_t *pObj)
Definition: aig.h:280
typedefABC_NAMESPACE_IMPL_START struct Saig_SimObj_t_ Saig_SimObj_t
DECLARATIONS ///.
Definition: saigSwitch.c:32
Definition: aig.h:69
static int Aig_ObjFaninC0(Aig_Obj_t *pObj)
Definition: aig.h:306
static int Aig_ManObjNumMax(Aig_Man_t *p)
Definition: aig.h:259
#define Aig_ManForEachObj(p, pObj, i)
Definition: aig.h:403
#define ABC_CALLOC(type, num)
Definition: abc_global.h:230
static int Aig_ObjFaninC1(Aig_Obj_t *pObj)
Definition: aig.h:307
#define assert(ex)
Definition: util_old.h:213
static int Aig_ObjIsCi(Aig_Obj_t *pObj)
Definition: aig.h:275
int Id
Definition: aig.h:85
static int Aig_ObjIsCo(Aig_Obj_t *pObj)
Definition: aig.h:276
void Saig_ManSimulateFrames ( Saig_SimObj_t pAig,
int  nFrames,
int  nPref 
)

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

Synopsis [Simulates the timeframes.]

Description []

SideEffects []

SeeAlso []

Definition at line 172 of file saigSwitch.c.

173 {
174  Saig_SimObj_t * pEntry;
175  int f;
176  for ( f = 0; f < nFrames; f++ )
177  {
178  for ( pEntry = pAig; pEntry->Type != AIG_OBJ_VOID; pEntry++ )
179  {
180  if ( pEntry->Type == AIG_OBJ_AND )
181  Saig_ManSimulateNode( pAig, pEntry );
182  else if ( pEntry->Type == AIG_OBJ_CO )
183  Saig_ManSimulateOneInput( pAig, pEntry );
184  else if ( pEntry->Type == AIG_OBJ_CI )
185  {
186  if ( pEntry->iFan0 == 0 ) // true PI
187  pEntry->pData[0] = Aig_ManRandom( 0 );
188  else if ( f > 0 ) // register output
189  Saig_ManSimulateOneInput( pAig, pEntry );
190  }
191  else if ( pEntry->Type == AIG_OBJ_CONST1 )
192  pEntry->pData[0] = ~0;
193  else if ( pEntry->Type != AIG_OBJ_NONE )
194  assert( 0 );
195  if ( f >= nPref )
196  pEntry->Number += Aig_WordCountOnes( pEntry->pData[0] );
197  }
198  }
199 }
static void Saig_ManSimulateNode(Saig_SimObj_t *pAig, Saig_SimObj_t *pObj)
Definition: saigSwitch.c:133
Definition: aig.h:61
unsigned Aig_ManRandom(int fReset)
Definition: aigUtil.c:1157
static int Aig_WordCountOnes(unsigned uWord)
Definition: aig.h:229
typedefABC_NAMESPACE_IMPL_START struct Saig_SimObj_t_ Saig_SimObj_t
DECLARATIONS ///.
Definition: saigSwitch.c:32
Definition: aig.h:60
#define assert(ex)
Definition: util_old.h:213
static void Saig_ManSimulateOneInput(Saig_SimObj_t *pAig, Saig_SimObj_t *pObj)
Definition: saigSwitch.c:152
static void Saig_ManSimulateNode ( Saig_SimObj_t pAig,
Saig_SimObj_t pObj 
)
inlinestatic

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

Synopsis [Simulated one node.]

Description []

SideEffects []

SeeAlso []

Definition at line 133 of file saigSwitch.c.

134 {
135  Saig_SimObj_t * pObj0 = pAig + Saig_SimObjFanin0( pObj );
136  Saig_SimObj_t * pObj1 = pAig + Saig_SimObjFanin1( pObj );
137  pObj->pData[0] = (Saig_SimObjFaninC0(pObj)? ~pObj0->pData[0] : pObj0->pData[0])
138  & (Saig_SimObjFaninC1(pObj)? ~pObj1->pData[0] : pObj1->pData[0]);
139 }
static int Saig_SimObjFaninC1(Saig_SimObj_t *pObj)
Definition: saigSwitch.c:43
static int Saig_SimObjFanin0(Saig_SimObj_t *pObj)
Definition: saigSwitch.c:44
typedefABC_NAMESPACE_IMPL_START struct Saig_SimObj_t_ Saig_SimObj_t
DECLARATIONS ///.
Definition: saigSwitch.c:32
static int Saig_SimObjFanin1(Saig_SimObj_t *pObj)
Definition: saigSwitch.c:45
static int Saig_SimObjFaninC0(Saig_SimObj_t *pObj)
Definition: saigSwitch.c:42
static void Saig_ManSimulateNode2 ( Saig_SimObj_t pAig,
Saig_SimObj_t pObj 
)
inlinestatic

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

Synopsis [Simulated one node.]

Description []

SideEffects []

SeeAlso []

Definition at line 108 of file saigSwitch.c.

109 {
110  Saig_SimObj_t * pObj0 = pAig + Saig_SimObjFanin0( pObj );
111  Saig_SimObj_t * pObj1 = pAig + Saig_SimObjFanin1( pObj );
112  if ( Saig_SimObjFaninC0(pObj) && Saig_SimObjFaninC1(pObj) )
113  pObj->pData[0] = ~(pObj0->pData[0] | pObj1->pData[0]);
114  else if ( Saig_SimObjFaninC0(pObj) && !Saig_SimObjFaninC1(pObj) )
115  pObj->pData[0] = (~pObj0->pData[0] & pObj1->pData[0]);
116  else if ( !Saig_SimObjFaninC0(pObj) && Saig_SimObjFaninC1(pObj) )
117  pObj->pData[0] = (pObj0->pData[0] & ~pObj1->pData[0]);
118  else // if ( !Saig_SimObjFaninC0(pObj) && !Saig_SimObjFaninC1(pObj) )
119  pObj->pData[0] = (pObj0->pData[0] & pObj1->pData[0]);
120 }
static int Saig_SimObjFaninC1(Saig_SimObj_t *pObj)
Definition: saigSwitch.c:43
static int Saig_SimObjFanin0(Saig_SimObj_t *pObj)
Definition: saigSwitch.c:44
typedefABC_NAMESPACE_IMPL_START struct Saig_SimObj_t_ Saig_SimObj_t
DECLARATIONS ///.
Definition: saigSwitch.c:32
static int Saig_SimObjFanin1(Saig_SimObj_t *pObj)
Definition: saigSwitch.c:45
static int Saig_SimObjFaninC0(Saig_SimObj_t *pObj)
Definition: saigSwitch.c:42
static void Saig_ManSimulateOneInput ( Saig_SimObj_t pAig,
Saig_SimObj_t pObj 
)
inlinestatic

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

Synopsis [Simulated buffer/inverter.]

Description []

SideEffects []

SeeAlso []

Definition at line 152 of file saigSwitch.c.

153 {
154  Saig_SimObj_t * pObj0 = pAig + Saig_SimObjFanin0( pObj );
155  if ( Saig_SimObjFaninC0(pObj) )
156  pObj->pData[0] = ~pObj0->pData[0];
157  else // if ( !Saig_SimObjFaninC0(pObj) )
158  pObj->pData[0] = pObj0->pData[0];
159 }
static int Saig_SimObjFanin0(Saig_SimObj_t *pObj)
Definition: saigSwitch.c:44
typedefABC_NAMESPACE_IMPL_START struct Saig_SimObj_t_ Saig_SimObj_t
DECLARATIONS ///.
Definition: saigSwitch.c:32
static int Saig_SimObjFaninC0(Saig_SimObj_t *pObj)
Definition: saigSwitch.c:42
static int Saig_SimObjFanin0 ( Saig_SimObj_t pObj)
inlinestatic

Definition at line 44 of file saigSwitch.c.

44 { return pObj->iFan0 >> 1; }
static int Saig_SimObjFanin1 ( Saig_SimObj_t pObj)
inlinestatic

Definition at line 45 of file saigSwitch.c.

45 { return pObj->iFan1 >> 1; }
static int Saig_SimObjFaninC0 ( Saig_SimObj_t pObj)
inlinestatic

Definition at line 42 of file saigSwitch.c.

42 { return pObj->iFan0 & 1; }
static int Saig_SimObjFaninC1 ( Saig_SimObj_t pObj)
inlinestatic

Definition at line 43 of file saigSwitch.c.

43 { return pObj->iFan1 & 1; }