abc/src/aig/ivy/ivyUtil.c
/**Function*************************************************************

  Synopsis    [Computes truth table of the cut.]

  Description [Does not modify the array of leaves. Uses array vTruth to store 
  temporary truth tables. The returned pointer should be used immediately.]
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
Function
Synopsis    [Computes truth table of the cut.]

Description [Does not modify the array of leaves. Uses array vTruth to store
temporary truth tables. The returned pointer should be used immediately.]




Function Synopsis [ Computes truth table of the cut . ] Description [ Does not modify the array of leaves . Uses array vTruth to store temporary truth tables . The returned pointer should be used immediately . ]
unsigned * Ivy_ManCutTruth( Ivy_Man_t * p, Ivy_Obj_t * pRoot, Vec_Int_t * vLeaves, Vec_Int_t * vNodes, Vec_Int_t * vTruth )
{
    static unsigned uTruths[8][8] = { 
        { 0xAAAAAAAA,0xAAAAAAAA,0xAAAAAAAA,0xAAAAAAAA,0xAAAAAAAA,0xAAAAAAAA,0xAAAAAAAA,0xAAAAAAAA },
        { 0xCCCCCCCC,0xCCCCCCCC,0xCCCCCCCC,0xCCCCCCCC,0xCCCCCCCC,0xCCCCCCCC,0xCCCCCCCC,0xCCCCCCCC },
        { 0xF0F0F0F0,0xF0F0F0F0,0xF0F0F0F0,0xF0F0F0F0,0xF0F0F0F0,0xF0F0F0F0,0xF0F0F0F0,0xF0F0F0F0 },
        { 0xFF00FF00,0xFF00FF00,0xFF00FF00,0xFF00FF00,0xFF00FF00,0xFF00FF00,0xFF00FF00,0xFF00FF00 },
        { 0xFFFF0000,0xFFFF0000,0xFFFF0000,0xFFFF0000,0xFFFF0000,0xFFFF0000,0xFFFF0000,0xFFFF0000 }, 
        { 0x00000000,0xFFFFFFFF,0x00000000,0xFFFFFFFF,0x00000000,0xFFFFFFFF,0x00000000,0xFFFFFFFF }, 
        { 0x00000000,0x00000000,0xFFFFFFFF,0xFFFFFFFF,0x00000000,0x00000000,0xFFFFFFFF,0xFFFFFFFF }, 
        { 0x00000000,0x00000000,0x00000000,0x00000000,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF } 
    };
    int i, Leaf;
    Ivy_ManCollectCut( p, pRoot, vLeaves, vNodes );
    Vec_IntForEachEntry( vNodes, Leaf, i )
        Ivy_ManObj(p, Leaf)->TravId = i;
    Vec_IntClear( vTruth );
    Vec_IntGrow( vTruth, 8 * Vec_IntSize(vNodes) );
    Vec_IntForEachEntry( vLeaves, Leaf, i )
        memcpy( Ivy_ObjGetTruthStore(i, vTruth), uTruths[i], 8 * sizeof(unsigned) );
    Vec_IntForEachEntryStart( vNodes, Leaf, i, Vec_IntSize(vLeaves) )
        Ivy_ManCutTruthOne( p, Ivy_ManObj(p, Leaf), vTruth, 8 );
    return Ivy_ObjGetTruthStore( pRoot->TravId, vTruth );
}
unsigned * Ivy_ManCutTruth ( Ivy_Man_t * p , Ivy_Obj_t * pRoot , Vec_Int_t * vLeaves , Vec_Int_t * vNodes , Vec_Int_t * vTruth ) { static unsigned uTruths [ 8 ] [ 8 ] = { { 0xAAAAAAAA , 0xAAAAAAAA , 0xAAAAAAAA , 0xAAAAAAAA , 0xAAAAAAAA , 0xAAAAAAAA , 0xAAAAAAAA , 0xAAAAAAAA } , { 0xCCCCCCCC , 0xCCCCCCCC , 0xCCCCCCCC , 0xCCCCCCCC , 0xCCCCCCCC , 0xCCCCCCCC , 0xCCCCCCCC , 0xCCCCCCCC } , { 0xF0F0F0F0 , 0xF0F0F0F0 , 0xF0F0F0F0 , 0xF0F0F0F0 , 0xF0F0F0F0 , 0xF0F0F0F0 , 0xF0F0F0F0 , 0xF0F0F0F0 } , { 0xFF00FF00 , 0xFF00FF00 , 0xFF00FF00 , 0xFF00FF00 , 0xFF00FF00 , 0xFF00FF00 , 0xFF00FF00 , 0xFF00FF00 } , { 0xFFFF0000 , 0xFFFF0000 , 0xFFFF0000 , 0xFFFF0000 , 0xFFFF0000 , 0xFFFF0000 , 0xFFFF0000 , 0xFFFF0000 } , { 0x00000000 , 0xFFFFFFFF , 0x00000000 , 0xFFFFFFFF , 0x00000000 , 0xFFFFFFFF , 0x00000000 , 0xFFFFFFFF } , { 0x00000000 , 0x00000000 , 0xFFFFFFFF , 0xFFFFFFFF , 0x00000000 , 0x00000000 , 0xFFFFFFFF , 0xFFFFFFFF } , { 0x00000000 , 0x00000000 , 0x00000000 , 0x00000000 , 0xFFFFFFFF , 0xFFFFFFFF , 0xFFFFFFFF , 0xFFFFFFFF } } ; int i , Leaf ; Ivy_ManCollectCut ( p , pRoot , vLeaves , vNodes ) ; Vec_IntForEachEntry ( vNodes , Leaf , i ) Ivy_ManObj ( p , Leaf ) -> TravId = i ; Vec_IntClear ( vTruth ) ; Vec_IntGrow ( vTruth , 8 * Vec_IntSize ( vNodes ) ) ; Vec_IntForEachEntry ( vLeaves , Leaf , i ) memcpy ( Ivy_ObjGetTruthStore ( i , vTruth ) , uTruths [ i ] , 8 * sizeof ( unsigned ) ) ; Vec_IntForEachEntryStart ( vNodes , Leaf , i , Vec_IntSize ( vLeaves ) ) Ivy_ManCutTruthOne ( p , Ivy_ManObj ( p , Leaf ) , vTruth , 8 ) ; return Ivy_ObjGetTruthStore ( pRoot -> TravId , vTruth ) ; }
Function
Synopsis    [Computes truth table of the cut.]
Function Synopsis [ Computes truth table of the cut . ]
// elementary truth tables // collect the cut // set the node numbers // alloc enough memory // set the elementary truth tables // compute truths for other nodes