ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
aigTruth.c File Reference
#include "aig.h"
Include dependency graph for aigTruth.c:

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START unsigned * Aig_ManCutTruthOne (Aig_Obj_t *pNode, unsigned *pTruth, int nWords)
 DECLARATIONS ///.
 
unsigned * Aig_ManCutTruth (Aig_Obj_t *pRoot, Vec_Ptr_t *vLeaves, Vec_Ptr_t *vNodes, Vec_Ptr_t *vTruthElem, Vec_Ptr_t *vTruthStore)
 

Function Documentation

◆ Aig_ManCutTruth()

unsigned * Aig_ManCutTruth ( Aig_Obj_t * pRoot,
Vec_Ptr_t * vLeaves,
Vec_Ptr_t * vNodes,
Vec_Ptr_t * vTruthElem,
Vec_Ptr_t * vTruthStore )

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

Synopsis [Computes truth table of the cut.]

Description [The returned pointer should be used immediately.]

SideEffects []

SeeAlso []

Definition at line 80 of file aigTruth.c.

81{
82 Aig_Obj_t * pObj;
83 int i, nWords;
84 assert( Vec_PtrSize(vLeaves) <= Vec_PtrSize(vTruthElem) );
85 assert( Vec_PtrSize(vNodes) <= Vec_PtrSize(vTruthStore) );
86 assert( Vec_PtrSize(vNodes) == 0 || pRoot == Vec_PtrEntryLast(vNodes) );
87 // assign elementary truth tables
88 Vec_PtrForEachEntry( Aig_Obj_t *, vLeaves, pObj, i )
89 pObj->pData = Vec_PtrEntry( vTruthElem, i );
90 // compute truths for other nodes
91 nWords = Abc_TruthWordNum( Vec_PtrSize(vLeaves) );
92 Vec_PtrForEachEntry( Aig_Obj_t *, vNodes, pObj, i )
93 pObj->pData = Aig_ManCutTruthOne( pObj, (unsigned *)Vec_PtrEntry(vTruthStore, i), nWords );
94 return (unsigned *)pRoot->pData;
95}
int nWords
Definition abcNpn.c:127
ABC_NAMESPACE_IMPL_START unsigned * Aig_ManCutTruthOne(Aig_Obj_t *pNode, unsigned *pTruth, int nWords)
DECLARATIONS ///.
Definition aigTruth.c:45
struct Aig_Obj_t_ Aig_Obj_t
Definition aig.h:51
void * pData
Definition aig.h:87
#define assert(ex)
Definition util_old.h:213
#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:

◆ Aig_ManCutTruthOne()

ABC_NAMESPACE_IMPL_START unsigned * Aig_ManCutTruthOne ( Aig_Obj_t * pNode,
unsigned * pTruth,
int nWords )

DECLARATIONS ///.

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

FileName [aigTruth.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [AIG package.]

Synopsis [Computes truth table for the cut.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - April 28, 2007.]

Revision [

Id
aigTruth.c,v 1.00 2007/04/28 00:00:00 alanmi Exp

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

Synopsis [Computes truth table of the cut.]

Description []

SideEffects []

SeeAlso []

Definition at line 45 of file aigTruth.c.

46{
47 unsigned * pTruth0, * pTruth1;
48 int i;
49 pTruth0 = (unsigned *)Aig_ObjFanin0(pNode)->pData;
50 pTruth1 = (unsigned *)Aig_ObjFanin1(pNode)->pData;
51 if ( Aig_ObjIsExor(pNode) )
52 for ( i = 0; i < nWords; i++ )
53 pTruth[i] = pTruth0[i] ^ pTruth1[i];
54 else if ( !Aig_ObjFaninC0(pNode) && !Aig_ObjFaninC1(pNode) )
55 for ( i = 0; i < nWords; i++ )
56 pTruth[i] = pTruth0[i] & pTruth1[i];
57 else if ( !Aig_ObjFaninC0(pNode) && Aig_ObjFaninC1(pNode) )
58 for ( i = 0; i < nWords; i++ )
59 pTruth[i] = pTruth0[i] & ~pTruth1[i];
60 else if ( Aig_ObjFaninC0(pNode) && !Aig_ObjFaninC1(pNode) )
61 for ( i = 0; i < nWords; i++ )
62 pTruth[i] = ~pTruth0[i] & pTruth1[i];
63 else // if ( Aig_ObjFaninC0(pNode) && Aig_ObjFaninC1(pNode) )
64 for ( i = 0; i < nWords; i++ )
65 pTruth[i] = ~pTruth0[i] & ~pTruth1[i];
66 return pTruth;
67}
Here is the caller graph for this function: