ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
abcIf.c File Reference
#include "base/abc/abc.h"
#include "base/main/main.h"
#include "map/if/if.h"
#include "bool/kit/kit.h"
#include "aig/aig/aig.h"
#include "map/mio/mio.h"
Include dependency graph for abcIf.c:

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START If_Man_tAbc_NtkToIf (Abc_Ntk_t *pNtk, If_Par_t *pPars)
 DECLARATIONS ///.
 
Abc_Obj_tAbc_NodeFromIf_rec (Abc_Ntk_t *pNtkNew, If_Man_t *pIfMan, If_Obj_t *pIfObj, Vec_Int_t *vCover)
 
void Abc_NtkBddReorder (Abc_Ntk_t *pNtk, int fVerbose)
 DECLARATIONS ///.
 
void Abc_NtkBidecResyn (Abc_Ntk_t *pNtk, int fVerbose)
 
void If_ManComputeSwitching (If_Man_t *pIfMan)
 FUNCTION DEFINITIONS ///.
 
Abc_Ntk_tAbc_NtkIf (Abc_Ntk_t *pNtk, If_Par_t *pPars)
 
Hop_Obj_tAbc_NodeBuildFromMiniInt (Hop_Man_t *pMan, Vec_Int_t *vAig, int nLeaves)
 
Hop_Obj_tAbc_NodeBuildFromMini (Hop_Man_t *pMan, If_Man_t *p, If_Cut_t *pCut, int fUseDsd)
 
void Abc_DecRecordToHop (Abc_Ntk_t *pNtkNew, If_Man_t *pIfMan, If_Cut_t *pCutBest, If_Obj_t *pIfObj, Vec_Int_t *vCover, Abc_Obj_t *pNodeTop)
 
Hop_Obj_tAbc_NodeIfToHop_rec (Hop_Man_t *pHopMan, If_Man_t *pIfMan, If_Obj_t *pIfObj, Vec_Ptr_t *vVisited)
 
Hop_Obj_tAbc_NodeIfToHop2_rec (Hop_Man_t *pHopMan, If_Man_t *pIfMan, If_Obj_t *pIfObj, Vec_Ptr_t *vVisited)
 
int Abc_ObjCompareFlow (Abc_Obj_t **ppNode0, Abc_Obj_t **ppNode1)
 
void Abc_NtkFindGoodOrder_rec (Abc_Obj_t *pNode, Vec_Ptr_t *vNodes)
 
void Abc_NtkMarkMux (Abc_Obj_t *pDriver, Abc_Obj_t **ppNode1, Abc_Obj_t **ppNode2)
 

Function Documentation

◆ Abc_DecRecordToHop()

void Abc_DecRecordToHop ( Abc_Ntk_t * pNtkNew,
If_Man_t * pIfMan,
If_Cut_t * pCutBest,
If_Obj_t * pIfObj,
Vec_Int_t * vCover,
Abc_Obj_t * pNodeTop )

Function************************************************************* Synopsis [Implements decomposed LUT-structure of the cut.] Description []

SideEffects [] SeeAlso []

Definition at line 436 of file abcIf.c.

437{
438 extern Hop_Obj_t * Kit_TruthToHop( Hop_Man_t * pMan, unsigned * pTruth, int nVars, Vec_Int_t * vMemory );
439 assert( !pIfMan->pPars->fUseTtPerm );
440
441 // get the truth table
442 word * pTruth = If_CutTruthW(pIfMan, pCutBest);
443 int v;
444 If_Obj_t * pIfLeaf;
445
446 if ( pCutBest->nLeaves <= pIfMan->pPars->nLutDecSize )
447 {
448 /* add fanins */
449 If_CutForEachLeaf( pIfMan, pCutBest, pIfLeaf, v )
450 Abc_ObjAddFanin( pNodeTop, (Abc_Obj_t *)If_ObjCopy( pIfLeaf ) );
451
452 pNodeTop->Level = Abc_ObjLevelNew( pNodeTop );
453
454 pNodeTop->pData = Kit_TruthToHop( (Hop_Man_t *)pNtkNew->pManFunc, (unsigned *)pTruth, If_CutLeaveNum(pCutBest), vCover );
455 return;
456 }
457
458 // get the delay profile
459 unsigned delayProfile = pCutBest->decDelay;
460
461 // perform LUT-decomposition and return the LUT-structure
462 unsigned char decompArray[92];
463 int val;
464 if ( pIfMan->pPars->fUserLutDec )
465 {
466 val = acd_decompose( pTruth, pCutBest->nLeaves, pIfMan->pPars->nLutDecSize, &(delayProfile), decompArray );
467 }
468 else if ( pIfMan->pPars->fUserLut2D )
469 {
470 val = acd2_decompose( pTruth, pCutBest->nLeaves, pIfMan->pPars->nLutDecSize, &(delayProfile), decompArray );
471 }
472 else
473 {
474 val = acdXX_decompose( pTruth, pIfMan->pPars->nLutDecSize, pCutBest->nLeaves, decompArray );
475 }
476 assert( val == 0 );
477
478 // convert the LUT-structure into a set of logic nodes in Abc_Ntk_t
479 unsigned char bytes_check = decompArray[0];
480 assert( bytes_check <= 92 );
481
482 int byte_p = 2;
483 unsigned char i, j, k, num_fanins, num_words, num_bytes;
484 int level, fanin;
485 word *tt;
486 Abc_Obj_t *pNewNodes[5];
487
488 /* create intermediate LUTs */
489 assert( decompArray[1] <= 6 );
490 Abc_Obj_t * pFanin;
491 for ( i = 0; i < decompArray[1]; ++i )
492 {
493 if ( i < decompArray[1] - 1 )
494 {
495 pNewNodes[i] = Abc_NtkCreateNode( pNtkNew );
496 }
497 else
498 {
499 pNewNodes[i] = pNodeTop;
500 }
501 num_fanins = decompArray[byte_p++];
502 level = 0;
503 for ( j = 0; j < num_fanins; ++j )
504 {
505 fanin = (int)decompArray[byte_p++];
506 if ( fanin < If_CutLeaveNum(pCutBest) )
507 {
508 pFanin = (Abc_Obj_t *)If_ObjCopy( If_CutLeaf(pIfMan, pCutBest, fanin) );
509 }
510 else
511 {
512 assert( fanin - If_CutLeaveNum(pCutBest) < i );
513 pFanin = pNewNodes[fanin - If_CutLeaveNum(pCutBest)];
514 }
515 Abc_ObjAddFanin( pNewNodes[i], pFanin );
516 level = Abc_MaxInt( level, Abc_ObjLevel(pFanin) );
517 }
518
519 pNewNodes[i]->Level = level + (int)(Abc_ObjFaninNum(pNewNodes[i]) > 0);
520
521 /* extract the truth table */
522 tt = pIfMan->puTempW;
523 num_words = ( num_fanins <= 6 ) ? 1 : ( 1 << ( num_fanins - 6 ) );
524 num_bytes = ( num_fanins <= 3 ) ? 1 : ( 1 << ( Abc_MinInt( (int)num_fanins, 6 ) - 3 ) );
525 for ( j = 0; j < num_words; ++j )
526 {
527 tt[j] = 0;
528 for ( k = 0; k < num_bytes; ++k )
529 {
530 tt[j] |= ( (word)(decompArray[byte_p++]) ) << ( k << 3 );
531 }
532 }
533
534 /* extend truth table if size < 5 */
535 assert( num_fanins != 1 );
536 if ( num_fanins == 2 )
537 {
538 tt[0] |= tt[0] << 4;
539 }
540 while ( num_bytes < 4 )
541 {
542 tt[0] |= tt[0] << ( num_bytes << 3 );
543 num_bytes <<= 1;
544 }
545
546 /* add node data */
547 pNewNodes[i]->pData = Kit_TruthToHop( (Hop_Man_t *)pNtkNew->pManFunc, (unsigned *)tt, (int) num_fanins, vCover );
548 }
549
550 /* check correct read */
551 assert( byte_p == decompArray[0] );
552}
struct Abc_Obj_t_ Abc_Obj_t
Definition abc.h:116
ABC_DLL void Abc_ObjAddFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
Definition abcFanio.c:84
ABC_DLL int Abc_ObjLevelNew(Abc_Obj_t *pObj)
Definition abcTiming.c:1170
int acd_decompose(word *pTruth, unsigned nVars, int lutSize, unsigned *pdelay, unsigned char *decomposition)
int acdXX_decompose(word *pTruth, unsigned lutSize, unsigned nVars, unsigned char *decomposition)
int acd2_decompose(word *pTruth, unsigned nVars, int lutSize, unsigned *pdelay, unsigned char *decomposition)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
typedefABC_NAMESPACE_HEADER_START struct Hop_Man_t_ Hop_Man_t
INCLUDES ///.
Definition hop.h:49
struct Hop_Obj_t_ Hop_Obj_t
Definition hop.h:50
#define If_CutForEachLeaf(p, pCut, pLeaf, i)
Definition if.h:503
struct If_Obj_t_ If_Obj_t
Definition if.h:79
Hop_Obj_t * Kit_TruthToHop(Hop_Man_t *pMan, unsigned *pTruth, int nVars, Vec_Int_t *vMemory)
Definition kitHop.c:271
unsigned __int64 word
DECLARATIONS ///.
Definition kitPerm.c:36
void * pManFunc
Definition abc.h:191
void * pData
Definition abc.h:145
unsigned Level
Definition abc.h:142
unsigned nLeaves
Definition if.h:316
unsigned decDelay
Definition if.h:317
If_Par_t * pPars
Definition if.h:201
word * puTempW
Definition if.h:221
int fUserLut2D
Definition if.h:151
int fUserLutDec
Definition if.h:150
int nLutDecSize
Definition if.h:116
int fUseTtPerm
Definition if.h:144
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NodeBuildFromMini()

