ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
giaClp.c
Go to the documentation of this file.
1
20
21#include "gia.h"
22
23#ifdef ABC_USE_CUDD
24#include "bdd/extrab/extraBdd.h"
25#include "bdd/dsd/dsd.h"
26#endif
27
29
33
34#ifdef ABC_USE_CUDD
35
36extern int Abc_ConvertZddToSop( DdManager * dd, DdNode * zCover, char * pSop, int nFanins, Vec_Str_t * vCube, int fPhase );
37extern int Abc_CountZddCubes( DdManager * dd, DdNode * zCover );
38extern int Abc_NtkDeriveFlatGiaSop( Gia_Man_t * pGia, int * gFanins, char * pSop );
39extern int Gia_ManFactorNode( Gia_Man_t * p, char * pSop, Vec_Int_t * vLeaves );
40
44
56int Gia_ManRebuildIsop( DdManager * dd, DdNode * bLocal, Gia_Man_t * pNew, Vec_Int_t * vFanins, Vec_Str_t * vSop, Vec_Str_t * vCube )
57{
58 char * pSop;
59 DdNode * bCover, * zCover, * zCover0, * zCover1;
60 int nFanins = Vec_IntSize(vFanins);
61 int fPhase, nCubes, nCubes0, nCubes1;
62
63 // get the ZDD of the negative polarity
64 bCover = Cudd_zddIsop( dd, Cudd_Not(bLocal), Cudd_Not(bLocal), &zCover0 );
65 Cudd_Ref( zCover0 );
66 Cudd_Ref( bCover );
67 Cudd_RecursiveDeref( dd, bCover );
68 nCubes0 = Abc_CountZddCubes( dd, zCover0 );
69
70 // get the ZDD of the positive polarity
71 bCover = Cudd_zddIsop( dd, bLocal, bLocal, &zCover1 );
72 Cudd_Ref( zCover1 );
73 Cudd_Ref( bCover );
74 Cudd_RecursiveDeref( dd, bCover );
75 nCubes1 = Abc_CountZddCubes( dd, zCover1 );
76
77 // compare the number of cubes
78 if ( nCubes1 <= nCubes0 )
79 { // use positive polarity
80 nCubes = nCubes1;
81 zCover = zCover1;
82 Cudd_RecursiveDerefZdd( dd, zCover0 );
83 fPhase = 1;
84 }
85 else
86 { // use negative polarity
87 nCubes = nCubes0;
88 zCover = zCover0;
89 Cudd_RecursiveDerefZdd( dd, zCover1 );
90 fPhase = 0;
91 }
92 if ( nCubes > 1000 )
93 {
94 Cudd_RecursiveDerefZdd( dd, zCover );
95 return -1;
96 }
97
98 // allocate memory for the cover
99 Vec_StrGrow( vSop, (nFanins + 3) * nCubes + 1 );
100 pSop = Vec_StrArray( vSop );
101 pSop[(nFanins + 3) * nCubes] = 0;
102 // create the SOP
103 Vec_StrFill( vCube, nFanins, '-' );
104 Vec_StrPush( vCube, '\0' );
105 Abc_ConvertZddToSop( dd, zCover, pSop, nFanins, vCube, fPhase );
106 Cudd_RecursiveDerefZdd( dd, zCover );
107
108 // perform factoring
109// return Abc_NtkDeriveFlatGiaSop( pNew, Vec_IntArray(vFanins), pSop );
110 return Gia_ManFactorNode( pNew, pSop, vFanins );
111}
112int Gia_ManRebuildNode( Dsd_Manager_t * pManDsd, Dsd_Node_t * pNodeDsd, Gia_Man_t * pNew, DdManager * ddNew, Vec_Int_t * vFanins, Vec_Str_t * vSop, Vec_Str_t * vCube )
113{
114 DdManager * ddDsd = Dsd_ManagerReadDd( pManDsd );
115 DdNode * bLocal, * bTemp;
116 Dsd_Node_t * pFaninDsd;
117 Dsd_Type_t Type;
118 int i, nDecs, iLit = -1;
119
120 // add the fanins
121 Type = Dsd_NodeReadType( pNodeDsd );
122 nDecs = Dsd_NodeReadDecsNum( pNodeDsd );
123 assert( nDecs > 1 );
124 Vec_IntClear( vFanins );
125 for ( i = 0; i < nDecs; i++ )
126 {
127 pFaninDsd = Dsd_NodeReadDec( pNodeDsd, i );
128 iLit = Dsd_NodeReadMark( Dsd_Regular(pFaninDsd) );
129 iLit = Abc_LitNotCond( iLit, Dsd_IsComplement(pFaninDsd) );
130 assert( Type == DSD_NODE_OR || !Dsd_IsComplement(pFaninDsd) );
131 Vec_IntPush( vFanins, iLit );
132 }
133
134 // create the local function depending on the type of the node
135 switch ( Type )
136 {
137 case DSD_NODE_CONST1:
138 {
139 iLit = 1;
140 break;
141 }
142 case DSD_NODE_OR:
143 {
144 iLit = 0;
145 for ( i = 0; i < nDecs; i++ )
146 iLit = Gia_ManHashOr( pNew, iLit, Vec_IntEntry(vFanins, i) );
147 break;
148 }
149 case DSD_NODE_EXOR:
150 {
151 iLit = 0;
152 for ( i = 0; i < nDecs; i++ )
153 iLit = Gia_ManHashXor( pNew, iLit, Vec_IntEntry(vFanins, i) );
154 break;
155 }
156 case DSD_NODE_PRIME:
157 {
158 bLocal = Dsd_TreeGetPrimeFunction( ddDsd, pNodeDsd ); Cudd_Ref( bLocal );
159 bLocal = Extra_TransferLevelByLevel( ddDsd, ddNew, bTemp = bLocal ); Cudd_Ref( bLocal );
160 Cudd_RecursiveDeref( ddDsd, bTemp );
161 // bLocal is now in the new BDD manager
162 iLit = Gia_ManRebuildIsop( ddNew, bLocal, pNew, vFanins, vSop, vCube );
163 Cudd_RecursiveDeref( ddNew, bLocal );
164 break;
165 }
166 default:
167 {
168 assert( 0 );
169 break;
170 }
171 }
172 Dsd_NodeSetMark( pNodeDsd, iLit );
173 return iLit;
174}
175Gia_Man_t * Gia_ManRebuild( Gia_Man_t * p, Dsd_Manager_t * pManDsd, DdManager * ddNew )
176{
177 Gia_Man_t * pNew;
178 Dsd_Node_t ** ppNodesDsd;
179 Dsd_Node_t * pNodeDsd;
180 int i, nNodesDsd, iLit = -1;
181 Vec_Str_t * vSop, * vCube;
182 Vec_Int_t * vFanins;
183
184 vFanins = Vec_IntAlloc( 1000 );
185 vSop = Vec_StrAlloc( 10000 );
186 vCube = Vec_StrAlloc( 1000 );
187
188 pNew = Gia_ManStart( 2*Gia_ManObjNum(p) );
189 pNew->pName = Abc_UtilStrsav( p->pName );
190 pNew->pSpec = Abc_UtilStrsav( p->pSpec );
191 Gia_ManHashAlloc( pNew );
192
193 // save the CI nodes in the DSD nodes
195 for ( i = 0; i < Gia_ManCiNum(p); i++ )
196 {
197 pNodeDsd = Dsd_ManagerReadInput( pManDsd, i );
198 Dsd_NodeSetMark( pNodeDsd, Gia_ManAppendCi( pNew ) );
199 }
200
201 // collect DSD nodes in DFS order (leaves and const1 are not collected)
202 ppNodesDsd = Dsd_TreeCollectNodesDfs( pManDsd, &nNodesDsd );
203 for ( i = 0; i < nNodesDsd; i++ )
204 {
205 iLit = Gia_ManRebuildNode( pManDsd, ppNodesDsd[i], pNew, ddNew, vFanins, vSop, vCube );
206 if ( iLit == -1 )
207 break;
208 }
209 ABC_FREE( ppNodesDsd );
210 Vec_IntFree( vFanins );
211 Vec_StrFree( vSop );
212 Vec_StrFree( vCube );
213 if ( iLit == -1 )
214 {
215 Gia_ManStop( pNew );
216 return Gia_ManDup(p);
217 }
218
219 // set the pointers to the CO drivers
220 for ( i = 0; i < Gia_ManCoNum(p); i++ )
221 {
222 pNodeDsd = Dsd_ManagerReadRoot( pManDsd, i );
223 iLit = Dsd_NodeReadMark( Dsd_Regular(pNodeDsd) );
224 iLit = Abc_LitNotCond( iLit, Dsd_IsComplement(pNodeDsd) );
225 Gia_ManAppendCo( pNew, iLit );
226 }
227 Gia_ManSetRegNum( pNew, Gia_ManRegNum(p) );
228 return pNew;
229}
230
242void Gia_ManCollapseDeref( DdManager * dd, Vec_Ptr_t * vFuncs )
243{
244 DdNode * bFunc; int i;
245 Vec_PtrForEachEntry( DdNode *, vFuncs, bFunc, i )
246 if ( bFunc )
247 Cudd_RecursiveDeref( dd, bFunc );
248 Vec_PtrFree( vFuncs );
249}
250void Gia_ObjCollapseDeref( Gia_Man_t * p, DdManager * dd, Vec_Ptr_t * vFuncs, int Id )
251{
252 if ( Gia_ObjRefDecId(p, Id) )
253 return;
254 Cudd_RecursiveDeref( dd, (DdNode *)Vec_PtrEntry(vFuncs, Id) );
255 Vec_PtrWriteEntry( vFuncs, Id, NULL );
256}
257Vec_Ptr_t * Gia_ManCollapse( Gia_Man_t * p, DdManager * dd, int nBddLimit, int fVerbose )
258{
259 Vec_Ptr_t * vFuncs;
260 DdNode * bFunc0, * bFunc1, * bFunc;
261 Gia_Obj_t * pObj;
262 int i, Id;
264 // assign constant node
265 vFuncs = Vec_PtrStart( Gia_ManObjNum(p) );
266 if ( Gia_ObjRefNumId(p, 0) > 0 )
267 Vec_PtrWriteEntry( vFuncs, 0, Cudd_ReadLogicZero(dd) ), Cudd_Ref(Cudd_ReadLogicZero(dd));
268 // assign elementary variables
269 Gia_ManForEachCiId( p, Id, i )
270 if ( Gia_ObjRefNumId(p, Id) > 0 )
271 Vec_PtrWriteEntry( vFuncs, Id, Cudd_bddIthVar(dd,i) ), Cudd_Ref(Cudd_bddIthVar(dd,i));
272 // create BDD for AND nodes
273 Gia_ManForEachAnd( p, pObj, i )
274 {
275 bFunc0 = Cudd_NotCond( (DdNode *)Vec_PtrEntry(vFuncs, Gia_ObjFaninId0(pObj, i)), Gia_ObjFaninC0(pObj) );
276 bFunc1 = Cudd_NotCond( (DdNode *)Vec_PtrEntry(vFuncs, Gia_ObjFaninId1(pObj, i)), Gia_ObjFaninC1(pObj) );
277 bFunc = Cudd_bddAndLimit( dd, bFunc0, bFunc1, nBddLimit );
278 if ( bFunc == NULL )
279 {
280 Gia_ManCollapseDeref( dd, vFuncs );
281 return NULL;
282 }
283 Cudd_Ref( bFunc );
284 Vec_PtrWriteEntry( vFuncs, i, bFunc );
285 Gia_ObjCollapseDeref( p, dd, vFuncs, Gia_ObjFaninId0(pObj, i) );
286 Gia_ObjCollapseDeref( p, dd, vFuncs, Gia_ObjFaninId1(pObj, i) );
287 }
288 // create BDD for outputs
289 Gia_ManForEachCoId( p, Id, i )
290 {
291 pObj = Gia_ManCo( p, i );
292 bFunc0 = Cudd_NotCond( (DdNode *)Vec_PtrEntry(vFuncs, Gia_ObjFaninId0(pObj, Id)), Gia_ObjFaninC0(pObj) );
293 Vec_PtrWriteEntry( vFuncs, Id, bFunc0 ); Cudd_Ref( bFunc0 );
294 Gia_ObjCollapseDeref( p, dd, vFuncs, Gia_ObjFaninId0(pObj, Id) );
295 }
296 assert( Vec_PtrSize(vFuncs) == Vec_PtrCountZero(vFuncs) + Gia_ManCoNum(p) );
297 // compact
298 Gia_ManForEachCoId( p, Id, i )
299 Vec_PtrWriteEntry( vFuncs, i, Vec_PtrEntry(vFuncs, Id) );
300 Vec_PtrShrink( vFuncs, Gia_ManCoNum(p) );
301 return vFuncs;
302}
303
315Gia_Man_t * Gia_ManCollapseTest( Gia_Man_t * p, int fVerbose )
316{
317 Gia_Man_t * pNew;
318 DdManager * dd, * ddNew;
319 Dsd_Manager_t * pManDsd;
320 Vec_Ptr_t * vFuncs;
321 // derive global BDDs
322 dd = Cudd_Init( Gia_ManCiNum(p), 0, CUDD_UNIQUE_SLOTS, CUDD_CACHE_SLOTS, 0 );
323 Cudd_AutodynEnable( dd, CUDD_REORDER_SYMM_SIFT );
324 vFuncs = Gia_ManCollapse( p, dd, 10000, 0 );
325 Cudd_AutodynDisable( dd );
326 if ( vFuncs == NULL )
327 {
328 Extra_StopManager( dd );
329 return Gia_ManDup(p);
330 }
331 // start ISOP manager
332 ddNew = Cudd_Init( Gia_ManCiNum(p), 0, CUDD_UNIQUE_SLOTS, CUDD_CACHE_SLOTS, 0 );
333 Cudd_zddVarsFromBddVars( ddNew, 2 );
334// Cudd_ReduceHeap( dd, CUDD_REORDER_SYMM_SIFT, 100 );
335 if ( fVerbose )
336 printf( "Ins = %d. Outs = %d. Shared BDD nodes = %d. Peak live nodes = %d. Peak nodes = %d.\n",
337 Gia_ManCiNum(p), Gia_ManCoNum(p),
338 Cudd_SharingSize( (DdNode **)Vec_PtrArray(vFuncs), Vec_PtrSize(vFuncs) ),
339 Cudd_ReadPeakLiveNodeCount(dd), (int)Cudd_ReadNodeCount(dd) );
340 // perform decomposition
341 pManDsd = Dsd_ManagerStart( dd, Gia_ManCiNum(p), 0 );
342 Dsd_Decompose( pManDsd, (DdNode **)Vec_PtrArray(vFuncs), Vec_PtrSize(vFuncs) );
343 if ( fVerbose )
344 {
345 Vec_Ptr_t * vNamesCi = Gia_GetFakeNames( Gia_ManCiNum(p), 0 );
346 Vec_Ptr_t * vNamesCo = Gia_GetFakeNames( Gia_ManCoNum(p), 1 );
347 char ** ppNamesCi = (char **)Vec_PtrArray( vNamesCi );
348 char ** ppNamesCo = (char **)Vec_PtrArray( vNamesCo );
349 Dsd_TreePrint( stdout, pManDsd, ppNamesCi, ppNamesCo, 0, -1, 0 );
350 Vec_PtrFreeFree( vNamesCi );
351 Vec_PtrFreeFree( vNamesCo );
352 }
353
354 pNew = Gia_ManRebuild( p, pManDsd, ddNew );
355 Dsd_ManagerStop( pManDsd );
356 // return manager
357 Gia_ManCollapseDeref( dd, vFuncs );
358 Extra_StopManager( dd );
359 Extra_StopManager( ddNew );
360 return pNew;
361}
362void Gia_ManCollapseTestTest( Gia_Man_t * p )
363{
364 Gia_Man_t * pNew;
365 pNew = Gia_ManCollapseTest( p, 0 );
366 Gia_ManPrintStats( p, NULL );
367 Gia_ManPrintStats( pNew, NULL );
368 Gia_ManStop( pNew );
369}
370
382void Gia_ManPrintDsdOne( Dsd_Manager_t * pManDsd, int Output, int OffSet )
383{
384 Vec_Str_t * vStr = Vec_StrAlloc( 100 );
385 Dsd_TreePrint4( vStr, pManDsd, Output );
386 for ( int i = 0; i < OffSet; i++ )
387 printf( " " );
388 printf( "Supp %2d nDsd %2d %s\n", Dsd_TreeSuppSize(pManDsd, Output), Dsd_TreeNonDsdMax(pManDsd, Output), Vec_StrArray(vStr) );
389 Vec_StrFree( vStr );
390 fflush( stdout );
391}
392void Gia_ManPrintDsd( Dsd_Manager_t * pManDsd, int Output, int nOutputs, int OffSet )
393{
394 if ( Output == -1 )
395 {
396 for ( int i = 0; i < nOutputs; i++ )
397 Gia_ManPrintDsdOne( pManDsd, i, OffSet );
398 }
399 else
400 {
401 assert( Output >= 0 && Output < nOutputs );
402 Gia_ManPrintDsdOne( pManDsd, Output, OffSet );
403 }
404}
405
406void Gia_ManCheckDsd( Gia_Man_t * p, int OffSet, int fVerbose )
407{
408 DdManager * dd;
409 Dsd_Manager_t * pManDsd;
410 Vec_Ptr_t * vFuncs;
411 dd = Cudd_Init( Gia_ManCiNum(p), 0, CUDD_UNIQUE_SLOTS, CUDD_CACHE_SLOTS, 0 );
412 Cudd_AutodynEnable( dd, CUDD_REORDER_SYMM_SIFT );
413 vFuncs = Gia_ManCollapse( p, dd, 10000, 0 );
414 Cudd_AutodynDisable( dd );
415 if ( vFuncs == NULL )
416 {
417 Extra_StopManager( dd );
418 return;
419 }
420 pManDsd = Dsd_ManagerStart( dd, Gia_ManCiNum(p), 0 );
421 if ( pManDsd == NULL )
422 {
423 Gia_ManCollapseDeref( dd, vFuncs );
424 Cudd_Quit( dd );
425 return;
426 }
427 Dsd_Decompose( pManDsd, (DdNode **)Vec_PtrArray(vFuncs), Vec_PtrSize(vFuncs) );
428
429 if ( fVerbose )
430 {
431 Vec_Ptr_t * vNamesCi = Gia_GetFakeNames( Gia_ManCiNum(p), 0 );
432 Vec_Ptr_t * vNamesCo = Gia_GetFakeNames( Gia_ManCoNum(p), 1 );
433 char ** ppNamesCi = (char **)Vec_PtrArray( vNamesCi );
434 char ** ppNamesCo = (char **)Vec_PtrArray( vNamesCo );
435 Dsd_TreePrint( stdout, pManDsd, ppNamesCi, ppNamesCo, 0, -1, OffSet );
436 Vec_PtrFreeFree( vNamesCi );
437 Vec_PtrFreeFree( vNamesCo );
438 }
439 else
440 Gia_ManPrintDsd( pManDsd, 0, Vec_PtrSize(vFuncs), 0 );
441
442 Dsd_ManagerStop( pManDsd );
443 Gia_ManCollapseDeref( dd, vFuncs );
444 Extra_StopManager( dd );
445}
446
447Vec_Ptr_t * Gia_ManRecurDsdCof( DdManager * dd, Vec_Ptr_t * vFuncs, int iVar )
448{
449 Vec_Ptr_t * vNew = Vec_PtrAlloc( 2 * Vec_PtrSize(vFuncs) ); DdNode * bFunc; int i;
450 Vec_PtrForEachEntry( DdNode *, vFuncs, bFunc, i ) {
451 DdNode * bCof0 = Cudd_Cofactor( dd, bFunc, Cudd_Not(Cudd_bddIthVar(dd, iVar)) ); Cudd_Ref( bCof0 );
452 DdNode * bCof1 = Cudd_Cofactor( dd, bFunc, Cudd_bddIthVar(dd, iVar) ); Cudd_Ref( bCof1 );
453 Vec_PtrPush( vNew, bCof0 );
454 Vec_PtrPush( vNew, bCof1 );
455 }
456 return vNew;
457}
458void Gia_ManRecurDsd( Gia_Man_t * p, int fVerbose )
459{
460 DdManager * dd;
461 Dsd_Manager_t * pManDsd;
462 Vec_Ptr_t * vFuncs, * vAux;
463 dd = Cudd_Init( Gia_ManCiNum(p), 0, CUDD_UNIQUE_SLOTS, CUDD_CACHE_SLOTS, 0 );
464 Cudd_AutodynEnable( dd, CUDD_REORDER_SYMM_SIFT );
465 vFuncs = Gia_ManCollapse( p, dd, 10000, 0 );
466 Cudd_AutodynDisable( dd );
467 if ( vFuncs == NULL )
468 {
469 Extra_StopManager( dd );
470 return;
471 }
472 pManDsd = Dsd_ManagerStart( dd, Gia_ManCiNum(p), 0 );
473 if ( pManDsd == NULL )
474 {
475 Gia_ManCollapseDeref( dd, vFuncs );
476 Cudd_Quit( dd );
477 return;
478 }
479 Dsd_Decompose( pManDsd, (DdNode **)Vec_PtrArray(vFuncs), Vec_PtrSize(vFuncs) );
480
481 printf( "Function:\n" );
482 Gia_ManPrintDsd( pManDsd, 0, Vec_PtrSize(vFuncs), 0 );
483
484 for ( int i = 0; i < 5 && Dsd_TreeNonDsdMax(pManDsd, -1) > 0; i++ )
485 {
486 int v, iBestV = -1, DsdMin = ABC_INFINITY, SuppMin = ABC_INFINITY;
487 for ( v = 0; v < Gia_ManCiNum(p); v++ )
488 {
489 Vec_Ptr_t * vTemp = Gia_ManRecurDsdCof( dd, vFuncs, v );
490 Dsd_Decompose( pManDsd, (DdNode **)Vec_PtrArray(vTemp), Vec_PtrSize(vTemp) );
491 int DsdCur = Dsd_TreeNonDsdMax( pManDsd, -1 );
492 int SuppCur = Dsd_TreeSuppSize( pManDsd, -1 );
493 if ( DsdMin > DsdCur || (DsdMin == DsdCur && SuppMin > SuppCur) )
494 DsdMin = DsdCur, SuppMin = SuppCur, iBestV = v;
495 Gia_ManCollapseDeref( dd, vTemp );
496 }
497 assert( iBestV >= 0 );
498 vFuncs = Gia_ManRecurDsdCof( dd, vAux = vFuncs, iBestV );
499 Gia_ManCollapseDeref( dd, vAux );
500 printf( "Cofactoring variable %c:\n", (int)(iBestV >= 26 ? 'A' - 26 : 'a') + iBestV );
501 Dsd_Decompose( pManDsd, (DdNode **)Vec_PtrArray(vFuncs), Vec_PtrSize(vFuncs) );
502 Gia_ManPrintDsd( pManDsd, -1, Vec_PtrSize(vFuncs), (i+1)*2 );
503 }
504
505 Dsd_ManagerStop( pManDsd );
506 Gia_ManCollapseDeref( dd, vFuncs );
507 Extra_StopManager( dd );
508}
509
510#else
511
513{
514 return NULL;
515}
516
517void Gia_ManCheckDsd( Gia_Man_t * p, int OffSet, int fVerbose )
518{
519}
520
521void Gia_ManRecurDsd( Gia_Man_t * p, int fVerbose )
522{
523}
524
525#endif
526
530
531
533
int Abc_NtkDeriveFlatGiaSop(Gia_Man_t *pGia, int *gFanins, char *pSop)
Definition abcHieCec.c:131
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition abc_global.h:250
#define ABC_FREE(obj)
Definition abc_global.h:267
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
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
Dsd_Manager_t * Dsd_ManagerStart(DdManager *dd, int nSuppMax, int fVerbose)
FUNCTION DECLARATIONS ///.
Definition dsdMan.c:47
void Dsd_NodeSetMark(Dsd_Node_t *p, word Mark)
Definition dsdApi.c:77
void Dsd_TreePrint(FILE *pFile, Dsd_Manager_t *dMan, char *pInputNames[], char *pOutputNames[], int fShortNames, int Output, int OffSet)
Definition dsdTree.c:830
Dsd_Node_t * Dsd_ManagerReadConst1(Dsd_Manager_t *pMan)
Definition dsdApi.c:95
Dsd_Node_t * Dsd_NodeReadDec(Dsd_Node_t *p, int i)
Definition dsdApi.c:57
enum Dsd_Type_t_ Dsd_Type_t
Definition dsd.h:61
struct Dsd_Manager_t_ Dsd_Manager_t
TYPEDEF DEFINITIONS ///.
Definition dsd.h:59
word Dsd_NodeReadMark(Dsd_Node_t *p)
Definition dsdApi.c:59
Dsd_Node_t * Dsd_ManagerReadRoot(Dsd_Manager_t *pMan, int i)
Definition dsdApi.c:93
int Dsd_TreeSuppSize(Dsd_Manager_t *pDsdMan, int Output)
Definition dsdTree.c:693
void Dsd_ManagerStop(Dsd_Manager_t *dMan)
Definition dsdMan.c:100
struct Dsd_Node_t_ Dsd_Node_t
Definition dsd.h:60
DdNode * Dsd_TreeGetPrimeFunction(DdManager *dd, Dsd_Node_t *pNode)
FUNCTION DEFINITIONS ///.
Definition dsdLocal.c:54
DdManager * Dsd_ManagerReadDd(Dsd_Manager_t *pMan)
Definition dsdApi.c:96
#define Dsd_Regular(p)
Definition dsd.h:69
Dsd_Node_t * Dsd_ManagerReadInput(Dsd_Manager_t *pMan, int i)
Definition dsdApi.c:94
void Dsd_TreePrint4(void *pStr, Dsd_Manager_t *pDsdMan, int Output)
Definition dsdTree.c:803
int Dsd_NodeReadDecsNum(Dsd_Node_t *p)
Definition dsdApi.c:58
Dsd_Node_t ** Dsd_TreeCollectNodesDfs(Dsd_Manager_t *dMan, int *pnNodes)
Definition dsdTree.c:555
Dsd_Type_t Dsd_NodeReadType(Dsd_Node_t *p)
FUNCTION DEFINITIONS ///.
Definition dsdApi.c:53
@ DSD_NODE_EXOR
Definition dsd.h:51
@ DSD_NODE_OR
Definition dsd.h:50
@ DSD_NODE_PRIME
Definition dsd.h:52
@ DSD_NODE_CONST1
Definition dsd.h:48
int Dsd_TreeNonDsdMax(Dsd_Manager_t *pDsdMan, int Output)
Definition dsdTree.c:655
#define Dsd_IsComplement(p)
MACRO DEFINITIONS ///.
Definition dsd.h:68
void Dsd_Decompose(Dsd_Manager_t *dMan, DdNode **pbFuncs, int nFuncs)
DECOMPOSITION FUNCTIONS ///.
Definition dsdProc.c:113
Cube * p
Definition exorList.c:222
void Extra_StopManager(DdManager *dd)
DdNode * Extra_TransferLevelByLevel(DdManager *ddSource, DdManager *ddDestination, DdNode *f)
void Gia_ManRecurDsd(Gia_Man_t *p, int fVerbose)
Definition giaClp.c:521
void Gia_ManCheckDsd(Gia_Man_t *p, int OffSet, int fVerbose)
Definition giaClp.c:517
ABC_NAMESPACE_IMPL_START Gia_Man_t * Gia_ManCollapseTest(Gia_Man_t *p, int fVerbose)
DECLARATIONS ///.
Definition giaClp.c:512
int Gia_ManFactorNode(Gia_Man_t *p, char *pSop, Vec_Int_t *vLeaves)
Definition giaFx.c:113
void Gia_ManStop(Gia_Man_t *p)
Definition giaMan.c:82
Gia_Man_t * Gia_ManDup(Gia_Man_t *p)
Definition giaDup.c:720
#define Gia_ManForEachAnd(p, pObj, i)
Definition gia.h:1214
#define Gia_ManForEachCoId(p, Id, i)
Definition gia.h:1240
void Gia_ManSetRegNum(Gia_Man_t *p, int nRegs)
Definition giaMan.c:764
void Gia_ManHashAlloc(Gia_Man_t *p)
Definition giaHash.c:105
Gia_Man_t * Gia_ManStart(int nObjsMax)
FUNCTION DEFINITIONS ///.
Definition giaMan.c:57
int Gia_ManHashOr(Gia_Man_t *p, int iLit0, int iLit1)
Definition giaHash.c:621
struct Gia_Obj_t_ Gia_Obj_t
Definition gia.h:76
int Gia_ManHashXor(Gia_Man_t *p, int iLit0, int iLit1)
Definition giaHash.c:668
struct Gia_Man_t_ Gia_Man_t
Definition gia.h:96
void Gia_ManCreateRefs(Gia_Man_t *p)
Definition giaUtil.c:779
void Gia_ManPrintStats(Gia_Man_t *p, Gps_Par_t *pPars)
Definition giaMan.c:495
Vec_Ptr_t * Gia_GetFakeNames(int nNames, int fCaps)
Definition giaUtil.c:154
#define Gia_ManForEachCiId(p, Id, i)
Definition gia.h:1230
char * pSpec
Definition gia.h:100
char * pName
Definition gia.h:99
#define assert(ex)
Definition util_old.h:213
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition vecPtr.h:55