378{
380
381 Bdc_Par_t Pars = {0}, * pDecPars = &Pars;
387 int i, k, nNodes, nFaninMax;
388 abctime clk = Abc_Clock(), clk2;
389 int nTotalNodesBeg = Abc_NtkNodeNum(pNtk);
391
392 assert( Abc_NtkIsLogic(pNtk) );
394 if ( pPars->fResub )
395 {
396 if ( nFaninMax > 8 )
397 {
398 printf( "Nodes with more than %d fanins will not be processed.\n", 8 );
399 nFaninMax = 8;
400 }
401 }
402 else
403 {
405 {
406 printf(
"Nodes with more than %d fanins will not be processed.\n",
MFS_FANIN_MAX );
408 }
409 }
410
411
412
414 {
415 fprintf( stdout, "Converting to AIGs has failed.\n" );
416 return 0;
417 }
418 assert( Abc_NtkHasAig(pNtk) );
419
420
423 p->nFaninMax = nFaninMax;
424
425
426 if ( pPars->fPower )
427 {
429 if ( pPars->fResub )
431 else
433#if 0
435#else
437#endif
438 }
439
441 {
444 printf( "The PI count of careset (%d) and logic network (%d) differ. Careset is not used.\n",
446 else
447 {
452 }
453 }
454 if (
p->pCare != NULL )
455 printf(
"Performing optimization with %d external care clauses.\n", Aig_ManCoNum(
p->pCare) );
456
457 if ( !pPars->fResub )
458 {
459 pDecPars->nVarsMax = (nFaninMax < 3) ? 3 : nFaninMax;
460 pDecPars->fVerbose = pPars->fVerbose;
461 p->vTruth = Vec_IntAlloc( 0 );
463 }
464
465
467 {
469 pObj->
pData = (
void *)(ABC_PTRUINT_T)i;
470 }
471
472
475
476
477 nNodes = 0;
478 p->nTotalNodesBeg = nTotalNodesBeg;
479 p->nTotalEdgesBeg = nTotalEdgesBeg;
480 if ( pPars->fResub )
481 {
482#if 0
484#endif
485 if (pPars->fPower)
486 {
488 } else
489 {
492 {
493 if (
p->pPars->nDepthMax && (
int)pObj->
Level >
p->pPars->nDepthMax )
494 continue;
495 if ( Abc_ObjFaninNum(pObj) < 2 || Abc_ObjFaninNum(pObj) > nFaninMax )
496 continue;
497 if ( !
p->pPars->fVeryVerbose )
498 Extra_ProgressBarUpdate( pProgress, i, NULL );
499 if ( pPars->fResub )
501 else
503 }
505#if 0
507#endif
508 }
509 } else
510 {
511#if 0
513#endif
517 {
518 if ( !
p->pPars->fVeryVerbose )
519 Extra_ProgressBarUpdate( pProgress, nNodes, NULL );
520 p->nNodesGainedLevel = 0;
521 p->nTotConfLevel = 0;
522 p->nTimeOutsLevel = 0;
523 clk2 = Abc_Clock();
525 {
526 if (
p->pPars->nDepthMax && (
int)pObj->
Level >
p->pPars->nDepthMax )
527 break;
528 if ( Abc_ObjFaninNum(pObj) < 2 || Abc_ObjFaninNum(pObj) > nFaninMax )
529 continue;
530 if ( pPars->fResub )
532 else
534 }
535 nNodes += Vec_PtrSize(vNodes);
536 if ( pPars->fVerbose )
537 {
538
539
540
541
542
543
544
545
546 }
547 }
549 Vec_VecFree( vLevels );
550#if 0
552#endif
553 }
555
556
557 if ( !pPars->fResub )
558 {
560
561
562 }
563
564 p->nTotalNodesEnd = Abc_NtkNodeNum(pNtk);
566
567
569 {
572 }
573
574 if ( pPars->fPower )
575 {
576#if 1
578
579#else
581#endif
582 }
583
584
585 p->timeTotal = Abc_Clock() - clk;
587 return 1;
588}
void Abc_NtkBidecResyn(Abc_Ntk_t *pNtk, int fVerbose)
Vec_Int_t * Abc_NtkPowerEstimate(Abc_Ntk_t *pNtk, int fProbOne)
struct Abc_Obj_t_ Abc_Obj_t
ABC_DLL float Abc_NtkMfsTotalSwitching(Abc_Ntk_t *pNtk)
ABC_DLL Vec_Vec_t * Abc_NtkLevelize(Abc_Ntk_t *pNtk)
ABC_DLL int Abc_NtkGetFaninMax(Abc_Ntk_t *pNtk)
struct Abc_Ntk_t_ Abc_Ntk_t
ABC_DLL void Abc_NtkStopReverseLevels(Abc_Ntk_t *pNtk)
ABC_DLL int Abc_NtkLevel(Abc_Ntk_t *pNtk)
ABC_DLL void Abc_NtkStartReverseLevels(Abc_Ntk_t *pNtk, int nMaxLevelIncrease)
ABC_DLL int Abc_NtkToAig(Abc_Ntk_t *pNtk)
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
#define Abc_NtkForEachCi(pNtk, pCi, i)
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
ABC_DLL int Abc_NtkGetTotalFanins(Abc_Ntk_t *pNtk)
#define Abc_NtkForEachNode(pNtk, pNode, i)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Vec_Ptr_t * Aig_ManSupportsInverse(Aig_Man_t *p)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
ABC_NAMESPACE_IMPL_START typedef char ProgressBar
struct Bdc_Par_t_ Bdc_Par_t
Bdc_Man_t * Bdc_ManAlloc(Bdc_Par_t *pPars)
MACRO DEFINITIONS ///.
Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
int Abc_NtkMfsNode(Mfs_Man_t *p, Abc_Obj_t *pNode)
int Abc_NtkMfsResub(Mfs_Man_t *p, Abc_Obj_t *pNode)
void Abc_NtkMfsPowerResub(Mfs_Man_t *p, Mfs_Par_t *pPars)
Mfs_Man_t * Mfs_ManAlloc(Mfs_Par_t *pPars)
DECLARATIONS ///.
struct Mfs_Man_t_ Mfs_Man_t
#define MFS_FANIN_MAX
INCLUDES ///.
void Mfs_ManStop(Mfs_Man_t *p)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
#define Vec_VecForEachLevelStart(vGlob, vVec, i, LevelStart)
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.