ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
darRefact.c
Go to the documentation of this file.
1
20
21#include "darInt.h"
22#include "bool/kit/kit.h"
23
24#include "bool/bdc/bdc.h"
25#include "bool/bdc/bdcInt.h"
26
28
29
33
34// the refactoring manager
35typedef struct Ref_Man_t_ Ref_Man_t;
37{
38 // input data
39 Dar_RefPar_t * pPars; // rewriting parameters
40 Aig_Man_t * pAig; // AIG manager
41 // computed cuts
42 Vec_Vec_t * vCuts; // the storage for cuts
43 // truth table and ISOP
44 Vec_Ptr_t * vTruthElem; // elementary truth tables
45 Vec_Ptr_t * vTruthStore; // storage for truth tables
46 Vec_Int_t * vMemory; // storage for ISOP
47 Vec_Ptr_t * vCutNodes; // storage for internal nodes of the cut
48 // various data members
49 Vec_Ptr_t * vLeavesBest; // the best set of leaves
50 Kit_Graph_t * pGraphBest; // the best factored form
51 int GainBest; // the best gain
52 int LevelBest; // the level of node with the best gain
53 // bi-decomposition
54 Bdc_Par_t DecPars; // decomposition parameters
55 Bdc_Man_t * pManDec; // decomposition manager
56 // node statistics
57 int nNodesInit; // the initial number of nodes
58 int nNodesTried; // the number of nodes tried
59 int nNodesBelow; // the number of nodes below the level limit
60 int nNodesExten; // the number of nodes with extended cut
61 int nCutsUsed; // the number of rewriting steps
62 int nCutsTried; // the number of cuts tries
63 // timing statistics
68};
69
73
86{
87 memset( pPars, 0, sizeof(Dar_RefPar_t) );
88 pPars->nMffcMin = 2; // the min MFFC size for which refactoring is used
89 pPars->nLeafMax = 12; // the max number of leaves of a cut
90 pPars->nCutsMax = 5; // the max number of cuts to consider
91 pPars->fUpdateLevel = 0;
92 pPars->fUseZeros = 0;
93 pPars->fVerbose = 0;
94 pPars->fVeryVerbose = 0;
95}
96
109{
110 Ref_Man_t * p;
111 // start the manager
112 p = ABC_ALLOC( Ref_Man_t, 1 );
113 memset( p, 0, sizeof(Ref_Man_t) );
114 p->pAig = pAig;
115 p->pPars = pPars;
116 // other data
117 p->vCuts = Vec_VecStart( pPars->nCutsMax );
118 p->vTruthElem = Vec_PtrAllocTruthTables( pPars->nLeafMax );
119 p->vTruthStore = Vec_PtrAllocSimInfo( 1024, Kit_TruthWordNum(pPars->nLeafMax) );
120 p->vMemory = Vec_IntAlloc( 1 << 16 );
121 p->vCutNodes = Vec_PtrAlloc( 256 );
122 p->vLeavesBest = Vec_PtrAlloc( pPars->nLeafMax );
123 // alloc bi-decomposition manager
124 p->DecPars.nVarsMax = pPars->nLeafMax;
125 p->DecPars.fVerbose = pPars->fVerbose;
126 p->DecPars.fVeryVerbose = 0;
127// p->pManDec = Bdc_ManAlloc( &p->DecPars );
128 return p;
129}
130
143{
144 int Gain = p->nNodesInit - Aig_ManNodeNum(p->pAig);
145 printf( "NodesBeg = %8d. NodesEnd = %8d. Gain = %6d. (%6.2f %%).\n",
146 p->nNodesInit, Aig_ManNodeNum(p->pAig), Gain, 100.0*Gain/p->nNodesInit );
147 printf( "Tried = %6d. Below = %5d. Extended = %5d. Used = %5d. Levels = %4d.\n",
148 p->nNodesTried, p->nNodesBelow, p->nNodesExten, p->nCutsUsed, Aig_ManLevels(p->pAig) );
149 ABC_PRT( "Cuts ", p->timeCuts );
150 ABC_PRT( "Eval ", p->timeEval );
151 ABC_PRT( "Other ", p->timeOther );
152 ABC_PRT( "TOTAL ", p->timeTotal );
153}
154
167{
168 if ( p->pManDec )
169 Bdc_ManFree( p->pManDec );
170 if ( p->pPars->fVerbose )
172 Vec_VecFree( p->vCuts );
173 Vec_PtrFree( p->vTruthElem );
174 Vec_PtrFree( p->vTruthStore );
175 Vec_PtrFree( p->vLeavesBest );
176 Vec_IntFree( p->vMemory );
177 Vec_PtrFree( p->vCutNodes );
178 ABC_FREE( p );
179}
180
192void Ref_ObjComputeCuts( Aig_Man_t * pAig, Aig_Obj_t * pRoot, Vec_Vec_t * vCuts )
193{
194}
195
208{
209 printf( "%d", pObj? Aig_Regular(pObj)->Id : -1 );
210 if ( pObj )
211 printf( "(%d) ", Aig_IsComplement(pObj) );
212}
213
228int Dar_RefactTryGraph( Aig_Man_t * pAig, Aig_Obj_t * pRoot, Vec_Ptr_t * vCut, Kit_Graph_t * pGraph, int NodeMax, int LevelMax )
229{
230 Kit_Node_t * pNode, * pNode0, * pNode1;
231 Aig_Obj_t * pAnd, * pAnd0, * pAnd1;
232 int i, Counter, LevelNew, LevelOld;
233 // check for constant function or a literal
234 if ( Kit_GraphIsConst(pGraph) || Kit_GraphIsVar(pGraph) )
235 return 0;
236 // set the levels of the leaves
237 Kit_GraphForEachLeaf( pGraph, pNode, i )
238 {
239 pNode->pFunc = Vec_PtrEntry(vCut, i);
240 pNode->Level = Aig_Regular((Aig_Obj_t *)pNode->pFunc)->Level;
241 assert( Aig_Regular((Aig_Obj_t *)pNode->pFunc)->Level < (1<<24)-1 );
242 }
243//printf( "Trying:\n" );
244 // compute the AIG size after adding the internal nodes
245 Counter = 0;
246 Kit_GraphForEachNode( pGraph, pNode, i )
247 {
248 // get the children of this node
249 pNode0 = Kit_GraphNode( pGraph, pNode->eEdge0.Node );
250 pNode1 = Kit_GraphNode( pGraph, pNode->eEdge1.Node );
251 // get the AIG nodes corresponding to the children
252 pAnd0 = (Aig_Obj_t *)pNode0->pFunc;
253 pAnd1 = (Aig_Obj_t *)pNode1->pFunc;
254 if ( pAnd0 && pAnd1 )
255 {
256 // if they are both present, find the resulting node
257 pAnd0 = Aig_NotCond( pAnd0, pNode->eEdge0.fCompl );
258 pAnd1 = Aig_NotCond( pAnd1, pNode->eEdge1.fCompl );
259 pAnd = Aig_TableLookupTwo( pAig, pAnd0, pAnd1 );
260 // return -1 if the node is the same as the original root
261 if ( Aig_Regular(pAnd) == pRoot )
262 return -1;
263 }
264 else
265 pAnd = NULL;
266 // count the number of added nodes
267 if ( pAnd == NULL || Aig_ObjIsTravIdCurrent(pAig, Aig_Regular(pAnd)) )
268 {
269 if ( ++Counter > NodeMax )
270 return -1;
271 }
272 // count the number of new levels
273 LevelNew = 1 + Abc_MaxInt( pNode0->Level, pNode1->Level );
274 if ( pAnd )
275 {
276 if ( Aig_Regular(pAnd) == Aig_ManConst1(pAig) )
277 LevelNew = 0;
278 else if ( Aig_Regular(pAnd) == Aig_Regular(pAnd0) )
279 LevelNew = (int)Aig_Regular(pAnd0)->Level;
280 else if ( Aig_Regular(pAnd) == Aig_Regular(pAnd1) )
281 LevelNew = (int)Aig_Regular(pAnd1)->Level;
282 LevelOld = (int)Aig_Regular(pAnd)->Level;
283// assert( LevelNew == LevelOld );
284 }
285 if ( LevelNew > LevelMax )
286 return -1;
287 pNode->pFunc = pAnd;
288 pNode->Level = LevelNew;
289/*
290printf( "Checking " );
291Ref_ObjPrint( pAnd0 );
292printf( " and " );
293Ref_ObjPrint( pAnd1 );
294printf( " Result " );
295Ref_ObjPrint( pNode->pFunc );
296printf( "\n" );
297*/
298 }
299 return Counter;
300}
301
314{
315 Aig_Obj_t * pAnd0, * pAnd1;
316 Kit_Node_t * pNode = NULL;
317 int i;
318 // check for constant function
319 if ( Kit_GraphIsConst(pGraph) )
320 return Aig_NotCond( Aig_ManConst1(pAig), Kit_GraphIsComplement(pGraph) );
321 // set the leaves
322 Kit_GraphForEachLeaf( pGraph, pNode, i )
323 pNode->pFunc = Vec_PtrEntry(vCut, i);
324 // check for a literal
325 if ( Kit_GraphIsVar(pGraph) )
326 return Aig_NotCond( (Aig_Obj_t *)Kit_GraphVar(pGraph)->pFunc, Kit_GraphIsComplement(pGraph) );
327 // build the AIG nodes corresponding to the AND gates of the graph
328//printf( "Building (current number %d):\n", Aig_ManObjNumMax(pAig) );
329 Kit_GraphForEachNode( pGraph, pNode, i )
330 {
331 pAnd0 = Aig_NotCond( (Aig_Obj_t *)Kit_GraphNode(pGraph, pNode->eEdge0.Node)->pFunc, pNode->eEdge0.fCompl );
332 pAnd1 = Aig_NotCond( (Aig_Obj_t *)Kit_GraphNode(pGraph, pNode->eEdge1.Node)->pFunc, pNode->eEdge1.fCompl );
333 pNode->pFunc = Aig_And( pAig, pAnd0, pAnd1 );
334/*
335printf( "Checking " );
336Ref_ObjPrint( pAnd0 );
337printf( " and " );
338Ref_ObjPrint( pAnd1 );
339printf( " Result " );
340Ref_ObjPrint( pNode->pFunc );
341printf( "\n" );
342*/
343 }
344 // complement the result if necessary
345 return Aig_NotCond( (Aig_Obj_t *)pNode->pFunc, Kit_GraphIsComplement(pGraph) );
346}
347
359int Dar_ManRefactorTryCuts( Ref_Man_t * p, Aig_Obj_t * pObj, int nNodesSaved, int Required )
360{
361 Vec_Ptr_t * vCut;
362 Kit_Graph_t * pGraphCur;
363 int k, RetValue, GainCur, nNodesAdded;
364 unsigned * pTruth;
365
366 p->GainBest = -1;
367 p->pGraphBest = NULL;
368 Vec_VecForEachLevel( p->vCuts, vCut, k )
369 {
370 if ( Vec_PtrSize(vCut) == 0 )
371 continue;
372// if ( Vec_PtrSize(vCut) != 0 && Vec_PtrSize(Vec_VecEntry(p->vCuts, k+1)) != 0 )
373// continue;
374
375 p->nCutsTried++;
376 // get the cut nodes
377 Aig_ObjCollectCut( pObj, vCut, p->vCutNodes );
378 // get the truth table
379 pTruth = Aig_ManCutTruth( pObj, vCut, p->vCutNodes, p->vTruthElem, p->vTruthStore );
380 if ( Kit_TruthIsConst0(pTruth, Vec_PtrSize(vCut)) )
381 {
382 p->GainBest = Aig_NodeMffcSupp( p->pAig, pObj, 0, NULL );
383 p->pGraphBest = Kit_GraphCreateConst0();
384 Vec_PtrCopy( p->vLeavesBest, vCut );
385 return p->GainBest;
386 }
387 if ( Kit_TruthIsConst1(pTruth, Vec_PtrSize(vCut)) )
388 {
389 p->GainBest = Aig_NodeMffcSupp( p->pAig, pObj, 0, NULL );
390 p->pGraphBest = Kit_GraphCreateConst1();
391 Vec_PtrCopy( p->vLeavesBest, vCut );
392 return p->GainBest;
393 }
394
395 // try the positive phase
396 RetValue = Kit_TruthIsop( pTruth, Vec_PtrSize(vCut), p->vMemory, 0 );
397 if ( RetValue > -1 )
398 {
399 pGraphCur = Kit_SopFactor( p->vMemory, 0, Vec_PtrSize(vCut), p->vMemory );
400/*
401{
402 int RetValue;
403 RetValue = Bdc_ManDecompose( p->pManDec, pTruth, NULL, Vec_PtrSize(vCut), NULL, 1000 );
404 printf( "Graph = %d. Bidec = %d.\n", Kit_GraphNodeNum(pGraphCur), RetValue );
405}
406*/
407 nNodesAdded = Dar_RefactTryGraph( p->pAig, pObj, vCut, pGraphCur, nNodesSaved - !p->pPars->fUseZeros, Required );
408 if ( nNodesAdded > -1 )
409 {
410 GainCur = nNodesSaved - nNodesAdded;
411 if ( p->GainBest < GainCur || (p->GainBest == GainCur &&
412 (Kit_GraphIsConst(pGraphCur) || Kit_GraphRootLevel(pGraphCur) < Kit_GraphRootLevel(p->pGraphBest))) )
413 {
414 p->GainBest = GainCur;
415 if ( p->pGraphBest )
416 Kit_GraphFree( p->pGraphBest );
417 p->pGraphBest = pGraphCur;
418 Vec_PtrCopy( p->vLeavesBest, vCut );
419 }
420 else
421 Kit_GraphFree( pGraphCur );
422 }
423 else
424 Kit_GraphFree( pGraphCur );
425 }
426 // try negative phase
427 Kit_TruthNot( pTruth, pTruth, Vec_PtrSize(vCut) );
428 RetValue = Kit_TruthIsop( pTruth, Vec_PtrSize(vCut), p->vMemory, 0 );
429// Kit_TruthNot( pTruth, pTruth, Vec_PtrSize(vCut) );
430 if ( RetValue > -1 )
431 {
432 pGraphCur = Kit_SopFactor( p->vMemory, 1, Vec_PtrSize(vCut), p->vMemory );
433/*
434{
435 int RetValue;
436 RetValue = Bdc_ManDecompose( p->pManDec, pTruth, NULL, Vec_PtrSize(vCut), NULL, 1000 );
437 printf( "Graph = %d. Bidec = %d.\n", Kit_GraphNodeNum(pGraphCur), RetValue );
438}
439*/
440 nNodesAdded = Dar_RefactTryGraph( p->pAig, pObj, vCut, pGraphCur, nNodesSaved - !p->pPars->fUseZeros, Required );
441 if ( nNodesAdded > -1 )
442 {
443 GainCur = nNodesSaved - nNodesAdded;
444 if ( p->GainBest < GainCur || (p->GainBest == GainCur &&
445 (Kit_GraphIsConst(pGraphCur) || Kit_GraphRootLevel(pGraphCur) < Kit_GraphRootLevel(p->pGraphBest))) )
446 {
447 p->GainBest = GainCur;
448 if ( p->pGraphBest )
449 Kit_GraphFree( p->pGraphBest );
450 p->pGraphBest = pGraphCur;
451 Vec_PtrCopy( p->vLeavesBest, vCut );
452 }
453 else
454 Kit_GraphFree( pGraphCur );
455 }
456 else
457 Kit_GraphFree( pGraphCur );
458 }
459 }
460
461 return p->GainBest;
462}
463
475int Dar_ObjCutLevelAchieved( Vec_Ptr_t * vCut, int nLevelMin )
476{
477 Aig_Obj_t * pObj;
478 int i;
479 Vec_PtrForEachEntry( Aig_Obj_t *, vCut, pObj, i )
480 if ( !Aig_ObjIsCi(pObj) && (int)pObj->Level <= nLevelMin )
481 return 1;
482 return 0;
483}
484
497{
498// Bar_Progress_t * pProgress;
499 Ref_Man_t * p;
500 Vec_Ptr_t * vCut, * vCut2;
501 Aig_Obj_t * pObj, * pObjNew;
502 int nNodesOld, nNodeBefore, nNodeAfter, nNodesSaved, nNodesSaved2;
503 int i, Required, nLevelMin;
504 abctime clkStart, clk;
505
506 // start the manager
507 p = Dar_ManRefStart( pAig, pPars );
508 // remove dangling nodes
509 Aig_ManCleanup( pAig );
510 // if updating levels is requested, start fanout and timing
511 Aig_ManFanoutStart( pAig );
512 if ( p->pPars->fUpdateLevel )
513 Aig_ManStartReverseLevels( pAig, 0 );
514
515 // resynthesize each node once
516 clkStart = Abc_Clock();
517 vCut = Vec_VecEntry( p->vCuts, 0 );
518 vCut2 = Vec_VecEntry( p->vCuts, 1 );
519 p->nNodesInit = Aig_ManNodeNum(pAig);
520 nNodesOld = Vec_PtrSize( pAig->vObjs );
521// pProgress = Bar_ProgressStart( stdout, nNodesOld );
522 Aig_ManForEachObj( pAig, pObj, i )
523 {
524// Bar_ProgressUpdate( pProgress, i, NULL );
525 if ( !Aig_ObjIsNode(pObj) )
526 continue;
527 if ( i > nNodesOld )
528 break;
529 if ( pAig->Time2Quit && !(i & 256) && Abc_Clock() > pAig->Time2Quit )
530 break;
531 Vec_VecClear( p->vCuts );
532
533//printf( "\nConsidering node %d.\n", pObj->Id );
534 // get the bounded MFFC size
535clk = Abc_Clock();
536 nLevelMin = Abc_MaxInt( 0, Aig_ObjLevel(pObj) - 10 );
537 nNodesSaved = Aig_NodeMffcSupp( pAig, pObj, nLevelMin, vCut );
538 if ( nNodesSaved < p->pPars->nMffcMin ) // too small to consider
539 {
540p->timeCuts += Abc_Clock() - clk;
541 continue;
542 }
543 p->nNodesTried++;
544 if ( Vec_PtrSize(vCut) > p->pPars->nLeafMax ) // get one reconv-driven cut
545 {
546 Aig_ManFindCut( pObj, vCut, p->vCutNodes, p->pPars->nLeafMax, 50 );
547 nNodesSaved = Aig_NodeMffcLabelCut( p->pAig, pObj, vCut );
548 }
549 else if ( Vec_PtrSize(vCut) < p->pPars->nLeafMax - 2 && p->pPars->fExtend )
550 {
551 if ( !Dar_ObjCutLevelAchieved(vCut, nLevelMin) )
552 {
553 if ( Aig_NodeMffcExtendCut( pAig, pObj, vCut, vCut2 ) )
554 {
555 nNodesSaved2 = Aig_NodeMffcLabelCut( p->pAig, pObj, vCut );
556 assert( nNodesSaved2 == nNodesSaved );
557 }
558 if ( Vec_PtrSize(vCut2) > p->pPars->nLeafMax )
559 Vec_PtrClear(vCut2);
560 if ( Vec_PtrSize(vCut2) > 0 )
561 {
562 p->nNodesExten++;
563// printf( "%d(%d) ", Vec_PtrSize(vCut), Vec_PtrSize(vCut2) );
564 }
565 }
566 else
567 p->nNodesBelow++;
568 }
569p->timeCuts += Abc_Clock() - clk;
570
571 // try the cuts
572clk = Abc_Clock();
573 Required = pAig->vLevelR? Aig_ObjRequiredLevel(pAig, pObj) : ABC_INFINITY;
574 Dar_ManRefactorTryCuts( p, pObj, nNodesSaved, Required );
575p->timeEval += Abc_Clock() - clk;
576
577 // check the best gain
578 if ( !(p->GainBest > 0 || (p->GainBest == 0 && p->pPars->fUseZeros)) )
579 {
580 if ( p->pGraphBest )
581 Kit_GraphFree( p->pGraphBest );
582 continue;
583 }
584//printf( "\n" );
585
586 // if we end up here, a rewriting step is accepted
587 nNodeBefore = Aig_ManNodeNum( pAig );
588 pObjNew = Dar_RefactBuildGraph( pAig, p->vLeavesBest, p->pGraphBest );
589 //assert( (int)Aig_Regular(pObjNew)->Level <= Required );
590 // replace the node
591 Aig_ObjReplace( pAig, pObj, pObjNew, p->pPars->fUpdateLevel );
592 // compare the gains
593 nNodeAfter = Aig_ManNodeNum( pAig );
594 assert( p->GainBest <= nNodeBefore - nNodeAfter );
595 Kit_GraphFree( p->pGraphBest );
596 p->nCutsUsed++;
597// break;
598 }
599p->timeTotal = Abc_Clock() - clkStart;
600p->timeOther = p->timeTotal - p->timeCuts - p->timeEval;
601
602// Bar_ProgressStop( pProgress );
603 // put the nodes into the DFS order and reassign their IDs
604// Aig_NtkReassignIds( p );
605 // fix the levels
606 Aig_ManFanoutStop( pAig );
607 if ( p->pPars->fUpdateLevel )
609/*
610 Aig_ManForEachObj( p->pAig, pObj, i )
611 if ( Aig_ObjIsNode(pObj) && Aig_ObjRefs(pObj) == 0 )
612 {
613 printf( "Unreferenced " );
614 Aig_ObjPrintVerbose( pObj, 0 );
615 printf( "\n" );
616 }
617*/
618 // remove dangling nodes (they should not be here!)
619 Aig_ManCleanup( pAig );
620
621 // stop the rewriting manager
622 Dar_ManRefStop( p );
623// Aig_ManCheckPhase( pAig );
624 if ( !Aig_ManCheck( pAig ) )
625 {
626 printf( "Dar_ManRefactor: The network check has failed.\n" );
627 return 0;
628 }
629 return 1;
630
631}
632
636
637
639
ABC_INT64_T abctime
Definition abc_global.h:332
#define ABC_PRT(a, t)
Definition abc_global.h:255
#define ABC_ALLOC(type, num)
Definition abc_global.h:264
#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
void Aig_ManFanoutStart(Aig_Man_t *p)
FUNCTION DEFINITIONS ///.
Definition aigFanout.c:56
void Aig_ObjCollectCut(Aig_Obj_t *pRoot, Vec_Ptr_t *vLeaves, Vec_Ptr_t *vNodes)
Definition aigDfs.c:1031
void Aig_ManFanoutStop(Aig_Man_t *p)
Definition aigFanout.c:89
int Aig_NodeMffcExtendCut(Aig_Man_t *p, Aig_Obj_t *pNode, Vec_Ptr_t *vLeaves, Vec_Ptr_t *vResult)
Definition aigMffc.c:265
#define Aig_ManForEachObj(p, pObj, i)
Definition aig.h:403
void Aig_ManStartReverseLevels(Aig_Man_t *p, int nMaxLevelIncrease)
Definition aigTiming.c:142
Aig_Obj_t * Aig_And(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
Definition aigOper.c:104
void Aig_ManFindCut(Aig_Obj_t *pRoot, Vec_Ptr_t *vFront, Vec_Ptr_t *vVisited, int nSizeLimit, int nFanoutLimit)
Definition aigWin.c:145
struct Aig_Obj_t_ Aig_Obj_t
Definition aig.h:51
void Aig_ManStopReverseLevels(Aig_Man_t *p)
Definition aigTiming.c:175
int Aig_ManLevels(Aig_Man_t *p)
Definition aigUtil.c:102
unsigned * Aig_ManCutTruth(Aig_Obj_t *pRoot, Vec_Ptr_t *vLeaves, Vec_Ptr_t *vNodes, Vec_Ptr_t *vTruthElem, Vec_Ptr_t *vTruthStore)
Definition aigTruth.c:80
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition aig.h:50
int Aig_ManCleanup(Aig_Man_t *p)
Definition aigMan.c:265
void Aig_ObjReplace(Aig_Man_t *p, Aig_Obj_t *pObjOld, Aig_Obj_t *pObjNew, int fUpdateLevel)
Definition aigObj.c:467
int Aig_NodeMffcLabelCut(Aig_Man_t *p, Aig_Obj_t *pNode, Vec_Ptr_t *vLeaves)
Definition aigMffc.c:236
int Aig_ObjRequiredLevel(Aig_Man_t *p, Aig_Obj_t *pObj)
Definition aigTiming.c:100
int Aig_NodeMffcSupp(Aig_Man_t *p, Aig_Obj_t *pNode, int LevelMin, Vec_Ptr_t *vSupp)
Definition aigMffc.c:179
Aig_Obj_t * Aig_TableLookupTwo(Aig_Man_t *p, Aig_Obj_t *pFanin0, Aig_Obj_t *pFanin1)
Definition aigTable.c:146
ABC_DLL int Aig_ManCheck(Aig_Man_t *p)
FUNCTION DECLARATIONS ///.
Definition aigCheck.c:45
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
struct Bdc_Par_t_ Bdc_Par_t
Definition bdc.h:44
struct Bdc_Man_t_ Bdc_Man_t
Definition bdc.h:43
void Bdc_ManFree(Bdc_Man_t *p)
Definition bdcCore.c:113
Aig_Obj_t * Dar_RefactBuildGraph(Aig_Man_t *pAig, Vec_Ptr_t *vCut, Kit_Graph_t *pGraph)
Definition darRefact.c:313
void Ref_ObjPrint(Aig_Obj_t *pObj)
Definition darRefact.c:207
int Dar_ManRefactor(Aig_Man_t *pAig, Dar_RefPar_t *pPars)
Definition darRefact.c:496
void Dar_ManRefStop(Ref_Man_t *p)
Definition darRefact.c:166
int Dar_RefactTryGraph(Aig_Man_t *pAig, Aig_Obj_t *pRoot, Vec_Ptr_t *vCut, Kit_Graph_t *pGraph, int NodeMax, int LevelMax)
Definition darRefact.c:228
void Dar_ManDefaultRefParams(Dar_RefPar_t *pPars)
FUNCTION DEFINITIONS ///.
Definition darRefact.c:85
typedefABC_NAMESPACE_IMPL_START struct Ref_Man_t_ Ref_Man_t
DECLARATIONS ///.
Definition darRefact.c:35
void Dar_ManRefPrintStats(Ref_Man_t *p)
Definition darRefact.c:142
Ref_Man_t * Dar_ManRefStart(Aig_Man_t *pAig, Dar_RefPar_t *pPars)
Definition darRefact.c:108
void Ref_ObjComputeCuts(Aig_Man_t *pAig, Aig_Obj_t *pRoot, Vec_Vec_t *vCuts)
Definition darRefact.c:192
int Dar_ObjCutLevelAchieved(Vec_Ptr_t *vCut, int nLevelMin)
Definition darRefact.c:475
int Dar_ManRefactorTryCuts(Ref_Man_t *p, Aig_Obj_t *pObj, int nNodesSaved, int Required)
Definition darRefact.c:359
struct Dar_RefPar_t_ Dar_RefPar_t
Definition dar.h:43
Cube * p
Definition exorList.c:222
#define Kit_GraphForEachNode(pGraph, pAnd, i)
Definition kit.h:507
struct Kit_Graph_t_ Kit_Graph_t
Definition kit.h:88
int Kit_TruthIsop(unsigned *puTruth, int nVars, Vec_Int_t *vMemory, int fTryBoth)
Definition kitIsop.c:134
Kit_Graph_t * Kit_SopFactor(Vec_Int_t *vCover, int fCompl, int nVars, Vec_Int_t *vMemory)
FUNCTION DEFINITIONS ///.
Definition kitFactor.c:55
Kit_Graph_t * Kit_GraphCreateConst1()
Definition kitGraph.c:91
struct Kit_Node_t_ Kit_Node_t
Definition kit.h:69
void Kit_GraphFree(Kit_Graph_t *pGraph)
Definition kitGraph.c:132
#define Kit_GraphForEachLeaf(pGraph, pLeaf, i)
Definition kit.h:505
Kit_Graph_t * Kit_GraphCreateConst0()
Definition kitGraph.c:70
unsigned Level
Definition aig.h:82
int nLeafMax
Definition dar.h:62
int fVerbose
Definition dar.h:67
int fUseZeros
Definition dar.h:66
int nCutsMax
Definition dar.h:63
int fUpdateLevel
Definition dar.h:65
int fVeryVerbose
Definition dar.h:68
int nMffcMin
Definition dar.h:61
unsigned fCompl
Definition kit.h:65
unsigned Node
Definition kit.h:66
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
abctime timeCuts
Definition darRefact.c:64
Vec_Ptr_t * vTruthElem
Definition darRefact.c:44
abctime timeOther
Definition darRefact.c:66
int nNodesBelow
Definition darRefact.c:59
Dar_RefPar_t * pPars
Definition darRefact.c:39
int nCutsTried
Definition darRefact.c:62
int nNodesExten
Definition darRefact.c:60
abctime timeEval
Definition darRefact.c:65
int GainBest
Definition darRefact.c:51
Bdc_Man_t * pManDec
Definition darRefact.c:55
Vec_Ptr_t * vLeavesBest
Definition darRefact.c:49
int nNodesInit
Definition darRefact.c:57
Vec_Ptr_t * vTruthStore
Definition darRefact.c:45
Bdc_Par_t DecPars
Definition darRefact.c:54
abctime timeTotal
Definition darRefact.c:67
Vec_Ptr_t * vCutNodes
Definition darRefact.c:47
int LevelBest
Definition darRefact.c:52
Aig_Man_t * pAig
Definition darRefact.c:40
Kit_Graph_t * pGraphBest
Definition darRefact.c:50
Vec_Int_t * vMemory
Definition darRefact.c:46
int nCutsUsed
Definition darRefact.c:61
int nNodesTried
Definition darRefact.c:58
Vec_Vec_t * vCuts
Definition darRefact.c:42
#define assert(ex)
Definition util_old.h:213
char * memset()
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
#define Vec_VecForEachLevel(vGlob, vVec, i)
MACRO DEFINITIONS ///.
Definition vecVec.h:55
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
Definition vecVec.h:42