src/aig/aig/aigTruth.c File Reference

#include "aig.h"
Include dependency graph for aigTruth.c:

Go to the source code of this file.

Functions

unsigned * Aig_ManCutTruthOne (Aig_Obj_t *pNode, unsigned *pTruth, int nWords)
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

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 77 of file aigTruth.c.

00078 {
00079     Aig_Obj_t * pObj;
00080     int i, nWords;
00081     assert( Vec_PtrSize(vLeaves) <= Vec_PtrSize(vTruthElem) );
00082     assert( Vec_PtrSize(vNodes) <= Vec_PtrSize(vTruthStore) );
00083     assert( Vec_PtrSize(vNodes) == 0 || pRoot == Vec_PtrEntryLast(vNodes) );  
00084     // assign elementary truth tables
00085     Vec_PtrForEachEntry( vLeaves, pObj, i )
00086         pObj->pData = Vec_PtrEntry( vTruthElem, i );
00087     // compute truths for other nodes
00088     nWords = Aig_TruthWordNum( Vec_PtrSize(vLeaves) );
00089     Vec_PtrForEachEntry( vNodes, pObj, i )
00090         pObj->pData = Aig_ManCutTruthOne( pObj, Vec_PtrEntry(vTruthStore, i), nWords );
00091     return pRoot->pData;
00092 }

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

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

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

Synopsis [Computes truth table of the cut.]

Description []

SideEffects []

SeeAlso []

Definition at line 42 of file aigTruth.c.

00043 {
00044     unsigned * pTruth0, * pTruth1;
00045     int i;
00046     pTruth0 = Aig_ObjFanin0(pNode)->pData;
00047     pTruth1 = Aig_ObjFanin1(pNode)->pData;
00048     if ( Aig_ObjIsExor(pNode) )
00049         for ( i = 0; i < nWords; i++ )
00050             pTruth[i] = pTruth0[i] ^ pTruth1[i];
00051     else if ( !Aig_ObjFaninC0(pNode) && !Aig_ObjFaninC1(pNode) )
00052         for ( i = 0; i < nWords; i++ )
00053             pTruth[i] = pTruth0[i] & pTruth1[i];
00054     else if ( !Aig_ObjFaninC0(pNode) && Aig_ObjFaninC1(pNode) )
00055         for ( i = 0; i < nWords; i++ )
00056             pTruth[i] = pTruth0[i] & ~pTruth1[i];
00057     else if ( Aig_ObjFaninC0(pNode) && !Aig_ObjFaninC1(pNode) )
00058         for ( i = 0; i < nWords; i++ )
00059             pTruth[i] = ~pTruth0[i] & pTruth1[i];
00060     else // if ( Aig_ObjFaninC0(pNode) && Aig_ObjFaninC1(pNode) )
00061         for ( i = 0; i < nWords; i++ )
00062             pTruth[i] = ~pTruth0[i] & ~pTruth1[i];
00063     return pTruth;
00064 }


Generated on Tue Jan 5 12:18:12 2010 for abc70930 by  doxygen 1.6.1