ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
kit.h
Go to the documentation of this file.
1
20
21#ifndef ABC__aig__kit__kit_h
22#define ABC__aig__kit__kit_h
23
24
28
29#include <stdio.h>
30#include <stdlib.h>
31#include <string.h>
32#include <assert.h>
33
34#include "misc/vec/vec.h"
35#include "cloud.h"
36
37#ifdef ABC_USE_CUDD
38#include "bdd/extrab/extraBdd.h"
39#endif
40
44
45
46
48
49
53
54typedef struct Kit_Sop_t_ Kit_Sop_t;
56{
57 int nLits; // the number of literals
58 int nCubes; // the number of cubes
59 unsigned * pCubes; // the storage for cubes
60};
61
62typedef struct Kit_Edge_t_ Kit_Edge_t;
64{
65 unsigned fCompl : 1; // the complemented bit
66 unsigned Node : 30; // the decomposition node pointed by the edge
67};
68
69typedef struct Kit_Node_t_ Kit_Node_t;
71{
72 Kit_Edge_t eEdge0; // the left child of the node
73 Kit_Edge_t eEdge1; // the right child of the node
74 // other info
75 union { int iFunc; // the function of the node (BDD or AIG)
76 void * pFunc; }; // the function of the node (BDD or AIG)
77 unsigned Level : 14; // the level of this node in the global AIG
78 // printing info
79 unsigned fNodeOr : 1; // marks the original OR node
80 unsigned fCompl0 : 1; // marks the original complemented edge
81 unsigned fCompl1 : 1; // marks the original complemented edge
82 // latch info
83 unsigned nLat0 : 5; // the number of latches on the first edge
84 unsigned nLat1 : 5; // the number of latches on the second edge
85 unsigned nLat2 : 5; // the number of latches on the output edge
86};
87
90{
91 int fConst; // marks the constant 1 graph
92 int nLeaves; // the number of leaves
93 int nSize; // the number of nodes (including the leaves)
94 int nCap; // the number of allocated nodes
95 Kit_Node_t * pNodes; // the array of leaves and internal nodes
96 Kit_Edge_t eRoot; // the pointer to the topmost node
97};
98
99
100// DSD node types
101typedef enum {
102 KIT_DSD_NONE = 0, // 0: unknown
103 KIT_DSD_CONST1, // 1: constant 1
104 KIT_DSD_VAR, // 2: elementary variable
105 KIT_DSD_AND, // 3: multi-input AND
106 KIT_DSD_XOR, // 4: multi-input XOR
107 KIT_DSD_PRIME // 5: arbitrary function of 3+ variables
108} Kit_Dsd_t;
109
110// DSD node
113{
114 unsigned Id : 6; // the number of this node
115 unsigned Type : 3; // none, const, var, AND, XOR, MUX, PRIME
116 unsigned fMark : 1; // finished checking output
117 unsigned Offset : 8; // offset to the truth table
118 unsigned nRefs : 8; // offset to the truth table
119 unsigned nFans : 6; // the number of fanins of this node
120 unsigned short pFans[0]; // the fanin literals
121};
122
123// DSD network
126{
127 unsigned short nVars; // at most 16 (perhaps 18?)
128 unsigned short nNodesAlloc; // the number of allocated nodes (at most nVars)
129 unsigned short nNodes; // the number of nodes
130 unsigned short Root; // the root of the tree
131 unsigned * pMem; // memory for the truth tables (memory manager?)
132 unsigned * pSupps; // supports of the nodes
133 Kit_DsdObj_t** pNodes; // the nodes
134};
135
136// DSD manager
139{
140 int nVars; // the maximum number of variables
141 int nWords; // the number of words in TTs
142 Vec_Ptr_t * vTtElems; // elementary truth tables
143 Vec_Ptr_t * vTtNodes; // the node truth tables
144 // BDD representation
145 CloudManager * dd; // BDD package
146 Vec_Ptr_t * vTtBdds; // the node truth tables
147 Vec_Int_t * vNodes; // temporary array for BDD nodes
148};
149
150static inline unsigned Kit_DsdObjOffset( int nFans ) { return (nFans >> 1) + ((nFans & 1) > 0); }
151static inline unsigned * Kit_DsdObjTruth( Kit_DsdObj_t * pObj ) { return pObj->Type == KIT_DSD_PRIME ? (unsigned *)pObj->pFans + pObj->Offset: NULL; }
152static inline int Kit_DsdNtkObjNum( Kit_DsdNtk_t * pNtk ){ return pNtk->nVars + pNtk->nNodes; }
153static inline Kit_DsdObj_t * Kit_DsdNtkObj( Kit_DsdNtk_t * pNtk, int Id ) { assert( Id >= 0 && Id < pNtk->nVars + pNtk->nNodes ); return Id < pNtk->nVars ? NULL : pNtk->pNodes[Id - pNtk->nVars]; }
154static inline Kit_DsdObj_t * Kit_DsdNtkRoot( Kit_DsdNtk_t * pNtk ) { return Kit_DsdNtkObj( pNtk, Abc_Lit2Var(pNtk->Root) ); }
155static inline int Kit_DsdLitIsLeaf( Kit_DsdNtk_t * pNtk, int Lit ) { int Id = Abc_Lit2Var(Lit); assert( Id >= 0 && Id < pNtk->nVars + pNtk->nNodes ); return Id < pNtk->nVars; }
156static inline unsigned Kit_DsdLitSupport( Kit_DsdNtk_t * pNtk, int Lit ) { int Id = Abc_Lit2Var(Lit); assert( Id >= 0 && Id < pNtk->nVars + pNtk->nNodes ); return pNtk->pSupps? (Id < pNtk->nVars? (1 << Id) : pNtk->pSupps[Id - pNtk->nVars]) : 0; }
157
158#define Kit_DsdNtkForEachObj( pNtk, pObj, i ) \
159 for ( i = 0; (i < (pNtk)->nNodes) && ((pObj) = (pNtk)->pNodes[i]); i++ )
160#define Kit_DsdObjForEachFanin( pNtk, pObj, iLit, i ) \
161 for ( i = 0; (i < (int)(pObj)->nFans) && ((iLit) = (pObj)->pFans[i], 1); i++ )
162#define Kit_DsdObjForEachFaninReverse( pNtk, pObj, iLit, i ) \
163 for ( i = (int)(pObj)->nFans - 1; (i >= 0) && ((iLit) = (pObj)->pFans[i], 1); i-- )
164
165#define Kit_PlaForEachCube( pSop, nFanins, pCube ) \
166 for ( pCube = (pSop); *pCube; pCube += (nFanins) + 3 )
167#define Kit_PlaCubeForEachVar( pCube, Value, i ) \
168 for ( i = 0; (pCube[i] != ' ') && (Value = pCube[i]); i++ )
169
173
174#define KIT_MIN(a,b) (((a) < (b))? (a) : (b))
175#define KIT_MAX(a,b) (((a) > (b))? (a) : (b))
176#define KIT_INFINITY (100000000)
177
178static inline int Kit_CubeHasLit( unsigned uCube, int i ) { return(uCube & (unsigned)(1U<<i)) > 0; }
179static inline unsigned Kit_CubeSetLit( unsigned uCube, int i ) { return uCube | (unsigned)(1U<<i); }
180static inline unsigned Kit_CubeXorLit( unsigned uCube, int i ) { return uCube ^ (unsigned)(1U<<i); }
181static inline unsigned Kit_CubeRemLit( unsigned uCube, int i ) { return uCube & ~(unsigned)(1U<<i); }
182
183static inline int Kit_CubeContains( unsigned uLarge, unsigned uSmall ) { return (uLarge & uSmall) == uSmall; }
184static inline unsigned Kit_CubeSharp( unsigned uCube, unsigned uMask ) { return uCube & ~uMask; }
185static inline unsigned Kit_CubeMask( int nVar ) { return (~(unsigned)0) >> (32-nVar); }
186
187static inline int Kit_CubeIsMarked( unsigned uCube ) { return Kit_CubeHasLit( uCube, 31 ); }
188static inline unsigned Kit_CubeMark( unsigned uCube ) { return Kit_CubeSetLit( uCube, 31 ); }
189static inline unsigned Kit_CubeUnmark( unsigned uCube ) { return Kit_CubeRemLit( uCube, 31 ); }
190
191static inline int Kit_SopCubeNum( Kit_Sop_t * cSop ) { return cSop->nCubes; }
192static inline unsigned Kit_SopCube( Kit_Sop_t * cSop, int i ) { return cSop->pCubes[i]; }
193static inline void Kit_SopShrink( Kit_Sop_t * cSop, int nCubesNew ) { cSop->nCubes = nCubesNew; }
194static inline void Kit_SopPushCube( Kit_Sop_t * cSop, unsigned uCube ) { cSop->pCubes[cSop->nCubes++] = uCube; }
195static inline void Kit_SopWriteCube( Kit_Sop_t * cSop, unsigned uCube, int i ) { cSop->pCubes[i] = uCube; }
196
197static inline Kit_Edge_t Kit_EdgeCreate( int Node, int fCompl ) { Kit_Edge_t eEdge = { (unsigned)fCompl, (unsigned)Node }; return eEdge; }
198static inline unsigned Kit_EdgeToInt( Kit_Edge_t eEdge ) { return (eEdge.Node << 1) | eEdge.fCompl; }
199static inline Kit_Edge_t Kit_IntToEdge( unsigned Edge ) { return Kit_EdgeCreate( Edge >> 1, Edge & 1 ); }
200//static inline unsigned Kit_EdgeToInt_( Kit_Edge_t eEdge ) { return *(unsigned *)&eEdge; }
201//static inline Kit_Edge_t Kit_IntToEdge_( unsigned Edge ) { return *(Kit_Edge_t *)&Edge; }
202static inline unsigned Kit_EdgeToInt_( Kit_Edge_t m ) { union { Kit_Edge_t x; unsigned y; } v; v.x = m; return v.y; }
203static inline Kit_Edge_t Kit_IntToEdge_( unsigned m ) { union { Kit_Edge_t x; unsigned y; } v; v.y = m; return v.x; }
204
205static inline int Kit_GraphIsConst( Kit_Graph_t * pGraph ) { return pGraph->fConst; }
206static inline int Kit_GraphIsConst0( Kit_Graph_t * pGraph ) { return pGraph->fConst && pGraph->eRoot.fCompl; }
207static inline int Kit_GraphIsConst1( Kit_Graph_t * pGraph ) { return pGraph->fConst && !pGraph->eRoot.fCompl; }
208static inline int Kit_GraphIsComplement( Kit_Graph_t * pGraph ) { return pGraph->eRoot.fCompl; }
209static inline int Kit_GraphIsVar( Kit_Graph_t * pGraph ) { return pGraph->eRoot.Node < (unsigned)pGraph->nLeaves; }
210static inline void Kit_GraphComplement( Kit_Graph_t * pGraph ) { pGraph->eRoot.fCompl ^= 1; }
211static inline void Kit_GraphSetRoot( Kit_Graph_t * pGraph, Kit_Edge_t eRoot ) { pGraph->eRoot = eRoot; }
212static inline int Kit_GraphLeaveNum( Kit_Graph_t * pGraph ) { return pGraph->nLeaves; }
213static inline int Kit_GraphNodeNum( Kit_Graph_t * pGraph ) { return pGraph->nSize - pGraph->nLeaves; }
214static inline Kit_Node_t * Kit_GraphNode( Kit_Graph_t * pGraph, int i ) { return pGraph->pNodes + i; }
215static inline Kit_Node_t * Kit_GraphNodeLast( Kit_Graph_t * pGraph ) { return pGraph->pNodes + pGraph->nSize - 1; }
216static inline int Kit_GraphNodeInt( Kit_Graph_t * pGraph, Kit_Node_t * pNode ) { return pNode - pGraph->pNodes; }
217static inline int Kit_GraphNodeIsVar( Kit_Graph_t * pGraph, Kit_Node_t * pNode ) { return Kit_GraphNodeInt(pGraph,pNode) < pGraph->nLeaves; }
218static inline Kit_Node_t * Kit_GraphVar( Kit_Graph_t * pGraph ) { assert( Kit_GraphIsVar( pGraph ) ); return Kit_GraphNode( pGraph, pGraph->eRoot.Node ); }
219static inline int Kit_GraphVarInt( Kit_Graph_t * pGraph ) { assert( Kit_GraphIsVar( pGraph ) ); return Kit_GraphNodeInt( pGraph, Kit_GraphVar(pGraph) ); }
220static inline Kit_Node_t * Kit_GraphNodeFanin0( Kit_Graph_t * pGraph, Kit_Node_t * pNode ){ return Kit_GraphNodeIsVar(pGraph, pNode)? NULL : Kit_GraphNode(pGraph, pNode->eEdge0.Node); }
221static inline Kit_Node_t * Kit_GraphNodeFanin1( Kit_Graph_t * pGraph, Kit_Node_t * pNode ){ return Kit_GraphNodeIsVar(pGraph, pNode)? NULL : Kit_GraphNode(pGraph, pNode->eEdge1.Node); }
222static inline int Kit_GraphRootLevel( Kit_Graph_t * pGraph ) { return Kit_GraphNode(pGraph, pGraph->eRoot.Node)->Level; }
223
224static inline int Kit_SuppIsMinBase( int Supp ) { return (Supp & (Supp+1)) == 0; }
225
226static inline int Kit_BitWordNum( int nBits ) { return nBits/(8*sizeof(unsigned)) + ((nBits%(8*sizeof(unsigned))) > 0); }
227static inline int Kit_TruthWordNum( int nVars ) { return nVars <= 5 ? 1 : (1 << (nVars - 5)); }
228static inline unsigned Kit_BitMask( int nBits ) { assert( nBits <= 32 ); return ~((~(unsigned)0) << nBits); }
229
230static inline void Kit_TruthSetBit( unsigned * p, int Bit ) { p[Bit>>5] |= (1<<(Bit & 31)); }
231static inline void Kit_TruthXorBit( unsigned * p, int Bit ) { p[Bit>>5] ^= (1<<(Bit & 31)); }
232static inline int Kit_TruthHasBit( unsigned * p, int Bit ) { return (p[Bit>>5] & (1<<(Bit & 31))) > 0; }
233
234static inline int Kit_WordFindFirstBit( unsigned uWord )
235{
236 int i;
237 for ( i = 0; i < 32; i++ )
238 if ( uWord & (1 << i) )
239 return i;
240 return -1;
241}
242static inline int Kit_WordHasOneBit( unsigned uWord )
243{
244 return (uWord & (uWord - 1)) == 0;
245}
246static inline int Kit_WordCountOnes( unsigned uWord )
247{
248 uWord = (uWord & 0x55555555) + ((uWord>>1) & 0x55555555);
249 uWord = (uWord & 0x33333333) + ((uWord>>2) & 0x33333333);
250 uWord = (uWord & 0x0F0F0F0F) + ((uWord>>4) & 0x0F0F0F0F);
251 uWord = (uWord & 0x00FF00FF) + ((uWord>>8) & 0x00FF00FF);
252 return (uWord & 0x0000FFFF) + (uWord>>16);
253}
254static inline int Kit_TruthCountOnes( unsigned * pIn, int nVars )
255{
256 int w, Counter = 0;
257 for ( w = Kit_TruthWordNum(nVars)-1; w >= 0; w-- )
258 Counter += Kit_WordCountOnes(pIn[w]);
259 return Counter;
260}
261static inline int Kit_TruthFindFirstBit( unsigned * pIn, int nVars )
262{
263 int w;
264 for ( w = 0; w < Kit_TruthWordNum(nVars); w++ )
265 if ( pIn[w] )
266 return 32*w + Kit_WordFindFirstBit(pIn[w]);
267 return -1;
268}
269static inline int Kit_TruthFindFirstZero( unsigned * pIn, int nVars )
270{
271 int w;
272 for ( w = 0; w < Kit_TruthWordNum(nVars); w++ )
273 if ( ~pIn[w] )
274 return 32*w + Kit_WordFindFirstBit(~pIn[w]);
275 return -1;
276}
277static inline int Kit_TruthIsEqual( unsigned * pIn0, unsigned * pIn1, int nVars )
278{
279 int w;
280 for ( w = Kit_TruthWordNum(nVars)-1; w >= 0; w-- )
281 if ( pIn0[w] != pIn1[w] )
282 return 0;
283 return 1;
284}
285static inline int Kit_TruthIsEqualWithCare( unsigned * pIn0, unsigned * pIn1, unsigned * pCare, int nVars )
286{
287 int w;
288 for ( w = Kit_TruthWordNum(nVars)-1; w >= 0; w-- )
289 if ( (pIn0[w] & pCare[w]) != (pIn1[w] & pCare[w]) )
290 return 0;
291 return 1;
292}
293static inline int Kit_TruthIsOpposite( unsigned * pIn0, unsigned * pIn1, int nVars )
294{
295 int w;
296 for ( w = Kit_TruthWordNum(nVars)-1; w >= 0; w-- )
297 if ( pIn0[w] != ~pIn1[w] )
298 return 0;
299 return 1;
300}
301static inline int Kit_TruthIsEqualWithPhase( unsigned * pIn0, unsigned * pIn1, int nVars )
302{
303 int w;
304 if ( (pIn0[0] & 1) == (pIn1[0] & 1) )
305 {
306 for ( w = Kit_TruthWordNum(nVars)-1; w >= 0; w-- )
307 if ( pIn0[w] != pIn1[w] )
308 return 0;
309 }
310 else
311 {
312 for ( w = Kit_TruthWordNum(nVars)-1; w >= 0; w-- )
313 if ( pIn0[w] != ~pIn1[w] )
314 return 0;
315 }
316 return 1;
317}
318static inline int Kit_TruthIsConst0( unsigned * pIn, int nVars )
319{
320 int w;
321 for ( w = Kit_TruthWordNum(nVars)-1; w >= 0; w-- )
322 if ( pIn[w] )
323 return 0;
324 return 1;
325}
326static inline int Kit_TruthIsConst1( unsigned * pIn, int nVars )
327{
328 int w;
329 for ( w = Kit_TruthWordNum(nVars)-1; w >= 0; w-- )
330 if ( pIn[w] != ~(unsigned)0 )
331 return 0;
332 return 1;
333}
334static inline int Kit_TruthIsImply( unsigned * pIn1, unsigned * pIn2, int nVars )
335{
336 int w;
337 for ( w = Kit_TruthWordNum(nVars)-1; w >= 0; w-- )
338 if ( pIn1[w] & ~pIn2[w] )
339 return 0;
340 return 1;
341}
342static inline int Kit_TruthIsDisjoint( unsigned * pIn1, unsigned * pIn2, int nVars )
343{
344 int w;
345 for ( w = Kit_TruthWordNum(nVars)-1; w >= 0; w-- )
346 if ( pIn1[w] & pIn2[w] )
347 return 0;
348 return 1;
349}
350static inline int Kit_TruthIsDisjoint3( unsigned * pIn1, unsigned * pIn2, unsigned * pIn3, int nVars )
351{
352 int w;
353 for ( w = Kit_TruthWordNum(nVars)-1; w >= 0; w-- )
354 if ( pIn1[w] & pIn2[w] & pIn3[w] )
355 return 0;
356 return 1;
357}
358static inline void Kit_TruthCopy( unsigned * pOut, unsigned * pIn, int nVars )
359{
360 int w;
361 for ( w = Kit_TruthWordNum(nVars)-1; w >= 0; w-- )
362 pOut[w] = pIn[w];
363}
364static inline void Kit_TruthClear( unsigned * pOut, int nVars )
365{
366 int w;
367 for ( w = Kit_TruthWordNum(nVars)-1; w >= 0; w-- )
368 pOut[w] = 0;
369}
370static inline void Kit_TruthFill( unsigned * pOut, int nVars )
371{
372 int w;
373 for ( w = Kit_TruthWordNum(nVars)-1; w >= 0; w-- )
374 pOut[w] = ~(unsigned)0;
375}
376static inline void Kit_TruthNot( unsigned * pOut, unsigned * pIn, int nVars )
377{
378 int w;
379 for ( w = Kit_TruthWordNum(nVars)-1; w >= 0; w-- )
380 pOut[w] = ~pIn[w];
381}
382static inline void Kit_TruthAnd( unsigned * pOut, unsigned * pIn0, unsigned * pIn1, int nVars )
383{
384 int w;
385 for ( w = Kit_TruthWordNum(nVars)-1; w >= 0; w-- )
386 pOut[w] = pIn0[w] & pIn1[w];
387}
388static inline void Kit_TruthOr( unsigned * pOut, unsigned * pIn0, unsigned * pIn1, int nVars )
389{
390 int w;
391 for ( w = Kit_TruthWordNum(nVars)-1; w >= 0; w-- )
392 pOut[w] = pIn0[w] | pIn1[w];
393}
394static inline void Kit_TruthXor( unsigned * pOut, unsigned * pIn0, unsigned * pIn1, int nVars )
395{
396 int w;
397 for ( w = Kit_TruthWordNum(nVars)-1; w >= 0; w-- )
398 pOut[w] = pIn0[w] ^ pIn1[w];
399}
400static inline void Kit_TruthSharp( unsigned * pOut, unsigned * pIn0, unsigned * pIn1, int nVars )
401{
402 int w;
403 for ( w = Kit_TruthWordNum(nVars)-1; w >= 0; w-- )
404 pOut[w] = pIn0[w] & ~pIn1[w];
405}
406static inline void Kit_TruthNand( unsigned * pOut, unsigned * pIn0, unsigned * pIn1, int nVars )
407{
408 int w;
409 for ( w = Kit_TruthWordNum(nVars)-1; w >= 0; w-- )
410 pOut[w] = ~(pIn0[w] & pIn1[w]);
411}
412static inline void Kit_TruthAndPhase( unsigned * pOut, unsigned * pIn0, unsigned * pIn1, int nVars, int fCompl0, int fCompl1 )
413{
414 int w;
415 if ( fCompl0 && fCompl1 )
416 {
417 for ( w = Kit_TruthWordNum(nVars)-1; w >= 0; w-- )
418 pOut[w] = ~(pIn0[w] | pIn1[w]);
419 }
420 else if ( fCompl0 && !fCompl1 )
421 {
422 for ( w = Kit_TruthWordNum(nVars)-1; w >= 0; w-- )
423 pOut[w] = ~pIn0[w] & pIn1[w];
424 }
425 else if ( !fCompl0 && fCompl1 )
426 {
427 for ( w = Kit_TruthWordNum(nVars)-1; w >= 0; w-- )
428 pOut[w] = pIn0[w] & ~pIn1[w];
429 }
430 else // if ( !fCompl0 && !fCompl1 )
431 {
432 for ( w = Kit_TruthWordNum(nVars)-1; w >= 0; w-- )
433 pOut[w] = pIn0[w] & pIn1[w];
434 }
435}
436static inline void Kit_TruthOrPhase( unsigned * pOut, unsigned * pIn0, unsigned * pIn1, int nVars, int fCompl0, int fCompl1 )
437{
438 int w;
439 if ( fCompl0 && fCompl1 )
440 {
441 for ( w = Kit_TruthWordNum(nVars)-1; w >= 0; w-- )
442 pOut[w] = ~(pIn0[w] & pIn1[w]);
443 }
444 else if ( fCompl0 && !fCompl1 )
445 {
446 for ( w = Kit_TruthWordNum(nVars)-1; w >= 0; w-- )
447 pOut[w] = ~pIn0[w] | pIn1[w];
448 }
449 else if ( !fCompl0 && fCompl1 )
450 {
451 for ( w = Kit_TruthWordNum(nVars)-1; w >= 0; w-- )
452 pOut[w] = pIn0[w] | ~pIn1[w];
453 }
454 else // if ( !fCompl0 && !fCompl1 )
455 {
456 for ( w = Kit_TruthWordNum(nVars)-1; w >= 0; w-- )
457 pOut[w] = pIn0[w] | pIn1[w];
458 }
459}
460static inline void Kit_TruthMux( unsigned * pOut, unsigned * pIn0, unsigned * pIn1, unsigned * pCtrl, int nVars )
461{
462 int w;
463 for ( w = Kit_TruthWordNum(nVars)-1; w >= 0; w-- )
464 pOut[w] = (pIn0[w] & ~pCtrl[w]) | (pIn1[w] & pCtrl[w]);
465}
466static inline void Kit_TruthMuxPhase( unsigned * pOut, unsigned * pIn0, unsigned * pIn1, unsigned * pCtrl, int nVars, int fComp0 )
467{
468 int w;
469 if ( fComp0 )
470 for ( w = Kit_TruthWordNum(nVars)-1; w >= 0; w-- )
471 pOut[w] = (~pIn0[w] & ~pCtrl[w]) | (pIn1[w] & pCtrl[w]);
472 else
473 for ( w = Kit_TruthWordNum(nVars)-1; w >= 0; w-- )
474 pOut[w] = (pIn0[w] & ~pCtrl[w]) | (pIn1[w] & pCtrl[w]);
475}
476static inline void Kit_TruthIthVar( unsigned * pTruth, int nVars, int iVar )
477{
478 unsigned Masks[5] = { 0xAAAAAAAA, 0xCCCCCCCC, 0xF0F0F0F0, 0xFF00FF00, 0xFFFF0000 };
479 int k, nWords = (nVars <= 5 ? 1 : (1 << (nVars - 5)));
480 if ( iVar < 5 )
481 {
482 for ( k = 0; k < nWords; k++ )
483 pTruth[k] = Masks[iVar];
484 }
485 else
486 {
487 for ( k = 0; k < nWords; k++ )
488 if ( k & (1 << (iVar-5)) )
489 pTruth[k] = ~(unsigned)0;
490 else
491 pTruth[k] = 0;
492 }
493}
494
495
499
500#define Kit_SopForEachCube( cSop, uCube, i ) \
501 for ( i = 0; (i < Kit_SopCubeNum(cSop)) && ((uCube) = Kit_SopCube(cSop, i)); i++ )
502#define Kit_CubeForEachLiteral( uCube, Lit, nLits, i ) \
503 for ( i = 0; (i < (nLits)) && ((Lit) = Kit_CubeHasLit(uCube, i)); i++ )
504
505#define Kit_GraphForEachLeaf( pGraph, pLeaf, i ) \
506 for ( i = 0; (i < (pGraph)->nLeaves) && (((pLeaf) = Kit_GraphNode(pGraph, i)), 1); i++ )
507#define Kit_GraphForEachNode( pGraph, pAnd, i ) \
508 for ( i = (pGraph)->nLeaves; (i < (pGraph)->nSize) && (((pAnd) = Kit_GraphNode(pGraph, i)), 1); i++ )
509
513
514/*=== kitBdd.c ==========================================================*/
515#ifdef ABC_USE_CUDD
516extern DdNode * Kit_SopToBdd( DdManager * dd, Kit_Sop_t * cSop, int nVars );
517extern DdNode * Kit_GraphToBdd( DdManager * dd, Kit_Graph_t * pGraph );
518extern DdNode * Kit_TruthToBdd( DdManager * dd, unsigned * pTruth, int nVars, int fMSBonTop );
519#endif
520/*=== kitCloud.c ==========================================================*/
521extern CloudNode * Kit_TruthToCloud( CloudManager * dd, unsigned * pTruth, int nVars );
522extern unsigned * Kit_CloudToTruth( Vec_Int_t * vNodes, int nVars, Vec_Ptr_t * vStore, int fInv );
523extern int Kit_CreateCloud( CloudManager * dd, CloudNode * pFunc, Vec_Int_t * vNodes );
524extern int Kit_CreateCloudFromTruth( CloudManager * dd, unsigned * pTruth, int nVars, Vec_Int_t * vNodes );
525extern unsigned * Kit_TruthCompose( CloudManager * dd, unsigned * pTruth, int nVars, unsigned ** pInputs, int nVarsAll, Vec_Ptr_t * vStore, Vec_Int_t * vNodes );
526extern void Kit_TruthCofSupports( Vec_Int_t * vBddDir, Vec_Int_t * vBddInv, int nVars, Vec_Int_t * vMemory, unsigned * puSupps );
527/*=== kitDsd.c ==========================================================*/
528extern Kit_DsdMan_t * Kit_DsdManAlloc( int nVars, int nNodes );
529extern void Kit_DsdManFree( Kit_DsdMan_t * p );
530extern Kit_DsdNtk_t * Kit_DsdDeriveNtk( unsigned * pTruth, int nVars, int nLutSize );
531extern unsigned * Kit_DsdTruthCompute( Kit_DsdMan_t * p, Kit_DsdNtk_t * pNtk );
532extern void Kit_DsdTruth( Kit_DsdNtk_t * pNtk, unsigned * pTruthRes );
533extern void Kit_DsdTruthPartial( Kit_DsdMan_t * p, Kit_DsdNtk_t * pNtk, unsigned * pTruthRes, unsigned uSupp );
534extern void Kit_DsdTruthPartialTwo( Kit_DsdMan_t * p, Kit_DsdNtk_t * pNtk, unsigned uSupp, int iVar, unsigned * pTruthCo, unsigned * pTruthDec );
535extern void Kit_DsdPrint( FILE * pFile, Kit_DsdNtk_t * pNtk );
536extern void Kit_DsdPrintExpanded( Kit_DsdNtk_t * pNtk );
537extern void Kit_DsdPrintFromTruth( unsigned * pTruth, int nVars );
538extern void Kit_DsdPrintFromTruth2( FILE * pFile, unsigned * pTruth, int nVars );
539extern void Kit_DsdWriteFromTruth( char * pBuffer, unsigned * pTruth, int nVars );
540extern Kit_DsdNtk_t * Kit_DsdDecompose( unsigned * pTruth, int nVars );
541extern Kit_DsdNtk_t * Kit_DsdDecomposeExpand( unsigned * pTruth, int nVars );
542extern Kit_DsdNtk_t * Kit_DsdDecomposeMux( unsigned * pTruth, int nVars, int nDecMux );
543extern void Kit_DsdVerify( Kit_DsdNtk_t * pNtk, unsigned * pTruth, int nVars );
544extern void Kit_DsdNtkFree( Kit_DsdNtk_t * pNtk );
545extern int Kit_DsdNonDsdSizeMax( Kit_DsdNtk_t * pNtk );
547extern unsigned Kit_DsdNonDsdSupports( Kit_DsdNtk_t * pNtk );
548extern int Kit_DsdCountAigNodes( Kit_DsdNtk_t * pNtk );
549extern unsigned Kit_DsdGetSupports( Kit_DsdNtk_t * p );
551extern Kit_DsdNtk_t * Kit_DsdShrink( Kit_DsdNtk_t * p, int pPrios[] );
552extern void Kit_DsdRotate( Kit_DsdNtk_t * p, int pFreqs[] );
553extern int Kit_DsdCofactoring( unsigned * pTruth, int nVars, int * pCofVars, int nLimit, int fVerbose );
554/*=== kitFactor.c ==========================================================*/
555extern Kit_Graph_t * Kit_SopFactor( Vec_Int_t * vCover, int fCompl, int nVars, Vec_Int_t * vMemory );
556/*=== kitGraph.c ==========================================================*/
557extern Kit_Graph_t * Kit_GraphCreate( int nLeaves );
560extern Kit_Graph_t * Kit_GraphCreateLeaf( int iLeaf, int nLeaves, int fCompl );
561extern void Kit_GraphFree( Kit_Graph_t * pGraph );
562extern Kit_Node_t * Kit_GraphAppendNode( Kit_Graph_t * pGraph );
563extern Kit_Edge_t Kit_GraphAddNodeAnd( Kit_Graph_t * pGraph, Kit_Edge_t eEdge0, Kit_Edge_t eEdge1 );
564extern Kit_Edge_t Kit_GraphAddNodeOr( Kit_Graph_t * pGraph, Kit_Edge_t eEdge0, Kit_Edge_t eEdge1 );
565extern Kit_Edge_t Kit_GraphAddNodeXor( Kit_Graph_t * pGraph, Kit_Edge_t eEdge0, Kit_Edge_t eEdge1, int Type );
566extern Kit_Edge_t Kit_GraphAddNodeMux( Kit_Graph_t * pGraph, Kit_Edge_t eEdgeC, Kit_Edge_t eEdgeT, Kit_Edge_t eEdgeE, int Type );
567extern unsigned Kit_GraphToTruth( Kit_Graph_t * pGraph );
568extern Kit_Graph_t * Kit_TruthToGraph( unsigned * pTruth, int nVars, Vec_Int_t * vMemory );
569extern Kit_Graph_t * Kit_TruthToGraph2( unsigned * pTruth0, unsigned * pTruth1, int nVars, Vec_Int_t * vMemory );
570extern int Kit_GraphLeafDepth_rec( Kit_Graph_t * pGraph, Kit_Node_t * pNode, Kit_Node_t * pLeaf );
571extern int Kit_TruthLitNum( unsigned * pTruth, int nVars, Vec_Int_t * vMemory );
572/*=== kitHop.c ==========================================================*/
573//extern int Kit_TruthToGia( Gia_Man_t * pMan, unsigned * pTruth, int nVars, Vec_Int_t * vMemory, Vec_Int_t * vLeaves, int fHash );
574//extern Hop_Obj_t * Kit_GraphToHop( Hop_Man_t * pMan, Kit_Graph_t * pGraph );
575//extern Hop_Obj_t * Kit_TruthToHop( Hop_Man_t * pMan, unsigned * pTruth, int nVars, Vec_Int_t * vMemory );
576//extern Hop_Obj_t * Kit_CoverToHop( Hop_Man_t * pMan, Vec_Int_t * vCover, int nVars, Vec_Int_t * vMemory );
577extern int Kit_IsopNodeNum( unsigned * pTruth0, unsigned * pTruth1, int nVars, Vec_Int_t * vMemory );
578extern Vec_Int_t * Kit_IsopResub( unsigned * pTruth0, unsigned * pTruth1, int nVars, Vec_Int_t * vMemory );
579/*=== kitIsop.c ==========================================================*/
580extern int Kit_TruthIsop( unsigned * puTruth, int nVars, Vec_Int_t * vMemory, int fTryBoth );
581extern int Kit_TruthIsop2( unsigned * puTruth0, unsigned * puTruth1, int nVars, Vec_Int_t * vMemory, int fTryBoth, int fReturnTt );
582extern void Kit_TruthIsopPrint( unsigned * puTruth, int nVars, Vec_Int_t * vMemory, int fTryBoth );
583extern void Kit_TruthIsopPrintCover( Vec_Int_t * vCover, int nVars, int fCompl );
584/*=== kitPla.c ==========================================================*/
585extern int Kit_PlaIsConst0( char * pSop );
586extern int Kit_PlaIsConst1( char * pSop );
587extern int Kit_PlaIsBuf( char * pSop );
588extern int Kit_PlaIsInv( char * pSop );
589extern int Kit_PlaGetVarNum( char * pSop );
590extern int Kit_PlaGetCubeNum( char * pSop );
591extern int Kit_PlaIsComplement( char * pSop );
592extern void Kit_PlaComplement( char * pSop );
593extern char * Kit_PlaStart( void * p, int nCubes, int nVars );
594extern char * Kit_PlaCreateFromIsop( void * p, int nVars, Vec_Int_t * vCover );
595extern void Kit_PlaToIsop( char * pSop, Vec_Int_t * vCover );
596extern char * Kit_PlaStoreSop( void * p, char * pSop );
597extern char * Kit_PlaFromTruth( void * p, unsigned * pTruth, int nVars, Vec_Int_t * vCover );
598extern char * Kit_PlaFromTruthNew( unsigned * pTruth, int nVars, Vec_Int_t * vCover, Vec_Str_t * vStr );
599extern ABC_UINT64_T Kit_PlaToTruth6( char * pSop, int nVars );
600extern void Kit_PlaToTruth( char * pSop, int nVars, Vec_Ptr_t * vVars, unsigned * pTemp, unsigned * pTruth );
601/*=== kitSop.c ==========================================================*/
602extern void Kit_SopCreate( Kit_Sop_t * cResult, Vec_Int_t * vInput, int nVars, Vec_Int_t * vMemory );
603extern void Kit_SopCreateInverse( Kit_Sop_t * cResult, Vec_Int_t * vInput, int nVars, Vec_Int_t * vMemory );
604extern void Kit_SopDup( Kit_Sop_t * cResult, Kit_Sop_t * cSop, Vec_Int_t * vMemory );
605extern void Kit_SopDivideByLiteralQuo( Kit_Sop_t * cSop, int iLit );
606extern void Kit_SopDivideByCube( Kit_Sop_t * cSop, Kit_Sop_t * cDiv, Kit_Sop_t * vQuo, Kit_Sop_t * vRem, Vec_Int_t * vMemory );
607extern void Kit_SopDivideInternal( Kit_Sop_t * cSop, Kit_Sop_t * cDiv, Kit_Sop_t * vQuo, Kit_Sop_t * vRem, Vec_Int_t * vMemory );
608extern void Kit_SopMakeCubeFree( Kit_Sop_t * cSop );
609extern int Kit_SopIsCubeFree( Kit_Sop_t * cSop );
610extern void Kit_SopCommonCubeCover( Kit_Sop_t * cResult, Kit_Sop_t * cSop, Vec_Int_t * vMemory );
611extern int Kit_SopAnyLiteral( Kit_Sop_t * cSop, int nLits );
612extern int Kit_SopDivisor( Kit_Sop_t * cResult, Kit_Sop_t * cSop, int nLits, Vec_Int_t * vMemory );
613extern void Kit_SopBestLiteralCover( Kit_Sop_t * cResult, Kit_Sop_t * cSop, unsigned uCube, int nLits, Vec_Int_t * vMemory );
614/*=== kitTruth.c ==========================================================*/
615extern void Kit_TruthSwapAdjacentVars( unsigned * pOut, unsigned * pIn, int nVars, int Start );
616extern void Kit_TruthStretch( unsigned * pOut, unsigned * pIn, int nVars, int nVarsAll, unsigned Phase, int fReturnIn );
617extern void Kit_TruthPermute( unsigned * pOut, unsigned * pIn, int nVars, char * pPerm, int fReturnIn );
618extern void Kit_TruthShrink( unsigned * pOut, unsigned * pIn, int nVars, int nVarsAll, unsigned Phase, int fReturnIn );
619extern int Kit_TruthVarInSupport( unsigned * pTruth, int nVars, int iVar );
620extern int Kit_TruthSupportSize( unsigned * pTruth, int nVars );
621extern unsigned Kit_TruthSupport( unsigned * pTruth, int nVars );
622extern void Kit_TruthCofactor0( unsigned * pTruth, int nVars, int iVar );
623extern void Kit_TruthCofactor1( unsigned * pTruth, int nVars, int iVar );
624extern void Kit_TruthCofactor0New( unsigned * pOut, unsigned * pIn, int nVars, int iVar );
625extern void Kit_TruthCofactor1New( unsigned * pOut, unsigned * pIn, int nVars, int iVar );
626extern int Kit_TruthVarIsVacuous( unsigned * pOnset, unsigned * pOffset, int nVars, int iVar );
627extern void Kit_TruthExist( unsigned * pTruth, int nVars, int iVar );
628extern void Kit_TruthExistNew( unsigned * pRes, unsigned * pTruth, int nVars, int iVar );
629extern void Kit_TruthExistSet( unsigned * pRes, unsigned * pTruth, int nVars, unsigned uMask );
630extern void Kit_TruthForall( unsigned * pTruth, int nVars, int iVar );
631extern void Kit_TruthForallNew( unsigned * pRes, unsigned * pTruth, int nVars, int iVar );
632extern void Kit_TruthForallSet( unsigned * pRes, unsigned * pTruth, int nVars, unsigned uMask );
633extern void Kit_TruthUniqueNew( unsigned * pRes, unsigned * pTruth, int nVars, int iVar );
634extern void Kit_TruthMuxVar( unsigned * pOut, unsigned * pCof0, unsigned * pCof1, int nVars, int iVar );
635extern void Kit_TruthMuxVarPhase( unsigned * pOut, unsigned * pCof0, unsigned * pCof1, int nVars, int iVar, int fCompl0 );
636extern void Kit_TruthChangePhase( unsigned * pTruth, int nVars, int iVar );
637extern int Kit_TruthVarsSymm( unsigned * pTruth, int nVars, int iVar0, int iVar1, unsigned * pCof0, unsigned * pCof1 );
638extern int Kit_TruthVarsAntiSymm( unsigned * pTruth, int nVars, int iVar0, int iVar1, unsigned * pCof0, unsigned * pCof1 );
639extern int Kit_TruthMinCofSuppOverlap( unsigned * pTruth, int nVars, int * pVarMin );
640extern int Kit_TruthBestCofVar( unsigned * pTruth, int nVars, unsigned * pCof0, unsigned * pCof1 );
641extern void Kit_TruthCountOnesInCofs( unsigned * pTruth, int nVars, int * pStore );
642extern void Kit_TruthCountOnesInCofs0( unsigned * pTruth, int nVars, int * pStore );
643extern void Kit_TruthCountOnesInCofsSlow( unsigned * pTruth, int nVars, int * pStore, unsigned * pAux );
644extern unsigned Kit_TruthHash( unsigned * pIn, int nWords );
645extern unsigned Kit_TruthSemiCanonicize( unsigned * pInOut, unsigned * pAux, int nVars, char * pCanonPerm );
646extern char * Kit_TruthDumpToFile( unsigned * pTruth, int nVars, int nFile );
647extern void Kit_TruthPrintProfile( unsigned * pTruth, int nVars );
648
649
650
652
653
654
655#endif
656
660
int nWords
Definition abcNpn.c:127
#define ABC_NAMESPACE_HEADER_END
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
struct Vec_Str_t_ Vec_Str_t
Definition bblif.c:46
typedefABC_NAMESPACE_HEADER_START struct cloudManager CloudManager
Definition cloud.h:52
struct cloudNode CloudNode
Definition cloud.h:55
Cube * p
Definition exorList.c:222
void Kit_PlaToIsop(char *pSop, Vec_Int_t *vCover)
Definition kitPla.c:282
struct Kit_Graph_t_ Kit_Graph_t
Definition kit.h:88
int Kit_DsdNonDsdSizeMax(Kit_DsdNtk_t *pNtk)
Definition kitDsd.c:1212
Kit_DsdNtk_t * Kit_DsdDecompose(unsigned *pTruth, int nVars)
Definition kitDsd.c:2315
int Kit_TruthIsop(unsigned *puTruth, int nVars, Vec_Int_t *vMemory, int fTryBoth)
Definition kitIsop.c:134
void Kit_SopDivideByLiteralQuo(Kit_Sop_t *cSop, int iLit)
Definition kitSop.c:121
Kit_Edge_t Kit_GraphAddNodeMux(Kit_Graph_t *pGraph, Kit_Edge_t eEdgeC, Kit_Edge_t eEdgeT, Kit_Edge_t eEdgeE, int Type)
Definition kitGraph.c:266
void Kit_PlaComplement(char *pSop)
Definition kitPla.c:181
Kit_Graph_t * Kit_SopFactor(Vec_Int_t *vCover, int fCompl, int nVars, Vec_Int_t *vMemory)
FUNCTION DEFINITIONS ///.
Definition kitFactor.c:55
void Kit_TruthIsopPrint(unsigned *puTruth, int nVars, Vec_Int_t *vMemory, int fTryBoth)
Definition kitIsop.c:207
unsigned Kit_GraphToTruth(Kit_Graph_t *pGraph)
Definition kitGraph.c:307
Kit_DsdNtk_t * Kit_DsdDeriveNtk(unsigned *pTruth, int nVars, int nLutSize)
void Kit_TruthSwapAdjacentVars(unsigned *pOut, unsigned *pIn, int nVars, int Start)
DECLARATIONS ///.
Definition kitTruth.c:46
int Kit_PlaIsBuf(char *pSop)
Definition kitPla.c:78
void Kit_TruthCofactor0(unsigned *pTruth, int nVars, int iVar)
Definition kitTruth.c:368
void Kit_DsdVerify(Kit_DsdNtk_t *pNtk, unsigned *pTruth, int nVars)
Definition kitDsd.c:2493
void Kit_SopCreate(Kit_Sop_t *cResult, Vec_Int_t *vInput, int nVars, Vec_Int_t *vMemory)
DECLARATIONS ///.
Definition kitSop.c:45
int Kit_CreateCloud(CloudManager *dd, CloudNode *pFunc, Vec_Int_t *vNodes)
Definition kitCloud.c:167
void Kit_DsdPrint(FILE *pFile, Kit_DsdNtk_t *pNtk)
Definition kitDsd.c:375
void Kit_SopMakeCubeFree(Kit_Sop_t *cSop)
Definition kitSop.c:311
int Kit_CreateCloudFromTruth(CloudManager *dd, unsigned *pTruth, int nVars, Vec_Int_t *vNodes)
Definition kitCloud.c:209
int Kit_PlaIsInv(char *pSop)
Definition kitPla.c:98
void Kit_TruthCofSupports(Vec_Int_t *vBddDir, Vec_Int_t *vBddInv, int nVars, Vec_Int_t *vMemory, unsigned *puSupps)
Definition kitCloud.c:310
char * Kit_PlaFromTruth(void *p, unsigned *pTruth, int nVars, Vec_Int_t *vCover)
Definition kitPla.c:337
void Kit_DsdManFree(Kit_DsdMan_t *p)
Definition kitDsd.c:72
ABC_UINT64_T Kit_PlaToTruth6(char *pSop, int nVars)
Definition kitPla.c:442
void Kit_DsdTruth(Kit_DsdNtk_t *pNtk, unsigned *pTruthRes)
Definition kitDsd.c:1069
char * Kit_PlaFromTruthNew(unsigned *pTruth, int nVars, Vec_Int_t *vCover, Vec_Str_t *vStr)
Definition kitPla.c:406
unsigned Kit_TruthSupport(unsigned *pTruth, int nVars)
Definition kitTruth.c:346
void Kit_TruthMuxVar(unsigned *pOut, unsigned *pCof0, unsigned *pCof1, int nVars, int iVar)
Definition kitTruth.c:1069
Kit_DsdNtk_t * Kit_DsdDecomposeExpand(unsigned *pTruth, int nVars)
Definition kitDsd.c:2331
unsigned Kit_TruthHash(unsigned *pIn, int nWords)
Definition kitTruth.c:1560
int Kit_SopAnyLiteral(Kit_Sop_t *cSop, int nLits)
Definition kitSop.c:370
void Kit_TruthCofactor1New(unsigned *pOut, unsigned *pIn, int nVars, int iVar)
Definition kitTruth.c:573
char * Kit_TruthDumpToFile(unsigned *pTruth, int nVars, int nFile)
Definition kitTruth.c:2004
int Kit_DsdCofactoring(unsigned *pTruth, int nVars, int *pCofVars, int nLimit, int fVerbose)
Definition kitDsd.c:2679
void Kit_DsdWriteFromTruth(char *pBuffer, unsigned *pTruth, int nVars)
Definition kitDsd.c:537
Kit_Edge_t Kit_GraphAddNodeAnd(Kit_Graph_t *pGraph, Kit_Edge_t eEdge0, Kit_Edge_t eEdge1)
Definition kitGraph.c:173
int Kit_TruthBestCofVar(unsigned *pTruth, int nVars, unsigned *pCof0, unsigned *pCof1)
Definition kitTruth.c:1365
int Kit_TruthLitNum(unsigned *pTruth, int nVars, Vec_Int_t *vMemory)
Definition kitGraph.c:511
typedefABC_NAMESPACE_HEADER_START struct Kit_Sop_t_ Kit_Sop_t
INCLUDES ///.
Definition kit.h:54
unsigned Kit_TruthSemiCanonicize(unsigned *pInOut, unsigned *pAux, int nVars, char *pCanonPerm)
Definition kitTruth.c:1657
void Kit_SopDup(Kit_Sop_t *cResult, Kit_Sop_t *cSop, Vec_Int_t *vMemory)
Definition kitSop.c:97
void Kit_TruthUniqueNew(unsigned *pRes, unsigned *pTruth, int nVars, int iVar)
Definition kitTruth.c:922
void Kit_TruthCountOnesInCofs(unsigned *pTruth, int nVars, int *pStore)
Definition kitTruth.c:1410
Kit_Graph_t * Kit_GraphCreateConst1()
Definition kitGraph.c:91
void Kit_TruthChangePhase(unsigned *pTruth, int nVars, int iVar)
Definition kitTruth.c:1259
Kit_Dsd_t
Definition kit.h:101
@ KIT_DSD_XOR
Definition kit.h:106
@ KIT_DSD_CONST1
Definition kit.h:103
@ KIT_DSD_PRIME
Definition kit.h:107
@ KIT_DSD_AND
Definition kit.h:105
@ KIT_DSD_NONE
Definition kit.h:102
@ KIT_DSD_VAR
Definition kit.h:104
void Kit_TruthCofactor0New(unsigned *pOut, unsigned *pIn, int nVars, int iVar)
Definition kitTruth.c:521
void Kit_SopCommonCubeCover(Kit_Sop_t *cResult, Kit_Sop_t *cSop, Vec_Int_t *vMemory)
Definition kitSop.c:350
void Kit_TruthForallNew(unsigned *pRes, unsigned *pTruth, int nVars, int iVar)
Definition kitTruth.c:867
int Kit_PlaIsConst1(char *pSop)
Definition kitPla.c:62
void Kit_DsdNtkFree(Kit_DsdNtk_t *pNtk)
Definition kitDsd.c:164
struct Kit_DsdObj_t_ Kit_DsdObj_t
Definition kit.h:111
Kit_Graph_t * Kit_TruthToGraph2(unsigned *pTruth0, unsigned *pTruth1, int nVars, Vec_Int_t *vMemory)
Definition kitGraph.c:384
Kit_DsdNtk_t * Kit_DsdShrink(Kit_DsdNtk_t *p, int pPrios[])
Definition kitDsd.c:1634
int Kit_TruthSupportSize(unsigned *pTruth, int nVars)
Definition kitTruth.c:327
void Kit_TruthCofactor1(unsigned *pTruth, int nVars, int iVar)
Definition kitTruth.c:470
struct Kit_Node_t_ Kit_Node_t
Definition kit.h:69
unsigned * Kit_DsdTruthCompute(Kit_DsdMan_t *p, Kit_DsdNtk_t *pNtk)
Definition kitDsd.c:664
void Kit_DsdTruthPartialTwo(Kit_DsdMan_t *p, Kit_DsdNtk_t *pNtk, unsigned uSupp, int iVar, unsigned *pTruthCo, unsigned *pTruthDec)
Definition kitDsd.c:1090
int Kit_TruthVarIsVacuous(unsigned *pOnset, unsigned *pOffset, int nVars, int iVar)
Definition kitTruth.c:625
unsigned * Kit_TruthCompose(CloudManager *dd, unsigned *pTruth, int nVars, unsigned **pInputs, int nVarsAll, Vec_Ptr_t *vStore, Vec_Int_t *vNodes)
Definition kitCloud.c:263
void Kit_SopCreateInverse(Kit_Sop_t *cResult, Vec_Int_t *vInput, int nVars, Vec_Int_t *vMemory)
Definition kitSop.c:68
int Kit_TruthVarInSupport(unsigned *pTruth, int nVars, int iVar)
Definition kitTruth.c:270
Kit_Node_t * Kit_GraphAppendNode(Kit_Graph_t *pGraph)
Definition kitGraph.c:149
void Kit_TruthExistSet(unsigned *pRes, unsigned *pTruth, int nVars, unsigned uMask)
Definition kitTruth.c:793
Kit_DsdMan_t * Kit_DsdManAlloc(int nVars, int nNodes)
DECLARATIONS ///.
Definition kitDsd.c:46
int Kit_SopIsCubeFree(Kit_Sop_t *cSop)
Definition kitSop.c:334
void Kit_DsdPrintFromTruth(unsigned *pTruth, int nVars)
Definition kitDsd.c:491
void Kit_TruthPrintProfile(unsigned *pTruth, int nVars)
Definition kitTruth.c:2203
void Kit_TruthExist(unsigned *pTruth, int nVars, int iVar)
Definition kitTruth.c:684
char * Kit_PlaStart(void *p, int nCubes, int nVars)
Definition kitPla.c:211
int Kit_GraphLeafDepth_rec(Kit_Graph_t *pGraph, Kit_Node_t *pNode, Kit_Node_t *pLeaf)
Definition kitGraph.c:412
void Kit_GraphFree(Kit_Graph_t *pGraph)
Definition kitGraph.c:132
void Kit_TruthShrink(unsigned *pOut, unsigned *pIn, int nVars, int nVarsAll, unsigned Phase, int fReturnIn)
Definition kitTruth.c:200
int Kit_TruthIsop2(unsigned *puTruth0, unsigned *puTruth1, int nVars, Vec_Int_t *vMemory, int fTryBoth, int fReturnTt)
FUNCTION DEFINITIONS ///.
Definition kitIsop.c:55
unsigned Kit_DsdGetSupports(Kit_DsdNtk_t *p)
Definition kitDsd.c:1763
int Kit_PlaGetVarNum(char *pSop)
Definition kitPla.c:118
unsigned Kit_DsdNonDsdSupports(Kit_DsdNtk_t *pNtk)
Definition kitDsd.c:1265
Kit_Graph_t * Kit_GraphCreateLeaf(int iLeaf, int nLeaves, int fCompl)
Definition kitGraph.c:111
Kit_Edge_t Kit_GraphAddNodeOr(Kit_Graph_t *pGraph, Kit_Edge_t eEdge0, Kit_Edge_t eEdge1)
Definition kitGraph.c:197
void Kit_SopDivideByCube(Kit_Sop_t *cSop, Kit_Sop_t *cDiv, Kit_Sop_t *vQuo, Kit_Sop_t *vRem, Vec_Int_t *vMemory)
Definition kitSop.c:145
int Kit_PlaGetCubeNum(char *pSop)
Definition kitPla.c:138
void Kit_DsdPrintFromTruth2(FILE *pFile, unsigned *pTruth, int nVars)
Definition kitDsd.c:515
char * Kit_PlaCreateFromIsop(void *p, int nVars, Vec_Int_t *vCover)
Definition kitPla.c:243
void Kit_TruthExistNew(unsigned *pRes, unsigned *pTruth, int nVars, int iVar)
Definition kitTruth.c:738
Kit_Graph_t * Kit_GraphCreate(int nLeaves)
DECLARATIONS ///.
Definition kitGraph.c:46
int Kit_DsdCountAigNodes(Kit_DsdNtk_t *pNtk)
Definition kitDsd.c:1896
void Kit_TruthCountOnesInCofsSlow(unsigned *pTruth, int nVars, int *pStore, unsigned *pAux)
Definition kitTruth.c:1537
struct Kit_DsdNtk_t_ Kit_DsdNtk_t
Definition kit.h:124
Kit_DsdNtk_t * Kit_DsdDecomposeMux(unsigned *pTruth, int nVars, int nDecMux)
Definition kitDsd.c:2351
Kit_Edge_t Kit_GraphAddNodeXor(Kit_Graph_t *pGraph, Kit_Edge_t eEdge0, Kit_Edge_t eEdge1, int Type)
Definition kitGraph.c:225
char * Kit_PlaStoreSop(void *p, char *pSop)
Definition kitPla.c:317
Kit_DsdNtk_t * Kit_DsdExpand(Kit_DsdNtk_t *p)
Definition kitDsd.c:1452
struct Kit_DsdMan_t_ Kit_DsdMan_t
Definition kit.h:137
void Kit_TruthCountOnesInCofs0(unsigned *pTruth, int nVars, int *pStore)
Definition kitTruth.c:1486
int Kit_PlaIsComplement(char *pSop)
Definition kitPla.c:160
void Kit_TruthIsopPrintCover(Vec_Int_t *vCover, int nVars, int fCompl)
Definition kitIsop.c:183
void Kit_DsdTruthPartial(Kit_DsdMan_t *p, Kit_DsdNtk_t *pNtk, unsigned *pTruthRes, unsigned uSupp)
Definition kitDsd.c:1108
void Kit_TruthPermute(unsigned *pOut, unsigned *pIn, int nVars, char *pPerm, int fReturnIn)
Definition kitTruth.c:233
Kit_Graph_t * Kit_GraphCreateConst0()
Definition kitGraph.c:70
void Kit_DsdPrintExpanded(Kit_DsdNtk_t *pNtk)
Definition kitDsd.c:472
int Kit_SopDivisor(Kit_Sop_t *cResult, Kit_Sop_t *cSop, int nLits, Vec_Int_t *vMemory)
Definition kitSop.c:534
Vec_Int_t * Kit_IsopResub(unsigned *pTruth0, unsigned *pTruth1, int nVars, Vec_Int_t *vMemory)
Definition kitHop.c:200
int Kit_PlaIsConst0(char *pSop)
DECLARATIONS ///.
Definition kitPla.c:46
Kit_Graph_t * Kit_TruthToGraph(unsigned *pTruth, int nVars, Vec_Int_t *vMemory)
Definition kitGraph.c:356
unsigned * Kit_CloudToTruth(Vec_Int_t *vNodes, int nVars, Vec_Ptr_t *vStore, int fInv)
Definition kitCloud.c:229
void Kit_TruthForall(unsigned *pTruth, int nVars, int iVar)
Definition kitTruth.c:813
struct Kit_Edge_t_ Kit_Edge_t
Definition kit.h:62
void Kit_TruthForallSet(unsigned *pRes, unsigned *pTruth, int nVars, unsigned uMask)
Definition kitTruth.c:1048
int Kit_TruthVarsAntiSymm(unsigned *pTruth, int nVars, int iVar0, int iVar1, unsigned *pCof0, unsigned *pCof1)
Definition kitTruth.c:1223
void Kit_TruthStretch(unsigned *pOut, unsigned *pIn, int nVars, int nVarsAll, unsigned Phase, int fReturnIn)
Definition kitTruth.c:166
CloudNode * Kit_TruthToCloud(CloudManager *dd, unsigned *pTruth, int nVars)
FUNCTION DECLARATIONS ///.
Definition kitCloud.c:148
void Kit_PlaToTruth(char *pSop, int nVars, Vec_Ptr_t *vVars, unsigned *pTemp, unsigned *pTruth)
Definition kitPla.c:496
int Kit_TruthMinCofSuppOverlap(unsigned *pTruth, int nVars, int *pVarMin)
Definition kitTruth.c:1315
void Kit_SopDivideInternal(Kit_Sop_t *cSop, Kit_Sop_t *cDiv, Kit_Sop_t *vQuo, Kit_Sop_t *vRem, Vec_Int_t *vMemory)
Definition kitSop.c:178
void Kit_DsdRotate(Kit_DsdNtk_t *p, int pFreqs[])
Definition kitDsd.c:1672
Kit_DsdObj_t * Kit_DsdNonDsdPrimeMax(Kit_DsdNtk_t *pNtk)
Definition kitDsd.c:1237
void Kit_TruthMuxVarPhase(unsigned *pOut, unsigned *pCof0, unsigned *pCof1, int nVars, int iVar, int fCompl0)
Definition kitTruth.c:1125
int Kit_IsopNodeNum(unsigned *pTruth0, unsigned *pTruth1, int nVars, Vec_Int_t *vMemory)
Definition kitHop.c:139
int Kit_TruthVarsSymm(unsigned *pTruth, int nVars, int iVar0, int iVar1, unsigned *pCof0, unsigned *pCof1)
Definition kitTruth.c:1187
void Kit_SopBestLiteralCover(Kit_Sop_t *cResult, Kit_Sop_t *cSop, unsigned uCube, int nLits, Vec_Int_t *vMemory)
Definition kitSop.c:560
CloudManager * dd
Definition kit.h:145
Vec_Ptr_t * vTtBdds
Definition kit.h:146
Vec_Int_t * vNodes
Definition kit.h:147
Vec_Ptr_t * vTtElems
Definition kit.h:142
int nWords
Definition kit.h:141
int nVars
Definition kit.h:140
Vec_Ptr_t * vTtNodes
Definition kit.h:143
unsigned * pSupps
Definition kit.h:132
unsigned short Root
Definition kit.h:130
unsigned * pMem
Definition kit.h:131
unsigned short nNodesAlloc
Definition kit.h:128
unsigned short nVars
Definition kit.h:127
Kit_DsdObj_t ** pNodes
Definition kit.h:133
unsigned short nNodes
Definition kit.h:129
unsigned Type
Definition kit.h:115
unsigned Offset
Definition kit.h:117
unsigned nRefs
Definition kit.h:118
unsigned nFans
Definition kit.h:119
unsigned short pFans[0]
Definition kit.h:120
unsigned Id
Definition kit.h:114
unsigned fMark
Definition kit.h:116
unsigned fCompl
Definition kit.h:65
unsigned Node
Definition kit.h:66
Kit_Edge_t eRoot
Definition kit.h:96
Kit_Node_t * pNodes
Definition kit.h:95
int fConst
Definition kit.h:91
int nLeaves
Definition kit.h:92
int nCap
Definition kit.h:94
int nSize
Definition kit.h:93
unsigned fNodeOr
Definition kit.h:79
Kit_Edge_t eEdge0
Definition kit.h:72
Kit_Edge_t eEdge1
Definition kit.h:73
void * pFunc
Definition kit.h:76
unsigned Level
Definition kit.h:77
unsigned nLat0
Definition kit.h:83
unsigned fCompl1
Definition kit.h:81
int iFunc
Definition kit.h:75
unsigned nLat2
Definition kit.h:85
unsigned fCompl0
Definition kit.h:80
unsigned nLat1
Definition kit.h:84
int nLits
Definition kit.h:57
int nCubes
Definition kit.h:58
unsigned * pCubes
Definition kit.h:59
#define assert(ex)
Definition util_old.h:213
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42