src/misc/mvc/mvcOpAlg.c File Reference

#include "mvc.h"
Include dependency graph for mvcOpAlg.c:

Go to the source code of this file.

Functions

Mvc_Cover_tMvc_CoverAlgebraicMultiply (Mvc_Cover_t *pCover1, Mvc_Cover_t *pCover2)
Mvc_Cover_tMvc_CoverAlgebraicSubtract (Mvc_Cover_t *pCover1, Mvc_Cover_t *pCover2)
int Mvc_CoverAlgebraicEqual (Mvc_Cover_t *pCover1, Mvc_Cover_t *pCover2)

Function Documentation

int Mvc_CoverAlgebraicEqual ( Mvc_Cover_t pCover1,
Mvc_Cover_t pCover2 
)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 131 of file mvcOpAlg.c.

00132 {
00133     Mvc_Cube_t * pCube1, * pCube2;
00134     int fFound;
00135     int CompResult;
00136 
00137     // covers should be the same base
00138     assert( pCover1->nBits == pCover2->nBits );
00139     // iterate through the cubes
00140     Mvc_CoverForEachCube( pCover1, pCube1 )
00141     {
00142         fFound = 0;
00143         Mvc_CoverForEachCube( pCover2, pCube2 )
00144         {
00145             Mvc_CubeBitEqual( CompResult, pCube1, pCube2 );
00146             if ( CompResult )
00147             {
00148                 fFound = 1;
00149                 break;
00150             }
00151         }
00152         if ( !fFound )
00153             return 0;
00154     }
00155     return 1;
00156 }

Mvc_Cover_t* Mvc_CoverAlgebraicMultiply ( Mvc_Cover_t pCover1,
Mvc_Cover_t pCover2 
)

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

FileName [mvcOperAlg.c]

PackageName [MVSIS 2.0: Multi-valued logic synthesis system.]

Synopsis [Miscellaneous operations on covers.]

Author [MVSIS Group]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - February 1, 2003.]

Revision [

Id
mvcOpAlg.c,v 1.4 2003/04/26 20:41:36 alanmi Exp

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

Synopsis [Multiplies two disjoint-support covers.]

Description []

SideEffects []

SeeAlso []

Definition at line 40 of file mvcOpAlg.c.

00041 {
00042     Mvc_Cover_t * pCover;
00043     Mvc_Cube_t * pCube1, * pCube2, * pCube;
00044     int CompResult;
00045 
00046     // covers should be the same base
00047     assert( pCover1->nBits == pCover2->nBits );
00048     // make sure that supports do not overlap
00049     Mvc_CoverAllocateMask( pCover1 );
00050     Mvc_CoverAllocateMask( pCover2 );
00051     Mvc_CoverSupport( pCover1, pCover1->pMask );
00052     Mvc_CoverSupport( pCover2, pCover2->pMask );
00053     // check if the cubes are bit-wise disjoint
00054     Mvc_CubeBitDisjoint( CompResult, pCover1->pMask, pCover2->pMask );
00055     if ( !CompResult )
00056         printf( "Mvc_CoverMultiply(): Cover supports are not disjoint!\n" );
00057 
00058     // iterate through the cubes
00059     pCover = Mvc_CoverClone( pCover1 );
00060     Mvc_CoverForEachCube( pCover1, pCube1 )
00061         Mvc_CoverForEachCube( pCover2, pCube2 )
00062         { 
00063             // create the product cube
00064             pCube = Mvc_CubeAlloc( pCover );
00065             // set the product cube equal to the product of the two cubes
00066             Mvc_CubeBitOr( pCube, pCube1, pCube2 );
00067             // add the cube to the cover
00068             Mvc_CoverAddCubeTail( pCover, pCube );
00069         }
00070     return pCover;
00071 }

Mvc_Cover_t* Mvc_CoverAlgebraicSubtract ( Mvc_Cover_t pCover1,
Mvc_Cover_t pCover2 
)

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

Synopsis [Subtracts the second cover from the first.]

Description []

SideEffects []

SeeAlso []

Definition at line 85 of file mvcOpAlg.c.

00086 {
00087     Mvc_Cover_t * pCover;
00088     Mvc_Cube_t * pCube1, * pCube2, * pCube;
00089     int fFound;
00090     int CompResult;
00091 
00092     // covers should be the same base
00093     assert( pCover1->nBits == pCover2->nBits );
00094 
00095     // iterate through the cubes
00096     pCover = Mvc_CoverClone( pCover1 );
00097     Mvc_CoverForEachCube( pCover1, pCube1 )
00098     {
00099         fFound = 0;
00100         Mvc_CoverForEachCube( pCover2, pCube2 )
00101         {
00102             Mvc_CubeBitEqual( CompResult, pCube1, pCube2 );
00103             if ( CompResult )
00104             {
00105                 fFound = 1;
00106                 break;
00107             }
00108         }
00109         if ( !fFound )
00110         { 
00111             // create the copy of the cube
00112             pCube = Mvc_CubeDup( pCover, pCube1 );
00113             // add the cube copy to the cover
00114             Mvc_CoverAddCubeTail( pCover, pCube );
00115         }
00116     }
00117     return pCover;
00118 }


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