ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
mvcPrint.c
Go to the documentation of this file.
1
18
19#include "mvc.h"
20//#include "vm.h"
21//#include "vmInt.h"
22
24
25
29
30static void Mvc_CubePrintBinary( Mvc_Cover_t * pCover, Mvc_Cube_t * pCube );
31
35
48{
49 Mvc_Cube_t * pCube;
50 int i;
51 // print general statistics
52 printf( "The cover contains %d cubes (%d bits and %d words)\n",
53 pCover->lCubes.nItems, pCover->nBits, pCover->nWords );
54 // iterate through the cubes
55 Mvc_CoverForEachCube( pCover, pCube )
56 Mvc_CubePrint( pCover, pCube );
57
58 if ( pCover->pLits )
59 {
60 for ( i = 0; i < pCover->nBits; i++ )
61 printf( " %d", pCover->pLits[i] );
62 printf( "\n" );
63 }
64 printf( "End of cover printout\n" );
65}
66
67
79void Mvc_CubePrint( Mvc_Cover_t * pCover, Mvc_Cube_t * pCube )
80{
81 int iBit, Value;
82 // iterate through the literals
83// printf( "Size = %2d ", Mvc_CubeReadSize(pCube) );
84 Mvc_CubeForEachBit( pCover, pCube, iBit, Value )
85 printf( "%c", '0' + Value );
86 printf( "\n" );
87}
88
89
102{
103 Mvc_Cube_t * pCube;
104 int i;
105 // print general statistics
106 printf( "The cover contains %d cubes (%d bits and %d words)\n",
107 pCover->lCubes.nItems, pCover->nBits, pCover->nWords );
108 // iterate through the cubes
109 Mvc_CoverForEachCube( pCover, pCube )
110 Mvc_CubePrintBinary( pCover, pCube );
111
112 if ( pCover->pLits )
113 {
114 for ( i = 0; i < pCover->nBits; i++ )
115 printf( " %d", pCover->pLits[i] );
116 printf( "\n" );
117 }
118 printf( "End of cover printout\n" );
119}
120
121
133void Mvc_CubePrintBinary( Mvc_Cover_t * pCover, Mvc_Cube_t * pCube )
134{
135 int iVar, Value;
136 // iterate through the literals
137// printf( "Size = %2d ", Mvc_CubeReadSize(pCube) );
138 Mvc_CubeForEachVarValue( pCover, pCube, iVar, Value )
139 {
140 assert( Value != 0 );
141 if ( Value == 3 )
142 printf( "-" );
143 else if ( Value == 1 )
144 printf( "0" );
145 else
146 printf( "1" );
147 }
148 printf( "\n" );
149}
150
151#if 0
152
164void Mvc_CoverPrintMv( Mvc_Data_t * pData, Mvc_Cover_t * pCover )
165{
166 Mvc_Cube_t * pCube;
167 int i;
168 // print general statistics
169 printf( "The cover contains %d cubes (%d bits and %d words)\n",
170 pCover->lCubes.nItems, pCover->nBits, pCover->nWords );
171 // iterate through the cubes
172 Mvc_CoverForEachCube( pCover, pCube )
173 Mvc_CubePrintMv( pData, pCover, pCube );
174
175 if ( pCover->pLits )
176 {
177 for ( i = 0; i < pCover->nBits; i++ )
178 printf( " %d", pCover->pLits[i] );
179 printf( "\n" );
180 }
181 printf( "End of cover printout\n" );
182}
183
184
196void Mvc_CubePrintMv( Mvc_Data_t * pData, Mvc_Cover_t * pCover, Mvc_Cube_t * pCube )
197{
198 int iLit, iVar;
199 // iterate through the literals
200 printf( "Size = %2d ", Mvc_CubeReadSize(pCube) );
201 iVar = 0;
202 for ( iLit = 0; iLit < pData->pVm->nValuesIn; iLit++ )
203 {
204 if ( iLit == pData->pVm->pValuesFirst[iVar+1] )
205 {
206 printf( " " );
207 iVar++;
208 }
209 if ( Mvc_CubeBitValue( pCube, iLit ) )
210 printf( "%c", '0' + iLit - pData->pVm->pValuesFirst[iVar] );
211 else
212 printf( "-" );
213 }
214 printf( "\n" );
215}
216
217#endif
218
222
223
225
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
void Mvc_CubePrint(Mvc_Cover_t *pCover, Mvc_Cube_t *pCube)
Definition mvcPrint.c:79
void Mvc_CoverPrint(Mvc_Cover_t *pCover)
FUNCTION DEFINITIONS ///.
Definition mvcPrint.c:47
void Mvc_CoverPrintBinary(Mvc_Cover_t *pCover)
Definition mvcPrint.c:101
struct MvcCubeStruct Mvc_Cube_t
Definition mvc.h:56
struct MvcDataStruct Mvc_Data_t
Definition mvc.h:59
void Mvc_CoverPrintMv(Mvc_Data_t *pData, Mvc_Cover_t *pCover)
#define Mvc_CubeReadSize(Cube)
Definition mvc.h:124
#define Mvc_CubeBitValue(Cube, Bit)
Definition mvc.h:138
#define Mvc_CubeForEachVarValue(Cover, Cube, iVar, Value)
Definition mvc.h:558
#define Mvc_CoverForEachCube(Cover, Cube)
Definition mvc.h:528
struct MvcCoverStruct Mvc_Cover_t
Definition mvc.h:58
#define Mvc_CubeForEachBit(Cover, Cube, iBit, Value)
Definition mvc.h:553
void Mvc_CubePrintMv(Mvc_Data_t *pData, Mvc_Cover_t *pCover, Mvc_Cube_t *pCube)
int nBits
Definition mvc.h:87
int nWords
Definition mvc.h:85
int * pLits
Definition mvc.h:91
Mvc_List_t lCubes
Definition mvc.h:88
int nItems
Definition mvc.h:79
#define assert(ex)
Definition util_old.h:213