ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
simUtils.c File Reference
#include "base/abc/abc.h"
#include "sim.h"
Include dependency graph for simUtils.c:

Go to the source code of this file.

Functions

Vec_Ptr_tSim_UtilInfoAlloc (int nSize, int nWords, int fClean)
 FUNCTION DEFINITIONS ///.
 
void Sim_UtilInfoFree (Vec_Ptr_t *p)
 
void Sim_UtilInfoAdd (unsigned *pInfo1, unsigned *pInfo2, int nWords)
 
void Sim_UtilInfoDetectDiffs (unsigned *pInfo1, unsigned *pInfo2, int nWords, Vec_Int_t *vDiffs)
 
void Sim_UtilInfoDetectNews (unsigned *pInfo1, unsigned *pInfo2, int nWords, Vec_Int_t *vDiffs)
 
void Sim_UtilInfoFlip (Sim_Man_t *p, Abc_Obj_t *pNode)
 
int Sim_UtilInfoCompare (Sim_Man_t *p, Abc_Obj_t *pNode)
 
void Sim_UtilSimulate (Sim_Man_t *p, int fType)
 
void Sim_UtilSimulateNode (Sim_Man_t *p, Abc_Obj_t *pNode, int fType, int fType1, int fType2)
 
void Sim_UtilSimulateNodeOne (Abc_Obj_t *pNode, Vec_Ptr_t *vSimInfo, int nSimWords, int nOffset)
 
void Sim_UtilTransferNodeOne (Abc_Obj_t *pNode, Vec_Ptr_t *vSimInfo, int nSimWords, int nOffset, int fShift)
 
int Sim_UtilCountSuppSizes (Sim_Man_t *p, int fStruct)
 
int Sim_UtilCountOnes (unsigned *pSimInfo, int nSimWords)
 
Vec_Int_tSim_UtilCountOnesArray (Vec_Ptr_t *vInfo, int nSimWords)
 
void Sim_UtilSetRandom (unsigned *pPatRand, int nSimWords)
 
void Sim_UtilSetCompl (unsigned *pPatRand, int nSimWords)
 
void Sim_UtilSetConst (unsigned *pPatRand, int nSimWords, int fConst1)
 
int Sim_UtilInfoIsEqual (unsigned *pPats1, unsigned *pPats2, int nSimWords)
 
int Sim_UtilInfoIsImp (unsigned *pPats1, unsigned *pPats2, int nSimWords)
 
int Sim_UtilInfoIsClause (unsigned *pPats1, unsigned *pPats2, int nSimWords)
 
int Sim_UtilCountAllPairs (Vec_Ptr_t *vSuppFun, int nSimWords, Vec_Int_t *vCounters)
 
int Sim_UtilCountPairsOne (Extra_BitMat_t *pMat, Vec_Int_t *vSupport)
 
int Sim_UtilCountPairsOnePrint (Extra_BitMat_t *pMat, Vec_Int_t *vSupport)
 
void Sim_UtilCountPairsAllPrint (Sym_Man_t *p)
 
void Sim_UtilCountPairsAll (Sym_Man_t *p)
 
int Sim_UtilMatrsAreDisjoint (Sym_Man_t *p)
 

Function Documentation

◆ Sim_UtilCountAllPairs()

int Sim_UtilCountAllPairs ( Vec_Ptr_t * vSuppFun,
int nSimWords,
Vec_Int_t * vCounters )

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

Synopsis [Counts the total number of pairs.]

Description []

SideEffects []

SeeAlso []

Definition at line 564 of file simUtils.c.

565{
566 unsigned * pSupp;
567 int Counter, nOnes, nPairs, i;
568 Counter = 0;
569 Vec_PtrForEachEntry( unsigned *, vSuppFun, pSupp, i )
570 {
571 nOnes = Sim_UtilCountOnes( pSupp, nSimWords );
572 nPairs = nOnes * (nOnes - 1) / 2;
573 Vec_IntWriteEntry( vCounters, i, nPairs );
574 Counter += nPairs;
575 }
576 return Counter;
577}
int Sim_UtilCountOnes(unsigned *pSimInfo, int nSimWords)
Definition simUtils.c:403
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition vecPtr.h:55
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Sim_UtilCountOnes()

