abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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"

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 ///. More...
 
static Abc_Ntk_tAbc_NtkFromIf (If_Man_t *pIfMan, Abc_Ntk_t *pNtk)
 
Abc_Obj_tAbc_NodeFromIf_rec (Abc_Ntk_t *pNtkNew, If_Man_t *pIfMan, If_Obj_t *pIfObj, Vec_Int_t *vCover)
 
static Hop_Obj_tAbc_NodeIfToHop (Hop_Man_t *pHopMan, If_Man_t *pIfMan, If_Obj_t *pIfObj)
 
static Vec_Ptr_tAbc_NtkFindGoodOrder (Abc_Ntk_t *pNtk)
 
void Abc_NtkBddReorder (Abc_Ntk_t *pNtk, int fVerbose)
 
void Abc_NtkBidecResyn (Abc_Ntk_t *pNtk, int fVerbose)
 
void If_ManComputeSwitching (If_Man_t *pIfMan)
 FUNCTION DEFINITIONS ///. More...
 
Abc_Ntk_tAbc_NtkIf (Abc_Ntk_t *pNtk, If_Par_t *pPars)
 
static If_Obj_tAbc_ObjIfCopy (Abc_Obj_t *pNode)
 
static void Abc_MapBoxSetPrevNext (Vec_Ptr_t *vDrivers, Vec_Int_t *vMapIn, Vec_Int_t *vMapOut, int Id)
 
static int Abc_MapBox2Next (Vec_Ptr_t *vDrivers, Vec_Int_t *vMapIn, Vec_Int_t *vMapOut, int Id)
 
static int Abc_MapBox2Prev (Vec_Ptr_t *vDrivers, Vec_Int_t *vMapIn, Vec_Int_t *vMapOut, int Id)
 
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)
 
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

static int Abc_MapBox2Next ( Vec_Ptr_t vDrivers,
Vec_Int_t vMapIn,
Vec_Int_t vMapOut,
int  Id 
)
inlinestatic

Definition at line 268 of file abcIf.c.

269 {
270  Abc_Obj_t * pNode = (Abc_Obj_t *)Vec_PtrEntry(vDrivers, Id+4);
271  return Vec_IntEntry( vMapIn, Abc_ObjId(Abc_ObjFanin0(pNode)) );
272 }
static unsigned Abc_ObjId(Abc_Obj_t *pObj)
Definition: abc.h:329
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
Definition: abc.h:373
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
static int Abc_MapBox2Prev ( Vec_Ptr_t vDrivers,
Vec_Int_t vMapIn,
Vec_Int_t vMapOut,
int  Id 
)
inlinestatic

Definition at line 273 of file abcIf.c.

274 {
275  Abc_Obj_t * pNode = (Abc_Obj_t *)Vec_PtrEntry(vDrivers, Id+2);
276  return Vec_IntEntry( vMapOut, Abc_ObjId(Abc_ObjFanin0(pNode)) );
277 }
static unsigned Abc_ObjId(Abc_Obj_t *pObj)
Definition: abc.h:329
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
Definition: abc.h:373
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
static void Abc_MapBoxSetPrevNext ( Vec_Ptr_t vDrivers,
Vec_Int_t vMapIn,
Vec_Int_t vMapOut,
int  Id 
)
inlinestatic

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

Synopsis [Box mapping procedures.]

Description []

SideEffects []

SeeAlso []

Definition at line 260 of file abcIf.c.

261 {
262  Abc_Obj_t * pNode;
263  pNode = (Abc_Obj_t *)Vec_PtrEntry(vDrivers, Id+2);
264  Vec_IntWriteEntry( vMapIn, Abc_ObjId(Abc_ObjFanin0(pNode)), Id );
265  pNode = (Abc_Obj_t *)Vec_PtrEntry(vDrivers, Id+4);
266  Vec_IntWriteEntry( vMapOut, Abc_ObjId(Abc_ObjFanin0(pNode)), Id );
267 }
static unsigned Abc_ObjId(Abc_Obj_t *pObj)
Definition: abc.h:329
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
Definition: abc.h:373
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
Definition: bblif.c:285
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
Hop_Obj_t* Abc_NodeBuildFromMini ( Hop_Man_t pMan,
If_Man_t p,
If_Cut_t pCut,
int  fUseDsd 
)

Definition at line 393 of file abcIf.c.

394 {
395  int Delay;
396  if ( fUseDsd )
397  Delay = If_CutDsdBalanceEval( p, pCut, p->vArray );
398  else
399  Delay = If_CutSopBalanceEval( p, pCut, p->vArray );
400  assert( Delay >= 0 );
401  return Abc_NodeBuildFromMiniInt( pMan, p->vArray, If_CutLeaveNum(pCut) );
402 }
static int If_CutLeaveNum(If_Cut_t *pCut)
Definition: if.h:390
Hop_Obj_t * Abc_NodeBuildFromMiniInt(Hop_Man_t *pMan, Vec_Int_t *vAig, int nLeaves)
Definition: abcIf.c:357
Vec_Int_t * vArray
Definition: if.h:215
int If_CutSopBalanceEval(If_Man_t *p, If_Cut_t *pCut, Vec_Int_t *vAig)
Definition: ifDelay.c:248
#define assert(ex)
Definition: util_old.h:213
int If_CutDsdBalanceEval(If_Man_t *p, If_Cut_t *pCut, Vec_Int_t *vAig)
Definition: ifDsd.c:2288
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 357 of file abcIf.c.

