src/misc/mvc/mvcUtils.c File Reference

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

Go to the source code of this file.

Functions

static void Mvc_CoverCopyColumn (Mvc_Cover_t *pCoverOld, Mvc_Cover_t *pCoverNew, int iColOld, int iColNew)
void Mvc_CoverSupport (Mvc_Cover_t *pCover, Mvc_Cube_t *pSupp)
void Mvc_CoverSupportAnd (Mvc_Cover_t *pCover, Mvc_Cube_t *pSupp)
int Mvc_CoverSupportSizeBinary (Mvc_Cover_t *pCover)
int Mvc_CoverSupportVarBelongs (Mvc_Cover_t *pCover, int iVar)
void Mvc_CoverCommonCube (Mvc_Cover_t *pCover, Mvc_Cube_t *pComCube)
int Mvc_CoverIsCubeFree (Mvc_Cover_t *pCover)
void Mvc_CoverMakeCubeFree (Mvc_Cover_t *pCover)
Mvc_Cover_tMvc_CoverCommonCubeCover (Mvc_Cover_t *pCover)
int Mvc_CoverCheckSuppContainment (Mvc_Cover_t *pCover1, Mvc_Cover_t *pCover2)
int Mvc_CoverSetCubeSizes (Mvc_Cover_t *pCover)
int Mvc_CoverGetCubeSize (Mvc_Cube_t *pCube)
int Mvc_CoverCountCubePairDiffs (Mvc_Cover_t *pCover, unsigned char pDiffs[])
Mvc_Cover_tMvc_CoverRemap (Mvc_Cover_t *p, int *pVarsRem, int nVarsRem)
void Mvc_CoverInverse (Mvc_Cover_t *pCover)
Mvc_Cover_tMvc_CoverRemoveDontCareLits (Mvc_Cover_t *pCover)
Mvc_Cover_tMvc_CoverCofactor (Mvc_Cover_t *p, int iValue, int iValueOther)
Mvc_Cover_tMvc_CoverFlipVar (Mvc_Cover_t *p, int iValue0, int iValue1)
Mvc_Cover_tMvc_CoverUnivQuantify (Mvc_Cover_t *p, int iValueA0, int iValueA1, int iValueB0, int iValueB1)
Mvc_Cover_tMvc_CoverTranspose (Mvc_Cover_t *pCover)
int Mvc_UtilsCheckUnusedZeros (Mvc_Cover_t *pCover)

Variables

static int bit_count [256]

Function Documentation

int Mvc_CoverCheckSuppContainment ( Mvc_Cover_t pCover1,
Mvc_Cover_t pCover2 
)

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

Synopsis [Returns 1 if the support of cover2 is contained in the support of cover1.]

Description []

SideEffects []

SeeAlso []

Definition at line 244 of file mvcUtils.c.

00245 {
00246     int Result;
00247     assert( pCover1->nBits == pCover2->nBits );
00248     // set the supports
00249     Mvc_CoverAllocateMask( pCover1 );
00250     Mvc_CoverSupport( pCover1, pCover1->pMask );
00251     Mvc_CoverAllocateMask( pCover2 );
00252     Mvc_CoverSupport( pCover2, pCover2->pMask );
00253     // check the containment
00254     Mvc_CubeBitNotImpl( Result, pCover2->pMask, pCover1->pMask );
00255     return !Result;
00256 }

Mvc_Cover_t* Mvc_CoverCofactor ( Mvc_Cover_t p,
int  iValue,
int  iValueOther 
)

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

Synopsis [Returns the cofactor w.r.t. to a binary var.]

Description []

SideEffects []

SeeAlso []

Definition at line 515 of file mvcUtils.c.

00516 {
00517     Mvc_Cover_t * pCover;
00518     Mvc_Cube_t * pCube, * pCubeCopy;
00519     // clone the cover
00520     pCover = Mvc_CoverClone( p );
00521     // copy the cube list
00522     Mvc_CoverForEachCube( p, pCube )
00523         if ( Mvc_CubeBitValue( pCube, iValue ) )
00524         {
00525             pCubeCopy = Mvc_CubeDup( pCover, pCube );
00526             Mvc_CoverAddCubeTail( pCover, pCubeCopy );
00527             Mvc_CubeBitInsert( pCubeCopy, iValueOther );
00528         }
00529     return pCover;
00530 }