int Sim_UtilCountOnes ( unsigned * pSimInfo,
int nSimWords )

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

Synopsis [Counts the number of 1's in the bitstring.]

Description []

SideEffects []

SeeAlso []

Definition at line 403 of file simUtils.c.

404{
405 unsigned char * pBytes;
406 int nOnes, nBytes, i;
407 pBytes = (unsigned char *)pSimInfo;
408 nBytes = 4 * nSimWords;
409 nOnes = 0;
410 for ( i = 0; i < nBytes; i++ )
411 nOnes += bit_count[ pBytes[i] ];
412 return nOnes;
413}
Here is the caller graph for this function:

◆ Sim_UtilCountOnesArray()

Vec_Int_t * Sim_UtilCountOnesArray ( Vec_Ptr_t * vInfo,
int nSimWords )

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

Synopsis [Counts the number of 1's in the bitstring.]

Description []

SideEffects []

SeeAlso []

Definition at line 426 of file simUtils.c.

427{
428 Vec_Int_t * vCounters;
429 unsigned * pSimInfo;
430 int i;
431 vCounters = Vec_IntStart( Vec_PtrSize(vInfo) );
432 Vec_PtrForEachEntry( unsigned *, vInfo, pSimInfo, i )
433 Vec_IntWriteEntry( vCounters, i, Sim_UtilCountOnes(pSimInfo, nSimWords) );
434 return vCounters;
435}
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
Here is the call graph for this function:

◆ Sim_UtilCountPairsAll()

void Sim_UtilCountPairsAll ( Sym_Man_t * p)

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

Synopsis [Counts the number of entries in the array of matrices.]

Description []

SideEffects []

SeeAlso []

Definition at line 660 of file simUtils.c.

661{
662 int nPairsTotal, nPairsSym, nPairsNonSym, i;
663 abctime clk;
664clk = Abc_Clock();
665 p->nPairsSymm = 0;
666 p->nPairsNonSymm = 0;
667 for ( i = 0; i < p->nOutputs; i++ )
668 {
669 nPairsTotal = Vec_IntEntry(p->vPairsTotal, i);
670 nPairsSym = Vec_IntEntry(p->vPairsSym, i);
671 nPairsNonSym = Vec_IntEntry(p->vPairsNonSym,i);
672 assert( nPairsTotal >= nPairsSym + nPairsNonSym );
673 if ( nPairsTotal == nPairsSym + nPairsNonSym )
674 {
675 p->nPairsSymm += nPairsSym;
676 p->nPairsNonSymm += nPairsNonSym;
677 continue;
678 }
679 nPairsSym = Sim_UtilCountPairsOne( (Extra_BitMat_t *)Vec_PtrEntry(p->vMatrSymms, i), Vec_VecEntryInt(p->vSupports, i) );
680 nPairsNonSym = Sim_UtilCountPairsOne( (Extra_BitMat_t *)Vec_PtrEntry(p->vMatrNonSymms,i), Vec_VecEntryInt(p->vSupports, i) );
681 assert( nPairsTotal >= nPairsSym + nPairsNonSym );
682 Vec_IntWriteEntry( p->vPairsSym, i, nPairsSym );
683 Vec_IntWriteEntry( p->vPairsNonSym, i, nPairsNonSym );
684 p->nPairsSymm += nPairsSym;
685 p->nPairsNonSymm += nPairsNonSym;
686// printf( "%d ", nPairsTotal - nPairsSym - nPairsNonSym );
687 }
688//printf( "\n" );
689 p->nPairsRem = p->nPairsTotal-p->nPairsSymm-p->nPairsNonSymm;
690p->timeCount += Abc_Clock() - clk;
691}
ABC_INT64_T abctime
Definition abc_global.h:332
Cube * p
Definition exorList.c:222
struct Extra_BitMat_t_ Extra_BitMat_t
Definition extra.h:81
int Sim_UtilCountPairsOne(Extra_BitMat_t *pMat, Vec_Int_t *vSupport)
Definition simUtils.c:590
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Sim_UtilCountPairsAllPrint()

void Sim_UtilCountPairsAllPrint ( Sym_Man_t * p)

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

Synopsis [Counts the number of entries in the array of matrices.]

Description []

SideEffects []

SeeAlso []

Definition at line 635 of file simUtils.c.

636{
637 int i;
638 abctime clk;
639clk = Abc_Clock();
640 for ( i = 0; i < p->nOutputs; i++ )
641 {
642 printf( "Output %2d :", i );
643 Sim_UtilCountPairsOnePrint( (Extra_BitMat_t *)Vec_PtrEntry(p->vMatrSymms, i), Vec_VecEntryInt(p->vSupports, i) );
644 printf( "\n" );
645 }
646p->timeCount += Abc_Clock() - clk;
647}
int Sim_UtilCountPairsOnePrint(Extra_BitMat_t *pMat, Vec_Int_t *vSupport)
Definition simUtils.c:614
Here is the call graph for this function:

◆ Sim_UtilCountPairsOne()

int Sim_UtilCountPairsOne ( Extra_BitMat_t * pMat,
Vec_Int_t * vSupport )

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

Synopsis [Counts the number of entries in the array of matrices.]

Description []

SideEffects []

SeeAlso []

Definition at line 590 of file simUtils.c.

591{
592 int i, k, Index1, Index2;
593 int Counter = 0;
594// int Counter2;
595 Vec_IntForEachEntry( vSupport, i, Index1 )
596 Vec_IntForEachEntryStart( vSupport, k, Index2, Index1+1 )
597 Counter += Extra_BitMatrixLookup1( pMat, i, k );
598// Counter2 = Extra_BitMatrixCountOnesUpper(pMat);
599// assert( Counter == Counter2 );
600 return Counter;
601}
int Extra_BitMatrixLookup1(Extra_BitMat_t *p, int i, int k)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition vecInt.h:54
#define Vec_IntForEachEntryStart(vVec, Entry, i, Start)
Definition vecInt.h:56
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Sim_UtilCountPairsOnePrint()

int Sim_UtilCountPairsOnePrint ( Extra_BitMat_t * pMat,
Vec_Int_t * vSupport )

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

Synopsis [Counts the number of entries in the array of matrices.]

Description []

SideEffects []

SeeAlso []

Definition at line 614 of file simUtils.c.

615{
616 int i, k, Index1, Index2;
617 Vec_IntForEachEntry( vSupport, i, Index1 )
618 Vec_IntForEachEntryStart( vSupport, k, Index2, Index1+1 )
619 if ( Extra_BitMatrixLookup1( pMat, i, k ) )
620 printf( "(%d,%d) ", i, k );
621 return 0;
622}
if(last==0)
Definition sparse_int.h:34
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Sim_UtilCountSuppSizes()

int Sim_UtilCountSuppSizes ( Sim_Man_t * p,
int fStruct )

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

Synopsis [Returns 1 if the simulation infos are equal.]

Description []

SideEffects []

SeeAlso []

Definition at line 372 of file simUtils.c.

373{
374 Abc_Obj_t * pNode, * pNodeCi;
375 int i, v, Counter;
376 Counter = 0;
377 if ( fStruct )
378 {
379 Abc_NtkForEachCo( p->pNtk, pNode, i )
380 Abc_NtkForEachCi( p->pNtk, pNodeCi, v )
381 Counter += Sim_SuppStrHasVar( p->vSuppStr, pNode, v );
382 }
383 else
384 {
385 Abc_NtkForEachCo( p->pNtk, pNode, i )
386 Abc_NtkForEachCi( p->pNtk, pNodeCi, v )
387 Counter += Sim_SuppFunHasVar( p->vSuppFun, i, v );
388 }
389 return Counter;
390}
struct Abc_Obj_t_ Abc_Obj_t
Definition abc.h:116
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition abc.h:522
#define Abc_NtkForEachCi(pNtk, pCi, i)
Definition abc.h:518
#define Sim_SuppFunHasVar(vSupps, Output, v)
Definition sim.h:169
#define Sim_SuppStrHasVar(vSupps, pNode, v)
Definition sim.h:167
Here is the caller graph for this function:

◆ Sim_UtilInfoAdd()

void Sim_UtilInfoAdd ( unsigned * pInfo1,
unsigned * pInfo2,
int nWords )

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

Synopsis [Adds the second supp-info the first.]

Description []

SideEffects []

SeeAlso []

Definition at line 101 of file simUtils.c.

102{
103 int w;
104 for ( w = 0; w < nWords; w++ )
105 pInfo1[w] |= pInfo2[w];
106}
int nWords
Definition abcNpn.c:127

◆ Sim_UtilInfoAlloc()

Vec_Ptr_t * Sim_UtilInfoAlloc ( int nSize,
int nWords,
int fClean )

FUNCTION DEFINITIONS ///.

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

Synopsis [Allocates simulation information for all nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 57 of file simUtils.c.

58{
59 Vec_Ptr_t * vInfo;
60 int i;
61 assert( nSize > 0 && nWords > 0 );
62 vInfo = Vec_PtrAlloc( nSize );
63 vInfo->pArray[0] = ABC_ALLOC( unsigned, (long)nSize * (long)nWords );
64 assert( vInfo->pArray[0]);
65 if ( fClean )
66 memset( vInfo->pArray[0], 0, sizeof(unsigned) * nSize * nWords );
67 for ( i = 1; i < nSize; i++ )
68 vInfo->pArray[i] = ((unsigned *)vInfo->pArray[i-1]) + nWords;
69 vInfo->nSize = nSize;
70 return vInfo;
71}
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
char * memset()
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Sim_UtilInfoCompare()

int Sim_UtilInfoCompare ( Sim_Man_t * p,
Abc_Obj_t * pNode )

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

Synopsis [Returns 1 if the simulation infos are equal.]

Description []

SideEffects []

SeeAlso []

Definition at line 186 of file simUtils.c.

187{
188 unsigned * pSimInfo1, * pSimInfo2;
189 int k;
190 pSimInfo1 = (unsigned *)p->vSim0->pArray[pNode->Id];
191 pSimInfo2 = (unsigned *)p->vSim1->pArray[pNode->Id];
192 for ( k = 0; k < p->nSimWords; k++ )
193 if ( pSimInfo2[k] != pSimInfo1[k] )
194 return 0;
195 return 1;
196}
int Id
Definition abc.h:132

◆ Sim_UtilInfoDetectDiffs()

void Sim_UtilInfoDetectDiffs ( unsigned * pInfo1,
unsigned * pInfo2,
int nWords,
Vec_Int_t * vDiffs )

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

Synopsis [Returns the positions where pInfo2 is 1 while pInfo1 is 0.]

Description []

SideEffects []

SeeAlso []

Definition at line 119 of file simUtils.c.

120{
121 int w, b;
122 unsigned uMask;
123 vDiffs->nSize = 0;
124 for ( w = 0; w < nWords; w++ )
125 if ( (uMask = (pInfo2[w] ^ pInfo1[w])) )
126 for ( b = 0; b < 32; b++ )
127 if ( uMask & (1 << b) )
128 Vec_IntPush( vDiffs, 32*w + b );
129}

◆ Sim_UtilInfoDetectNews()

void Sim_UtilInfoDetectNews ( unsigned * pInfo1,
unsigned * pInfo2,
int nWords,
Vec_Int_t * vDiffs )

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

Synopsis [Returns the positions where pInfo2 is 1 while pInfo1 is 0.]

Description []

SideEffects []

SeeAlso []

Definition at line 142 of file simUtils.c.

143{
144 int w, b;
145 unsigned uMask;
146 vDiffs->nSize = 0;
147 for ( w = 0; w < nWords; w++ )
148 if ( (uMask = (pInfo2[w] & ~pInfo1[w])) )
149 for ( b = 0; b < 32; b++ )
150 if ( uMask & (1 << b) )
151 Vec_IntPush( vDiffs, 32*w + b );
152}

◆ Sim_UtilInfoFlip()

void Sim_UtilInfoFlip ( Sim_Man_t * p,
Abc_Obj_t * pNode )

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

Synopsis [Flips the simulation info of the node.]

Description []

SideEffects []

SeeAlso []

Definition at line 165 of file simUtils.c.

166{
167 unsigned * pSimInfo1, * pSimInfo2;
168 int k;
169 pSimInfo1 = (unsigned *)p->vSim0->pArray[pNode->Id];
170 pSimInfo2 = (unsigned *)p->vSim1->pArray[pNode->Id];
171 for ( k = 0; k < p->nSimWords; k++ )
172 pSimInfo2[k] = ~pSimInfo1[k];
173}

◆ Sim_UtilInfoFree()

void Sim_UtilInfoFree ( Vec_Ptr_t * p)

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

Synopsis [Allocates simulation information for all nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 84 of file simUtils.c.

85{
86 ABC_FREE( p->pArray[0] );
87 Vec_PtrFree( p );
88}
#define ABC_FREE(obj)
Definition abc_global.h:267
Here is the caller graph for this function:

◆ Sim_UtilInfoIsClause()

int Sim_UtilInfoIsClause ( unsigned * pPats1,
unsigned * pPats2,
int nSimWords )

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

Synopsis [Returns 1 if Node1 v Node2 is always true.]

Description []

SideEffects []

SeeAlso []

Definition at line 544 of file simUtils.c.

545{
546 int k;
547 for ( k = 0; k < nSimWords; k++ )
548 if ( ~pPats1[k] & ~pPats2[k] )
549 return 0;
550 return 1;
551}

◆ Sim_UtilInfoIsEqual()

int Sim_UtilInfoIsEqual ( unsigned * pPats1,
unsigned * pPats2,
int nSimWords )

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

Synopsis [Returns 1 if equal.]

Description []

SideEffects []

SeeAlso []

Definition at line 504 of file simUtils.c.

505{
506 int k;
507 for ( k = 0; k < nSimWords; k++ )
508 if ( pPats1[k] != pPats2[k] )
509 return 0;
510 return 1;
511}

◆ Sim_UtilInfoIsImp()

int Sim_UtilInfoIsImp ( unsigned * pPats1,
unsigned * pPats2,
int nSimWords )

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

Synopsis [Returns 1 if Node1 implies Node2.]

Description []

SideEffects []

SeeAlso []

Definition at line 524 of file simUtils.c.

525{
526 int k;
527 for ( k = 0; k < nSimWords; k++ )
528 if ( pPats1[k] & ~pPats2[k] )
529 return 0;
530 return 1;
531}

◆ Sim_UtilMatrsAreDisjoint()

int Sim_UtilMatrsAreDisjoint ( Sym_Man_t * p)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 704 of file simUtils.c.

705{
706 int i;
707 for ( i = 0; i < p->nOutputs; i++ )
708 if ( !Extra_BitMatrixIsDisjoint( (Extra_BitMat_t *)Vec_PtrEntry(p->vMatrSymms,i), (Extra_BitMat_t *)Vec_PtrEntry(p->vMatrNonSymms,i) ) )
709 return 0;
710 return 1;
711}
int Extra_BitMatrixIsDisjoint(Extra_BitMat_t *p1, Extra_BitMat_t *p2)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Sim_UtilSetCompl()

void Sim_UtilSetCompl ( unsigned * pPatRand,
int nSimWords )

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

Synopsis [Returns complemented patterns.]

Description []

SideEffects []

SeeAlso []

Definition at line 466 of file simUtils.c.

467{
468 int k;
469 for ( k = 0; k < nSimWords; k++ )
470 pPatRand[k] = ~pPatRand[k];
471}
Here is the caller graph for this function:

◆ Sim_UtilSetConst()

void Sim_UtilSetConst ( unsigned * pPatRand,
int nSimWords,
int fConst1 )

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

Synopsis [Returns constant patterns.]

Description []

SideEffects []

SeeAlso []

Definition at line 484 of file simUtils.c.

485{
486 int k;
487 for ( k = 0; k < nSimWords; k++ )
488 pPatRand[k] = 0;
489 if ( fConst1 )
490 Sim_UtilSetCompl( pPatRand, nSimWords );
491}
void Sim_UtilSetCompl(unsigned *pPatRand, int nSimWords)
Definition simUtils.c:466
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Sim_UtilSetRandom()

void Sim_UtilSetRandom ( unsigned * pPatRand,
int nSimWords )

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

Synopsis [Returns random patterns.]

Description []

SideEffects []

SeeAlso []

Definition at line 448 of file simUtils.c.

449{
450 int k;
451 for ( k = 0; k < nSimWords; k++ )
452 pPatRand[k] = SIM_RANDOM_UNSIGNED;
453}
#define SIM_RANDOM_UNSIGNED
Definition sim.h:158
Here is the caller graph for this function:

◆ Sim_UtilSimulate()

void Sim_UtilSimulate ( Sim_Man_t * p,
int fType )

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

Synopsis [Simulates the internal nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 209 of file simUtils.c.

210{
211 Abc_Obj_t * pNode;
212 int i;
213 // simulate the internal nodes
214 Abc_NtkForEachNode( p->pNtk, pNode, i )
215 Sim_UtilSimulateNode( p, pNode, fType, fType, fType );
216 // assign simulation info of the CO nodes
217 Abc_NtkForEachCo( p->pNtk, pNode, i )
218 Sim_UtilSimulateNode( p, pNode, fType, fType, fType );
219}
#define Abc_NtkForEachNode(pNtk, pNode, i)
Definition abc.h:464
void Sim_UtilSimulateNode(Sim_Man_t *p, Abc_Obj_t *pNode, int fType, int fType1, int fType2)
Definition simUtils.c:232
Here is the call graph for this function:

◆ Sim_UtilSimulateNode()

void Sim_UtilSimulateNode ( Sim_Man_t * p,
Abc_Obj_t * pNode,
int fType,
int fType1,
int fType2 )

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

Synopsis [Simulates one node.]

Description []

SideEffects []

SeeAlso []

Definition at line 232 of file simUtils.c.

233{
234 unsigned * pSimmNode, * pSimmNode1, * pSimmNode2;
235 int k, fComp1, fComp2;
236 // simulate the internal nodes
237 if ( Abc_ObjIsNode(pNode) )
238 {
239 if ( fType )
240 pSimmNode = (unsigned *)p->vSim1->pArray[ pNode->Id ];
241 else
242 pSimmNode = (unsigned *)p->vSim0->pArray[ pNode->Id ];
243
244 if ( fType1 )
245 pSimmNode1 = (unsigned *)p->vSim1->pArray[ Abc_ObjFaninId0(pNode) ];
246 else
247 pSimmNode1 = (unsigned *)p->vSim0->pArray[ Abc_ObjFaninId0(pNode) ];
248
249 if ( fType2 )
250 pSimmNode2 = (unsigned *)p->vSim1->pArray[ Abc_ObjFaninId1(pNode) ];
251 else
252 pSimmNode2 = (unsigned *)p->vSim0->pArray[ Abc_ObjFaninId1(pNode) ];
253
254 fComp1 = Abc_ObjFaninC0(pNode);
255 fComp2 = Abc_ObjFaninC1(pNode);
256 if ( fComp1 && fComp2 )
257 for ( k = 0; k < p->nSimWords; k++ )
258 pSimmNode[k] = ~pSimmNode1[k] & ~pSimmNode2[k];
259 else if ( fComp1 && !fComp2 )
260 for ( k = 0; k < p->nSimWords; k++ )
261 pSimmNode[k] = ~pSimmNode1[k] & pSimmNode2[k];
262 else if ( !fComp1 && fComp2 )
263 for ( k = 0; k < p->nSimWords; k++ )
264 pSimmNode[k] = pSimmNode1[k] & ~pSimmNode2[k];
265 else // if ( fComp1 && fComp2 )
266 for ( k = 0; k < p->nSimWords; k++ )
267 pSimmNode[k] = pSimmNode1[k] & pSimmNode2[k];
268 }
269 else
270 {
271 assert( Abc_ObjFaninNum(pNode) == 1 );
272 if ( fType )
273 pSimmNode = (unsigned *)p->vSim1->pArray[ pNode->Id ];
274 else
275 pSimmNode = (unsigned *)p->vSim0->pArray[ pNode->Id ];
276
277 if ( fType1 )
278 pSimmNode1 = (unsigned *)p->vSim1->pArray[ Abc_ObjFaninId0(pNode) ];
279 else
280 pSimmNode1 = (unsigned *)p->vSim0->pArray[ Abc_ObjFaninId0(pNode) ];
281
282 fComp1 = Abc_ObjFaninC0(pNode);
283 if ( fComp1 )
284 for ( k = 0; k < p->nSimWords; k++ )
285 pSimmNode[k] = ~pSimmNode1[k];
286 else
287 for ( k = 0; k < p->nSimWords; k++ )
288 pSimmNode[k] = pSimmNode1[k];
289 }
290}
Here is the caller graph for this function:

◆ Sim_UtilSimulateNodeOne()

void Sim_UtilSimulateNodeOne ( Abc_Obj_t * pNode,
Vec_Ptr_t * vSimInfo,
int nSimWords,
int nOffset )

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

Synopsis [Simulates one node.]

Description []

SideEffects []

SeeAlso []

Definition at line 303 of file simUtils.c.

304{
305 unsigned * pSimmNode, * pSimmNode1, * pSimmNode2;
306 int k, fComp1, fComp2;
307 // simulate the internal nodes
308 assert( Abc_ObjIsNode(pNode) );
309 pSimmNode = (unsigned *)Vec_PtrEntry(vSimInfo, pNode->Id);
310 pSimmNode1 = (unsigned *)Vec_PtrEntry(vSimInfo, Abc_ObjFaninId0(pNode));
311 pSimmNode2 = (unsigned *)Vec_PtrEntry(vSimInfo, Abc_ObjFaninId1(pNode));
312 pSimmNode += nOffset;
313 pSimmNode1 += nOffset;
314 pSimmNode2 += nOffset;
315 fComp1 = Abc_ObjFaninC0(pNode);
316 fComp2 = Abc_ObjFaninC1(pNode);
317 if ( fComp1 && fComp2 )
318 for ( k = 0; k < nSimWords; k++ )
319 pSimmNode[k] = ~pSimmNode1[k] & ~pSimmNode2[k];
320 else if ( fComp1 && !fComp2 )
321 for ( k = 0; k < nSimWords; k++ )
322 pSimmNode[k] = ~pSimmNode1[k] & pSimmNode2[k];
323 else if ( !fComp1 && fComp2 )
324 for ( k = 0; k < nSimWords; k++ )
325 pSimmNode[k] = pSimmNode1[k] & ~pSimmNode2[k];
326 else // if ( fComp1 && fComp2 )
327 for ( k = 0; k < nSimWords; k++ )
328 pSimmNode[k] = pSimmNode1[k] & pSimmNode2[k];
329}
Here is the caller graph for this function:

◆ Sim_UtilTransferNodeOne()

void Sim_UtilTransferNodeOne ( Abc_Obj_t * pNode,
Vec_Ptr_t * vSimInfo,
int nSimWords,
int nOffset,
int fShift )

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

Synopsis [Simulates one node.]

Description []

SideEffects []

SeeAlso []

Definition at line 342 of file simUtils.c.

343{
344 unsigned * pSimmNode, * pSimmNode1;
345 int k, fComp1;
346 // simulate the internal nodes
347 assert( Abc_ObjIsCo(pNode) );
348 pSimmNode = (unsigned *)Vec_PtrEntry(vSimInfo, pNode->Id);
349 pSimmNode1 = (unsigned *)Vec_PtrEntry(vSimInfo, Abc_ObjFaninId0(pNode));
350 pSimmNode += nOffset + (fShift > 0)*nSimWords;
351 pSimmNode1 += nOffset;
352 fComp1 = Abc_ObjFaninC0(pNode);
353 if ( fComp1 )
354 for ( k = 0; k < nSimWords; k++ )
355 pSimmNode[k] = ~pSimmNode1[k];
356 else
357 for ( k = 0; k < nSimWords; k++ )
358 pSimmNode[k] = pSimmNode1[k];
359}