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

Go to the source code of this file.

Data Structures

struct  Faig_Man_t_
 

Typedefs

typedef
typedefABC_NAMESPACE_IMPL_START
struct Faig_Man_t_ 
Faig_Man_t
 DECLARATIONS ///. More...
 

Functions

static int Faig_CheckIdPi (Faig_Man_t *p, int i)
 
static int Faig_CheckIdLo (Faig_Man_t *p, int i)
 
static int Faig_CheckIdNo (Faig_Man_t *p, int i)
 
static int Faig_CheckIdPo (Faig_Man_t *p, int i)
 
static int Faig_CheckIdLi (Faig_Man_t *p, int i)
 
static int Faig_CheckIdCo (Faig_Man_t *p, int i)
 
static int Faig_CheckIdObj (Faig_Man_t *p, int i)
 
static int Faig_ObjIdToNumPi (Faig_Man_t *p, int i)
 
static int Faig_ObjIdToNumLo (Faig_Man_t *p, int i)
 
static int Faig_ObjIdToNumNo (Faig_Man_t *p, int i)
 
static int Faig_ObjIdToNumPo (Faig_Man_t *p, int i)
 
static int Faig_ObjIdToNumLi (Faig_Man_t *p, int i)
 
static int Faig_ObjIdToNumCo (Faig_Man_t *p, int i)
 
static int Faig_ObjLoToLi (Faig_Man_t *p, int i)
 
static int Faig_ObjLiToLo (Faig_Man_t *p, int i)
 
static int Faig_NodeChild0 (Faig_Man_t *p, int n)
 
static int Faig_NodeChild1 (Faig_Man_t *p, int n)
 
static int Faig_CoChild0 (Faig_Man_t *p, int n)
 
static int Faig_ObjFaninC (int iFan)
 
static int Faig_ObjFanin (int iFan)
 
int Faig_ManIsCorrect (Aig_Man_t *pAig)
 FUNCTION DEFINITIONS ///. More...
 
Faig_Man_tFaig_ManAlloc (Aig_Man_t *pAig)
 
Faig_Man_tFaig_ManCreate (Aig_Man_t *pAig)
 
static unsigned Faig_SimulateNode (Faig_Man_t *p, int Id, unsigned *pSimInfo)
 
static unsigned Faig_SimulateCo (Faig_Man_t *p, int Id, unsigned *pSimInfo)
 
static unsigned Faig_SimulateRandomShift (unsigned uOld)
 
static unsigned Faig_SimulateTransferShift (unsigned uOld, unsigned uNew)
 
int * Faig_ManSimulateFrames (Faig_Man_t *p, int nFrames, int nPref, int fTrans)
 
float Faig_ManComputeSwitching (int nOnes, int nSimWords)
 
float Faig_ManComputeProbOne (int nOnes, int nSimWords)
 
Vec_Int_tFaig_ManComputeSwitchProbs4 (Aig_Man_t *p, int nFrames, int nPref, int fProbOne)
 
Vec_Int_tSaig_ManComputeSwitchProb3s (Aig_Man_t *p, int nFrames, int nPref, int fProbOne)
 

Typedef Documentation

typedef typedefABC_NAMESPACE_IMPL_START struct Faig_Man_t_ Faig_Man_t

DECLARATIONS ///.

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

FileName [saigSimFast.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Sequential AIG package.]

Synopsis [Fast sequential AIG simulator.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

]

Definition at line 33 of file saigSimFast.c.

Function Documentation

static int Faig_CheckIdCo ( Faig_Man_t p,
int  i 
)
inlinestatic

Definition at line 59 of file saigSimFast.c.