void Mvc_CoverCommonCube ( Mvc_Cover_t pCover,
Mvc_Cube_t pComCube 
)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 152 of file mvcUtils.c.

00153 {
00154     Mvc_Cube_t * pCube;
00155     // clean the support
00156     Mvc_CubeBitFill( pComCube );
00157     // collect the support
00158     Mvc_CoverForEachCube( pCover, pCube )
00159         Mvc_CubeBitAnd( pComCube, pComCube, pCube );
00160 }

Mvc_Cover_t* Mvc_CoverCommonCubeCover ( Mvc_Cover_t pCover  ) 

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 217 of file mvcUtils.c.

00218 {
00219     Mvc_Cover_t * pRes;
00220     Mvc_Cube_t * pCube;
00221     // create the new cover
00222     pRes = Mvc_CoverClone( pCover );
00223     // get the new cube
00224     pCube = Mvc_CubeAlloc( pRes );
00225     // get the common cube
00226     Mvc_CoverCommonCube( pCover, pCube );
00227     // add the cube to the cover
00228     Mvc_CoverAddCubeTail( pRes, pCube );
00229     return pRes;
00230 }

void Mvc_CoverCopyColumn ( Mvc_Cover_t pCoverOld,
Mvc_Cover_t pCoverNew,
int  iColOld,
int  iColNew 
) [static]

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

Synopsis [Copies a column from the old cover to the new cover.]

Description [Copies the column (iColOld) of the old cover (pCoverOld) into the column (iColNew) of the new cover (pCoverNew). Assumes that the number of cubes is the same in both covers. Makes no assuptions about the current contents of the column in the new cover.]

SideEffects []

SeeAlso []

Definition at line 437 of file mvcUtils.c.

00439 {
00440     Mvc_Cube_t * pCubeOld, * pCubeNew;
00441     int iWordOld, iWordNew, iBitOld, iBitNew;
00442 
00443     assert( Mvc_CoverReadCubeNum(pCoverOld) == Mvc_CoverReadCubeNum(pCoverNew) );
00444 
00445     // get the place of the old and new columns
00446     iWordOld = Mvc_CubeWhichWord(iColOld);
00447     iBitOld  = Mvc_CubeWhichBit(iColOld);
00448     iWordNew = Mvc_CubeWhichWord(iColNew);
00449     iBitNew  = Mvc_CubeWhichBit(iColNew);
00450 
00451     // go through the cubes of both covers
00452     pCubeNew = Mvc_CoverReadCubeHead(pCoverNew);
00453     Mvc_CoverForEachCube( pCoverOld, pCubeOld )
00454     {
00455         if ( pCubeOld->pData[iWordOld] & (1<<iBitOld) )
00456             pCubeNew->pData[iWordNew] |= (1<<iBitNew);
00457         else
00458             pCubeNew->pData[iWordNew] &= ~(1<<iBitNew);  // added by wjiang
00459         pCubeNew = Mvc_CubeReadNext( pCubeNew );
00460     }
00461 }

int Mvc_CoverCountCubePairDiffs ( Mvc_Cover_t pCover,
unsigned char  pDiffs[] 
)

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

Synopsis [Counts the differences in each cube pair in the cover.]

Description [Takes the cover (pCover) and the array where the diff counters go (pDiffs). The array pDiffs should have as many entries as there are different pairs of cubes in the cover: n(n-1)/2. Fills out the array pDiffs with the following info: For each cube pair, included in the array is the number of literals in both cubes after they are made cube free.]

SideEffects []

SeeAlso []

Definition at line 339 of file mvcUtils.c.

00340 {
00341     Mvc_Cube_t * pCube1;
00342     Mvc_Cube_t * pCube2;
00343     Mvc_Cube_t * pMask;
00344     unsigned char * pByte, * pByteStart, * pByteStop;
00345     int nBytes, nOnes;
00346     int nCubePairs;
00347 
00348     // allocate a temporary mask
00349     pMask = Mvc_CubeAlloc( pCover );
00350     // get the number of unsigned chars in the cube's bit strings
00351     nBytes = pCover->nBits / (8 * sizeof(unsigned char)) + (int)(pCover->nBits % (8 * sizeof(unsigned char)) > 0);
00352     // iterate through the cubes
00353     nCubePairs = 0;
00354     Mvc_CoverForEachCube( pCover, pCube1 )
00355     {
00356         Mvc_CoverForEachCubeStart( Mvc_CubeReadNext(pCube1), pCube2 )
00357         {
00358             // find the bit-wise exor of cubes
00359             Mvc_CubeBitExor( pMask, pCube1, pCube2 );
00360             // set the starting and stopping positions
00361             pByteStart = (unsigned char *)pMask->pData;
00362             pByteStop  = pByteStart + nBytes;
00363             // clean the counter of ones
00364             nOnes = 0;
00365             // iterate through the positions
00366             for ( pByte = pByteStart; pByte < pByteStop; pByte++ )
00367                 nOnes += bit_count[*pByte];
00368             // set the nOnes
00369             pDiffs[nCubePairs++] = nOnes;
00370         }
00371     }
00372     // deallocate the mask
00373     Mvc_CubeFree( pCover, pMask );
00374     return 1;
00375 }

Mvc_Cover_t* Mvc_CoverFlipVar ( Mvc_Cover_t p,
int  iValue0,
int  iValue1 
)

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

Synopsis [Returns the cover, in which the binary var is complemented.]

Description []

SideEffects []

SeeAlso []

Definition at line 543 of file mvcUtils.c.

00544 {
00545     Mvc_Cover_t * pCover;
00546     Mvc_Cube_t * pCube, * pCubeCopy;
00547     int Value0, Value1, Temp;
00548 
00549     assert( iValue0 + 1 == iValue1 ); // should be adjacent
00550 
00551     // clone the cover
00552     pCover = Mvc_CoverClone( p );
00553     // copy the cube list
00554     Mvc_CoverForEachCube( p, pCube )
00555     {
00556         pCubeCopy = Mvc_CubeDup( pCover, pCube );
00557         Mvc_CoverAddCubeTail( pCover, pCubeCopy );
00558 
00559         // get the bits
00560         Value0 = Mvc_CubeBitValue( pCubeCopy, iValue0 );
00561         Value1 = Mvc_CubeBitValue( pCubeCopy, iValue1 );
00562 
00563         // if both bits are one, nothing to swap
00564         if ( Value0 && Value1 )
00565             continue;
00566         // cannot be both zero because they belong to the same var
00567         assert( Value0 || Value1 ); 
00568 
00569         // swap the bits
00570         Temp   = Value0;
00571         Value0 = Value1;
00572         Value1 = Temp;
00573 
00574         // set the bits after the swap
00575         if ( Value0 )
00576             Mvc_CubeBitInsert( pCubeCopy, iValue0 );
00577         else
00578             Mvc_CubeBitRemove( pCubeCopy, iValue0 );
00579 
00580         if ( Value1 )
00581             Mvc_CubeBitInsert( pCubeCopy, iValue1 );
00582         else
00583             Mvc_CubeBitRemove( pCubeCopy, iValue1 );
00584     }
00585     return pCover;
00586 }

int Mvc_CoverGetCubeSize ( Mvc_Cube_t pCube  ) 

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

Synopsis [Counts the cube sizes.]

Description []

SideEffects []

SeeAlso []

Definition at line 305 of file mvcUtils.c.

00306 {
00307     unsigned char * pByte, * pByteStart, * pByteStop;
00308     int nOnes, nBytes, nBits;
00309     // get the number of unsigned chars in the cube's bit strings
00310     nBits = (pCube->iLast + 1) * sizeof(Mvc_CubeWord_t) * 8 - pCube->nUnused;
00311     nBytes = nBits / (8 * sizeof(unsigned char)) + (int)(nBits % (8 * sizeof(unsigned char)) > 0);
00312     // clean the counter of ones
00313     nOnes = 0;
00314     // set the starting and stopping positions
00315     pByteStart = (unsigned char *)pCube->pData;
00316     pByteStop  = pByteStart + nBytes;
00317     // iterate through the positions
00318     for ( pByte = pByteStart; pByte < pByteStop; pByte++ )
00319         nOnes += bit_count[*pByte];
00320     return nOnes;
00321 }

void Mvc_CoverInverse ( Mvc_Cover_t pCover  ) 

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 474 of file mvcUtils.c.

00475 {
00476     Mvc_Cube_t * pCube;
00477     // complement the cubes
00478     Mvc_CoverForEachCube( pCover, pCube )
00479         Mvc_CubeBitNot( pCube );
00480 }

int Mvc_CoverIsCubeFree ( Mvc_Cover_t pCover  ) 

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 173 of file mvcUtils.c.

00174 {
00175     int Result;
00176     // get the common cube
00177     Mvc_CoverAllocateMask( pCover );
00178     Mvc_CoverCommonCube( pCover, pCover->pMask );
00179     // check whether the common cube is empty
00180     Mvc_CubeBitEmpty( Result, pCover->pMask );
00181     return Result;
00182 }

void Mvc_CoverMakeCubeFree ( Mvc_Cover_t pCover  ) 

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 195 of file mvcUtils.c.

00196 {
00197     Mvc_Cube_t * pCube;
00198     // get the common cube
00199     Mvc_CoverAllocateMask( pCover );
00200     Mvc_CoverCommonCube( pCover, pCover->pMask );
00201     // remove this cube from the cubes in the cover
00202     Mvc_CoverForEachCube( pCover, pCube )
00203         Mvc_CubeBitSharp( pCube, pCube, pCover->pMask );
00204 }

Mvc_Cover_t* Mvc_CoverRemap ( Mvc_Cover_t p,
int *  pVarsRem,
int  nVarsRem 
)

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

Synopsis [Creates a new cover containing some literals of the old cover.]

Description [Creates the new cover containing the given number (nVarsRem) literals of the old cover. All the bits of the new cover are initialized to "1". The selected bits from the old cover are copied on top. The numbers of the selected bits to copy are given in the array pVarsRem. The i-set entry in this array is the index of the bit in the old cover which goes to the i-th place in the new cover. If the i-th entry in pVarsRem is -1, it means that the i-th bit does not change (remains composed of all 1's). This is a useful feature to speed up remapping covers, which are known to depend only on a subset of input variables.]

SideEffects []

SeeAlso []

Definition at line 397 of file mvcUtils.c.

00398 {
00399     Mvc_Cover_t * pCover;
00400     Mvc_Cube_t * pCube, * pCubeCopy;
00401     int i;
00402     // clone the cover
00403     pCover = Mvc_CoverAlloc( p->pMem, nVarsRem );
00404     // copy the cube list
00405     Mvc_CoverForEachCube( p, pCube )
00406     {
00407         pCubeCopy = Mvc_CubeAlloc( pCover );
00408         //Mvc_CubeBitClean( pCubeCopy );   //changed by wjiang
00409         Mvc_CubeBitFill( pCubeCopy );      //changed by wjiang
00410         Mvc_CoverAddCubeTail( pCover, pCubeCopy );
00411     }
00412     // copy the corresponding columns
00413     for ( i = 0; i < nVarsRem; i++ )
00414     {
00415         if (pVarsRem[i] < 0) 
00416             continue;     //added by wjiang
00417         assert( pVarsRem[i] >= 0 && pVarsRem[i] < p->nBits );
00418         Mvc_CoverCopyColumn( p, pCover, pVarsRem[i], i );
00419     }
00420     return pCover;
00421 }

Mvc_Cover_t* Mvc_CoverRemoveDontCareLits ( Mvc_Cover_t pCover  ) 

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

Synopsis [This function dups the cover and removes DC literals from cubes.]

Description []

SideEffects []

SeeAlso []

Definition at line 493 of file mvcUtils.c.

00494 {
00495     Mvc_Cover_t * pCoverNew;
00496     Mvc_Cube_t * pCube;
00497 
00498     pCoverNew = Mvc_CoverDup( pCover );
00499     Mvc_CoverForEachCube( pCoverNew, pCube )
00500         Mvc_CubeBitRemoveDcs( pCube );
00501     return pCoverNew;
00502 }

int Mvc_CoverSetCubeSizes ( Mvc_Cover_t pCover  ) 

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

Synopsis [Counts the cube sizes.]

Description []

SideEffects []

SeeAlso []

Definition at line 269 of file mvcUtils.c.

00270 {
00271     Mvc_Cube_t * pCube;
00272     unsigned char * pByte, * pByteStart, * pByteStop;
00273     int nBytes, nOnes;
00274 
00275     // get the number of unsigned chars in the cube's bit strings
00276     nBytes = pCover->nBits / (8 * sizeof(unsigned char)) + (int)(pCover->nBits % (8 * sizeof(unsigned char)) > 0);
00277     // iterate through the cubes
00278     Mvc_CoverForEachCube( pCover, pCube )
00279     {
00280         // clean the counter of ones
00281         nOnes = 0;
00282         // set the starting and stopping positions
00283         pByteStart = (unsigned char *)pCube->pData;
00284         pByteStop  = pByteStart + nBytes;
00285         // iterate through the positions
00286         for ( pByte = pByteStart; pByte < pByteStop; pByte++ )
00287             nOnes += bit_count[*pByte];
00288         // set the nOnes
00289         Mvc_CubeSetSize( pCube, nOnes );
00290     }
00291     return 1;
00292 }

void Mvc_CoverSupport ( Mvc_Cover_t pCover,
Mvc_Cube_t pSupp 
)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 55 of file mvcUtils.c.

00056 {
00057     Mvc_Cube_t * pCube;
00058     // clean the support
00059     Mvc_CubeBitClean( pSupp );
00060     // collect the support
00061     Mvc_CoverForEachCube( pCover, pCube )
00062         Mvc_CubeBitOr( pSupp, pSupp, pCube );
00063 }

void Mvc_CoverSupportAnd ( Mvc_Cover_t pCover,
Mvc_Cube_t pSupp 
)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 76 of file mvcUtils.c.

00077 {
00078     Mvc_Cube_t * pCube;
00079     // clean the support
00080     Mvc_CubeBitFill( pSupp );
00081     // collect the support
00082     Mvc_CoverForEachCube( pCover, pCube )
00083         Mvc_CubeBitAnd( pSupp, pSupp, pCube );
00084 }

int Mvc_CoverSupportSizeBinary ( Mvc_Cover_t pCover  ) 

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 97 of file mvcUtils.c.

00098 {
00099     Mvc_Cube_t * pSupp;
00100     int Counter, i, v0, v1;
00101     // compute the support
00102     pSupp = Mvc_CubeAlloc( pCover );
00103     Mvc_CoverSupportAnd( pCover, pSupp );
00104     Counter = pCover->nBits/2;
00105     for ( i = 0; i < pCover->nBits/2; i++ )
00106     {
00107         v0 = Mvc_CubeBitValue( pSupp, 2*i   );
00108         v1 = Mvc_CubeBitValue( pSupp, 2*i+1 );
00109         if ( v0 && v1 )
00110             Counter--;
00111     }
00112     Mvc_CubeFree( pCover, pSupp );
00113     return Counter;
00114 }

int Mvc_CoverSupportVarBelongs ( Mvc_Cover_t pCover,
int  iVar 
)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 127 of file mvcUtils.c.

00128 {
00129     Mvc_Cube_t * pSupp;
00130     int RetValue, v0, v1;
00131     // compute the support
00132     pSupp = Mvc_CubeAlloc( pCover );
00133     Mvc_CoverSupportAnd( pCover, pSupp );
00134     v0 = Mvc_CubeBitValue( pSupp, 2*iVar   );
00135     v1 = Mvc_CubeBitValue( pSupp, 2*iVar+1 );
00136     RetValue = (int)( !v0 || !v1 );
00137     Mvc_CubeFree( pCover, pSupp );
00138     return RetValue;
00139 }

Mvc_Cover_t* Mvc_CoverTranspose ( Mvc_Cover_t pCover  ) 

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

Synopsis [Transposes the cube cover.]

Description [Returns the cube cover that looks like a transposed matrix, compared to the matrix derived from the original cover.]

SideEffects []

SeeAlso []

Definition at line 801 of file mvcUtils.c.

00802 {
00803     Mvc_Cover_t * pRes;
00804     Mvc_Cube_t * pCubeRes, * pCube;
00805     int nWord, nBit, i, iCube;
00806 
00807     pRes = Mvc_CoverAlloc( pCover->pMem, Mvc_CoverReadCubeNum(pCover) );
00808     for ( i = 0; i < pCover->nBits; i++ )
00809     {
00810         // get the word and bit of this literal
00811         nWord = Mvc_CubeWhichWord(i);
00812         nBit  = Mvc_CubeWhichBit(i);
00813         // get the transposed cube
00814         pCubeRes = Mvc_CubeAlloc( pRes );
00815         Mvc_CubeBitClean( pCubeRes );
00816         iCube = 0;
00817         Mvc_CoverForEachCube( pCover, pCube )
00818         {
00819             if ( pCube->pData[nWord] & (1<<nBit) )
00820                 Mvc_CubeBitInsert( pCubeRes, iCube );
00821             iCube++;
00822         }
00823         Mvc_CoverAddCubeTail( pRes, pCubeRes ); 
00824     }
00825     return pRes;
00826 }

Mvc_Cover_t* Mvc_CoverUnivQuantify ( Mvc_Cover_t p,
int  iValueA0,
int  iValueA1,
int  iValueB0,
int  iValueB1 
)

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

Synopsis [Returns the cover derived by universal quantification.]

Description [Returns the cover computed by universal quantification as follows: CoverNew = Univ(B) [Cover & (A==B)]. Removes the second binary var from the support (given by values iValueB0 and iValueB1). Leaves the first binary variable (given by values iValueA0 and iValueA1) in the support.]

SideEffects []

SeeAlso []

Definition at line 603 of file mvcUtils.c.

00605 {
00606     Mvc_Cover_t * pCover;
00607     Mvc_Cube_t * pCube, * pCubeCopy;
00608     int ValueA0, ValueA1, ValueB0, ValueB1;
00609 
00610     // clone the cover
00611     pCover = Mvc_CoverClone( p );
00612     // copy the cube list
00613     Mvc_CoverForEachCube( p, pCube )
00614     {
00615         // get the bits
00616         ValueA0 = Mvc_CubeBitValue( pCube, iValueA0 );
00617         ValueA1 = Mvc_CubeBitValue( pCube, iValueA1 );
00618         ValueB0 = Mvc_CubeBitValue( pCube, iValueB0 );
00619         ValueB1 = Mvc_CubeBitValue( pCube, iValueB1 );
00620 
00621         // cannot be both zero because they belong to the same var
00622         assert( ValueA0 || ValueA1 ); 
00623         assert( ValueB0 || ValueB1 ); 
00624 
00625         // if the values of this var are different, do not add the cube
00626         if ( ValueA0 != ValueB0 && ValueA1 != ValueB1 )
00627             continue;
00628 
00629         // create the cube
00630         pCubeCopy = Mvc_CubeDup( pCover, pCube );
00631         Mvc_CoverAddCubeTail( pCover, pCubeCopy );
00632 
00633         // insert 1's into for the first var, if both have this value
00634         if ( ValueA0 && ValueB0 )
00635             Mvc_CubeBitInsert( pCubeCopy, iValueA0 );
00636         else
00637             Mvc_CubeBitRemove( pCubeCopy, iValueA0 );
00638 
00639         if ( ValueA1 && ValueB1 )
00640             Mvc_CubeBitInsert( pCubeCopy, iValueA1 );
00641         else
00642             Mvc_CubeBitRemove( pCubeCopy, iValueA1 );
00643             
00644         // insert 1's into for the second var (the cover does not depend on it)
00645         Mvc_CubeBitInsert( pCubeCopy, iValueB0 );
00646         Mvc_CubeBitInsert( pCubeCopy, iValueB1 );
00647     }
00648     return pCover;
00649 }

int Mvc_UtilsCheckUnusedZeros ( Mvc_Cover_t pCover  ) 

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

Synopsis [Checks that the cubes of the cover have 0's in unused bits.]

Description []

SideEffects []

SeeAlso []

Definition at line 839 of file mvcUtils.c.

00840 {
00841     unsigned Unsigned;
00842     Mvc_Cube_t * pCube;
00843     int nCubes;
00844 
00845     nCubes = 0;
00846     Mvc_CoverForEachCube( pCover, pCube )
00847     {
00848         if ( pCube->nUnused == 0 )
00849             continue;
00850 
00851         Unsigned = ( pCube->pData[pCube->iLast] & 
00852                     (BITS_FULL << (32-pCube->nUnused)) );
00853         if( Unsigned )
00854         {
00855             printf( "Cube %2d out of %2d contains dirty bits.\n", nCubes, 
00856                 Mvc_CoverReadCubeNum(pCover) );
00857         }
00858         nCubes++;
00859     }
00860     return 1;
00861 }


Variable Documentation

int bit_count[256] [static]
Initial value:
 {
  0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,
  1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
  1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
  2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,
  1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
  2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,
  2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,
  3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,4,5,5,6,5,6,6,7,5,6,6,7,6,7,7,8
}

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

FileName [mvcUtils.c]

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

Synopsis [Various cover handling utilities.]

Author [MVSIS Group]

Affiliation [UC Berkeley]

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

Revision [

Id
mvcUtils.c,v 1.7 2003/04/26 20:41:36 alanmi Exp

] DECLARATIONS ///

Definition at line 25 of file mvcUtils.c.


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