Hop_Obj_t * Abc_NodeBuildFromMini ( Hop_Man_t * pMan,
If_Man_t * p,
If_Cut_t * pCut,
int fUseDsd )

Definition at line 418 of file abcIf.c.

419{
420 int Delay;
421 if ( fUseDsd )
422 Delay = If_CutDsdBalanceEval( p, pCut, p->vArray );
423 else
424 Delay = If_CutSopBalanceEval( p, pCut, p->vArray );
425 assert( Delay >= 0 );
426 return Abc_NodeBuildFromMiniInt( pMan, p->vArray, If_CutLeaveNum(pCut) );
427}
Hop_Obj_t * Abc_NodeBuildFromMiniInt(Hop_Man_t *pMan, Vec_Int_t *vAig, int nLeaves)
Definition abcIf.c:382
Cube * p
Definition exorList.c:222
int If_CutDsdBalanceEval(If_Man_t *p, If_Cut_t *pCut, Vec_Int_t *vAig)
Definition ifDsd.c:2322
int If_CutSopBalanceEval(If_Man_t *p, If_Cut_t *pCut, Vec_Int_t *vAig)
Definition ifDelay.c:248
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NodeBuildFromMiniInt()

Hop_Obj_t * Abc_NodeBuildFromMiniInt ( Hop_Man_t * pMan,
Vec_Int_t * vAig,
int nLeaves )

Function*************************************************************