358 {
359  assert( Vec_IntSize(vAig) > 0 );
360  assert( Vec_IntEntryLast(vAig) < 2 );
361  if ( Vec_IntSize(vAig) == 1 ) // const
362  {
363  assert( nLeaves == 0 );
364  return Hop_NotCond( Hop_ManConst0(pMan), Vec_IntEntry(vAig, 0) );
365  }
366  if ( Vec_IntSize(vAig) == 2 ) // variable
367  {
368  assert( Vec_IntEntry(vAig, 0) == 0 );
369  assert( nLeaves == 1 );
370  return Hop_NotCond( Hop_IthVar(pMan, 0), Vec_IntEntry(vAig, 1) );
371  }
372  else
373  {
374  int i, iVar0, iVar1, iLit0, iLit1;
375  Hop_Obj_t * piLit0, * piLit1, * piLit = NULL;
376  assert( Vec_IntSize(vAig) & 1 );
377  Vec_IntForEachEntryDouble( vAig, iLit0, iLit1, i )
378  {
379  iVar0 = Abc_Lit2Var( iLit0 );
380  iVar1 = Abc_Lit2Var( iLit1 );
381  piLit0 = Hop_NotCond( iVar0 < nLeaves ? Hop_IthVar(pMan, iVar0) : (Hop_Obj_t *)Vec_PtrEntry((Vec_Ptr_t *)vAig, iVar0 - nLeaves), Abc_LitIsCompl(iLit0) );
382  piLit1 = Hop_NotCond( iVar1 < nLeaves ? Hop_IthVar(pMan, iVar1) : (Hop_Obj_t *)Vec_PtrEntry((Vec_Ptr_t *)vAig, iVar1 - nLeaves), Abc_LitIsCompl(iLit1) );
383  piLit = Hop_And( pMan, piLit0, piLit1 );
384  assert( (i & 1) == 0 );
385  Vec_PtrWriteEntry( (Vec_Ptr_t *)vAig, Abc_Lit2Var(i), piLit ); // overwriting entries
386  }
387  assert( i == Vec_IntSize(vAig) - 1 );
388  piLit = Hop_NotCond( piLit, Vec_IntEntry(vAig, i) );
389  Vec_IntClear( vAig ); // useless
390  return piLit;
391  }
392 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
Hop_Obj_t * Hop_And(Hop_Man_t *p, Hop_Obj_t *p0, Hop_Obj_t *p1)
Definition: hopOper.c:104
Definition: hop.h:65
static int Abc_LitIsCompl(int Lit)
Definition: abc_global.h:265
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
#define Vec_IntForEachEntryDouble(vVec, Entry1, Entry2, i)
Definition: vecInt.h:66
static void Vec_PtrWriteEntry(Vec_Ptr_t *p, int i, void *Entry)
Definition: vecPtr.h:396
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
static int Vec_IntEntryLast(Vec_Int_t *p)
Definition: bblif.c:319
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
static Hop_Obj_t * Hop_NotCond(Hop_Obj_t *p, int c)
Definition: hop.h:128
static int Abc_Lit2Var(int Lit)
Definition: abc_global.h:264
#define assert(ex)
Definition: util_old.h:213
static Hop_Obj_t * Hop_ManConst0(Hop_Man_t *p)
Definition: hop.h:131
static void Vec_IntClear(Vec_Int_t *p)
Definition: bblif.c:452
Hop_Obj_t * Hop_IthVar(Hop_Man_t *p, int i)
FUNCTION DEFINITIONS ///.
Definition: hopOper.c:63
Abc_Obj_t * Abc_NodeFromIf_rec ( Abc_Ntk_t pNtkNew,
If_Man_t pIfMan,
If_Obj_t pIfObj,
Vec_Int_t vCover 
)

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

Synopsis [Derive one node after FPGA mapping.]

Description []

SideEffects []

SeeAlso []

Definition at line 415 of file abcIf.c.

416 {
417  Abc_Obj_t * pNodeNew;
418  If_Cut_t * pCutBest;
419  If_Obj_t * pIfLeaf;
420  int i;
421  // return if the result if known
422  pNodeNew = (Abc_Obj_t *)If_ObjCopy( pIfObj );
423  if ( pNodeNew )
424  return pNodeNew;
425  assert( pIfObj->Type == IF_AND );
426  // get the parameters of the best cut
427  // create a new node
428  pNodeNew = Abc_NtkCreateNode( pNtkNew );
429  pCutBest = If_ObjCutBest( pIfObj );
430 // printf( "%d 0x%02X %d\n", pCutBest->nLeaves, 0xff & *If_CutTruth(pCutBest), pIfMan->pPars->pFuncCost(pCutBest) );
431 // if ( pIfMan->pPars->pLutLib && pIfMan->pPars->pLutLib->fVarPinDelays )
432  if ( !pIfMan->pPars->fDelayOpt && !pIfMan->pPars->fDelayOptLut && !pIfMan->pPars->fDsdBalance && !pIfMan->pPars->fUseTtPerm && !pIfMan->pPars->pLutStruct && !pIfMan->pPars->fUserRecLib && !pIfMan->pPars->nGateSize )
433  If_CutRotatePins( pIfMan, pCutBest );
434  if ( pIfMan->pPars->fUseCnfs || pIfMan->pPars->fUseMv )
435  {
436  If_CutForEachLeafReverse( pIfMan, pCutBest, pIfLeaf, i )
437  Abc_ObjAddFanin( pNodeNew, Abc_NodeFromIf_rec(pNtkNew, pIfMan, pIfLeaf, vCover) );
438  }
439  else
440  {
441  If_CutForEachLeaf( pIfMan, pCutBest, pIfLeaf, i )
442  Abc_ObjAddFanin( pNodeNew, Abc_NodeFromIf_rec(pNtkNew, pIfMan, pIfLeaf, vCover) );
443  }
444  // set the level of the new node
445  pNodeNew->Level = Abc_ObjLevelNew( pNodeNew );
446  // derive the function of this node
447  if ( pIfMan->pPars->fTruth )
448  {
449  if ( pIfMan->pPars->fUseBdds )
450  {
451  // transform truth table into the BDD
452  pNodeNew->pData = Kit_TruthToBdd( (DdManager *)pNtkNew->pManFunc, If_CutTruth(pIfMan, pCutBest), If_CutLeaveNum(pCutBest), 0 ); Cudd_Ref((DdNode *)pNodeNew->pData);
453  }
454  else if ( pIfMan->pPars->fUseCnfs || pIfMan->pPars->fUseMv )
455  {
456  // transform truth table into the BDD
457  pNodeNew->pData = Kit_TruthToBdd( (DdManager *)pNtkNew->pManFunc, If_CutTruth(pIfMan, pCutBest), If_CutLeaveNum(pCutBest), 1 ); Cudd_Ref((DdNode *)pNodeNew->pData);
458  }
459  else if ( pIfMan->pPars->fUseSops || pIfMan->pPars->nGateSize > 0 )
460  {
461  // transform truth table into the SOP
462  int RetValue = Kit_TruthIsop( If_CutTruth(pIfMan, pCutBest), If_CutLeaveNum(pCutBest), vCover, 1 );
463  assert( RetValue == 0 || RetValue == 1 );
464  // check the case of constant cover
465  if ( Vec_IntSize(vCover) == 0 || (Vec_IntSize(vCover) == 1 && Vec_IntEntry(vCover,0) == 0) )
466  {
467  assert( RetValue == 0 );
468  pNodeNew->pData = Abc_SopCreateAnd( (Mem_Flex_t *)pNtkNew->pManFunc, If_CutLeaveNum(pCutBest), NULL );
469  pNodeNew = (Vec_IntSize(vCover) == 0) ? Abc_NtkCreateNodeConst0(pNtkNew) : Abc_NtkCreateNodeConst1(pNtkNew);
470  }
471  else
472  {
473  // derive the AIG for that tree
474  pNodeNew->pData = Abc_SopCreateFromIsop( (Mem_Flex_t *)pNtkNew->pManFunc, If_CutLeaveNum(pCutBest), vCover );
475  if ( RetValue )
476  Abc_SopComplement( (char *)pNodeNew->pData );
477  }
478  }
479  else if ( pIfMan->pPars->fDelayOpt )
480  pNodeNew->pData = Abc_NodeBuildFromMini( (Hop_Man_t *)pNtkNew->pManFunc, pIfMan, pCutBest, 0 );
481  else if ( pIfMan->pPars->fDsdBalance )
482  pNodeNew->pData = Abc_NodeBuildFromMini( (Hop_Man_t *)pNtkNew->pManFunc, pIfMan, pCutBest, 1 );
483  else if ( pIfMan->pPars->fUserRecLib )
484  {
485  extern Hop_Obj_t * Abc_RecToHop3( Hop_Man_t * pMan, If_Man_t * pIfMan, If_Cut_t * pCut, If_Obj_t * pIfObj );
486  pNodeNew->pData = Abc_RecToHop3( (Hop_Man_t *)pNtkNew->pManFunc, pIfMan, pCutBest, pIfObj );
487  }
488  else
489  {
490  extern Hop_Obj_t * Kit_TruthToHop( Hop_Man_t * pMan, unsigned * pTruth, int nVars, Vec_Int_t * vMemory );
491  word * pTruth = If_CutTruthW(pIfMan, pCutBest);
492  if ( pIfMan->pPars->fUseTtPerm )
493  for ( i = 0; i < (int)pCutBest->nLeaves; i++ )
494  if ( If_CutLeafBit(pCutBest, i) )
495  Abc_TtFlip( pTruth, Abc_TtWordNum(pCutBest->nLeaves), i );
496  pNodeNew->pData = Kit_TruthToHop( (Hop_Man_t *)pNtkNew->pManFunc, (unsigned *)pTruth, If_CutLeaveNum(pCutBest), vCover );
497 // if ( pIfMan->pPars->fUseBat )
498 // Bat_ManFuncPrintCell( *pTruth );
499  }
500  // complement the node if the cut was complemented
501  if ( pCutBest->fCompl && !pIfMan->pPars->fDelayOpt && !pIfMan->pPars->fDsdBalance )
502  Abc_NodeComplement( pNodeNew );
503  }
504  else
505  {
506  pNodeNew->pData = Abc_NodeIfToHop( (Hop_Man_t *)pNtkNew->pManFunc, pIfMan, pIfObj );
507  }
508  If_ObjSetCopy( pIfObj, pNodeNew );
509  return pNodeNew;
510 }
void If_CutRotatePins(If_Man_t *p, If_Cut_t *pCut)
Definition: ifTruth.c:67
unsigned nLeaves
Definition: if.h:289
int fUseMv
Definition: if.h:151
unsigned Type
Definition: if.h:305
Definition: cudd.h:278
int fUseCnfs
Definition: if.h:150
static void * If_ObjCopy(If_Obj_t *pObj)
Definition: if.h:384
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
Definition: if.h:303
Definition: if.h:275
#define If_CutForEachLeaf(p, pCut, pLeaf, i)
Definition: if.h:474
static int If_CutLeaveNum(If_Cut_t *pCut)
Definition: if.h:390
int fDelayOptLut
Definition: if.h:122
#define If_CutForEachLeafReverse(p, pCut, pLeaf, i)
Definition: if.h:476
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 char * Abc_SopCreateAnd(Mem_Flex_t *pMan, int nVars, int *pfCompl)
Definition: abcSop.c:162
DdNode * Kit_TruthToBdd(DdManager *dd, unsigned *pTruth, int nVars, int fMSBonTop)
Definition: kitBdd.c:182
ABC_DLL char * Abc_SopCreateFromIsop(Mem_Flex_t *pMan, int nVars, Vec_Int_t *vCover)
Definition: abcSop.c:416
char * pLutStruct
Definition: if.h:141
ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeConst1(Abc_Ntk_t *pNtk)
Definition: abcObj.c:633
static If_Cut_t * If_ObjCutBest(If_Obj_t *pObj)
Definition: if.h:401
Definition: hop.h:65
Hop_Obj_t * Kit_TruthToHop(Hop_Man_t *pMan, unsigned *pTruth, int nVars, Vec_Int_t *vMemory)
Definition: kitHop.c:146
Definition: if.h:68
ABC_DLL void Abc_ObjAddFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
Definition: abcFanio.c:84
int nGateSize
Definition: if.h:107
static word * If_CutTruthW(If_Man_t *p, If_Cut_t *pCut)
Definition: if.h:421
static Hop_Obj_t * Abc_NodeIfToHop(Hop_Man_t *pHopMan, If_Man_t *pIfMan, If_Obj_t *pIfObj)
Definition: abcIf.c:603
int fDsdBalance
Definition: if.h:123
int Kit_TruthIsop(unsigned *puTruth, int nVars, Vec_Int_t *vMemory, int fTryBoth)
FUNCTION DEFINITIONS ///.
Definition: kitIsop.c:55
Definition: if.h:180
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
unsigned __int64 word
DECLARATIONS ///.
Definition: kitPerm.c:36
static void If_ObjSetCopy(If_Obj_t *pObj, void *pCopy)
Definition: if.h:387
if(last==0)
Definition: sparse_int.h:34
else
Definition: sparse_int.h:55
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:415
static unsigned * If_CutTruth(If_Man_t *p, If_Cut_t *pCut)
Definition: if.h:422
static void Abc_TtFlip(word *pTruth, int nWords, int iVar)
Definition: utilTruth.h:1130
static int If_CutLeafBit(If_Cut_t *pCut, int i)
Definition: if.h:396
If_Par_t * pPars
Definition: if.h:184
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
ABC_DLL void Abc_SopComplement(char *pSop)
Definition: abcSop.c:600
static int Abc_TtWordNum(int nVars)
Definition: utilTruth.h:169
ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeConst0(Abc_Ntk_t *pNtk)
Definition: abcObj.c:604
int fUserRecLib
Definition: if.h:124
static Abc_Obj_t * Abc_NtkCreateNode(Abc_Ntk_t *pNtk)
Definition: abc.h:308
int fDelayOpt
Definition: if.h:121
int fUseTtPerm
Definition: if.h:137
#define assert(ex)
Definition: util_old.h:213
unsigned fCompl
Definition: if.h:285
Hop_Obj_t * Abc_NodeBuildFromMini(Hop_Man_t *pMan, If_Man_t *p, If_Cut_t *pCut, int fUseDsd)
Definition: abcIf.c:393
void Cudd_Ref(DdNode *n)
Definition: cuddRef.c:129
ABC_DLL void Abc_NodeComplement(Abc_Obj_t *pNode)
Definition: abcObj.c:980
typedefABC_NAMESPACE_HEADER_START struct Hop_Man_t_ Hop_Man_t
INCLUDES ///.
Definition: hop.h:49
ABC_DLL int Abc_ObjLevelNew(Abc_Obj_t *pObj)
Definition: abcTiming.c:1058
Hop_Obj_t * Abc_NodeIfToHop ( Hop_Man_t pHopMan,
If_Man_t pIfMan,
If_Obj_t pIfObj 
)
static

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

Synopsis [Derives the truth table for one cut.]

Description []

SideEffects []

SeeAlso []

Definition at line 603 of file abcIf.c.

604 {
605  If_Cut_t * pCut;
606  Hop_Obj_t * gFunc;
607  If_Obj_t * pLeaf;
608  int i;
609  // get the best cut
610  pCut = If_ObjCutBest(pIfObj);
611  assert( pCut->nLeaves > 1 );
612  // set the leaf variables
613  If_CutForEachLeaf( pIfMan, pCut, pLeaf, i )
614  If_CutSetData( If_ObjCutBest(pLeaf), Hop_IthVar(pHopMan, i) );
615  // recursively compute the function while collecting visited cuts
616  Vec_PtrClear( pIfMan->vTemp );
617  gFunc = Abc_NodeIfToHop2_rec( pHopMan, pIfMan, pIfObj, pIfMan->vTemp );
618  if ( gFunc == (void *)1 )
619  {
620  printf( "Abc_NodeIfToHop(): Computing local AIG has failed.\n" );
621  return NULL;
622  }
623  // clean the cuts
624  If_CutForEachLeaf( pIfMan, pCut, pLeaf, i )
625  If_CutSetData( If_ObjCutBest(pLeaf), NULL );
626  Vec_PtrForEachEntry( If_Cut_t *, pIfMan->vTemp, pCut, i )
627  If_CutSetData( pCut, NULL );
628  return gFunc;
629 }
unsigned nLeaves
Definition: if.h:289
Definition: if.h:303
Definition: if.h:275
#define If_CutForEachLeaf(p, pCut, pLeaf, i)
Definition: if.h:474
static void If_CutSetData(If_Cut_t *pCut, void *pData)
Definition: if.h:412
static If_Cut_t * If_ObjCutBest(If_Obj_t *pObj)
Definition: if.h:401
Definition: hop.h:65
if(last==0)
Definition: sparse_int.h:34
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:556
#define assert(ex)
Definition: util_old.h:213
static void Vec_PtrClear(Vec_Ptr_t *p)
Definition: vecPtr.h:545
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
Hop_Obj_t * Hop_IthVar(Hop_Man_t *p, int i)
FUNCTION DEFINITIONS ///.
Definition: hopOper.c:63
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 556 of file abcIf.c.

557 {
558  If_Cut_t * pCut;
559  If_Obj_t * pTemp;
560  Hop_Obj_t * gFunc, * gFunc0, * gFunc1;
561  // get the best cut
562  pCut = If_ObjCutBest(pIfObj);
563  // if the cut is visited, return the result
564  if ( If_CutData(pCut) )
565  return (Hop_Obj_t *)If_CutData(pCut);
566  // mark the node as visited
567  Vec_PtrPush( vVisited, pCut );
568  // insert the worst case
569  If_CutSetData( pCut, (void *)1 );
570  // skip in case of primary input
571  if ( If_ObjIsCi(pIfObj) )
572  return (Hop_Obj_t *)If_CutData(pCut);
573  // compute the functions of the children
574  for ( pTemp = pIfObj; pTemp; pTemp = pTemp->pEquiv )
575  {
576  gFunc0 = Abc_NodeIfToHop2_rec( pHopMan, pIfMan, pTemp->pFanin0, vVisited );
577  if ( gFunc0 == (void *)1 )
578  continue;
579  gFunc1 = Abc_NodeIfToHop2_rec( pHopMan, pIfMan, pTemp->pFanin1, vVisited );
580  if ( gFunc1 == (void *)1 )
581  continue;
582  // both branches are solved
583  gFunc = Hop_And( pHopMan, Hop_NotCond(gFunc0, pTemp->fCompl0), Hop_NotCond(gFunc1, pTemp->fCompl1) );
584  if ( pTemp->fPhase != pIfObj->fPhase )
585  gFunc = Hop_Not(gFunc);
586  If_CutSetData( pCut, gFunc );
587  break;
588  }
589  return (Hop_Obj_t *)If_CutData(pCut);
590 }
If_Obj_t * pFanin0
Definition: if.h:321
Hop_Obj_t * Hop_And(Hop_Man_t *p, Hop_Obj_t *p0, Hop_Obj_t *p1)
Definition: hopOper.c:104
Definition: if.h:303
Definition: if.h:275
static void If_CutSetData(If_Cut_t *pCut, void *pData)
Definition: if.h:412
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
static int If_ObjIsCi(If_Obj_t *pObj)
Definition: if.h:373
static If_Cut_t * If_ObjCutBest(If_Obj_t *pObj)
Definition: if.h:401
static Hop_Obj_t * Hop_Not(Hop_Obj_t *p)
Definition: hop.h:127
Definition: hop.h:65
If_Obj_t * pFanin1
Definition: if.h:322
If_Obj_t * pEquiv
Definition: if.h:323
static void * If_CutData(If_Cut_t *pCut)
Definition: if.h:411
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:556
static Hop_Obj_t * Hop_NotCond(Hop_Obj_t *p, int c)
Definition: hop.h:128
unsigned fCompl1
Definition: if.h:307
unsigned fCompl0
Definition: if.h:306
unsigned fPhase
Definition: if.h:308
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 523 of file abcIf.c.

524 {
525  If_Cut_t * pCut;
526  Hop_Obj_t * gFunc, * gFunc0, * gFunc1;
527  // get the best cut
528  pCut = If_ObjCutBest(pIfObj);
529  // if the cut is visited, return the result
530  if ( If_CutData(pCut) )
531  return (Hop_Obj_t *)If_CutData(pCut);
532  // compute the functions of the children
533  gFunc0 = Abc_NodeIfToHop_rec( pHopMan, pIfMan, pIfObj->pFanin0, vVisited );
534  gFunc1 = Abc_NodeIfToHop_rec( pHopMan, pIfMan, pIfObj->pFanin1, vVisited );
535  // get the function of the cut
536  gFunc = Hop_And( pHopMan, Hop_NotCond(gFunc0, pIfObj->fCompl0), Hop_NotCond(gFunc1, pIfObj->fCompl1) );
537  assert( If_CutData(pCut) == NULL );
538  If_CutSetData( pCut, gFunc );
539  // add this cut to the visited list
540  Vec_PtrPush( vVisited, pCut );
541  return gFunc;
542 }
If_Obj_t * pFanin0
Definition: if.h:321
Hop_Obj_t * Hop_And(Hop_Man_t *p, Hop_Obj_t *p0, Hop_Obj_t *p1)
Definition: hopOper.c:104
Definition: if.h:275
static void If_CutSetData(If_Cut_t *pCut, void *pData)
Definition: if.h:412
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:523
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
static If_Cut_t * If_ObjCutBest(If_Obj_t *pObj)
Definition: if.h:401
Definition: hop.h:65
If_Obj_t * pFanin1
Definition: if.h:322
static void * If_CutData(If_Cut_t *pCut)
Definition: if.h:411
static Hop_Obj_t * Hop_NotCond(Hop_Obj_t *p, int c)
Definition: hop.h:128
#define assert(ex)
Definition: util_old.h:213
unsigned fCompl1
Definition: if.h:307
unsigned fCompl0
Definition: if.h:306
void Abc_NtkBddReorder ( Abc_Ntk_t pNtk,
int  fVerbose 
)

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

Synopsis [Reorders BDDs of the local functions.]

Description []

SideEffects []

SeeAlso []

Definition at line 77 of file abcReorder.c.

78 {
79  reo_man * p;
80  Abc_Obj_t * pNode;
81  int i;
82  Abc_NtkRemoveDupFanins( pNtk );
83  Abc_NtkMinimumBase( pNtk );
84  p = Extra_ReorderInit( Abc_NtkGetFaninMax(pNtk), 100 );
85  Abc_NtkForEachNode( pNtk, pNode, i )
86  {
87  if ( Abc_ObjFaninNum(pNode) < 3 )
88  continue;
89  if ( fVerbose )
90  fprintf( stdout, "%10s: ", Abc_ObjName(pNode) );
91  if ( fVerbose )
92  fprintf( stdout, "Before = %5d BDD nodes. ", Cudd_DagSize((DdNode *)pNode->pData) );
93  Abc_NodeBddReorder( p, pNode );
94  if ( fVerbose )
95  fprintf( stdout, "After = %5d BDD nodes.\n", Cudd_DagSize((DdNode *)pNode->pData) );
96  }
97  Extra_ReorderQuit( p );
98 }
ABC_NAMESPACE_IMPL_START void Abc_NodeBddReorder(reo_man *p, Abc_Obj_t *pNode)
DECLARATIONS ///.
Definition: abcReorder.c:45
Definition: cudd.h:278
ABC_DLL int Abc_NtkMinimumBase(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition: abcMinBase.c:48
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Abc_ObjFaninNum(Abc_Obj_t *pObj)
Definition: abc.h:364
ABC_DLL int Abc_NtkGetFaninMax(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:453
ABC_DLL int Abc_NtkRemoveDupFanins(Abc_Ntk_t *pNtk)
Definition: abcMinBase.c:116
#define Abc_NtkForEachNode(pNtk, pNode, i)
Definition: abc.h:461
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
Definition: abcNames.c:48
reo_man * Extra_ReorderInit(int nDdVarsMax, int nNodesMax)
FUNCTION DECLARATIONS ///.
Definition: reoApi.c:50
void Extra_ReorderQuit(reo_man *p)
Definition: reoApi.c:79
void * pData
Definition: abc.h:145
Definition: reo.h:101
int Cudd_DagSize(DdNode *node)
Definition: cuddUtil.c:442
void Abc_NtkBidecResyn ( Abc_Ntk_t pNtk,
int  fVerbose 
)

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 }
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
int Hop_DagSize(Hop_Obj_t *pObj)
Definition: hopDfs.c:279
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
Bdc_Man_t * Bdc_ManAlloc(Bdc_Par_t *pPars)
MACRO DEFINITIONS ///.
Definition: bdcCore.c:68
static int Abc_ObjFaninNum(Abc_Obj_t *pObj)
Definition: abc.h:364
ABC_DLL int Abc_NtkGetFaninMax(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:453
static abctime Abc_Clock()
Definition: abc_global.h:279
Definition: hop.h:65
void * pManFunc
Definition: abc.h:191
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
#define Abc_NtkForEachNode(pNtk, pNode, i)
Definition: abc.h:461
Definition: bdc.h:45
#define ABC_PRT(a, t)
Definition: abc_global.h:220
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_NtkToAig(Abc_Ntk_t *pNtk)
Definition: abcFunc.c:1192
#define assert(ex)
Definition: util_old.h:213
void Bdc_ManFree(Bdc_Man_t *p)
Definition: bdcCore.c:113
void * pData
Definition: abc.h:145
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
ABC_INT64_T abctime
Definition: abc_global.h:278
typedefABC_NAMESPACE_HEADER_START struct Hop_Man_t_ Hop_Man_t
INCLUDES ///.
Definition: hop.h:49
Vec_Ptr_t * Abc_NtkFindGoodOrder ( Abc_Ntk_t pNtk)
static

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

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

Description []

SideEffects []

SeeAlso []

Definition at line 693 of file abcIf.c.

694 {
695  Vec_Ptr_t * vNodes, * vCos;
696  Abc_Obj_t * pNode, * pFanin0, * pFanin1;
697  float Flow0, Flow1;
698  int i;
699 
700  // initialize the flow
701  Abc_AigConst1(pNtk)->pCopy = NULL;
702  Abc_NtkForEachCi( pNtk, pNode, i )
703  pNode->pCopy = NULL;
704  // compute the flow
705  Abc_AigForEachAnd( pNtk, pNode, i )
706  {
707  pFanin0 = Abc_ObjFanin0(pNode);
708  pFanin1 = Abc_ObjFanin1(pNode);
709  Flow0 = Abc_Int2Float((int)(ABC_PTRINT_T)pFanin0->pCopy)/Abc_ObjFanoutNum(pFanin0);
710  Flow1 = Abc_Int2Float((int)(ABC_PTRINT_T)pFanin1->pCopy)/Abc_ObjFanoutNum(pFanin1);
711  pNode->pCopy = (Abc_Obj_t *)(ABC_PTRINT_T)Abc_Float2Int(Flow0 + Flow1+(float)1.0);
712  }
713  // find the flow of the COs
714  vCos = Vec_PtrAlloc( Abc_NtkCoNum(pNtk) );
715  Abc_NtkForEachCo( pNtk, pNode, i )
716  {
717  pNode->pCopy = Abc_ObjFanin0(pNode)->pCopy;
718 // pNode->pCopy = (Abc_Obj_t *)Abc_Float2Int((float)Abc_ObjFanin0(pNode)->Level);
719  Vec_PtrPush( vCos, pNode );
720  }
721 
722  // sort nodes in the increasing order of the flow
723  qsort( (Abc_Obj_t **)Vec_PtrArray(vCos), Abc_NtkCoNum(pNtk),
724  sizeof(Abc_Obj_t *), (int (*)(const void *, const void *))Abc_ObjCompareFlow );
725  // verify sorting
726  pFanin0 = (Abc_Obj_t *)Vec_PtrEntry(vCos, 0);
727  pFanin1 = (Abc_Obj_t *)Vec_PtrEntryLast(vCos);
728  assert( Abc_Int2Float((int)(ABC_PTRINT_T)pFanin0->pCopy) >= Abc_Int2Float((int)(ABC_PTRINT_T)pFanin1->pCopy) );
729 
730  // collect the nodes in the topological order from the new array
731  Abc_NtkIncrementTravId( pNtk );
732  vNodes = Vec_PtrAlloc( 100 );
733  Vec_PtrForEachEntry( Abc_Obj_t *, vCos, pNode, i )
734  Abc_NtkFindGoodOrder_rec( Abc_ObjFanin0(pNode), vNodes );
735  Vec_PtrFree( vCos );
736  return vNodes;
737 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
static Abc_Obj_t * Abc_ObjFanin1(Abc_Obj_t *pObj)
Definition: abc.h:374
ABC_DLL Abc_Obj_t * Abc_AigConst1(Abc_Ntk_t *pNtk)
Definition: abcAig.c:683
int Abc_ObjCompareFlow(Abc_Obj_t **ppNode0, Abc_Obj_t **ppNode1)
Definition: abcIf.c:643
static int Abc_ObjFanoutNum(Abc_Obj_t *pObj)
Definition: abc.h:365
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition: abc.h:519
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
Definition: abc.h:373
static int Abc_NtkCoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:288
#define Abc_AigForEachAnd(pNtk, pNode, i)
Definition: abc.h:485
static int Abc_Float2Int(float Val)
Definition: abc_global.h:249
Abc_Obj_t * pCopy
Definition: abc.h:148
static void * Vec_PtrEntryLast(Vec_Ptr_t *p)
Definition: vecPtr.h:413
void Abc_NtkFindGoodOrder_rec(Abc_Obj_t *pNode, Vec_Ptr_t *vNodes)
Definition: abcIf.c:665
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
Definition: vecPtr.h:362
#define Abc_NtkForEachCi(pNtk, pCi, i)
Definition: abc.h:515
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
static void Abc_NtkIncrementTravId(Abc_Ntk_t *p)
Definition: abc.h:406
static float Abc_Int2Float(int Num)
Definition: abc_global.h:250
#define assert(ex)
Definition: util_old.h:213
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
static void ** Vec_PtrArray(Vec_Ptr_t *p)
Definition: vecPtr.h:279
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
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 665 of file abcIf.c.

666 {
667  if ( !Abc_ObjIsNode(pNode) )
668  return;
669  assert( Abc_ObjIsNode( pNode ) );
670  // if this node is already visited, skip
671  if ( Abc_NodeIsTravIdCurrent( pNode ) )
672  return;
673  // mark the node as visited
674  Abc_NodeSetTravIdCurrent( pNode );
675  // visit the transitive fanin of the node
676  Abc_NtkFindGoodOrder_rec( Abc_ObjFanin0(pNode), vNodes );
677  Abc_NtkFindGoodOrder_rec( Abc_ObjFanin1(pNode), vNodes );
678  // add the node after the fanins have been added
679  Vec_PtrPush( vNodes, pNode );
680 }
static Abc_Obj_t * Abc_ObjFanin1(Abc_Obj_t *pObj)
Definition: abc.h:374
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
Definition: abc.h:373
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
Definition: abc.h:355
void Abc_NtkFindGoodOrder_rec(Abc_Obj_t *pNode, Vec_Ptr_t *vNodes)
Definition: abcIf.c:665
static int Abc_NodeIsTravIdCurrent(Abc_Obj_t *p)
Definition: abc.h:411
#define assert(ex)
Definition: util_old.h:213
static void Abc_NodeSetTravIdCurrent(Abc_Obj_t *p)
Definition: abc.h:409
Abc_Ntk_t * Abc_NtkFromIf ( If_Man_t pIfMan,
Abc_Ntk_t pNtk 
)
static

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

Synopsis [Creates the mapped network.]

Description [Assuming the copy field of the mapped nodes are NULL.]

SideEffects []

SeeAlso []

Definition at line 290 of file abcIf.c.

291 {
292  ProgressBar * pProgress;
293  Abc_Ntk_t * pNtkNew;
294  Abc_Obj_t * pNode, * pNodeNew;
295  Vec_Int_t * vCover;
296  int i, nDupGates;
297  // create the new network
298  if ( pIfMan->pPars->fUseBdds || pIfMan->pPars->fUseCnfs || pIfMan->pPars->fUseMv )
299  pNtkNew = Abc_NtkStartFrom( pNtk, ABC_NTK_LOGIC, ABC_FUNC_BDD );
300  else if ( pIfMan->pPars->fUseSops || pIfMan->pPars->nGateSize > 0 )
301  pNtkNew = Abc_NtkStartFrom( pNtk, ABC_NTK_LOGIC, ABC_FUNC_SOP );
302  else
303  pNtkNew = Abc_NtkStartFrom( pNtk, ABC_NTK_LOGIC, ABC_FUNC_AIG );
304  // prepare the mapping manager
305  If_ManCleanNodeCopy( pIfMan );
306  If_ManCleanCutData( pIfMan );
307  // make the mapper point to the new network
309  Abc_NtkForEachCi( pNtk, pNode, i )
310  If_ObjSetCopy( If_ManCi(pIfMan, i), pNode->pCopy );
311 
312  // process the nodes in topological order
313  vCover = Vec_IntAlloc( 1 << 16 );
314  pProgress = Extra_ProgressBarStart( stdout, Abc_NtkCoNum(pNtk) );
315  Abc_NtkForEachCo( pNtk, pNode, i )
316  {
317  Extra_ProgressBarUpdate( pProgress, i, "Final" );
318  pNodeNew = Abc_NodeFromIf_rec( pNtkNew, pIfMan, If_ObjFanin0(If_ManCo(pIfMan, i)), vCover );
319  pNodeNew = Abc_ObjNotCond( pNodeNew, If_ObjFaninC0(If_ManCo(pIfMan, i)) );
320  Abc_ObjAddFanin( pNode->pCopy, pNodeNew );
321  }
322  Extra_ProgressBarStop( pProgress );
323  Vec_IntFree( vCover );
324 
325  // remove the constant node if not used
326  pNodeNew = (Abc_Obj_t *)If_ObjCopy( If_ManConst1(pIfMan) );
327  if ( Abc_ObjFanoutNum(pNodeNew) == 0 && !Abc_ObjIsNone(pNodeNew) )
328  Abc_NtkDeleteObj( pNodeNew );
329  // minimize the node
330  if ( pIfMan->pPars->fUseBdds || pIfMan->pPars->fUseCnfs || pIfMan->pPars->fUseMv )
331  Abc_NtkSweep( pNtkNew, 0 );
332  if ( pIfMan->pPars->fUseBdds )
333  Abc_NtkBddReorder( pNtkNew, 0 );
334  // decouple the PO driver nodes to reduce the number of levels
335  nDupGates = Abc_NtkLogicMakeSimpleCos( pNtkNew, !pIfMan->pPars->fUseBuffs );
336  if ( nDupGates && pIfMan->pPars->fVerbose && !Abc_FrameReadFlag("silentmode") )
337  {
338  if ( pIfMan->pPars->fUseBuffs )
339  printf( "Added %d buffers/inverters to decouple the CO drivers.\n", nDupGates );
340  else
341  printf( "Duplicated %d gates to decouple the CO drivers.\n", nDupGates );
342  }
343  return pNtkNew;
344 }
int fUseMv
Definition: if.h:151
int fUseCnfs
Definition: if.h:150
static void * If_ObjCopy(If_Obj_t *pObj)
Definition: if.h:384
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static int Abc_ObjFanoutNum(Abc_Obj_t *pObj)
Definition: abc.h:365
static int If_ObjFaninC0(If_Obj_t *pObj)
Definition: if.h:382
ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeConst1(Abc_Ntk_t *pNtk)
Definition: abcObj.c:633
static If_Obj_t * If_ObjFanin0(If_Obj_t *pObj)
Definition: if.h:380
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition: abc.h:519
static int Abc_NtkCoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:288
static int Abc_ObjIsNone(Abc_Obj_t *pObj)
Definition: abc.h:346
ABC_DLL void Abc_ObjAddFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
Definition: abcFanio.c:84
int nGateSize
Definition: if.h:107
DECLARATIONS ///.
ABC_DLL Abc_Ntk_t * Abc_NtkStartFrom(Abc_Ntk_t *pNtk, Abc_NtkType_t Type, Abc_NtkFunc_t Func)
Definition: abcNtk.c:106
ABC_DLL void Abc_NtkDeleteObj(Abc_Obj_t *pObj)
Definition: abcObj.c:167
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
static If_Obj_t * If_ManCo(If_Man_t *p, int i)
Definition: if.h:367
static void If_ObjSetCopy(If_Obj_t *pObj, void *pCopy)
Definition: if.h:387
static If_Obj_t * If_ManConst1(If_Man_t *p)
Definition: if.h:365
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:415
static If_Obj_t * If_ManCi(If_Man_t *p, int i)
Definition: if.h:366
void Extra_ProgressBarStop(ProgressBar *p)
ABC_DLL int Abc_NtkLogicMakeSimpleCos(Abc_Ntk_t *pNtk, int fDuplicate)
Definition: abcUtil.c:1047
If_Par_t * pPars
Definition: if.h:184
int fUseBdds
Definition: if.h:148
#define Abc_NtkForEachCi(pNtk, pCi, i)
Definition: abc.h:515
ABC_DLL int Abc_NtkSweep(Abc_Ntk_t *pNtk, int fVerbose)
Definition: abcSweep.c:574
void If_ManCleanCutData(If_Man_t *p)
Definition: ifUtil.c:64
ProgressBar * Extra_ProgressBarStart(FILE *pFile, int nItemsTotal)
FUNCTION DEFINITIONS ///.
static Abc_Obj_t * Abc_ObjNotCond(Abc_Obj_t *p, int c)
Definition: abc.h:325
int fUseSops
Definition: if.h:149
void If_ManCleanNodeCopy(If_Man_t *p)
DECLARATIONS ///.
Definition: ifUtil.c:45
static void Extra_ProgressBarUpdate(ProgressBar *p, int nItemsCur, char *pString)
Definition: extra.h:243
ABC_DLL char * Abc_FrameReadFlag(char *pFlag)
Definition: mainFrame.c:64
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
void Abc_NtkBddReorder(Abc_Ntk_t *pNtk, int fVerbose)
Definition: abcReorder.c:77
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 106 of file abcIf.c.

107 {
108  Abc_Ntk_t * pNtkNew, * pTemp;
109  If_Man_t * pIfMan;
110 
111  assert( Abc_NtkIsStrash(pNtk) );
112 
113  // get timing information
114  pPars->pTimesArr = Abc_NtkGetCiArrivalFloats(pNtk);
115  pPars->pTimesReq = Abc_NtkGetCoRequiredFloats(pNtk);
116 
117  // set the latch paths
118  if ( pPars->fLatchPaths && pPars->pTimesArr )
119  {
120  int c;
121  for ( c = 0; c < Abc_NtkPiNum(pNtk); c++ )
122  pPars->pTimesArr[c] = -ABC_INFINITY;
123  }
124 
125  // create FPGA mapper
126  pIfMan = Abc_NtkToIf( pNtk, pPars );
127  if ( pIfMan == NULL )
128  return NULL;
129  if ( pPars->fPower )
130  If_ManComputeSwitching( pIfMan );
131 
132  // create DSD manager
133  if ( pPars->fUseDsd )
134  {
136  assert( pPars->nLutSize <= If_DsdManVarNum(p) );
137  assert( (pPars->pLutStruct == NULL && If_DsdManLutSize(p) == 0) || (pPars->pLutStruct && pPars->pLutStruct[0] - '0' == If_DsdManLutSize(p)) );
139  if ( pPars->fDsdBalance )
140  If_DsdManAllocIsops( pIfMan->pIfDsdMan, pPars->nLutSize );
141  }
142 
143  // perform FPGA mapping
144  if ( !If_ManPerformMapping( pIfMan ) )
145  {
146  If_ManStop( pIfMan );
147  return NULL;
148  }
149 
150  // transform the result of mapping into the new network
151  pNtkNew = Abc_NtkFromIf( pIfMan, pNtk );
152  if ( pNtkNew == NULL )
153  return NULL;
154  If_ManStop( pIfMan );
155  if ( pPars->fDelayOpt || pPars->fDsdBalance || pPars->fUserRecLib )
156  {
157  pNtkNew = Abc_NtkStrash( pTemp = pNtkNew, 0, 0, 0 );
158  Abc_NtkDelete( pTemp );
159  }
160  else if ( pPars->fBidec && pPars->nLutSize <= 8 )
161  Abc_NtkBidecResyn( pNtkNew, 0 );
162 
163  // duplicate EXDC
164  if ( pNtk->pExdc )
165  pNtkNew->pExdc = Abc_NtkDup( pNtk->pExdc );
166  // make sure that everything is okay
167  if ( !Abc_NtkCheck( pNtkNew ) )
168  {
169  printf( "Abc_NtkIf: The network check has failed.\n" );
170  Abc_NtkDelete( pNtkNew );
171  return NULL;
172  }
173  return pNtkNew;
174 }
If_DsdMan_t * pIfDsdMan
Definition: if.h:243
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
int nLutSize
Definition: if.h:103
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Abc_Ntk_t * pExdc
Definition: abc.h:201
void Abc_NtkBidecResyn(Abc_Ntk_t *pNtk, int fVerbose)
Definition: abcBidec.c:110
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
char * pLutStruct
Definition: if.h:141
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:419
ABC_DLL float * Abc_NtkGetCoRequiredFloats(Abc_Ntk_t *pNtk)
Definition: abcTiming.c:676
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition: abcCheck.c:61
void If_ManComputeSwitching(If_Man_t *pIfMan)
FUNCTION DEFINITIONS ///.
Definition: abcIf.c:58
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
void If_DsdManAllocIsops(If_DsdMan_t *p, int nLutSize)
Definition: ifDsd.c:289
int fDsdBalance
Definition: if.h:123
ABC_NAMESPACE_IMPL_START If_Man_t * Abc_NtkToIf(Abc_Ntk_t *pNtk, If_Par_t *pPars)
DECLARATIONS ///.
Definition: abcIf.c:188
int fLatchPaths
Definition: if.h:117
Definition: if.h:180
float * pTimesArr
Definition: if.h:161
int If_DsdManVarNum(If_DsdMan_t *p)
Definition: ifDsd.c:165
ABC_DLL void * Abc_FrameReadManDsd()
Definition: mainFrame.c:62
int fBidec
Definition: if.h:125
float * pTimesReq
Definition: if.h:162
int fUseDsd
Definition: if.h:133
ABC_DLL float * Abc_NtkGetCiArrivalFloats(Abc_Ntk_t *pNtk)
Definition: abcTiming.c:658
int If_ManPerformMapping(If_Man_t *p)
Definition: ifCore.c:80
int If_DsdManLutSize(If_DsdMan_t *p)
Definition: ifDsd.c:173
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:285
int fUserRecLib
Definition: if.h:124
int fPower
Definition: if.h:119
int fDelayOpt
Definition: if.h:121
#define ABC_INFINITY
MACRO DEFINITIONS ///.
Definition: abc_global.h:216
static Abc_Ntk_t * Abc_NtkFromIf(If_Man_t *pIfMan, Abc_Ntk_t *pNtk)
Definition: abcIf.c:290
#define assert(ex)
Definition: util_old.h:213
void If_ManStop(If_Man_t *p)
Definition: ifMan.c:205
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 751 of file abcIf.c.

752 {
753  Abc_Obj_t * pNodeC, * pNodeT, * pNodeE;
754  If_Obj_t * pIfObj;
755 
756  *ppNode1 = NULL;
757  *ppNode2 = NULL;
758  if ( pDriver == NULL )
759  return;
760  if ( !Abc_NodeIsMuxType(pDriver) )
761  return;
762 
763  pNodeC = Abc_NodeRecognizeMux( pDriver, &pNodeT, &pNodeE );
764 
765  pIfObj = If_Regular( (If_Obj_t *)Abc_ObjFanin0(pDriver)->pCopy );
766  if ( If_ObjIsAnd(pIfObj) )
767  pIfObj->fSkipCut = 1;
768  pIfObj = If_Regular( (If_Obj_t *)Abc_ObjFanin1(pDriver)->pCopy );
769  if ( If_ObjIsAnd(pIfObj) )
770  pIfObj->fSkipCut = 1;
771 
772  pIfObj = If_Regular( (If_Obj_t *)Abc_ObjRegular(pNodeC)->pCopy );
773  if ( If_ObjIsAnd(pIfObj) )
774  pIfObj->fSkipCut = 1;
775 
776 /*
777  pIfObj = If_Regular( (If_Obj_t *)Abc_ObjRegular(pNodeT)->pCopy );
778  if ( If_ObjIsAnd(pIfObj) )
779  pIfObj->fSkipCut = 1;
780  pIfObj = If_Regular( (If_Obj_t *)Abc_ObjRegular(pNodeE)->pCopy );
781  if ( If_ObjIsAnd(pIfObj) )
782  pIfObj->fSkipCut = 1;
783 */
784  *ppNode1 = Abc_ObjRegular(pNodeC);
785  *ppNode2 = Abc_ObjRegular(pNodeT);
786 }
static Abc_Obj_t * Abc_ObjFanin1(Abc_Obj_t *pObj)
Definition: abc.h:374
Definition: if.h:303
static int If_ObjIsAnd(If_Obj_t *pObj)
Definition: if.h:377
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
Definition: abc.h:373
ABC_DLL int Abc_NodeIsMuxType(Abc_Obj_t *pNode)
Definition: abcUtil.c:1301
unsigned fSkipCut
Definition: if.h:314
static If_Obj_t * If_Regular(If_Obj_t *p)
Definition: if.h:355
static Abc_Obj_t * Abc_ObjRegular(Abc_Obj_t *p)
Definition: abc.h:323
ABC_DLL Abc_Obj_t * Abc_NodeRecognizeMux(Abc_Obj_t *pNode, Abc_Obj_t **ppNodeT, Abc_Obj_t **ppNodeE)
Definition: abcUtil.c:1389
If_Man_t * Abc_NtkToIf ( Abc_Ntk_t pNtk,
If_Par_t pPars 
)

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 188 of file abcIf.c.

189 {
190  ProgressBar * pProgress;
191  If_Man_t * pIfMan;
192  Vec_Ptr_t * vNodes;
193  Abc_Obj_t * pNode, * pPrev;
194  int i;
195 
196  assert( Abc_NtkIsStrash(pNtk) );
197 
198  // start the mapping manager and set its parameters
199  pIfMan = If_ManStart( pPars );
200  pIfMan->pName = Abc_UtilStrsav( Abc_NtkName(pNtk) );
201 
202  // print warning about excessive memory usage
203  if ( 1.0 * Abc_NtkObjNum(pNtk) * pIfMan->nObjBytes / (1<<30) > 1.0 )
204  printf( "Warning: The mapper will allocate %.1f GB for to represent the subject graph with %d AIG nodes.\n",
205  1.0 * Abc_NtkObjNum(pNtk) * pIfMan->nObjBytes / (1<<30), Abc_NtkObjNum(pNtk) );
206 
207  // create PIs and remember them in the old nodes
208  Abc_NtkCleanCopy( pNtk );
209  Abc_AigConst1(pNtk)->pCopy = (Abc_Obj_t *)If_ManConst1( pIfMan );
210  Abc_NtkForEachCi( pNtk, pNode, i )
211  {
212  pNode->pCopy = (Abc_Obj_t *)If_ManCreateCi( pIfMan );
213  // transfer logic level information
214  Abc_ObjIfCopy(pNode)->Level = pNode->Level;
215  }
216 
217  // load the AIG into the mapper
218  pProgress = Extra_ProgressBarStart( stdout, Abc_NtkObjNumMax(pNtk) );
219  vNodes = Abc_AigDfs( pNtk, 0, 0 );
220  Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
221  {
222  Extra_ProgressBarUpdate( pProgress, i, "Initial" );
223  // add the node to the mapper
224  pNode->pCopy = (Abc_Obj_t *)If_ManCreateAnd( pIfMan,
227  // set up the choice node
228  if ( Abc_AigNodeIsChoice( pNode ) )
229  {
230  Abc_Obj_t * pEquiv;
231 // int Counter = 0;
233  for ( pPrev = pNode, pEquiv = Abc_ObjEquiv(pPrev); pEquiv; pPrev = pEquiv, pEquiv = Abc_ObjEquiv(pPrev) )
234  If_ObjSetChoice( Abc_ObjIfCopy(pPrev), Abc_ObjIfCopy(pEquiv) );//, Counter++;
235 // printf( "%d ", Counter );
236  If_ManCreateChoice( pIfMan, Abc_ObjIfCopy(pNode) );
237  }
238  }
239  Extra_ProgressBarStop( pProgress );
240  Vec_PtrFree( vNodes );
241 
242  // set the primary outputs without copying the phase
243  Abc_NtkForEachCo( pNtk, pNode, i )
244  pNode->pCopy = (Abc_Obj_t *)If_ManCreateCo( pIfMan, If_NotCond( Abc_ObjIfCopy(Abc_ObjFanin0(pNode)), Abc_ObjFaninC0(pNode) ) );
245  return pIfMan;
246 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static If_Obj_t * If_NotCond(If_Obj_t *p, int c)
Definition: if.h:357
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
static Abc_Obj_t * Abc_ObjFanin1(Abc_Obj_t *pObj)
Definition: abc.h:374
static int Abc_NtkObjNumMax(Abc_Ntk_t *pNtk)
Definition: abc.h:284
static int If_ObjId(If_Obj_t *pObj)
Definition: if.h:379
ABC_DLL Abc_Obj_t * Abc_AigConst1(Abc_Ntk_t *pNtk)
Definition: abcAig.c:683
static int Abc_ObjFaninC1(Abc_Obj_t *pObj)
Definition: abc.h:378
If_Man_t * If_ManStart(If_Par_t *pPars)
FUNCTION DEFINITIONS ///.
Definition: ifMan.c:50
static If_Obj_t * Abc_ObjIfCopy(Abc_Obj_t *pNode)
Definition: abcIf.c:187
static int Abc_ObjFaninC0(Abc_Obj_t *pObj)
Definition: abc.h:377
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition: abc.h:519
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
Definition: abc.h:373
unsigned Level
Definition: abc.h:142
If_Obj_t * If_ManCreateCo(If_Man_t *p, If_Obj_t *pDriver)
Definition: ifMan.c:338
char * pName
Definition: if.h:182
DECLARATIONS ///.
Abc_Obj_t * pCopy
Definition: abc.h:148
Definition: if.h:180
static If_Obj_t * If_ManConst1(If_Man_t *p)
Definition: if.h:365
void Extra_ProgressBarStop(ProgressBar *p)
unsigned Level
Definition: if.h:315
int nObjBytes
Definition: if.h:228
ABC_DLL Vec_Ptr_t * Abc_AigDfs(Abc_Ntk_t *pNtk, int fCollectAll, int fCollectCos)
Definition: abcDfs.c:1014
static void If_ObjSetChoice(If_Obj_t *pObj, If_Obj_t *pEqu)
Definition: if.h:388
static int Abc_AigNodeIsChoice(Abc_Obj_t *pNode)
Definition: abc.h:398
static Abc_Obj_t * Abc_ObjEquiv(Abc_Obj_t *pObj)
Definition: abc.h:337
static char * Abc_NtkName(Abc_Ntk_t *pNtk)
Definition: abc.h:270
#define Abc_NtkForEachCi(pNtk, pCi, i)
Definition: abc.h:515
void If_ManCreateChoice(If_Man_t *p, If_Obj_t *pRepr)
Definition: ifMan.c:442
If_Obj_t * If_ManCreateCi(If_Man_t *p)
Definition: ifMan.c:316
ProgressBar * Extra_ProgressBarStart(FILE *pFile, int nItemsTotal)
FUNCTION DEFINITIONS ///.
ABC_DLL void Abc_NtkCleanCopy(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:507
If_Obj_t * If_ManCreateAnd(If_Man_t *p, If_Obj_t *pFan0, If_Obj_t *pFan1)
Definition: ifMan.c:366
#define assert(ex)
Definition: util_old.h:213
static void Extra_ProgressBarUpdate(ProgressBar *p, int nItemsCur, char *pString)
Definition: extra.h:243
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
static int Abc_NtkObjNum(Abc_Ntk_t *pNtk)
Definition: abc.h:283
char * Abc_UtilStrsav(char *s)
Definition: starter.c:47
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
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 643 of file abcIf.c.

644 {
645  float Flow0 = Abc_Int2Float((int)(ABC_PTRINT_T)(*ppNode0)->pCopy);
646  float Flow1 = Abc_Int2Float((int)(ABC_PTRINT_T)(*ppNode1)->pCopy);
647  if ( Flow0 > Flow1 )
648  return -1;
649  if ( Flow0 < Flow1 )
650  return 1;
651  return 0;
652 }
static float Abc_Int2Float(int Num)
Definition: abc_global.h:250
static If_Obj_t* Abc_ObjIfCopy ( Abc_Obj_t pNode)
inlinestatic

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

Synopsis [Load the network into FPGA manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 187 of file abcIf.c.

187 { return (If_Obj_t *)pNode->pCopy; }
Definition: if.h:303
Abc_Obj_t * pCopy
Definition: abc.h:148
void If_ManComputeSwitching ( If_Man_t pIfMan)

FUNCTION DEFINITIONS ///.

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

Synopsis [Interface with the FPGA mapping package.]

Description []

SideEffects []

SeeAlso []

Definition at line 58 of file abcIf.c.

59 {
60  abctime clk = Abc_Clock();
61  Gia_Man_t * pNew;
62  Vec_Int_t * vCopy;
63  If_Obj_t * pIfObj;
64  int i;
65  assert( pIfMan->vSwitching == NULL );
66  // create the new manager
67  pNew = Gia_ManStart( If_ManObjNum(pIfMan) );
68  vCopy = Vec_IntAlloc( If_ManObjNum(pIfMan) );
69  // constant and inputs
70  Vec_IntPush( vCopy, 1 );
71  If_ManForEachCi( pIfMan, pIfObj, i )
72  Vec_IntPush( vCopy, Gia_ManAppendCi(pNew) );
73  // internal nodes
74  If_ManForEachNode( pIfMan, pIfObj, i )
75  {
76  int iLit0 = Abc_LitNotCond( Vec_IntEntry(vCopy, If_ObjFanin0(pIfObj)->Id), If_ObjFaninC0(pIfObj) );
77  int iLit1 = Abc_LitNotCond( Vec_IntEntry(vCopy, If_ObjFanin1(pIfObj)->Id), If_ObjFaninC1(pIfObj) );
78  Vec_IntPush( vCopy, Gia_ManAppendAnd(pNew, iLit0, iLit1) );
79  }
80  // outputs
81  If_ManForEachCo( pIfMan, pIfObj, i )
82  {
83  int iLit0 = Abc_LitNotCond( Vec_IntEntry(vCopy, If_ObjFanin0(pIfObj)->Id), If_ObjFaninC0(pIfObj) );
84  Vec_IntPush( vCopy, Gia_ManAppendCo(pNew, iLit0) );
85  }
86  assert( Vec_IntSize(vCopy) == If_ManObjNum(pIfMan) );
87  Vec_IntFree( vCopy );
88  // compute switching activity
89  pIfMan->vSwitching = Gia_ManComputeSwitchProbs( pNew, 48, 16, 0 );
90  Gia_ManStop( pNew );
91  if ( pIfMan->pPars->fVerbose )
92  Abc_PrintTime( 1, "Computing switching activity", Abc_Clock() - clk );
93 }
static int Gia_ManAppendAnd(Gia_Man_t *p, int iLit0, int iLit1)
Definition: gia.h:592
#define If_ManForEachNode(p, pObj, i)
Definition: if.h:468
void Gia_ManStop(Gia_Man_t *p)
Definition: giaMan.c:77
static int Gia_ManAppendCo(Gia_Man_t *p, int iLit0)
Definition: gia.h:703
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
Definition: if.h:303
static int Gia_ManAppendCi(Gia_Man_t *p)
Definition: gia.h:583
static int If_ObjFaninC0(If_Obj_t *pObj)
Definition: if.h:382
static If_Obj_t * If_ObjFanin0(If_Obj_t *pObj)
Definition: if.h:380
static abctime Abc_Clock()
Definition: abc_global.h:279
Vec_Int_t * vSwitching
Definition: if.h:208
static int Abc_LitNotCond(int Lit, int c)
Definition: abc_global.h:267
static void Abc_PrintTime(int level, const char *pStr, abctime time)
Definition: abc_global.h:367
static int If_ObjFaninC1(If_Obj_t *pObj)
Definition: if.h:383
#define If_ManForEachCi(p, pObj, i)
Definition: if.h:445
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
Gia_Man_t * Gia_ManStart(int nObjsMax)
DECLARATIONS ///.
Definition: giaMan.c:52
static If_Obj_t * If_ObjFanin1(If_Obj_t *pObj)
Definition: if.h:381
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
static int If_ManObjNum(If_Man_t *p)
Definition: if.h:363
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
#define If_ManForEachCo(p, pObj, i)
Definition: if.h:448
Definition: gia.h:95
#define assert(ex)
Definition: util_old.h:213
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
ABC_INT64_T abctime
Definition: abc_global.h:278
Vec_Int_t * Gia_ManComputeSwitchProbs(Gia_Man_t *pGia, int nFrames, int nPref, int fProbOne)
Definition: giaSwitch.c:658