59 { return i >= p->nCisNos1 && i < p->nObjs; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Faig_CheckIdLi ( Faig_Man_t p,
int  i 
)
inlinestatic

Definition at line 58 of file saigSimFast.c.

58 { return i >= p->nCisNosPos1 && i < p->nObjs; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Faig_CheckIdLo ( Faig_Man_t p,
int  i 
)
inlinestatic

Definition at line 55 of file saigSimFast.c.

55 { return i >= p->nPis1 && i < p->nCis1; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Faig_CheckIdNo ( Faig_Man_t p,
int  i 
)
inlinestatic

Definition at line 56 of file saigSimFast.c.

56 { return i >= p->nCis1 && i < p->nCisNos1; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Faig_CheckIdObj ( Faig_Man_t p,
int  i 
)
inlinestatic

Definition at line 60 of file saigSimFast.c.

60 { return i >= 0 && i < p->nObjs; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Faig_CheckIdPi ( Faig_Man_t p,
int  i 
)
inlinestatic

Definition at line 54 of file saigSimFast.c.

54 { return i >= 1 && i < p->nPis1; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Faig_CheckIdPo ( Faig_Man_t p,
int  i 
)
inlinestatic

Definition at line 57 of file saigSimFast.c.

57 { return i >= p->nCisNos1 && i < p->nCisNosPos1; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Faig_CoChild0 ( Faig_Man_t p,
int  n 
)
inlinestatic

Definition at line 74 of file saigSimFast.c.

74 { return p->pObjs[(p->nNos<<1)+n]; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Faig_Man_t* Faig_ManAlloc ( Aig_Man_t pAig)

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

Synopsis [Creates fast simulation manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 110 of file saigSimFast.c.

111 {
112  Faig_Man_t * p;
113  int nWords;
114 // assert( Faig_ManIsCorrect(pAig) );
115  nWords = 2 * Aig_ManNodeNum(pAig) + Aig_ManCoNum(pAig);
116  p = (Faig_Man_t *)ABC_ALLOC( char, sizeof(Faig_Man_t) + sizeof(int) * nWords );
117 //printf( "Allocating %7.2f MB.\n", 1.0 * (sizeof(Faig_Man_t) + sizeof(int) * nWords)/(1<<20) );
118  memset( p, 0, sizeof(Faig_Man_t) );
119  p->nPis = Aig_ManCiNum(pAig) - Aig_ManRegNum(pAig);
120  p->nPos = Aig_ManCoNum(pAig) - Aig_ManRegNum(pAig);
121  p->nCis = Aig_ManCiNum(pAig);
122  p->nCos = Aig_ManCoNum(pAig);
123  p->nFfs = Aig_ManRegNum(pAig);
124  p->nNos = Aig_ManNodeNum(pAig);
125  // offsets
126  p->nPis1 = p->nPis + 1;
127  p->nCis1 = p->nCis + 1;
128  p->nCisNos1 = p->nCis + p->nNos + 1;
129  p->nCisNosPos1 = p->nCis + p->nNos + p->nPos + 1;
130  p->nObjs = p->nCis + p->nNos + p->nCos + 1;
131  p->nWords = nWords;
132  return p;
133 }
char * memset()
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Faig_Man_t_ Faig_Man_t
DECLARATIONS ///.
Definition: saigSimFast.c:33
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
int nWords
Definition: abcNpn.c:127
static int Aig_ManNodeNum(Aig_Man_t *p)
Definition: aig.h:256
static int Aig_ManCoNum(Aig_Man_t *p)
Definition: aig.h:252
static int Aig_ManCiNum(Aig_Man_t *p)
Definition: aig.h:251
static int Aig_ManRegNum(Aig_Man_t *p)
Definition: aig.h:260
float Faig_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 327 of file saigSimFast.c.

328 {
329  int nTotal = 32 * nSimWords;
330  return (float)nOnes / nTotal;
331 }
int nTotal
DECLARATIONS ///.
Definition: cutTruth.c:37
float Faig_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 310 of file saigSimFast.c.

311 {
312  int nTotal = 32 * nSimWords;
313  return (float)2.0 * nOnes / nTotal * (nTotal - nOnes) / nTotal;
314 }
int nTotal
DECLARATIONS ///.
Definition: cutTruth.c:37
Vec_Int_t* Faig_ManComputeSwitchProbs4 ( Aig_Man_t p,
int  nFrames,
int  nPref,
int  fProbOne 
)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 344 of file saigSimFast.c.

345 {
346  int fTrans = 1;
347  Faig_Man_t * pAig;
348  Vec_Int_t * vSwitching;
349  int * pProbs;
350  float * pSwitching;
351  int nFramesReal;
352  abctime clk;//, clkTotal = Abc_Clock();
353  if ( fProbOne )
354  fTrans = 0;
355  vSwitching = Vec_IntStart( Aig_ManObjNumMax(p) );
356  pSwitching = (float *)vSwitching->pArray;
357 clk = Abc_Clock();
358  pAig = Faig_ManCreate( p );
359 //ABC_PRT( "\nCreation ", Abc_Clock() - clk );
360  Aig_ManRandom( 1 );
361  // get the number of frames to simulate
362  // if the parameter "seqsimframes" is defined, use it
363  // otherwise, use the given number of frames "nFrames"
364  nFramesReal = nFrames;
365  if ( Abc_FrameReadFlag("seqsimframes") )
366  nFramesReal = atoi( Abc_FrameReadFlag("seqsimframes") );
367  if ( nFramesReal <= nPref )
368  {
369  printf( "The total number of frames (%d) should exceed prefix (%d).\n", nFramesReal, nPref );
370  printf( "Setting the total number of frames to be %d.\n", nFrames );
371  nFramesReal = nFrames;
372  }
373 //printf( "Simulating %d frames.\n", nFramesReal );
374 clk = Abc_Clock();
375  pProbs = Faig_ManSimulateFrames( pAig, nFramesReal, nPref, fTrans );
376 //ABC_PRT( "Simulation", Abc_Clock() - clk );
377 clk = Abc_Clock();
378  if ( fTrans )
379  {
380  Aig_Obj_t * pObj;
381  int i, Counter = 0;
382  pObj = Aig_ManConst1(p);
383  pSwitching[pObj->Id] = Faig_ManComputeProbOne( pProbs[Counter++], (nFramesReal - nPref)/2 );
384  Aig_ManForEachCi( p, pObj, i )
385  pSwitching[pObj->Id] = Faig_ManComputeProbOne( pProbs[Counter++], (nFramesReal - nPref)/2 );
386  Aig_ManForEachNode( p, pObj, i )
387  pSwitching[pObj->Id] = Faig_ManComputeProbOne( pProbs[Counter++], (nFramesReal - nPref)/2 );
388  Aig_ManForEachCo( p, pObj, i )
389  pSwitching[pObj->Id] = Faig_ManComputeProbOne( pProbs[Counter++], (nFramesReal - nPref)/2 );
390  assert( Counter == pAig->nObjs );
391  }
392  else if ( fProbOne )
393  {
394  Aig_Obj_t * pObj;
395  int i, Counter = 0;
396  pObj = Aig_ManConst1(p);
397  pSwitching[pObj->Id] = Faig_ManComputeProbOne( pProbs[Counter++], nFramesReal - nPref );
398  Aig_ManForEachCi( p, pObj, i )
399  pSwitching[pObj->Id] = Faig_ManComputeProbOne( pProbs[Counter++], nFramesReal - nPref );
400  Aig_ManForEachNode( p, pObj, i )
401  pSwitching[pObj->Id] = Faig_ManComputeProbOne( pProbs[Counter++], nFramesReal - nPref );
402  Aig_ManForEachCo( p, pObj, i )
403  pSwitching[pObj->Id] = Faig_ManComputeProbOne( pProbs[Counter++], nFramesReal - nPref );
404  assert( Counter == pAig->nObjs );
405  }
406  else
407  {
408  Aig_Obj_t * pObj;
409  int i, Counter = 0;
410  pObj = Aig_ManConst1(p);
411  pSwitching[pObj->Id] = Faig_ManComputeSwitching( pProbs[Counter++], nFramesReal - nPref );
412  Aig_ManForEachCi( p, pObj, i )
413  pSwitching[pObj->Id] = Faig_ManComputeSwitching( pProbs[Counter++], nFramesReal - nPref );
414  Aig_ManForEachNode( p, pObj, i )
415  pSwitching[pObj->Id] = Faig_ManComputeSwitching( pProbs[Counter++], nFramesReal - nPref );
416  Aig_ManForEachCo( p, pObj, i )
417  pSwitching[pObj->Id] = Faig_ManComputeSwitching( pProbs[Counter++], nFramesReal - nPref );
418  assert( Counter == pAig->nObjs );
419  }
420  ABC_FREE( pProbs );
421  ABC_FREE( pAig );
422 //ABC_PRT( "Switch ", Abc_Clock() - clk );
423 //ABC_PRT( "TOTAL ", Abc_Clock() - clkTotal );
424  return vSwitching;
425 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
float Faig_ManComputeSwitching(int nOnes, int nSimWords)
Definition: saigSimFast.c:310
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
typedefABC_NAMESPACE_IMPL_START struct Faig_Man_t_ Faig_Man_t
DECLARATIONS ///.
Definition: saigSimFast.c:33
float Faig_ManComputeProbOne(int nOnes, int nSimWords)
Definition: saigSimFast.c:327
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
Definition: aig.h:393
#define Aig_ManForEachCo(p, pObj, i)
Definition: aig.h:398
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
#define Aig_ManForEachNode(p, pObj, i)
Definition: aig.h:413
if(last==0)
Definition: sparse_int.h:34
else
Definition: sparse_int.h:55
Definition: aig.h:69
static int Counter
static int Aig_ManObjNumMax(Aig_Man_t *p)
Definition: aig.h:259
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
Definition: aig.h:264
#define ABC_FREE(obj)
Definition: abc_global.h:232
#define assert(ex)
Definition: util_old.h:213
ABC_DLL char * Abc_FrameReadFlag(char *pFlag)
Definition: mainFrame.c:64
ABC_INT64_T abctime
Definition: abc_global.h:278
Faig_Man_t * Faig_ManCreate(Aig_Man_t *pAig)
Definition: saigSimFast.c:146
int Id
Definition: aig.h:85
int * Faig_ManSimulateFrames(Faig_Man_t *p, int nFrames, int nPref, int fTrans)
Definition: saigSimFast.c:253
Faig_Man_t* Faig_ManCreate ( Aig_Man_t pAig)

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

Synopsis [Creates fast simulation manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 146 of file saigSimFast.c.

147 {
148  Faig_Man_t * p;
149  Aig_Obj_t * pObj;
150  int i, iWord = 0;
151  p = Faig_ManAlloc( pAig );
152  Aig_ManForEachNode( pAig, pObj, i )
153  {
154  p->pObjs[iWord++] = (Aig_ObjFaninId0(pObj) << 1) | Aig_ObjFaninC0(pObj);
155  p->pObjs[iWord++] = (Aig_ObjFaninId1(pObj) << 1) | Aig_ObjFaninC1(pObj);
156  }
157  Aig_ManForEachCo( pAig, pObj, i )
158  p->pObjs[iWord++] = (Aig_ObjFaninId0(pObj) << 1) | Aig_ObjFaninC0(pObj);
159  assert( iWord == p->nWords );
160  return p;
161 }
static int Aig_ObjFaninId0(Aig_Obj_t *pObj)
Definition: aig.h:304
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Faig_Man_t_ Faig_Man_t
DECLARATIONS ///.
Definition: saigSimFast.c:33
#define Aig_ManForEachCo(p, pObj, i)
Definition: aig.h:398
static int Aig_ObjFaninId1(Aig_Obj_t *pObj)
Definition: aig.h:305
int nWords
Definition: abcNpn.c:127
#define Aig_ManForEachNode(p, pObj, i)
Definition: aig.h:413
Faig_Man_t * Faig_ManAlloc(Aig_Man_t *pAig)
Definition: saigSimFast.c:110
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
#define assert(ex)
Definition: util_old.h:213
int Faig_ManIsCorrect ( Aig_Man_t pAig)

FUNCTION DEFINITIONS ///.

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

Synopsis [Checks if the manager is correct.]

Description []

SideEffects []

SeeAlso []

Definition at line 93 of file saigSimFast.c.

94 {
95  return Aig_ManObjNumMax(pAig) ==
96  1 + Aig_ManCiNum(pAig) + Aig_ManNodeNum(pAig) + Aig_ManCoNum(pAig);
97 }
static int Aig_ManNodeNum(Aig_Man_t *p)
Definition: aig.h:256
static int Aig_ManCoNum(Aig_Man_t *p)
Definition: aig.h:252
static int Aig_ManCiNum(Aig_Man_t *p)
Definition: aig.h:251
static int Aig_ManObjNumMax(Aig_Man_t *p)
Definition: aig.h:259
int* Faig_ManSimulateFrames ( Faig_Man_t p,
int  nFrames,
int  nPref,
int  fTrans 
)

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

Synopsis [Simulates the timeframes.]

Description []

SideEffects []

SeeAlso []

Definition at line 253 of file saigSimFast.c.

254 {
255  int * pNumOnes = ABC_CALLOC( int, p->nObjs );
256  unsigned * pSimInfo = ABC_ALLOC( unsigned, p->nObjs );
257  int f, i;
258 //printf( "Allocating %7.2f MB.\n", 1.0 * 4 * p->nObjs/(1<<20) );
259 //printf( "Allocating %7.2f MB.\n", 1.0 * 4 * p->nObjs/(1<<20) );
260  // set constant 1
261  pSimInfo[0] = ~0;
262  for ( f = 0; f < nFrames; f++ )
263  {
264  if ( fTrans )
265  {
266  for ( i = 1; i < p->nPis1; i++ )
267  pSimInfo[i] = f? Faig_SimulateRandomShift( pSimInfo[i] ) : Aig_ManRandom( 0 );
268  for ( ; i < p->nCis1; i++ )
269  pSimInfo[i] = f? Faig_SimulateTransferShift( pSimInfo[i], pSimInfo[Faig_ObjLoToLi(p,i)] ) : 0;
270  }
271  else
272  {
273  for ( i = 1; i < p->nPis1; i++ )
274  pSimInfo[i] = Aig_ManRandom( 0 );
275  for ( ; i < p->nCis1; i++ )
276  pSimInfo[i] = f? pSimInfo[Faig_ObjLoToLi(p,i)] : 0;
277  }
278  for ( ; i < p->nCisNos1; i++ )
279  pSimInfo[i] = Faig_SimulateNode( p, i, pSimInfo );
280  for ( ; i < p->nObjs; i++ )
281  pSimInfo[i] = Faig_SimulateCo( p, i, pSimInfo );
282  if ( f < nPref )
283  continue;
284  if ( fTrans )
285  {
286  for ( i = 0; i < p->nObjs; i++ )
287  pNumOnes[i] += Aig_WordCountOnes( (pSimInfo[i] ^ (pSimInfo[i] >> 16)) & 0xffff );
288  }
289  else
290  {
291  for ( i = 0; i < p->nObjs; i++ )
292  pNumOnes[i] += Aig_WordCountOnes( pSimInfo[i] );
293  }
294  }
295  ABC_FREE( pSimInfo );
296  return pNumOnes;
297 }
static unsigned Faig_SimulateTransferShift(unsigned uOld, unsigned uNew)
Definition: saigSimFast.c:237
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Faig_ObjLoToLi(Faig_Man_t *p, int i)
Definition: saigSimFast.c:69
static unsigned Faig_SimulateCo(Faig_Man_t *p, int Id, unsigned *pSimInfo)
Definition: saigSimFast.c:200
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
unsigned Aig_ManRandom(int fReset)
Definition: aigUtil.c:1157
static int Aig_WordCountOnes(unsigned uWord)
Definition: aig.h:229
static unsigned Faig_SimulateRandomShift(unsigned uOld)
Definition: saigSimFast.c:221
#define ABC_FREE(obj)
Definition: abc_global.h:232
#define ABC_CALLOC(type, num)
Definition: abc_global.h:230
static unsigned Faig_SimulateNode(Faig_Man_t *p, int Id, unsigned *pSimInfo)
Definition: saigSimFast.c:174
static int Faig_NodeChild0 ( Faig_Man_t p,
int  n 
)
inlinestatic

Definition at line 72 of file saigSimFast.c.

72 { return p->pObjs[n<<1]; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Faig_NodeChild1 ( Faig_Man_t p,
int  n 
)
inlinestatic

Definition at line 73 of file saigSimFast.c.

73 { return p->pObjs[(n<<1)+1]; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Faig_ObjFanin ( int  iFan)
inlinestatic

Definition at line 76 of file saigSimFast.c.

76 { return iFan >> 1; }
static int Faig_ObjFaninC ( int  iFan)
inlinestatic

Definition at line 75 of file saigSimFast.c.

75 { return iFan & 1; }
static int Faig_ObjIdToNumCo ( Faig_Man_t p,
int  i 
)
inlinestatic

Definition at line 67 of file saigSimFast.c.

67 { assert( Faig_CheckIdCo(p,i) ); return i - p->nCisNos1; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define assert(ex)
Definition: util_old.h:213
static int Faig_CheckIdCo(Faig_Man_t *p, int i)
Definition: saigSimFast.c:59
static int Faig_ObjIdToNumLi ( Faig_Man_t p,
int  i 
)
inlinestatic

Definition at line 66 of file saigSimFast.c.

66 { assert( Faig_CheckIdLi(p,i) ); return i - p->nCisNosPos1; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Faig_CheckIdLi(Faig_Man_t *p, int i)
Definition: saigSimFast.c:58
#define assert(ex)
Definition: util_old.h:213
static int Faig_ObjIdToNumLo ( Faig_Man_t p,
int  i 
)
inlinestatic

Definition at line 63 of file saigSimFast.c.

63 { assert( Faig_CheckIdLo(p,i) ); return i - p->nPis1; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Faig_CheckIdLo(Faig_Man_t *p, int i)
Definition: saigSimFast.c:55
#define assert(ex)
Definition: util_old.h:213
static int Faig_ObjIdToNumNo ( Faig_Man_t p,
int  i 
)
inlinestatic

Definition at line 64 of file saigSimFast.c.

64 { assert( Faig_CheckIdNo(p,i) ); return i - p->nCis1; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Faig_CheckIdNo(Faig_Man_t *p, int i)
Definition: saigSimFast.c:56
#define assert(ex)
Definition: util_old.h:213
static int Faig_ObjIdToNumPi ( Faig_Man_t p,
int  i 
)
inlinestatic

Definition at line 62 of file saigSimFast.c.

62 { assert( Faig_CheckIdPi(p,i) ); return i - 1; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define assert(ex)
Definition: util_old.h:213
static int Faig_CheckIdPi(Faig_Man_t *p, int i)
Definition: saigSimFast.c:54
static int Faig_ObjIdToNumPo ( Faig_Man_t p,
int  i 
)
inlinestatic

Definition at line 65 of file saigSimFast.c.

65 { assert( Faig_CheckIdPo(p,i) ); return i - p->nCisNos1; }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Faig_CheckIdPo(Faig_Man_t *p, int i)
Definition: saigSimFast.c:57
#define assert(ex)
Definition: util_old.h:213
static int Faig_ObjLiToLo ( Faig_Man_t p,
int  i 
)
inlinestatic

Definition at line 70 of file saigSimFast.c.

70 { assert( Faig_CheckIdLi(p,i) ); return p->nCis1 - (p->nObjs - i); }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Faig_CheckIdLi(Faig_Man_t *p, int i)
Definition: saigSimFast.c:58
#define assert(ex)
Definition: util_old.h:213
static int Faig_ObjLoToLi ( Faig_Man_t p,
int  i 
)
inlinestatic

Definition at line 69 of file saigSimFast.c.

69 { assert( Faig_CheckIdLo(p,i) ); return p->nObjs - (p->nCis1 - i); }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Faig_CheckIdLo(Faig_Man_t *p, int i)
Definition: saigSimFast.c:55
#define assert(ex)
Definition: util_old.h:213
static unsigned Faig_SimulateCo ( Faig_Man_t p,
int  Id,
unsigned *  pSimInfo 
)
inlinestatic

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

Synopsis [Simulates one node.]

Description []

SideEffects []

SeeAlso []

Definition at line 200 of file saigSimFast.c.

201 {
202  int n = Faig_ObjIdToNumCo( p, Id );
203  int iFan0 = Faig_CoChild0( p, n );
204  if ( Faig_ObjFaninC(iFan0) )
205  return ~pSimInfo[Faig_ObjFanin(iFan0)];
206  // if ( !Faig_ObjFaninC(iFan0) )
207  return pSimInfo[Faig_ObjFanin(iFan0)];
208 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Faig_ObjFaninC(int iFan)
Definition: saigSimFast.c:75
static int Faig_ObjIdToNumCo(Faig_Man_t *p, int i)
Definition: saigSimFast.c:67
static int Faig_ObjFanin(int iFan)
Definition: saigSimFast.c:76
static int Faig_CoChild0(Faig_Man_t *p, int n)
Definition: saigSimFast.c:74
static unsigned Faig_SimulateNode ( Faig_Man_t p,
int  Id,
unsigned *  pSimInfo 
)
inlinestatic

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

Synopsis [Simulates one node.]

Description []

SideEffects []

SeeAlso []

Definition at line 174 of file saigSimFast.c.

175 {
176  int n = Faig_ObjIdToNumNo( p, Id );
177  int iFan0 = Faig_NodeChild0( p, n );
178  int iFan1 = Faig_NodeChild1( p, n );
179  if ( Faig_ObjFaninC(iFan0) && Faig_ObjFaninC(iFan1) )
180  return ~(pSimInfo[Faig_ObjFanin(iFan0)] | pSimInfo[Faig_ObjFanin(iFan1)]);
181  if ( Faig_ObjFaninC(iFan0) && !Faig_ObjFaninC(iFan1) )
182  return (~pSimInfo[Faig_ObjFanin(iFan0)] & pSimInfo[Faig_ObjFanin(iFan1)]);
183  if ( !Faig_ObjFaninC(iFan0) && Faig_ObjFaninC(iFan1) )
184  return (pSimInfo[Faig_ObjFanin(iFan0)] & ~pSimInfo[Faig_ObjFanin(iFan1)]);
185  // if ( !Faig_ObjFaninC(iFan0) && !Faig_ObjFaninC(iFan1) )
186  return (pSimInfo[Faig_ObjFanin(iFan0)] & pSimInfo[Faig_ObjFanin(iFan1)]);
187 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Faig_ObjFaninC(int iFan)
Definition: saigSimFast.c:75
static int Faig_NodeChild0(Faig_Man_t *p, int n)
Definition: saigSimFast.c:72
static int Faig_NodeChild1(Faig_Man_t *p, int n)
Definition: saigSimFast.c:73
static int Faig_ObjIdToNumNo(Faig_Man_t *p, int i)
Definition: saigSimFast.c:64
static int Faig_ObjFanin(int iFan)
Definition: saigSimFast.c:76
static unsigned Faig_SimulateRandomShift ( unsigned  uOld)
inlinestatic

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 221 of file saigSimFast.c.

222 {
223  return (uOld << 16) | ((uOld ^ Aig_ManRandom(0)) & 0xffff);
224 }
unsigned Aig_ManRandom(int fReset)
Definition: aigUtil.c:1157
static unsigned Faig_SimulateTransferShift ( unsigned  uOld,
unsigned  uNew 
)
inlinestatic

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 237 of file saigSimFast.c.

238 {
239  return (uOld << 16) | (uNew & 0xffff);
240 }
Vec_Int_t* Saig_ManComputeSwitchProb3s ( Aig_Man_t p,
int  nFrames,
int  nPref,
int  fProbOne 
)

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

Synopsis [Computes probability of switching (or of being 1).]

Description []

SideEffects []

SeeAlso []

Definition at line 438 of file saigSimFast.c.

439 {
440 // return Faig_ManComputeSwitchProbs( p, nFrames, nPref, fProbOne );
441  return NULL;
442 }