Synopsis [Rebuilds GIA from mini AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 382 of file abcIf.c.

383{
384 assert( Vec_IntSize(vAig) > 0 );
385 assert( Vec_IntEntryLast(vAig) < 2 );
386 if ( Vec_IntSize(vAig) == 1 ) // const
387 {
388 assert( nLeaves == 0 );
389 return Hop_NotCond( Hop_ManConst0(pMan), Vec_IntEntry(vAig, 0) );
390 }
391 if ( Vec_IntSize(vAig) == 2 ) // variable
392 {
393 assert( Vec_IntEntry(vAig, 0) == 0 );
394 assert( nLeaves == 1 );
395 return Hop_NotCond( Hop_IthVar(pMan, 0), Vec_IntEntry(vAig, 1) );
396 }
397 else
398 {
399 int i, iVar0, iVar1, iLit0, iLit1;
400 Hop_Obj_t * piLit0, * piLit1, * piLit = NULL;
401 assert( Vec_IntSize(vAig) & 1 );
402 Vec_IntForEachEntryDouble( vAig, iLit0, iLit1, i )
403 {
404 iVar0 = Abc_Lit2Var( iLit0 );
405 iVar1 = Abc_Lit2Var( iLit1 );
406 piLit0 = Hop_NotCond( iVar0 < nLeaves ? Hop_IthVar(pMan, iVar0) : (Hop_Obj_t *)Vec_PtrEntry((Vec_Ptr_t *)vAig, iVar0 - nLeaves), Abc_LitIsCompl(iLit0) );
407 piLit1 = Hop_NotCond( iVar1 < nLeaves ? Hop_IthVar(pMan, iVar1) : (Hop_Obj_t *)Vec_PtrEntry((Vec_Ptr_t *)vAig, iVar1 - nLeaves), Abc_LitIsCompl(iLit1) );
408 piLit = Hop_And( pMan, piLit0, piLit1 );
409 assert( (i & 1) == 0 );
410 Vec_PtrWriteEntry( (Vec_Ptr_t *)vAig, Abc_Lit2Var(i), piLit ); // overwriting entries
411 }
412 assert( i == Vec_IntSize(vAig) - 1 );
413 piLit = Hop_NotCond( piLit, Vec_IntEntry(vAig, i) );
414 Vec_IntClear( vAig ); // useless
415 return piLit;
416 }
417}
Hop_Obj_t * Hop_IthVar(Hop_Man_t *p, int i)
FUNCTION DEFINITIONS ///.
Definition hopOper.c:63
Hop_Obj_t * Hop_And(Hop_Man_t *p, Hop_Obj_t *p0, Hop_Obj_t *p1)
Definition hopOper.c:104
#define Vec_IntForEachEntryDouble(vVec, Entry1, Entry2, i)
Definition vecInt.h:72
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NodeFromIf_rec()

Abc_Obj_t * Abc_NodeFromIf_rec ( Abc_Ntk_t * pNtkNew,
If_Man_t * pIfMan,
If_Obj_t * pIfObj,
Vec_Int_t * vCover )
extern

Function*************************************************************

Synopsis [Derive one node after FPGA mapping.]

Description []

SideEffects []

SeeAlso []

Definition at line 565 of file abcIf.c.

566{
567 Abc_Obj_t * pNodeNew;
568 If_Cut_t * pCutBest;
569 If_Obj_t * pIfLeaf;
570 int i;
571 // return if the result if known
572 pNodeNew = (Abc_Obj_t *)If_ObjCopy( pIfObj );
573 if ( pNodeNew )
574 return pNodeNew;
575 assert( pIfObj->Type == IF_AND );
576 // get the parameters of the best cut
577 pCutBest = If_ObjCutBest( pIfObj );
578 if ( pIfMan->pPars->fUserSesLib )
579 {
580 // create the subgraph composed of Abc_Obj_t nodes based on the given cut
582 If_CutForEachLeaf( pIfMan, pCutBest, pIfLeaf, i )
583 pFanins[i] = Abc_NodeFromIf_rec(pNtkNew, pIfMan, pIfLeaf, vCover);
584 pNodeNew = Abc_ExactBuildNode( If_CutTruthW(pIfMan, pCutBest), If_CutLeaveNum(pCutBest), If_CutArrTimeProfile(pIfMan, pCutBest), pFanins, pNtkNew );
585 If_ObjSetCopy( pIfObj, pNodeNew );
586 return pNodeNew;
587 }
588 // create a new node
589 pNodeNew = Abc_NtkCreateNode( pNtkNew );
590// if ( pIfMan->pPars->pLutLib && pIfMan->pPars->pLutLib->fVarPinDelays )
591 if ( !pIfMan->pPars->fDelayOpt && !pIfMan->pPars->fDelayOptLut && !pIfMan->pPars->fDsdBalance && !pIfMan->pPars->fUseTtPerm &&
592 !pIfMan->pPars->pLutStruct && !pIfMan->pPars->fUserLutDec && !pIfMan->pPars->fUserLut2D && !pIfMan->pPars->fUserRecLib &&
593 !pIfMan->pPars->fUserSesLib && !pIfMan->pPars->nGateSize )
594 If_CutRotatePins( pIfMan, pCutBest );
595 if ( pIfMan->pPars->fUseCnfs || pIfMan->pPars->fUseMv )
596 {
597 If_CutForEachLeafReverse( pIfMan, pCutBest, pIfLeaf, i )
598 Abc_ObjAddFanin( pNodeNew, Abc_NodeFromIf_rec(pNtkNew, pIfMan, pIfLeaf, vCover) );
599 }
600 else if ( pIfMan->pPars->fUserLutDec || pIfMan->pPars->fUserLut2D || pIfMan->pPars->fDeriveLuts )
601 {
602 If_CutForEachLeaf( pIfMan, pCutBest, pIfLeaf, i )
603 Abc_NodeFromIf_rec(pNtkNew, pIfMan, pIfLeaf, vCover);
604 }
605 else
606 {
607 If_CutForEachLeaf( pIfMan, pCutBest, pIfLeaf, i )
608 Abc_ObjAddFanin( pNodeNew, Abc_NodeFromIf_rec(pNtkNew, pIfMan, pIfLeaf, vCover) );
609 }
610 // set the level of the new node
611 pNodeNew->Level = Abc_ObjLevelNew( pNodeNew );
612 // derive the function of this node
613 if ( pIfMan->pPars->fTruth )
614 {
615 if ( pIfMan->pPars->fUseBdds )
616 {
617 // transform truth table into the BDD
618#ifdef ABC_USE_CUDD
619 pNodeNew->pData = Kit_TruthToBdd( (DdManager *)pNtkNew->pManFunc, If_CutTruth(pIfMan, pCutBest), If_CutLeaveNum(pCutBest), 0 ); Cudd_Ref((DdNode *)pNodeNew->pData);
620#endif
621 }
622 else if ( pIfMan->pPars->fUseCnfs || pIfMan->pPars->fUseMv )
623 {
624 // transform truth table into the BDD
625#ifdef ABC_USE_CUDD
626 pNodeNew->pData = Kit_TruthToBdd( (DdManager *)pNtkNew->pManFunc, If_CutTruth(pIfMan, pCutBest), If_CutLeaveNum(pCutBest), 1 ); Cudd_Ref((DdNode *)pNodeNew->pData);
627#endif
628 }
629 else if ( pIfMan->pPars->fUseSops || pIfMan->pPars->nGateSize > 0 )
630 {
631 // transform truth table into the SOP
632 int RetValue = Kit_TruthIsop( If_CutTruth(pIfMan, pCutBest), If_CutLeaveNum(pCutBest), vCover, 1 );
633 assert( RetValue == 0 || RetValue == 1 );
634 // check the case of constant cover
635 if ( Vec_IntSize(vCover) == 0 || (Vec_IntSize(vCover) == 1 && Vec_IntEntry(vCover,0) == 0) )
636 {
637 assert( RetValue == 0 );
638 pNodeNew->pData = Abc_SopCreateAnd( (Mem_Flex_t *)pNtkNew->pManFunc, If_CutLeaveNum(pCutBest), NULL );
639 pNodeNew = (Vec_IntSize(vCover) == 0) ? Abc_NtkCreateNodeConst0(pNtkNew) : Abc_NtkCreateNodeConst1(pNtkNew);
640 }
641 else
642 {
643 // derive the AIG for that tree
644 pNodeNew->pData = Abc_SopCreateFromIsop( (Mem_Flex_t *)pNtkNew->pManFunc, If_CutLeaveNum(pCutBest), vCover );
645 if ( RetValue )
646 Abc_SopComplement( (char *)pNodeNew->pData );
647 }
648 }
649 else if ( pIfMan->pPars->fDelayOpt )
650 pNodeNew->pData = Abc_NodeBuildFromMini( (Hop_Man_t *)pNtkNew->pManFunc, pIfMan, pCutBest, 0 );
651 else if ( pIfMan->pPars->fDsdBalance )
652 pNodeNew->pData = Abc_NodeBuildFromMini( (Hop_Man_t *)pNtkNew->pManFunc, pIfMan, pCutBest, 1 );
653 else if ( pIfMan->pPars->fUserRecLib )
654 {
655 extern Hop_Obj_t * Abc_RecToHop3( Hop_Man_t * pMan, If_Man_t * pIfMan, If_Cut_t * pCut, If_Obj_t * pIfObj );
656 pNodeNew->pData = Abc_RecToHop3( (Hop_Man_t *)pNtkNew->pManFunc, pIfMan, pCutBest, pIfObj );
657 }
658 else if ( pIfMan->pPars->fUserLutDec || pIfMan->pPars->fUserLut2D || pIfMan->pPars->fDeriveLuts )
659 {
660 extern void Abc_DecRecordToHop( Abc_Ntk_t * pNtkNew, If_Man_t * pIfMan, If_Cut_t * pCut, If_Obj_t * pIfObj, Vec_Int_t * vMemory, Abc_Obj_t * pNodeTop );
661 Abc_DecRecordToHop( pNtkNew, pIfMan, pCutBest, pIfObj, vCover, pNodeNew );
662 }
663 else
664 {
665 extern Hop_Obj_t * Kit_TruthToHop( Hop_Man_t * pMan, unsigned * pTruth, int nVars, Vec_Int_t * vMemory );
666 word * pTruth = If_CutTruthW(pIfMan, pCutBest);
667 if ( pIfMan->pPars->fUseTtPerm )
668 for ( i = 0; i < (int)pCutBest->nLeaves; i++ )
669 if ( If_CutLeafBit(pCutBest, i) )
670 Abc_TtFlip( pTruth, Abc_TtWordNum(pCutBest->nLeaves), i );
671 pNodeNew->pData = Kit_TruthToHop( (Hop_Man_t *)pNtkNew->pManFunc, (unsigned *)pTruth, If_CutLeaveNum(pCutBest), vCover );
672// if ( pIfMan->pPars->fUseBat )
673// Bat_ManFuncPrintCell( *pTruth );
674 }
675 // complement the node if the cut was complemented
676 if ( pCutBest->fCompl && !pIfMan->pPars->fDelayOpt && !pIfMan->pPars->fDsdBalance )
677 Abc_NodeComplement( pNodeNew );
678 }
679 else
680 {
681 pNodeNew->pData = Abc_NodeIfToHop( (Hop_Man_t *)pNtkNew->pManFunc, pIfMan, pIfObj );
682 }
683 If_ObjSetCopy( pIfObj, pNodeNew );
684 return pNodeNew;
685}
Abc_Obj_t * Abc_NodeFromIf_rec(Abc_Ntk_t *pNtkNew, If_Man_t *pIfMan, If_Obj_t *pIfObj, Vec_Int_t *vCover)
Definition abcIf.c:565
Hop_Obj_t * Abc_NodeBuildFromMini(Hop_Man_t *pMan, If_Man_t *p, If_Cut_t *pCut, int fUseDsd)
Definition abcIf.c:418
void Abc_DecRecordToHop(Abc_Ntk_t *pNtkNew, If_Man_t *pIfMan, If_Cut_t *pCutBest, If_Obj_t *pIfObj, Vec_Int_t *vCover, Abc_Obj_t *pNodeTop)
Definition abcIf.c:436
Hop_Obj_t * Abc_RecToHop3(Hop_Man_t *pMan, If_Man_t *pIfMan, If_Cut_t *pCut, If_Obj_t *pIfObj)
Definition abcRec3.c:1031
ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeConst1(Abc_Ntk_t *pNtk)
Definition abcObj.c:643
ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeConst0(Abc_Ntk_t *pNtk)
Definition abcObj.c:612
ABC_DLL void Abc_SopComplement(char *pSop)
Definition abcSop.c:648
ABC_DLL void Abc_NodeComplement(Abc_Obj_t *pNode)
Definition abcObj.c:1012
struct Abc_Ntk_t_ Abc_Ntk_t
Definition abc.h:115
ABC_DLL char * Abc_SopCreateAnd(Mem_Flex_t *pMan, int nVars, int *pfCompl)
Definition abcSop.c:168
ABC_DLL Abc_Obj_t * Abc_ExactBuildNode(word *pTruth, int nVars, int *pArrTimeProfile, Abc_Obj_t **pFanins, Abc_Ntk_t *pNtk)
Definition abcExact.c:2894
ABC_DLL char * Abc_SopCreateFromIsop(Mem_Flex_t *pMan, int nVars, Vec_Int_t *vCover)
Definition abcSop.c:424
@ IF_AND
Definition if.h:69
struct If_Cut_t_ If_Cut_t
Definition if.h:80
#define If_CutForEachLeafReverse(p, pCut, pLeaf, i)
Definition if.h:505
void If_CutRotatePins(If_Man_t *p, If_Cut_t *pCut)
Definition ifTruth.c:68
int * If_CutArrTimeProfile(If_Man_t *p, If_Cut_t *pCut)
Definition ifMap.c:143
#define IF_MAX_FUNC_LUTSIZE
Definition if.h:55
struct If_Man_t_ If_Man_t
BASIC TYPES ///.
Definition if.h:77
int Kit_TruthIsop(unsigned *puTruth, int nVars, Vec_Int_t *vMemory, int fTryBoth)
Definition kitIsop.c:134
struct Mem_Flex_t_ Mem_Flex_t
Definition mem.h:34
unsigned fCompl
Definition if.h:311
unsigned Type
Definition if.h:333
int nGateSize
Definition if.h:108
int fDelayOpt
Definition if.h:126
int fUseSops
Definition if.h:163
int fDeriveLuts
Definition if.h:147
int fTruth
Definition if.h:160
int fUseCnfs
Definition if.h:164
int fUserSesLib
Definition if.h:130
int fUseBdds
Definition if.h:162
int fDelayOptLut
Definition if.h:127
int fUseMv
Definition if.h:165
int fDsdBalance
Definition if.h:128
int fUserRecLib
Definition if.h:129
char * pLutStruct
Definition if.h:154
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NodeIfToHop2_rec()

Hop_Obj_t * Abc_NodeIfToHop2_rec ( Hop_Man_t * pHopMan,
If_Man_t * pIfMan,
If_Obj_t * pIfObj,
Vec_Ptr_t * vVisited )

Function*************************************************************

Synopsis [Recursively derives the truth table for the cut.]

Description []

SideEffects []

SeeAlso []

Definition at line 731 of file abcIf.c.

732{
733 If_Cut_t * pCut;
734 If_Obj_t * pTemp;
735 Hop_Obj_t * gFunc, * gFunc0, * gFunc1;
736 // get the best cut
737 pCut = If_ObjCutBest(pIfObj);
738 // if the cut is visited, return the result
739 if ( If_CutData(pCut) )
740 return (Hop_Obj_t *)If_CutData(pCut);
741 // mark the node as visited
742 Vec_PtrPush( vVisited, pCut );
743 // insert the worst case
744 If_CutSetData( pCut, (void *)1 );
745 // skip in case of primary input
746 if ( If_ObjIsCi(pIfObj) )
747 return (Hop_Obj_t *)If_CutData(pCut);
748 // compute the functions of the children
749 for ( pTemp = pIfObj; pTemp; pTemp = pTemp->pEquiv )
750 {
751 gFunc0 = Abc_NodeIfToHop2_rec( pHopMan, pIfMan, pTemp->pFanin0, vVisited );
752 if ( gFunc0 == (void *)1 )
753 continue;
754 gFunc1 = Abc_NodeIfToHop2_rec( pHopMan, pIfMan, pTemp->pFanin1, vVisited );
755 if ( gFunc1 == (void *)1 )
756 continue;
757 // both branches are solved
758 gFunc = Hop_And( pHopMan, Hop_NotCond(gFunc0, pTemp->fCompl0), Hop_NotCond(gFunc1, pTemp->fCompl1) );
759 if ( pTemp->fPhase != pIfObj->fPhase )
760 gFunc = Hop_Not(gFunc);
761 If_CutSetData( pCut, gFunc );
762 break;
763 }
764 return (Hop_Obj_t *)If_CutData(pCut);
765}
Hop_Obj_t * Abc_NodeIfToHop2_rec(Hop_Man_t *pHopMan, If_Man_t *pIfMan, If_Obj_t *pIfObj, Vec_Ptr_t *vVisited)
Definition abcIf.c:731
unsigned fPhase
Definition if.h:336
If_Obj_t * pFanin1
Definition if.h:350
If_Obj_t * pFanin0
Definition if.h:349
unsigned fCompl1
Definition if.h:335
unsigned fCompl0
Definition if.h:334
If_Obj_t * pEquiv
Definition if.h:351
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NodeIfToHop_rec()

Hop_Obj_t * Abc_NodeIfToHop_rec ( Hop_Man_t * pHopMan,
If_Man_t * pIfMan,
If_Obj_t * pIfObj,
Vec_Ptr_t * vVisited )

Function*************************************************************

Synopsis [Recursively derives the truth table for the cut.]

Description []

SideEffects []

SeeAlso []

Definition at line 698 of file abcIf.c.

699{
700 If_Cut_t * pCut;
701 Hop_Obj_t * gFunc, * gFunc0, * gFunc1;
702 // get the best cut
703 pCut = If_ObjCutBest(pIfObj);
704 // if the cut is visited, return the result
705 if ( If_CutData(pCut) )
706 return (Hop_Obj_t *)If_CutData(pCut);
707 // compute the functions of the children
708 gFunc0 = Abc_NodeIfToHop_rec( pHopMan, pIfMan, pIfObj->pFanin0, vVisited );
709 gFunc1 = Abc_NodeIfToHop_rec( pHopMan, pIfMan, pIfObj->pFanin1, vVisited );
710 // get the function of the cut
711 gFunc = Hop_And( pHopMan, Hop_NotCond(gFunc0, pIfObj->fCompl0), Hop_NotCond(gFunc1, pIfObj->fCompl1) );
712 assert( If_CutData(pCut) == NULL );
713 If_CutSetData( pCut, gFunc );
714 // add this cut to the visited list
715 Vec_PtrPush( vVisited, pCut );
716 return gFunc;
717}
Hop_Obj_t * Abc_NodeIfToHop_rec(Hop_Man_t *pHopMan, If_Man_t *pIfMan, If_Obj_t *pIfObj, Vec_Ptr_t *vVisited)
Definition abcIf.c:698
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkBddReorder()

void Abc_NtkBddReorder ( Abc_Ntk_t * pNtk,
int fVerbose )
extern

DECLARATIONS ///.

CFile****************************************************************

FileName [abcReorder.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Network and node package.]

Synopsis [Reordering local BDDs of the nodes.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 20, 2005.]

Revision [

Id
abcReorder.c,v 1.00 2005/06/20 00:00:00 alanmi Exp

] FUNCTION DEFINITIONS ///

Definition at line 107 of file abcReorder.c.

107{}

◆ Abc_NtkBidecResyn()

void Abc_NtkBidecResyn ( Abc_Ntk_t * pNtk,
int fVerbose )
extern

Function*************************************************************

Synopsis [Resynthesizes nodes using bi-decomposition.]

Description []

SideEffects []

SeeAlso []

Definition at line 110 of file abcBidec.c.

111{
112 Bdc_Par_t Pars = {0}, * pPars = &Pars;
113 Bdc_Man_t * p;
114 Abc_Obj_t * pObj;
115 Vec_Int_t * vTruth;
116 int i, nGainTotal = 0, nNodes1, nNodes2;
117 abctime clk = Abc_Clock();
118 assert( Abc_NtkIsLogic(pNtk) );
119 if ( !Abc_NtkToAig(pNtk) )
120 return;
121 pPars->nVarsMax = Abc_NtkGetFaninMax( pNtk );
122 pPars->fVerbose = fVerbose;
123 if ( pPars->nVarsMax > 15 )
124 {
125 if ( fVerbose )
126 printf( "Resynthesis is not performed for nodes with more than 15 inputs.\n" );
127 pPars->nVarsMax = 15;
128 }
129 vTruth = Vec_IntAlloc( 0 );
130 p = Bdc_ManAlloc( pPars );
131 Abc_NtkForEachNode( pNtk, pObj, i )
132 {
133 if ( Abc_ObjFaninNum(pObj) > 15 )
134 continue;
135 nNodes1 = Hop_DagSize((Hop_Obj_t *)pObj->pData);
136 pObj->pData = Abc_NodeIfNodeResyn( p, (Hop_Man_t *)pNtk->pManFunc, (Hop_Obj_t *)pObj->pData, Abc_ObjFaninNum(pObj), vTruth, NULL, -1.0 );
137 nNodes2 = Hop_DagSize((Hop_Obj_t *)pObj->pData);
138 nGainTotal += nNodes1 - nNodes2;
139 }
140 Bdc_ManFree( p );
141 Vec_IntFree( vTruth );
142 if ( fVerbose )
143 {
144 printf( "Total gain in AIG nodes = %d. ", nGainTotal );
145 ABC_PRT( "Total runtime", Abc_Clock() - clk );
146 }
147}
Hop_Obj_t * Abc_NodeIfNodeResyn(Bdc_Man_t *p, Hop_Man_t *pHop, Hop_Obj_t *pRoot, int nVars, Vec_Int_t *vTruth, unsigned *puCare, float dProb)
FUNCTION DEFINITIONS ///.
Definition abcBidec.c:49
ABC_DLL int Abc_NtkGetFaninMax(Abc_Ntk_t *pNtk)
Definition abcUtil.c:486
ABC_DLL int Abc_NtkToAig(Abc_Ntk_t *pNtk)
Definition abcFunc.c:1333
#define Abc_NtkForEachNode(pNtk, pNode, i)
Definition abc.h:464
ABC_INT64_T abctime
Definition abc_global.h:332
#define ABC_PRT(a, t)
Definition abc_global.h:255
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
Bdc_Man_t * Bdc_ManAlloc(Bdc_Par_t *pPars)
MACRO DEFINITIONS ///.
Definition bdcCore.c:68
int Hop_DagSize(Hop_Obj_t *pObj)
Definition hopDfs.c:279
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkFindGoodOrder_rec()

void Abc_NtkFindGoodOrder_rec ( Abc_Obj_t * pNode,
Vec_Ptr_t * vNodes )

Function*************************************************************

Synopsis [Orders AIG nodes so that nodes from larger cones go first.]

Description []

SideEffects []

SeeAlso []

Definition at line 840 of file abcIf.c.

841{
842 if ( !Abc_ObjIsNode(pNode) )
843 return;
844 assert( Abc_ObjIsNode( pNode ) );
845 // if this node is already visited, skip
846 if ( Abc_NodeIsTravIdCurrent( pNode ) )
847 return;
848 // mark the node as visited
849 Abc_NodeSetTravIdCurrent( pNode );
850 // visit the transitive fanin of the node
851 Abc_NtkFindGoodOrder_rec( Abc_ObjFanin0(pNode), vNodes );
852 Abc_NtkFindGoodOrder_rec( Abc_ObjFanin1(pNode), vNodes );
853 // add the node after the fanins have been added
854 Vec_PtrPush( vNodes, pNode );
855}
void Abc_NtkFindGoodOrder_rec(Abc_Obj_t *pNode, Vec_Ptr_t *vNodes)
Definition abcIf.c:840
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkIf()

Abc_Ntk_t * Abc_NtkIf ( Abc_Ntk_t * pNtk,
If_Par_t * pPars )

Function*************************************************************

Synopsis [Interface with the FPGA mapping package.]

Description []

SideEffects []

SeeAlso []

Definition at line 107 of file abcIf.c.

108{
109 Abc_Ntk_t * pNtkNew, * pTemp;
110 If_Man_t * pIfMan;
111
112 assert( Abc_NtkIsStrash(pNtk) );
113
114 // get timing information
117
118 // update timing info to reflect logic level
119 if ( (pPars->fDelayOpt || pPars->fDsdBalance || pPars->fUserRecLib || pPars->fUserSesLib || pPars->fUserLutDec || pPars->fUserLut2D ) && pNtk->pManTime )
120 {
121 int c;
122 if ( pNtk->AndGateDelay == 0.0 )
123 {
124 if ( Abc_FrameReadLibGen() )
126 if ( pNtk->AndGateDelay == 0.0 )
127 {
128 pNtk->AndGateDelay = 1.0;
129 printf( "The AIG-node delay is not set. Assuming unit-delay.\n" );
130 }
131 }
132 for ( c = 0; c < Abc_NtkCiNum(pNtk); c++ )
133 pPars->pTimesArr[c] /= pNtk->AndGateDelay;
134 for ( c = 0; c < Abc_NtkCoNum(pNtk); c++ )
135 pPars->pTimesReq[c] /= pNtk->AndGateDelay;
136 }
137
138 // set the latch paths
139 if ( pPars->fLatchPaths && pPars->pTimesArr )
140 {
141 int c;
142 for ( c = 0; c < Abc_NtkPiNum(pNtk); c++ )
143 pPars->pTimesArr[c] = -ABC_INFINITY;
144 }
145
146 // create FPGA mapper
147 pIfMan = Abc_NtkToIf( pNtk, pPars );
148 if ( pIfMan == NULL )
149 return NULL;
150 if ( pPars->fPower )
151 If_ManComputeSwitching( pIfMan );
152
153 // create DSD manager
154 if ( pPars->fUseDsd )
155 {
157 assert( pPars->nLutSize <= If_DsdManVarNum(p) );
158 assert( (pPars->pLutStruct == NULL && If_DsdManLutSize(p) == 0) || (pPars->pLutStruct && pPars->pLutStruct[0] - '0' == If_DsdManLutSize(p)) );
160 if ( pPars->fDsdBalance )
161 If_DsdManAllocIsops( pIfMan->pIfDsdMan, pPars->nLutSize );
162 }
163
164 // perform FPGA mapping
165 if ( !If_ManPerformMapping( pIfMan ) )
166 {
167 If_ManStop( pIfMan );
168 return NULL;
169 }
170
171 // transform the result of mapping into the new network
172 pNtkNew = Abc_NtkFromIf( pIfMan, pNtk );
173 if ( pNtkNew == NULL )
174 return NULL;
175 If_ManStop( pIfMan );
176 if ( pPars->fDelayOpt || pPars->fDsdBalance || pPars->fUserRecLib )
177 {
178 pNtkNew = Abc_NtkStrash( pTemp = pNtkNew, 0, 0, 0 );
179 Abc_NtkDelete( pTemp );
180 }
181 else if ( pPars->fBidec && pPars->nLutSize <= 8 )
182 Abc_NtkBidecResyn( pNtkNew, 0 );
183
184 // duplicate EXDC
185 if ( pNtk->pExdc )
186 pNtkNew->pExdc = Abc_NtkDup( pNtk->pExdc );
187 // make sure that everything is okay
188 if ( !Abc_NtkCheck( pNtkNew ) )
189 {
190 printf( "Abc_NtkIf: The network check has failed.\n" );
191 Abc_NtkDelete( pNtkNew );
192 return NULL;
193 }
194 return pNtkNew;
195}
ABC_NAMESPACE_IMPL_START If_Man_t * Abc_NtkToIf(Abc_Ntk_t *pNtk, If_Par_t *pPars)
DECLARATIONS ///.
Definition abcIf.c:209
void If_ManComputeSwitching(If_Man_t *pIfMan)
FUNCTION DEFINITIONS ///.
Definition abcIf.c:59
void Abc_NtkBidecResyn(Abc_Ntk_t *pNtk, int fVerbose)
Definition abcBidec.c:110
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition abcCheck.c:64
ABC_DLL float * Abc_NtkGetCoRequiredFloats(Abc_Ntk_t *pNtk)
Definition abcTiming.c:802
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition abcStrash.c:265
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition abcNtk.c:1421
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
Definition abcNtk.c:472
ABC_DLL float * Abc_NtkGetCiArrivalFloats(Abc_Ntk_t *pNtk)
Definition abcTiming.c:789
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition abc_global.h:250
ABC_DLL void * Abc_FrameReadLibGen()
Definition mainFrame.c:59
ABC_DLL void * Abc_FrameReadManDsd()
Definition mainFrame.c:67
int If_DsdManLutSize(If_DsdMan_t *p)
Definition ifDsd.c:181
int If_DsdManVarNum(If_DsdMan_t *p)
Definition ifDsd.c:173
void If_DsdManAllocIsops(If_DsdMan_t *p, int nLutSize)
Definition ifDsd.c:306
struct If_DsdMan_t_ If_DsdMan_t
Definition if.h:84
void If_ManStop(If_Man_t *p)
Definition ifMan.c:212
int If_ManPerformMapping(If_Man_t *p)
Definition ifCore.c:82
struct Mio_LibraryStruct_t_ Mio_Library_t
Definition mio.h:42
float Mio_LibraryReadDelayAigNode(Mio_Library_t *pLib)
Definition mioApi.c:64
float AndGateDelay
Definition abc.h:194
Abc_Ntk_t * pExdc
Definition abc.h:201
Abc_ManTime_t * pManTime
Definition abc.h:192
If_DsdMan_t * pIfDsdMan
Definition if.h:260
float * pTimesArr
Definition if.h:176
int fUseDsd
Definition if.h:140
int fLatchPaths
Definition if.h:121
int fPower
Definition if.h:124
int nLutSize
Definition if.h:104
int fBidec
Definition if.h:131
float * pTimesReq
Definition if.h:177
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_NtkMarkMux()

void Abc_NtkMarkMux ( Abc_Obj_t * pDriver,
Abc_Obj_t ** ppNode1,
Abc_Obj_t ** ppNode2 )

Function*************************************************************

Synopsis [Sets PO drivers.]

Description []

SideEffects []

SeeAlso []

Definition at line 926 of file abcIf.c.

927{
928 Abc_Obj_t * pNodeC, * pNodeT, * pNodeE;
929 If_Obj_t * pIfObj;
930
931 *ppNode1 = NULL;
932 *ppNode2 = NULL;
933 if ( pDriver == NULL )
934 return;
935 if ( !Abc_NodeIsMuxType(pDriver) )
936 return;
937
938 pNodeC = Abc_NodeRecognizeMux( pDriver, &pNodeT, &pNodeE );
939
940 pIfObj = If_Regular( (If_Obj_t *)Abc_ObjFanin0(pDriver)->pCopy );
941 if ( If_ObjIsAnd(pIfObj) )
942 pIfObj->fSkipCut = 1;
943 pIfObj = If_Regular( (If_Obj_t *)Abc_ObjFanin1(pDriver)->pCopy );
944 if ( If_ObjIsAnd(pIfObj) )
945 pIfObj->fSkipCut = 1;
946
947 pIfObj = If_Regular( (If_Obj_t *)Abc_ObjRegular(pNodeC)->pCopy );
948 if ( If_ObjIsAnd(pIfObj) )
949 pIfObj->fSkipCut = 1;
950
951/*
952 pIfObj = If_Regular( (If_Obj_t *)Abc_ObjRegular(pNodeT)->pCopy );
953 if ( If_ObjIsAnd(pIfObj) )
954 pIfObj->fSkipCut = 1;
955 pIfObj = If_Regular( (If_Obj_t *)Abc_ObjRegular(pNodeE)->pCopy );
956 if ( If_ObjIsAnd(pIfObj) )
957 pIfObj->fSkipCut = 1;
958*/
959 *ppNode1 = Abc_ObjRegular(pNodeC);
960 *ppNode2 = Abc_ObjRegular(pNodeT);
961}
ABC_DLL int Abc_NodeIsMuxType(Abc_Obj_t *pNode)
Definition abcUtil.c:1342
ABC_DLL Abc_Obj_t * Abc_NodeRecognizeMux(Abc_Obj_t *pNode, Abc_Obj_t **ppNodeT, Abc_Obj_t **ppNodeE)
Definition abcUtil.c:1430
unsigned fSkipCut
Definition if.h:342
Here is the call graph for this function:

◆ Abc_NtkToIf()

If_Man_t * Abc_NtkToIf ( Abc_Ntk_t * pNtk,
If_Par_t * pPars )
extern

DECLARATIONS ///.

CFile****************************************************************

FileName [abcIf.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Network and node package.]

Synopsis [Interface with the FPGA mapping package.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - November 21, 2006.]

Revision [

Id
abcIf.c,v 1.00 2006/11/21 00:00:00 alanmi Exp

]

Definition at line 209 of file abcIf.c.

210{
211 ProgressBar * pProgress;
212 If_Man_t * pIfMan;
213 Vec_Ptr_t * vNodes;
214 Abc_Obj_t * pNode, * pPrev;
215 int i;
216
217 assert( Abc_NtkIsStrash(pNtk) );
218
219 // start the mapping manager and set its parameters
220 pIfMan = If_ManStart( pPars );
221 pIfMan->pName = Abc_UtilStrsav( Abc_NtkName(pNtk) );
222
223 // print warning about excessive memory usage
224 if ( 1.0 * Abc_NtkObjNum(pNtk) * pIfMan->nObjBytes / (1<<30) > 1.0 )
225 printf( "Warning: The mapper will allocate %.1f GB for to represent the subject graph with %d AIG nodes.\n",
226 1.0 * Abc_NtkObjNum(pNtk) * pIfMan->nObjBytes / (1<<30), Abc_NtkObjNum(pNtk) );
227
228 // create PIs and remember them in the old nodes
229 Abc_NtkCleanCopy( pNtk );
230 Abc_AigConst1(pNtk)->pCopy = (Abc_Obj_t *)If_ManConst1( pIfMan );
231 Abc_NtkForEachCi( pNtk, pNode, i )
232 {
233 If_Obj_t * pIfObj = If_ManCreateCi( pIfMan );
234 pNode->pCopy = (Abc_Obj_t *)pIfObj;
235 // transfer logic level information
236 Abc_ObjIfCopy(pNode)->Level = pNode->Level;
237 // mark the largest level
238 if ( pIfMan->nLevelMax < (int)pIfObj->Level )
239 pIfMan->nLevelMax = (int)pIfObj->Level;
240 }
241
242 // load the AIG into the mapper
243 pProgress = Extra_ProgressBarStart( stdout, Abc_NtkObjNumMax(pNtk) );
244 vNodes = Abc_AigDfs( pNtk, 0, 0 );
245 Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
246 {
247 Extra_ProgressBarUpdate( pProgress, i, "Initial" );
248 // add the node to the mapper
249 pNode->pCopy = (Abc_Obj_t *)If_ManCreateAnd( pIfMan,
250 If_NotCond( Abc_ObjIfCopy(Abc_ObjFanin0(pNode)), Abc_ObjFaninC0(pNode) ),
251 If_NotCond( Abc_ObjIfCopy(Abc_ObjFanin1(pNode)), Abc_ObjFaninC1(pNode) ) );
252 // set up the choice node
253 if ( Abc_AigNodeIsChoice( pNode ) )
254 {
255 Abc_Obj_t * pEquiv;
256// int Counter = 0;
257 assert( If_ObjId(Abc_ObjIfCopy(pNode)) > If_ObjId(Abc_ObjIfCopy(Abc_ObjEquiv(pNode))) );
258 for ( pPrev = pNode, pEquiv = Abc_ObjEquiv(pPrev); pEquiv; pPrev = pEquiv, pEquiv = Abc_ObjEquiv(pPrev) )
259 If_ObjSetChoice( Abc_ObjIfCopy(pPrev), Abc_ObjIfCopy(pEquiv) );//, Counter++;
260// printf( "%d ", Counter );
261 If_ManCreateChoice( pIfMan, Abc_ObjIfCopy(pNode) );
262 }
263 }
264 Extra_ProgressBarStop( pProgress );
265 Vec_PtrFree( vNodes );
266
267 // set the primary outputs without copying the phase
268 Abc_NtkForEachCo( pNtk, pNode, i )
269 pNode->pCopy = (Abc_Obj_t *)If_ManCreateCo( pIfMan, If_NotCond( Abc_ObjIfCopy(Abc_ObjFanin0(pNode)), Abc_ObjFaninC0(pNode) ) );
270 return pIfMan;
271}
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition abc.h:522
ABC_DLL Vec_Ptr_t * Abc_AigDfs(Abc_Ntk_t *pNtk, int fCollectAll, int fCollectCos)
Definition abcDfs.c:1198
#define Abc_NtkForEachCi(pNtk, pCi, i)
Definition abc.h:518
ABC_DLL void Abc_NtkCleanCopy(Abc_Ntk_t *pNtk)
Definition abcUtil.c:540
ABC_DLL Abc_Obj_t * Abc_AigConst1(Abc_Ntk_t *pNtk)
Definition abcAig.c:683
ABC_NAMESPACE_IMPL_START typedef char ProgressBar
Definition bbrNtbdd.c:27
void Extra_ProgressBarStop(ProgressBar *p)
ProgressBar * Extra_ProgressBarStart(FILE *pFile, int nItemsTotal)
FUNCTION DEFINITIONS ///.
void If_ManCreateChoice(If_Man_t *p, If_Obj_t *pRepr)
Definition ifMan.c:460
If_Obj_t * If_ManCreateCo(If_Man_t *p, If_Obj_t *pDriver)
Definition ifMan.c:356
If_Obj_t * If_ManCreateAnd(If_Man_t *p, If_Obj_t *pFan0, If_Obj_t *pFan1)
Definition ifMan.c:384
If_Man_t * If_ManStart(If_Par_t *pPars)
FUNCTION DEFINITIONS ///.
Definition ifMan.c:50
If_Obj_t * If_ManCreateCi(If_Man_t *p)
Definition ifMan.c:334
Abc_Obj_t * pCopy
Definition abc.h:148
int nLevelMax
Definition if.h:211
char * pName
Definition if.h:199
int nObjBytes
Definition if.h:245
unsigned Level
Definition if.h:343
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition vecPtr.h:55
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Abc_ObjCompareFlow()

int Abc_ObjCompareFlow ( Abc_Obj_t ** ppNode0,
Abc_Obj_t ** ppNode1 )

Function*************************************************************

Synopsis [Comparison for two nodes with the flow.]

Description []

SideEffects []

SeeAlso []

Definition at line 818 of file abcIf.c.

819{
820 float Flow0 = Abc_Int2Float((int)(ABC_PTRINT_T)(*ppNode0)->pCopy);
821 float Flow1 = Abc_Int2Float((int)(ABC_PTRINT_T)(*ppNode1)->pCopy);
822 if ( Flow0 > Flow1 )
823 return -1;
824 if ( Flow0 < Flow1 )
825 return 1;
826 return 0;
827}

◆ If_ManComputeSwitching()

void If_ManComputeSwitching ( If_Man_t * pIfMan)

FUNCTION DEFINITIONS ///.

Function*************************************************************

Synopsis [Interface with the FPGA mapping package.]

Description []

SideEffects []

SeeAlso []

Definition at line 59 of file abcIf.c.

60{
61 abctime clk = Abc_Clock();
62 Gia_Man_t * pNew;
63 Vec_Int_t * vCopy;
64 If_Obj_t * pIfObj;
65 int i;
66 assert( pIfMan->vSwitching == NULL );
67 // create the new manager
68 pNew = Gia_ManStart( If_ManObjNum(pIfMan) );
69 vCopy = Vec_IntAlloc( If_ManObjNum(pIfMan) );
70 // constant and inputs
71 Vec_IntPush( vCopy, 1 );
72 If_ManForEachCi( pIfMan, pIfObj, i )
73 Vec_IntPush( vCopy, Gia_ManAppendCi(pNew) );
74 // internal nodes
75 If_ManForEachNode( pIfMan, pIfObj, i )
76 {
77 int iLit0 = Abc_LitNotCond( Vec_IntEntry(vCopy, If_ObjFanin0(pIfObj)->Id), If_ObjFaninC0(pIfObj) );
78 int iLit1 = Abc_LitNotCond( Vec_IntEntry(vCopy, If_ObjFanin1(pIfObj)->Id), If_ObjFaninC1(pIfObj) );
79 Vec_IntPush( vCopy, Gia_ManAppendAnd(pNew, iLit0, iLit1) );
80 }
81 // outputs
82 If_ManForEachCo( pIfMan, pIfObj, i )
83 {
84 int iLit0 = Abc_LitNotCond( Vec_IntEntry(vCopy, If_ObjFanin0(pIfObj)->Id), If_ObjFaninC0(pIfObj) );
85 Vec_IntPush( vCopy, Gia_ManAppendCo(pNew, iLit0) );
86 }
87 assert( Vec_IntSize(vCopy) == If_ManObjNum(pIfMan) );
88 Vec_IntFree( vCopy );
89 // compute switching activity
90 pIfMan->vSwitching = Gia_ManComputeSwitchProbs( pNew, 48, 16, 0 );
91 Gia_ManStop( pNew );
92 if ( pIfMan->pPars->fVerbose )
93 Abc_PrintTime( 1, "Computing switching activity", Abc_Clock() - clk );
94}
void Gia_ManStop(Gia_Man_t *p)
Definition giaMan.c:82
Gia_Man_t * Gia_ManStart(int nObjsMax)
FUNCTION DEFINITIONS ///.
Definition giaMan.c:57
struct Gia_Man_t_ Gia_Man_t
Definition gia.h:96
Vec_Int_t * Gia_ManComputeSwitchProbs(Gia_Man_t *pGia, int nFrames, int nPref, int fProbOne)
Definition giaSwitch.c:658
#define If_ManForEachCo(p, pObj, i)
Definition if.h:477
#define If_ManForEachCi(p, pObj, i)
Definition if.h:474
#define If_ManForEachNode(p, pObj, i)
Definition if.h:497
Vec_Int_t * vSwitching
Definition if.h:225
int fVerbose
Definition if.h:152
Here is the call graph for this function:
Here is the caller graph for this function: