ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
mvcUtils.c
Go to the documentation of this file.
1
18
19#include "mvc.h"
20
22
23
27
28static int bit_count[256] = {
29 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,
30 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,
31 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,
32 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,
33 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,
34 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,
35 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,
36 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
37};
38
39
40static void Mvc_CoverCopyColumn( Mvc_Cover_t * pCoverOld, Mvc_Cover_t * pCoverNew, int iColOld, int iColNew );
41
42
46
58void Mvc_CoverSupport( Mvc_Cover_t * pCover, Mvc_Cube_t * pSupp )
59{
60 Mvc_Cube_t * pCube;
61 // clean the support
62 Mvc_CubeBitClean( pSupp );
63 // collect the support
64 Mvc_CoverForEachCube( pCover, pCube )
65 Mvc_CubeBitOr( pSupp, pSupp, pCube );
66}
67
80{
81 Mvc_Cube_t * pCube;
82 // clean the support
83 Mvc_CubeBitFill( pSupp );
84 // collect the support
85 Mvc_CoverForEachCube( pCover, pCube )
86 Mvc_CubeBitAnd( pSupp, pSupp, pCube );
87}
88
101{
102 Mvc_Cube_t * pSupp;
103 int Counter, i, v0, v1;
104 // compute the support
105 pSupp = Mvc_CubeAlloc( pCover );
106 Mvc_CoverSupportAnd( pCover, pSupp );
107 Counter = pCover->nBits/2;
108 for ( i = 0; i < pCover->nBits/2; i++ )
109 {
110 v0 = Mvc_CubeBitValue( pSupp, 2*i );
111 v1 = Mvc_CubeBitValue( pSupp, 2*i+1 );
112 if ( v0 && v1 )
113 Counter--;
114 }
115 Mvc_CubeFree( pCover, pSupp );
116 return Counter;
117}
118
131{
132 Mvc_Cube_t * pSupp;
133 int RetValue, v0, v1;
134 // compute the support
135 pSupp = Mvc_CubeAlloc( pCover );
136 Mvc_CoverSupportAnd( pCover, pSupp );
137 v0 = Mvc_CubeBitValue( pSupp, 2*iVar );
138 v1 = Mvc_CubeBitValue( pSupp, 2*iVar+1 );
139 RetValue = (int)( !v0 || !v1 );
140 Mvc_CubeFree( pCover, pSupp );
141 return RetValue;
142}
143
155void Mvc_CoverCommonCube( Mvc_Cover_t * pCover, Mvc_Cube_t * pComCube )
156{
157 Mvc_Cube_t * pCube;
158 // clean the support
159 Mvc_CubeBitFill( pComCube );
160 // collect the support
161 Mvc_CoverForEachCube( pCover, pCube )
162 Mvc_CubeBitAnd( pComCube, pComCube, pCube );
163}
164
177{
178 int Result;
179 // get the common cube
180 Mvc_CoverAllocateMask( pCover );
181 Mvc_CoverCommonCube( pCover, pCover->pMask );
182 // check whether the common cube is empty
183 Mvc_CubeBitEmpty( Result, pCover->pMask );
184 return Result;
185}
186
199{
200 Mvc_Cube_t * pCube;
201 // get the common cube
202 Mvc_CoverAllocateMask( pCover );
203 Mvc_CoverCommonCube( pCover, pCover->pMask );
204 // remove this cube from the cubes in the cover
205 Mvc_CoverForEachCube( pCover, pCube )
206 Mvc_CubeBitSharp( pCube, pCube, pCover->pMask );
207}
208
221{
222 Mvc_Cover_t * pRes;
223 Mvc_Cube_t * pCube;
224 // create the new cover
225 pRes = Mvc_CoverClone( pCover );
226 // get the new cube
227 pCube = Mvc_CubeAlloc( pRes );
228 // get the common cube
229 Mvc_CoverCommonCube( pCover, pCube );
230 // add the cube to the cover
231 Mvc_CoverAddCubeTail( pRes, pCube );
232 return pRes;
233}
234
235
248{
249 int Result;
250 assert( pCover1->nBits == pCover2->nBits );
251 // set the supports
252 Mvc_CoverAllocateMask( pCover1 );
253 Mvc_CoverSupport( pCover1, pCover1->pMask );
254 Mvc_CoverAllocateMask( pCover2 );
255 Mvc_CoverSupport( pCover2, pCover2->pMask );
256 // check the containment
257 Mvc_CubeBitNotImpl( Result, pCover2->pMask, pCover1->pMask );
258 return !Result;
259}
260
273{
274 Mvc_Cube_t * pCube;
275 unsigned char * pByte, * pByteStart, * pByteStop;
276 int nBytes, nOnes;
277
278 // get the number of unsigned chars in the cube's bit strings
279// nBytes = pCover->nBits / (8 * sizeof(unsigned char)) + (int)(pCover->nBits % (8 * sizeof(unsigned char)) > 0);
280 nBytes = sizeof(Mvc_CubeWord_t) * pCover->nWords; // big-endian issue
281 // iterate through the cubes
282 Mvc_CoverForEachCube( pCover, pCube )
283 {
284 // clean the counter of ones
285 nOnes = 0;
286 // set the starting and stopping positions
287 pByteStart = (unsigned char *)pCube->pData;
288 pByteStop = pByteStart + nBytes;
289 // iterate through the positions
290 for ( pByte = pByteStart; pByte < pByteStop; pByte++ )
291 nOnes += bit_count[*pByte];
292 // set the nOnes
293 Mvc_CubeSetSize( pCube, nOnes );
294 }
295 return 1;
296}
297
309/*
310int Mvc_CoverGetCubeSize( Mvc_Cube_t * pCube )
311{
312 unsigned char * pByte, * pByteStart, * pByteStop;
313 int nOnes, nBytes, nBits;
314 // get the number of unsigned chars in the cube's bit strings
315 nBits = (pCube->iLast + 1) * sizeof(Mvc_CubeWord_t) * 8 - pCube->nUnused;
316 nBytes = nBits / (8 * sizeof(unsigned char)) + (int)(nBits % (8 * sizeof(unsigned char)) > 0);
317 // clean the counter of ones
318 nOnes = 0;
319 // set the starting and stopping positions
320 pByteStart = (unsigned char *)pCube->pData;
321 pByteStop = pByteStart + nBytes;
322 // iterate through the positions
323 for ( pByte = pByteStart; pByte < pByteStop; pByte++ )
324 nOnes += bit_count[*pByte];
325 return nOnes;
326}
327*/
328
345int Mvc_CoverCountCubePairDiffs( Mvc_Cover_t * pCover, unsigned char pDiffs[] )
346{
347 Mvc_Cube_t * pCube1;
348 Mvc_Cube_t * pCube2;
349 Mvc_Cube_t * pMask;
350 unsigned char * pByte, * pByteStart, * pByteStop;
351 int nBytes, nOnes;
352 int nCubePairs;
353
354 // allocate a temporary mask
355 pMask = Mvc_CubeAlloc( pCover );
356 // get the number of unsigned chars in the cube's bit strings
357// nBytes = pCover->nBits / (8 * sizeof(unsigned char)) + (int)(pCover->nBits % (8 * sizeof(unsigned char)) > 0);
358 nBytes = sizeof(Mvc_CubeWord_t) * pCover->nWords; // big-endian issue
359 // iterate through the cubes
360 nCubePairs = 0;
361 Mvc_CoverForEachCube( pCover, pCube1 )
362 {
364 {
365 // find the bit-wise exor of cubes
366 Mvc_CubeBitExor( pMask, pCube1, pCube2 );
367 // set the starting and stopping positions
368 pByteStart = (unsigned char *)pMask->pData;
369 pByteStop = pByteStart + nBytes;
370 // clean the counter of ones
371 nOnes = 0;
372 // iterate through the positions
373 for ( pByte = pByteStart; pByte < pByteStop; pByte++ )
374 nOnes += bit_count[*pByte];
375 // set the nOnes
376 pDiffs[nCubePairs++] = nOnes;
377 }
378 }
379 // deallocate the mask
380 Mvc_CubeFree( pCover, pMask );
381 return 1;
382}
383
384
404Mvc_Cover_t * Mvc_CoverRemap( Mvc_Cover_t * p, int * pVarsRem, int nVarsRem )
405{
406 Mvc_Cover_t * pCover;
407 Mvc_Cube_t * pCube, * pCubeCopy;
408 int i;
409 // clone the cover
410 pCover = Mvc_CoverAlloc( p->pMem, nVarsRem );
411 // copy the cube list
412 Mvc_CoverForEachCube( p, pCube )
413 {
414 pCubeCopy = Mvc_CubeAlloc( pCover );
415 //Mvc_CubeBitClean( pCubeCopy ); //changed by wjiang
416 Mvc_CubeBitFill( pCubeCopy ); //changed by wjiang
417 Mvc_CoverAddCubeTail( pCover, pCubeCopy );
418 }
419 // copy the corresponding columns
420 for ( i = 0; i < nVarsRem; i++ )
421 {
422 if (pVarsRem[i] < 0)
423 continue; //added by wjiang
424 assert( pVarsRem[i] >= 0 && pVarsRem[i] < p->nBits );
425 Mvc_CoverCopyColumn( p, pCover, pVarsRem[i], i );
426 }
427 return pCover;
428}
429
444void Mvc_CoverCopyColumn( Mvc_Cover_t * pCoverOld, Mvc_Cover_t * pCoverNew,
445 int iColOld, int iColNew )
446{
447 Mvc_Cube_t * pCubeOld, * pCubeNew;
448 int iWordOld, iWordNew, iBitOld, iBitNew;
449
450 assert( Mvc_CoverReadCubeNum(pCoverOld) == Mvc_CoverReadCubeNum(pCoverNew) );
451
452 // get the place of the old and new columns
453 iWordOld = Mvc_CubeWhichWord(iColOld);
454 iBitOld = Mvc_CubeWhichBit(iColOld);
455 iWordNew = Mvc_CubeWhichWord(iColNew);
456 iBitNew = Mvc_CubeWhichBit(iColNew);
457
458 // go through the cubes of both covers
459 pCubeNew = Mvc_CoverReadCubeHead(pCoverNew);
460 Mvc_CoverForEachCube( pCoverOld, pCubeOld )
461 {
462 if ( pCubeOld->pData[iWordOld] & (1<<iBitOld) )
463 pCubeNew->pData[iWordNew] |= (1<<iBitNew);
464 else
465 pCubeNew->pData[iWordNew] &= ~(1<<iBitNew); // added by wjiang
466 pCubeNew = Mvc_CubeReadNext( pCubeNew );
467 }
468}
469
482{
483 Mvc_Cube_t * pCube;
484 // complement the cubes
485 Mvc_CoverForEachCube( pCover, pCube )
486 Mvc_CubeBitNot( pCube );
487}
488
501{
502 Mvc_Cover_t * pCoverNew;
503 Mvc_Cube_t * pCube;
504
505 pCoverNew = Mvc_CoverDup( pCover );
506 Mvc_CoverForEachCube( pCoverNew, pCube )
507 Mvc_CubeBitRemoveDcs( pCube );
508 return pCoverNew;
509}
510
522Mvc_Cover_t * Mvc_CoverCofactor( Mvc_Cover_t * p, int iValue, int iValueOther )
523{
524 Mvc_Cover_t * pCover;
525 Mvc_Cube_t * pCube, * pCubeCopy;
526 // clone the cover
527 pCover = Mvc_CoverClone( p );
528 // copy the cube list
529 Mvc_CoverForEachCube( p, pCube )
530 if ( Mvc_CubeBitValue( pCube, iValue ) )
531 {
532 pCubeCopy = Mvc_CubeDup( pCover, pCube );
533 Mvc_CoverAddCubeTail( pCover, pCubeCopy );
534 Mvc_CubeBitInsert( pCubeCopy, iValueOther );
535 }
536 return pCover;
537}
538
550Mvc_Cover_t * Mvc_CoverFlipVar( Mvc_Cover_t * p, int iValue0, int iValue1 )
551{
552 Mvc_Cover_t * pCover;
553 Mvc_Cube_t * pCube, * pCubeCopy;
554 int Value0, Value1, Temp;
555
556 assert( iValue0 + 1 == iValue1 ); // should be adjacent
557
558 // clone the cover
559 pCover = Mvc_CoverClone( p );
560 // copy the cube list
561 Mvc_CoverForEachCube( p, pCube )
562 {
563 pCubeCopy = Mvc_CubeDup( pCover, pCube );
564 Mvc_CoverAddCubeTail( pCover, pCubeCopy );
565
566 // get the bits
567 Value0 = Mvc_CubeBitValue( pCubeCopy, iValue0 );
568 Value1 = Mvc_CubeBitValue( pCubeCopy, iValue1 );
569
570 // if both bits are one, nothing to swap
571 if ( Value0 && Value1 )
572 continue;
573 // cannot be both zero because they belong to the same var
574 assert( Value0 || Value1 );
575
576 // swap the bits
577 Temp = Value0;
578 Value0 = Value1;
579 Value1 = Temp;
580
581 // set the bits after the swap
582 if ( Value0 )
583 Mvc_CubeBitInsert( pCubeCopy, iValue0 );
584 else
585 Mvc_CubeBitRemove( pCubeCopy, iValue0 );
586
587 if ( Value1 )
588 Mvc_CubeBitInsert( pCubeCopy, iValue1 );
589 else
590 Mvc_CubeBitRemove( pCubeCopy, iValue1 );
591 }
592 return pCover;
593}
594
611 int iValueA0, int iValueA1, int iValueB0, int iValueB1 )
612{
613 Mvc_Cover_t * pCover;
614 Mvc_Cube_t * pCube, * pCubeCopy;
615 int ValueA0, ValueA1, ValueB0, ValueB1;
616
617 // clone the cover
618 pCover = Mvc_CoverClone( p );
619 // copy the cube list
620 Mvc_CoverForEachCube( p, pCube )
621 {
622 // get the bits
623 ValueA0 = Mvc_CubeBitValue( pCube, iValueA0 );
624 ValueA1 = Mvc_CubeBitValue( pCube, iValueA1 );
625 ValueB0 = Mvc_CubeBitValue( pCube, iValueB0 );
626 ValueB1 = Mvc_CubeBitValue( pCube, iValueB1 );
627
628 // cannot be both zero because they belong to the same var
629 assert( ValueA0 || ValueA1 );
630 assert( ValueB0 || ValueB1 );
631
632 // if the values of this var are different, do not add the cube
633 if ( ValueA0 != ValueB0 && ValueA1 != ValueB1 )
634 continue;
635
636 // create the cube
637 pCubeCopy = Mvc_CubeDup( pCover, pCube );
638 Mvc_CoverAddCubeTail( pCover, pCubeCopy );
639
640 // insert 1's into for the first var, if both have this value
641 if ( ValueA0 && ValueB0 )
642 Mvc_CubeBitInsert( pCubeCopy, iValueA0 );
643 else
644 Mvc_CubeBitRemove( pCubeCopy, iValueA0 );
645
646 if ( ValueA1 && ValueB1 )
647 Mvc_CubeBitInsert( pCubeCopy, iValueA1 );
648 else
649 Mvc_CubeBitRemove( pCubeCopy, iValueA1 );
650
651 // insert 1's into for the second var (the cover does not depend on it)
652 Mvc_CubeBitInsert( pCubeCopy, iValueB0 );
653 Mvc_CubeBitInsert( pCubeCopy, iValueB1 );
654 }
655 return pCover;
656}
657
658#if 0
659
672Mvc_Cover_t ** Mvc_CoverCofactors( Mvc_Data_t * pData, Mvc_Cover_t * pCover, int iVar )
673{
674 Mvc_Cover_t ** ppCofs;
675 Mvc_Cube_t * pCube, * pCubeNew;
676 int i, nValues, iValueFirst, Res;
677
678 // start the covers for cofactors
679 iValueFirst = Vm_VarMapReadValuesFirst(pData->pVm, iVar);
680 nValues = Vm_VarMapReadValues(pData->pVm, iVar);
681 ppCofs = ABC_ALLOC( Mvc_Cover_t *, nValues + 1 );
682 for ( i = 0; i <= nValues; i++ )
683 ppCofs[i] = Mvc_CoverClone( pCover );
684
685 // go through the cubes
686 Mvc_CoverForEachCube( pCover, pCube )
687 {
688 // if the literal if a full literal, add it to last "cofactor"
689 Mvc_CubeBitEqualUnderMask( Res, pCube, pData->ppMasks[iVar], pData->ppMasks[iVar] );
690 if ( Res )
691 {
692 pCubeNew = Mvc_CubeDup(pCover, pCube);
693 Mvc_CoverAddCubeTail( ppCofs[nValues], pCubeNew );
694 continue;
695 }
696
697 // otherwise, add it to separate values
698 for ( i = 0; i < nValues; i++ )
699 if ( Mvc_CubeBitValue( pCube, iValueFirst + i ) )
700 {
701 pCubeNew = Mvc_CubeDup(pCover, pCube);
702 Mvc_CubeBitOr( pCubeNew, pCubeNew, pData->ppMasks[iVar] );
703 Mvc_CoverAddCubeTail( ppCofs[i], pCubeNew );
704 }
705 }
706 return ppCofs;
707}
708
723int Mvr_CoverCountLitsWithValue( Mvc_Data_t * pData, Mvc_Cover_t * pCover, int iVar, int iValue )
724{
725 Mvc_Cube_t * pCube;
726 int iValueFirst, Res, Counter;
727
728 Counter = 0;
729 iValueFirst = Vm_VarMapReadValuesFirst( pData->pVm, iVar );
730 Mvc_CoverForEachCube( pCover, pCube )
731 {
732 // check if the given literal is the full literal
733 Mvc_CubeBitEqualUnderMask( Res, pCube, pData->ppMasks[iVar], pData->ppMasks[iVar] );
734 if ( Res )
735 continue;
736 // this literal is not a full literal; check if it has this value
737 Counter += Mvc_CubeBitValue( pCube, iValueFirst + iValue );
738 }
739 return Counter;
740}
741
757Mvc_Cover_t * Mvc_CoverCreateExpanded( Mvc_Cover_t * pCover, Vm_VarMap_t * pVmNew )
758{
759 Mvc_Cover_t * pCoverNew;
760 Mvc_Cube_t * pCube, * pCubeNew;
761 int i, iLast, iLastNew;
762
763 // create the new cover
764 pCoverNew = Mvc_CoverAlloc( pCover->pMem, Vm_VarMapReadValuesInNum(pVmNew) );
765
766 // get the cube composed of extra bits
767 Mvc_CoverAllocateMask( pCoverNew );
768 Mvc_CubeBitClean( pCoverNew->pMask );
769 for ( i = pCover->nBits; i < pCoverNew->nBits; i++ )
770 Mvc_CubeBitInsert( pCoverNew->pMask, i );
771
772 // get the indexes of the last words in both covers
773 iLast = pCover->nWords? pCover->nWords - 1: 0;
774 iLastNew = pCoverNew->nWords? pCoverNew->nWords - 1: 0;
775
776 // create the cubes of the new cover
777 Mvc_CoverForEachCube( pCover, pCube )
778 {
779 pCubeNew = Mvc_CubeAlloc( pCoverNew );
780 Mvc_CubeBitClean( pCubeNew );
781 // copy the bits (cannot immediately use Mvc_CubeBitCopy,
782 // because covers have different numbers of bits)
783 Mvc_CubeSetLast( pCubeNew, iLast );
784 Mvc_CubeBitCopy( pCubeNew, pCube );
785 Mvc_CubeSetLast( pCubeNew, iLastNew );
786 // add the extra bits
787 Mvc_CubeBitOr( pCubeNew, pCubeNew, pCoverNew->pMask );
788 // add the cube to the new cover
789 Mvc_CoverAddCubeTail( pCoverNew, pCubeNew );
790 }
791 return pCoverNew;
792}
793
794#endif
795
809{
810 Mvc_Cover_t * pRes;
811 Mvc_Cube_t * pCubeRes, * pCube;
812 int nWord, nBit, i, iCube;
813
814 pRes = Mvc_CoverAlloc( pCover->pMem, Mvc_CoverReadCubeNum(pCover) );
815 for ( i = 0; i < pCover->nBits; i++ )
816 {
817 // get the word and bit of this literal
818 nWord = Mvc_CubeWhichWord(i);
819 nBit = Mvc_CubeWhichBit(i);
820 // get the transposed cube
821 pCubeRes = Mvc_CubeAlloc( pRes );
822 Mvc_CubeBitClean( pCubeRes );
823 iCube = 0;
824 Mvc_CoverForEachCube( pCover, pCube )
825 {
826 if ( pCube->pData[nWord] & (1<<nBit) )
827 Mvc_CubeBitInsert( pCubeRes, iCube );
828 iCube++;
829 }
830 Mvc_CoverAddCubeTail( pRes, pCubeRes );
831 }
832 return pRes;
833}
834
847{
848 unsigned Unsigned;
849 Mvc_Cube_t * pCube;
850 int nCubes;
851
852 nCubes = 0;
853 Mvc_CoverForEachCube( pCover, pCube )
854 {
855 if ( pCube->nUnused == 0 )
856 continue;
857
858 Unsigned = ( pCube->pData[pCube->iLast] &
859 (BITS_FULL << (32-pCube->nUnused)) );
860 if( Unsigned )
861 {
862 printf( "Cube %2d out of %2d contains dirty bits.\n", nCubes,
863 Mvc_CoverReadCubeNum(pCover) );
864 }
865 nCubes++;
866 }
867 return 1;
868}
869
870
874
875
877
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
Cube * p
Definition exorList.c:222
Mvc_Cover_t * Mvc_CoverCofactor(Mvc_Cover_t *p, int iValue, int iValueOther)
Definition mvcUtils.c:522
Mvc_Cover_t * Mvc_CoverTranspose(Mvc_Cover_t *pCover)
Definition mvcUtils.c:808
Mvc_Cover_t * Mvc_CoverCommonCubeCover(Mvc_Cover_t *pCover)
Definition mvcUtils.c:220
int Mvc_CoverSupportSizeBinary(Mvc_Cover_t *pCover)
Definition mvcUtils.c:100
Mvc_Cover_t * Mvc_CoverFlipVar(Mvc_Cover_t *p, int iValue0, int iValue1)
Definition mvcUtils.c:550
int Mvc_CoverCountCubePairDiffs(Mvc_Cover_t *pCover, unsigned char pDiffs[])
Definition mvcUtils.c:345
void Mvc_CoverMakeCubeFree(Mvc_Cover_t *pCover)
Definition mvcUtils.c:198
int Mvc_CoverCheckSuppContainment(Mvc_Cover_t *pCover1, Mvc_Cover_t *pCover2)
Definition mvcUtils.c:247
int Mvc_UtilsCheckUnusedZeros(Mvc_Cover_t *pCover)
Definition mvcUtils.c:846
Mvc_Cover_t * Mvc_CoverRemoveDontCareLits(Mvc_Cover_t *pCover)
Definition mvcUtils.c:500
Mvc_Cover_t * Mvc_CoverUnivQuantify(Mvc_Cover_t *p, int iValueA0, int iValueA1, int iValueB0, int iValueB1)
Definition mvcUtils.c:610
void Mvc_CoverSupportAnd(Mvc_Cover_t *pCover, Mvc_Cube_t *pSupp)
Definition mvcUtils.c:79
void Mvc_CoverInverse(Mvc_Cover_t *pCover)
Definition mvcUtils.c:481
void Mvc_CoverCommonCube(Mvc_Cover_t *pCover, Mvc_Cube_t *pComCube)
Definition mvcUtils.c:155
Mvc_Cover_t * Mvc_CoverRemap(Mvc_Cover_t *p, int *pVarsRem, int nVarsRem)
Definition mvcUtils.c:404
int Mvc_CoverSupportVarBelongs(Mvc_Cover_t *pCover, int iVar)
Definition mvcUtils.c:130
int Mvc_CoverIsCubeFree(Mvc_Cover_t *pCover)
Definition mvcUtils.c:176
int Mvc_CoverSetCubeSizes(Mvc_Cover_t *pCover)
Definition mvcUtils.c:272
void Mvc_CoverSupport(Mvc_Cover_t *pCover, Mvc_Cube_t *pSupp)
FUNCTION DEFINITIONS ///.
Definition mvcUtils.c:58
#define Mvc_CubeBitOr(CubeR, Cube1, Cube2)
Definition mvc.h:397
int Mvr_CoverCountLitsWithValue(Mvc_Data_t *pData, Mvc_Cover_t *pCover, int iVar, int iValue)
#define Mvc_CoverAddCubeTail(pCover, pCube)
Definition mvc.h:501
#define Mvc_CubeBitNotImpl(Res, Cube1, Cube2)
Definition mvc.h:429
Mvc_Cover_t * Mvc_CoverDup(Mvc_Cover_t *pCover)
Definition mvcCover.c:112
#define Mvc_CubeWhichWord(Bit)
Definition mvc.h:135
Mvc_Cover_t * Mvc_CoverClone(Mvc_Cover_t *pCover)
Definition mvcCover.c:79
#define Mvc_CubeSetSize(Cube, Size)
Definition mvc.h:128
struct MvcCubeStruct Mvc_Cube_t
Definition mvc.h:56
#define Mvc_CubeSetLast(Cube, Last)
Definition mvc.h:127
#define Mvc_CubeBitAnd(CubeR, Cube1, Cube2)
Definition mvc.h:405
void Mvc_CoverAllocateMask(Mvc_Cover_t *pCover)
Definition mvcCover.c:168
struct MvcDataStruct Mvc_Data_t
Definition mvc.h:59
#define Mvc_CubeBitExor(CubeR, Cube1, Cube2)
Definition mvc.h:401
#define Mvc_CubeBitEmpty(Res, Cube)
Definition mvc.h:413
#define Mvc_CubeReadNext(Cube)
MACRO DEFINITIONS ///.
Definition mvc.h:121
#define Mvc_CubeBitClean(Cube)
Definition mvc.h:381
#define Mvc_CubeBitSharp(CubeR, Cube1, Cube2)
Definition mvc.h:409
#define Mvc_CubeBitRemove(Cube, Bit)
Definition mvc.h:140
unsigned int Mvc_CubeWord_t
STRUCTURE DEFINITIONS ///.
Definition mvc.h:55
Mvc_Cover_t * Mvc_CoverAlloc(Mvc_Manager_t *pMem, int nBits)
DECLARATIONS ///.
Definition mvcCover.c:43
#define Mvc_CubeBitFill(Cube)
Definition mvc.h:385
#define Mvc_CubeBitValue(Cube, Bit)
Definition mvc.h:138
#define Mvc_CoverForEachCube(Cover, Cube)
Definition mvc.h:528
Mvc_Cover_t ** Mvc_CoverCofactors(Mvc_Data_t *pData, Mvc_Cover_t *pCover, int iVar)
Mvc_Cube_t * Mvc_CubeAlloc(Mvc_Cover_t *pCover)
DECLARATIONS ///.
Definition mvcCube.c:43
struct MvcCoverStruct Mvc_Cover_t
Definition mvc.h:58
#define BITS_FULL
Definition mvc.h:45
#define Mvc_CubeBitEqualUnderMask(Res, Cube1, Cube2, Mask)
Definition mvc.h:437
void Mvc_CubeBitRemoveDcs(Mvc_Cube_t *pCube)
Definition mvcCube.c:159
Mvc_Cube_t * Mvc_CoverReadCubeHead(Mvc_Cover_t *pCover)
Definition mvcApi.c:46
#define Mvc_CubeWhichBit(Bit)
Definition mvc.h:136
#define Mvc_CubeBitNot(Cube)
Definition mvc.h:389
int Mvc_CoverReadCubeNum(Mvc_Cover_t *pCover)
Definition mvcApi.c:45
#define Mvc_CubeBitInsert(Cube, Bit)
Definition mvc.h:139
void Mvc_CubeFree(Mvc_Cover_t *pCover, Mvc_Cube_t *pCube)
Definition mvcCube.c:114
Mvc_Cube_t * Mvc_CubeDup(Mvc_Cover_t *pCover, Mvc_Cube_t *pCube)
Definition mvcCube.c:94
#define Mvc_CoverForEachCubeStart(Start, Cube)
Definition mvc.h:542
#define Mvc_CubeBitCopy(Cube1, Cube2)
Definition mvc.h:393
int nBits
Definition mvc.h:87
Mvc_Cube_t * pMask
Definition mvc.h:92
int nWords
Definition mvc.h:85
Mvc_Manager_t * pMem
Definition mvc.h:93
Mvc_CubeWord_t pData[1]
Definition mvc.h:71
unsigned iLast
Definition mvc.h:66
unsigned nUnused
Definition mvc.h:67
Mvc_Cube_t ** ppMasks
Definition mvc.h:103
#define assert(ex)
Definition util_old.h:213