abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
abcIvy.c File Reference
#include "base/abc/abc.h"
#include "bool/dec/dec.h"
#include "proof/fra/fra.h"
#include "aig/ivy/ivy.h"
#include "proof/fraig/fraig.h"
#include "map/mio/mio.h"
#include "aig/aig/aig.h"
#include "misc/extra/extraBdd.h"

Go to the source code of this file.

Typedefs

typedef int Abc_Edge_t
 

Functions

ABC_NAMESPACE_IMPL_START
Aig_Man_t
Abc_NtkToDar (Abc_Ntk_t *pNtk, int fExors, int fRegisters)
 DECLARATIONS ///. More...
 
void Aig_ManStop (Aig_Man_t *pMan)
 
Ivy_Obj_tDec_GraphToNetworkIvy (Ivy_Man_t *pMan, Dec_Graph_t *pGraph)
 
void Ivy_CutComputeAll (Ivy_Man_t *p, int nInputs)
 
static Abc_Ntk_tAbc_NtkFromIvy (Abc_Ntk_t *pNtkOld, Ivy_Man_t *pMan)
 DECLARATIONS ///. More...
 
static Abc_Ntk_tAbc_NtkFromIvySeq (Abc_Ntk_t *pNtkOld, Ivy_Man_t *pMan, int fHaig)
 
static Ivy_Man_tAbc_NtkToIvy (Abc_Ntk_t *pNtkOld)
 
static void Abc_NtkStrashPerformAig (Abc_Ntk_t *pNtk, Ivy_Man_t *pMan)
 
static Ivy_Obj_tAbc_NodeStrashAig (Ivy_Man_t *pMan, Abc_Obj_t *pNode)
 
static Ivy_Obj_tAbc_NodeStrashAigSopAig (Ivy_Man_t *pMan, Abc_Obj_t *pNode, char *pSop)
 
static Ivy_Obj_tAbc_NodeStrashAigExorAig (Ivy_Man_t *pMan, Abc_Obj_t *pNode, char *pSop)
 
static Ivy_Obj_tAbc_NodeStrashAigFactorAig (Ivy_Man_t *pMan, Abc_Obj_t *pNode, char *pSop)
 
static Abc_Edge_t Abc_EdgeCreate (int Id, int fCompl)
 
static int Abc_EdgeId (Abc_Edge_t Edge)
 
static int Abc_EdgeIsComplement (Abc_Edge_t Edge)
 
static Abc_Edge_t Abc_EdgeRegular (Abc_Edge_t Edge)
 
static Abc_Edge_t Abc_EdgeNot (Abc_Edge_t Edge)
 
static Abc_Edge_t Abc_EdgeNotCond (Abc_Edge_t Edge, int fCond)
 
static Abc_Edge_t Abc_EdgeFromNode (Abc_Obj_t *pNode)
 
static Abc_Obj_tAbc_EdgeToNode (Abc_Ntk_t *p, Abc_Edge_t Edge)
 
static Abc_Obj_tAbc_ObjFanin0Ivy (Abc_Ntk_t *p, Ivy_Obj_t *pObj)
 
static Abc_Obj_tAbc_ObjFanin1Ivy (Abc_Ntk_t *p, Ivy_Obj_t *pObj)
 
static Vec_Int_tAbc_NtkCollectLatchValuesIvy (Abc_Ntk_t *pNtk, int fUseDcs)
 
Ivy_Man_tAbc_NtkIvyBefore (Abc_Ntk_t *pNtk, int fSeq, int fUseDc)
 FUNCTION DEFINITIONS ///. More...
 
Abc_Ntk_tAbc_NtkIvyAfter (Abc_Ntk_t *pNtk, Ivy_Man_t *pMan, int fSeq, int fHaig)
 
Abc_Ntk_tAbc_NtkIvyStrash (Abc_Ntk_t *pNtk)
 
Abc_Ntk_tAbc_NtkIvyHaig (Abc_Ntk_t *pNtk, int nIters, int fUseZeroCost, int fVerbose)
 
void Abc_NtkIvyCuts (Abc_Ntk_t *pNtk, int nInputs)
 
Abc_Ntk_tAbc_NtkIvyRewrite (Abc_Ntk_t *pNtk, int fUpdateLevel, int fUseZeroCost, int fVerbose)
 
Abc_Ntk_tAbc_NtkIvyRewriteSeq (Abc_Ntk_t *pNtk, int fUseZeroCost, int fVerbose)
 
Abc_Ntk_tAbc_NtkIvyResyn0 (Abc_Ntk_t *pNtk, int fUpdateLevel, int fVerbose)
 
Abc_Ntk_tAbc_NtkIvyResyn (Abc_Ntk_t *pNtk, int fUpdateLevel, int fVerbose)
 
Abc_Ntk_tAbc_NtkIvySat (Abc_Ntk_t *pNtk, int nConfLimit, int fVerbose)
 
void Abc_NtkTransferPointers (Abc_Ntk_t *pNtk, Abc_Ntk_t *pNtkAig)
 
Abc_Ntk_tAbc_NtkIvyFraig (Abc_Ntk_t *pNtk, int nConfLimit, int fDoSparse, int fProve, int fTransfer, int fVerbose)
 
int Abc_NtkIvyProve (Abc_Ntk_t **ppNtk, void *pPars)
 
Abc_Ntk_tAbc_NtkIvy (Abc_Ntk_t *pNtk)
 

Variables

int timeRetime
 DECLARATIONS ///. More...
 

Typedef Documentation

typedef int Abc_Edge_t

Definition at line 52 of file abcIvy.c.

Function Documentation

static Abc_Edge_t Abc_EdgeCreate ( int  Id,
int  fCompl 
)
inlinestatic

Definition at line 53 of file abcIvy.c.

53 { return (Id << 1) | fCompl; }
static Abc_Edge_t Abc_EdgeFromNode ( Abc_Obj_t pNode)
inlinestatic

Definition at line 59 of file abcIvy.c.

59 { return Abc_EdgeCreate( Abc_ObjRegular(pNode)->Id, Abc_ObjIsComplement(pNode) ); }
static Abc_Edge_t Abc_EdgeCreate(int Id, int fCompl)
Definition: abcIvy.c:53
static Abc_Obj_t * Abc_ObjRegular(Abc_Obj_t *p)
Definition: abc.h:323
static int Abc_ObjIsComplement(Abc_Obj_t *p)
Definition: abc.h:322
static int Abc_EdgeId ( Abc_Edge_t  Edge)
inlinestatic

Definition at line 54 of file abcIvy.c.

54 { return Edge >> 1; }
static int Abc_EdgeIsComplement ( Abc_Edge_t  Edge)
inlinestatic

Definition at line 55 of file abcIvy.c.

55 { return Edge & 1; }
static Abc_Edge_t Abc_EdgeNot ( Abc_Edge_t  Edge)
inlinestatic

Definition at line 57 of file abcIvy.c.

57 { return Edge ^ 1; }
static Abc_Edge_t Abc_EdgeNotCond ( Abc_Edge_t  Edge,
int  fCond 
)
inlinestatic

Definition at line 58 of file abcIvy.c.

58 { return Edge ^ fCond; }
static Abc_Edge_t Abc_EdgeRegular ( Abc_Edge_t  Edge)
inlinestatic

Definition at line 56 of file abcIvy.c.

56 { return (Edge >> 1) << 1; }
static Abc_Obj_t* Abc_EdgeToNode ( Abc_Ntk_t p,
Abc_Edge_t  Edge 
)
inlinestatic

Definition at line 60 of file abcIvy.c.

60 { return Abc_ObjNotCond( Abc_NtkObj(p, Abc_EdgeId(Edge)), Abc_EdgeIsComplement(Edge) ); }
static int Abc_EdgeId(Abc_Edge_t Edge)
Definition: abcIvy.c:54
static Abc_Obj_t * Abc_NtkObj(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:314
static int Abc_EdgeIsComplement(Abc_Edge_t Edge)
Definition: abcIvy.c:55
static Abc_Obj_t * Abc_ObjNotCond(Abc_Obj_t *p, int c)
Definition: abc.h:325
Ivy_Obj_t * Abc_NodeStrashAig ( Ivy_Man_t pMan,
Abc_Obj_t pNode 
)
static

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

Synopsis [Strashes one logic node.]

Description []

SideEffects []

SeeAlso []

Definition at line 958 of file abcIvy.c.

959 {
960  int fUseFactor = 1;
961  char * pSop;
962  Ivy_Obj_t * pFanin0, * pFanin1;
963 
964  assert( Abc_ObjIsNode(pNode) );
965 
966  // consider the case when the graph is an AIG
967  if ( Abc_NtkIsStrash(pNode->pNtk) )
968  {
969  if ( Abc_AigNodeIsConst(pNode) )
970  return Ivy_ManConst1(pMan);
971  pFanin0 = (Ivy_Obj_t *)Abc_ObjFanin0(pNode)->pCopy;
972  pFanin0 = Ivy_NotCond( pFanin0, Abc_ObjFaninC0(pNode) );
973  pFanin1 = (Ivy_Obj_t *)Abc_ObjFanin1(pNode)->pCopy;
974  pFanin1 = Ivy_NotCond( pFanin1, Abc_ObjFaninC1(pNode) );
975  return Ivy_And( pMan, pFanin0, pFanin1 );
976  }
977 
978  // get the SOP of the node
979  if ( Abc_NtkHasMapping(pNode->pNtk) )
980  pSop = Mio_GateReadSop((Mio_Gate_t *)pNode->pData);
981  else
982  pSop = (char *)pNode->pData;
983 
984  // consider the constant node
985  if ( Abc_NodeIsConst(pNode) )
986  return Ivy_NotCond( Ivy_ManConst1(pMan), Abc_SopIsConst0(pSop) );
987 
988  // decide when to use factoring
989  if ( fUseFactor && Abc_ObjFaninNum(pNode) > 2 && Abc_SopGetCubeNum(pSop) > 1 && !Abc_SopIsExorType(pSop) )
990  return Abc_NodeStrashAigFactorAig( pMan, pNode, pSop );
991  return Abc_NodeStrashAigSopAig( pMan, pNode, pSop );
992 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static Abc_Obj_t * Abc_ObjFanin1(Abc_Obj_t *pObj)
Definition: abc.h:374
static Ivy_Obj_t * Ivy_ManConst1(Ivy_Man_t *p)
Definition: ivy.h:199
ABC_DLL int Abc_NodeIsConst(Abc_Obj_t *pNode)
Definition: abcObj.c:843
static int Abc_ObjFaninC1(Abc_Obj_t *pObj)
Definition: abc.h:378
ABC_DLL int Abc_SopGetCubeNum(char *pSop)
Definition: abcSop.c:489
static int Abc_ObjFaninNum(Abc_Obj_t *pObj)
Definition: abc.h:364
static int Abc_NtkHasMapping(Abc_Ntk_t *pNtk)
Definition: abc.h:256
static int Abc_ObjFaninC0(Abc_Obj_t *pObj)
Definition: abc.h:377
static int Abc_AigNodeIsConst(Abc_Obj_t *pNode)
Definition: abc.h:396
ABC_DLL int Abc_SopIsExorType(char *pSop)
Definition: abcSop.c:802
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
static Ivy_Obj_t * Abc_NodeStrashAigFactorAig(Ivy_Man_t *pMan, Abc_Obj_t *pNode, char *pSop)
Definition: abcIvy.c:1083
Abc_Obj_t * pCopy
Definition: abc.h:148
static Ivy_Obj_t * Abc_NodeStrashAigSopAig(Ivy_Man_t *pMan, Abc_Obj_t *pNode, char *pSop)
Definition: abcIvy.c:1005
if(last==0)
Definition: sparse_int.h:34
Definition: ivy.h:73
ABC_DLL int Abc_SopIsConst0(char *pSop)
Definition: abcSop.c:676
Abc_Ntk_t * pNtk
Definition: abc.h:130
static Ivy_Obj_t * Ivy_NotCond(Ivy_Obj_t *p, int c)
Definition: ivy.h:195
#define assert(ex)
Definition: util_old.h:213
void * pData
Definition: abc.h:145
char * Mio_GateReadSop(Mio_Gate_t *pGate)
Definition: mioApi.c:153
Ivy_Obj_t * Ivy_And(Ivy_Man_t *p, Ivy_Obj_t *p0, Ivy_Obj_t *p1)
Definition: ivyOper.c:84
Ivy_Obj_t * Abc_NodeStrashAigExorAig ( Ivy_Man_t pMan,
Abc_Obj_t pNode,
char *  pSop 
)
static

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

Synopsis [Strashed n-input XOR function.]

Description []

SideEffects []

SeeAlso []

Definition at line 1052 of file abcIvy.c.

1053 {
1054  Abc_Obj_t * pFanin;
1055  Ivy_Obj_t * pSum;
1056  int i, nFanins;
1057  // get the number of node's fanins
1058  nFanins = Abc_ObjFaninNum( pNode );
1059  assert( nFanins == Abc_SopGetVarNum(pSop) );
1060  // go through the cubes of the node's SOP
1061  pSum = Ivy_Not( Ivy_ManConst1(pMan) );
1062  for ( i = 0; i < nFanins; i++ )
1063  {
1064  pFanin = Abc_ObjFanin( pNode, i );
1065  pSum = Ivy_Exor( pMan, pSum, (Ivy_Obj_t *)pFanin->pCopy );
1066  }
1067  if ( Abc_SopIsComplement(pSop) )
1068  pSum = Ivy_Not(pSum);
1069  return pSum;
1070 }
static Ivy_Obj_t * Ivy_ManConst1(Ivy_Man_t *p)
Definition: ivy.h:199
static int Abc_ObjFaninNum(Abc_Obj_t *pObj)
Definition: abc.h:364
Ivy_Obj_t * Ivy_Exor(Ivy_Man_t *p, Ivy_Obj_t *p0, Ivy_Obj_t *p1)
Definition: ivyOper.c:113
Abc_Obj_t * pCopy
Definition: abc.h:148
Definition: ivy.h:73
static Ivy_Obj_t * Ivy_Not(Ivy_Obj_t *p)
Definition: ivy.h:194
ABC_DLL int Abc_SopGetVarNum(char *pSop)
Definition: abcSop.c:536
#define assert(ex)
Definition: util_old.h:213
static Abc_Obj_t * Abc_ObjFanin(Abc_Obj_t *pObj, int i)
Definition: abc.h:372
ABC_DLL int Abc_SopIsComplement(char *pSop)
Definition: abcSop.c:655
Ivy_Obj_t * Abc_NodeStrashAigFactorAig ( Ivy_Man_t pMan,
Abc_Obj_t pRoot,
char *  pSop 
)
static

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

Synopsis [Strashes one logic node using its SOP.]

Description []

SideEffects []

SeeAlso []

Definition at line 1083 of file abcIvy.c.

1084 {
1085  Dec_Graph_t * pFForm;
1086  Dec_Node_t * pNode;
1087  Ivy_Obj_t * pAnd;
1088  int i;
1089 
1090 // extern Ivy_Obj_t * Dec_GraphToNetworkAig( Ivy_Man_t * pMan, Dec_Graph_t * pGraph );
1091 
1092 // assert( 0 );
1093 
1094  // perform factoring
1095  pFForm = Dec_Factor( pSop );
1096  // collect the fanins
1097  Dec_GraphForEachLeaf( pFForm, pNode, i )
1098  pNode->pFunc = Abc_ObjFanin(pRoot,i)->pCopy;
1099  // perform strashing
1100 // pAnd = Dec_GraphToNetworkAig( pMan, pFForm );
1101  pAnd = Dec_GraphToNetworkIvy( pMan, pFForm );
1102 // pAnd = NULL;
1103 
1104  Dec_GraphFree( pFForm );
1105  return pAnd;
1106 }
Ivy_Obj_t * Dec_GraphToNetworkIvy(Ivy_Man_t *pMan, Dec_Graph_t *pGraph)
Definition: decAbc.c:329
Dec_Graph_t * Dec_Factor(char *pSop)
FUNCTION DECLARATIONS ///.
Definition: decFactor.c:55
Definition: ivy.h:73
#define Dec_GraphForEachLeaf(pGraph, pLeaf, i)
ITERATORS ///.
Definition: dec.h:98
static void Dec_GraphFree(Dec_Graph_t *pGraph)
Definition: dec.h:307
static Abc_Obj_t * Abc_ObjFanin(Abc_Obj_t *pObj, int i)
Definition: abc.h:372
Ivy_Obj_t * Abc_NodeStrashAigSopAig ( Ivy_Man_t pMan,
Abc_Obj_t pNode,
char *  pSop 
)
static

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

Synopsis [Strashes one logic node using its SOP.]

Description []

SideEffects []

SeeAlso []

Definition at line 1005 of file abcIvy.c.

1006 {
1007  Abc_Obj_t * pFanin;
1008  Ivy_Obj_t * pAnd, * pSum;
1009  char * pCube;
1010  int i, nFanins;
1011  int fExor = Abc_SopIsExorType(pSop);
1012 
1013  // get the number of node's fanins
1014  nFanins = Abc_ObjFaninNum( pNode );
1015  assert( nFanins == Abc_SopGetVarNum(pSop) );
1016  // go through the cubes of the node's SOP
1017  pSum = Ivy_Not( Ivy_ManConst1(pMan) );
1018  Abc_SopForEachCube( pSop, nFanins, pCube )
1019  {
1020  // create the AND of literals
1021  pAnd = Ivy_ManConst1(pMan);
1022  Abc_ObjForEachFanin( pNode, pFanin, i ) // pFanin can be a net
1023  {
1024  if ( pCube[i] == '1' )
1025  pAnd = Ivy_And( pMan, pAnd, (Ivy_Obj_t *)pFanin->pCopy );
1026  else if ( pCube[i] == '0' )
1027  pAnd = Ivy_And( pMan, pAnd, Ivy_Not((Ivy_Obj_t *)pFanin->pCopy) );
1028  }
1029  // add to the sum of cubes
1030  if ( fExor )
1031  pSum = Ivy_Exor( pMan, pSum, pAnd );
1032  else
1033  pSum = Ivy_Or( pMan, pSum, pAnd );
1034  }
1035  // decide whether to complement the result
1036  if ( Abc_SopIsComplement(pSop) )
1037  pSum = Ivy_Not(pSum);
1038  return pSum;
1039 }
static Ivy_Obj_t * Ivy_ManConst1(Ivy_Man_t *p)
Definition: ivy.h:199
#define Abc_SopForEachCube(pSop, nFanins, pCube)
Definition: abc.h:531
static int Abc_ObjFaninNum(Abc_Obj_t *pObj)
Definition: abc.h:364
Ivy_Obj_t * Ivy_Exor(Ivy_Man_t *p, Ivy_Obj_t *p0, Ivy_Obj_t *p1)
Definition: ivyOper.c:113
ABC_DLL int Abc_SopIsExorType(char *pSop)
Definition: abcSop.c:802
Ivy_Obj_t * Ivy_Or(Ivy_Man_t *p, Ivy_Obj_t *p0, Ivy_Obj_t *p1)
Definition: ivyOper.c:142
Abc_Obj_t * pCopy
Definition: abc.h:148
Definition: ivy.h:73
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition: abc.h:524
static Ivy_Obj_t * Ivy_Not(Ivy_Obj_t *p)
Definition: ivy.h:194
ABC_DLL int Abc_SopGetVarNum(char *pSop)
Definition: abcSop.c:536
#define assert(ex)
Definition: util_old.h:213
ABC_DLL int Abc_SopIsComplement(char *pSop)
Definition: abcSop.c:655
Ivy_Obj_t * Ivy_And(Ivy_Man_t *p, Ivy_Obj_t *p0, Ivy_Obj_t *p1)
Definition: ivyOper.c:84
Vec_Int_t * Abc_NtkCollectLatchValuesIvy ( Abc_Ntk_t pNtk,
int  fUseDcs 
)
static

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

Synopsis [Strashes one logic node using its SOP.]

Description []

SideEffects []

SeeAlso []

Definition at line 1119 of file abcIvy.c.

1120 {
1121  Abc_Obj_t * pLatch;
1122  Vec_Int_t * vArray;
1123  int i;
1124  vArray = Vec_IntAlloc( Abc_NtkLatchNum(pNtk) );
1125  Abc_NtkForEachLatch( pNtk, pLatch, i )
1126  {
1127  if ( fUseDcs || Abc_LatchIsInitDc(pLatch) )
1128  Vec_IntPush( vArray, IVY_INIT_DC );
1129  else if ( Abc_LatchIsInit1(pLatch) )
1130  Vec_IntPush( vArray, IVY_INIT_1 );
1131  else if ( Abc_LatchIsInit0(pLatch) )
1132  Vec_IntPush( vArray, IVY_INIT_0 );
1133  else assert( 0 );
1134  }
1135  return vArray;
1136 }
Definition: ivy.h:68
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
static int Abc_LatchIsInit0(Abc_Obj_t *pLatch)
Definition: abc.h:422
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
static int Abc_LatchIsInitDc(Abc_Obj_t *pLatch)
Definition: abc.h:424
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
#define Abc_NtkForEachLatch(pNtk, pObj, i)
Definition: abc.h:497
static int Abc_LatchIsInit1(Abc_Obj_t *pLatch)
Definition: abc.h:423
Definition: ivy.h:67
#define assert(ex)
Definition: util_old.h:213
Abc_Ntk_t * Abc_NtkFromIvy ( Abc_Ntk_t pNtkOld,
Ivy_Man_t pMan 
)
static

DECLARATIONS ///.

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

Synopsis [Converts the network from the AIG manager into ABC.]

Description []

SideEffects []

SeeAlso []

Definition at line 738 of file abcIvy.c.

739 {
740  Vec_Int_t * vNodes;
741  Abc_Ntk_t * pNtk;
742  Abc_Obj_t * pObj, * pObjNew, * pFaninNew, * pFaninNew0, * pFaninNew1;
743  Ivy_Obj_t * pNode;
744  int i;
745  // perform strashing
746  pNtk = Abc_NtkStartFrom( pNtkOld, ABC_NTK_STRASH, ABC_FUNC_AIG );
747  // transfer the pointers to the basic nodes
749  Abc_NtkForEachCi( pNtkOld, pObj, i )
750  Ivy_ManPi(pMan, i)->TravId = Abc_EdgeFromNode( pObj->pCopy );
751  // rebuild the AIG
752  vNodes = Ivy_ManDfs( pMan );
753  Ivy_ManForEachNodeVec( pMan, vNodes, pNode, i )
754  {
755  // add the first fanin
756  pFaninNew0 = Abc_ObjFanin0Ivy( pNtk, pNode );
757  if ( Ivy_ObjIsBuf(pNode) )
758  {
759  pNode->TravId = Abc_EdgeFromNode( pFaninNew0 );
760  continue;
761  }
762  // add the second fanin
763  pFaninNew1 = Abc_ObjFanin1Ivy( pNtk, pNode );
764  // create the new node
765  if ( Ivy_ObjIsExor(pNode) )
766  pObjNew = Abc_AigXor( (Abc_Aig_t *)pNtk->pManFunc, pFaninNew0, pFaninNew1 );
767  else
768  pObjNew = Abc_AigAnd( (Abc_Aig_t *)pNtk->pManFunc, pFaninNew0, pFaninNew1 );
769  pNode->TravId = Abc_EdgeFromNode( pObjNew );
770  }
771  // connect the PO nodes
772  Abc_NtkForEachCo( pNtkOld, pObj, i )
773  {
774  pFaninNew = Abc_ObjFanin0Ivy( pNtk, Ivy_ManPo(pMan, i) );
775  Abc_ObjAddFanin( pObj->pCopy, pFaninNew );
776  }
777  Vec_IntFree( vNodes );
778  if ( !Abc_NtkCheck( pNtk ) )
779  fprintf( stdout, "Abc_NtkFromIvy(): Network check has failed.\n" );
780  return pNtk;
781 }
int TravId
Definition: ivy.h:76
static Ivy_Obj_t * Ivy_ManConst1(Ivy_Man_t *p)
Definition: ivy.h:199
static Abc_Edge_t Abc_EdgeFromNode(Abc_Obj_t *pNode)
Definition: abcIvy.c:59
static Ivy_Obj_t * Ivy_ManPi(Ivy_Man_t *p, int i)
Definition: ivy.h:201
ABC_DLL Abc_Obj_t * Abc_AigConst1(Abc_Ntk_t *pNtk)
Definition: abcAig.c:683
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
Vec_Int_t * Ivy_ManDfs(Ivy_Man_t *p)
Definition: ivyDfs.c:87
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition: abc.h:519
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition: abcCheck.c:61
DECLARATIONS ///.
Definition: abcAig.c:52
ABC_DLL void Abc_ObjAddFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
Definition: abcFanio.c:84
ABC_DLL Abc_Obj_t * Abc_AigXor(Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1)
Definition: abcAig.c:735
void * pManFunc
Definition: abc.h:191
ABC_DLL Abc_Obj_t * Abc_AigAnd(Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1)
Definition: abcAig.c:700
ABC_DLL Abc_Ntk_t * Abc_NtkStartFrom(Abc_Ntk_t *pNtk, Abc_NtkType_t Type, Abc_NtkFunc_t Func)
Definition: abcNtk.c:106
Abc_Obj_t * pCopy
Definition: abc.h:148
static Abc_Obj_t * Abc_ObjFanin0Ivy(Abc_Ntk_t *p, Ivy_Obj_t *pObj)
Definition: abcIvy.c:62
Definition: ivy.h:73
static Abc_Obj_t * Abc_ObjFanin1Ivy(Abc_Ntk_t *p, Ivy_Obj_t *pObj)
Definition: abcIvy.c:63
static int Ivy_ObjIsExor(Ivy_Obj_t *pObj)
Definition: ivy.h:243
#define Abc_NtkForEachCi(pNtk, pCi, i)
Definition: abc.h:515
#define Ivy_ManForEachNodeVec(p, vIds, pObj, i)
Definition: ivy.h:408
static int Ivy_ObjIsBuf(Ivy_Obj_t *pObj)
Definition: ivy.h:244
static Ivy_Obj_t * Ivy_ManPo(Ivy_Man_t *p, int i)
Definition: ivy.h:202
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
Abc_Ntk_t * Abc_NtkFromIvySeq ( Abc_Ntk_t pNtkOld,
Ivy_Man_t pMan,
int  fHaig 
)
static

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

Synopsis [Converts the network from the AIG manager into ABC.]

Description []

SideEffects []

SeeAlso []

Definition at line 794 of file abcIvy.c.

795 {
796  Vec_Int_t * vNodes, * vLatches;
797  Abc_Ntk_t * pNtk;
798  Abc_Obj_t * pObj, * pObjNew, * pFaninNew, * pFaninNew0, * pFaninNew1;
799  Ivy_Obj_t * pNode, * pTemp;
800  int i;
801 // assert( Ivy_ManLatchNum(pMan) > 0 );
802  // perform strashing
804  // transfer the pointers to the basic nodes
806  Abc_NtkForEachPi( pNtkOld, pObj, i )
807  Ivy_ManPi(pMan, i)->TravId = Abc_EdgeFromNode( pObj->pCopy );
808  // create latches of the new network
809  vNodes = Ivy_ManDfsSeq( pMan, &vLatches );
810  Ivy_ManForEachNodeVec( pMan, vLatches, pNode, i )
811  {
812  pObjNew = Abc_NtkCreateLatch( pNtk );
813  pFaninNew0 = Abc_NtkCreateBi( pNtk );
814  pFaninNew1 = Abc_NtkCreateBo( pNtk );
815  Abc_ObjAddFanin( pObjNew, pFaninNew0 );
816  Abc_ObjAddFanin( pFaninNew1, pObjNew );
817  if ( fHaig || Ivy_ObjInit(pNode) == IVY_INIT_DC )
818  Abc_LatchSetInitDc( pObjNew );
819  else if ( Ivy_ObjInit(pNode) == IVY_INIT_1 )
820  Abc_LatchSetInit1( pObjNew );
821  else if ( Ivy_ObjInit(pNode) == IVY_INIT_0 )
822  Abc_LatchSetInit0( pObjNew );
823  else assert( 0 );
824  pNode->TravId = Abc_EdgeFromNode( pFaninNew1 );
825  }
826  Abc_NtkAddDummyBoxNames( pNtk );
827  // rebuild the AIG
828  Ivy_ManForEachNodeVec( pMan, vNodes, pNode, i )
829  {
830  // add the first fanin
831  pFaninNew0 = Abc_ObjFanin0Ivy( pNtk, pNode );
832  if ( Ivy_ObjIsBuf(pNode) )
833  {
834  pNode->TravId = Abc_EdgeFromNode( pFaninNew0 );
835  continue;
836  }
837  // add the second fanin
838  pFaninNew1 = Abc_ObjFanin1Ivy( pNtk, pNode );
839  // create the new node
840  if ( Ivy_ObjIsExor(pNode) )
841  pObjNew = Abc_AigXor( (Abc_Aig_t *)pNtk->pManFunc, pFaninNew0, pFaninNew1 );
842  else
843  pObjNew = Abc_AigAnd( (Abc_Aig_t *)pNtk->pManFunc, pFaninNew0, pFaninNew1 );
844  pNode->TravId = Abc_EdgeFromNode( pObjNew );
845  // process the choice nodes
846  if ( fHaig && pNode->pEquiv && Ivy_ObjRefs(pNode) > 0 )
847  {
848  pFaninNew = Abc_EdgeToNode( pNtk, pNode->TravId );
849 // pFaninNew->fPhase = 0;
850  assert( !Ivy_IsComplement(pNode->pEquiv) );
851  for ( pTemp = pNode->pEquiv; pTemp != pNode; pTemp = Ivy_Regular(pTemp->pEquiv) )
852  {
853  pFaninNew1 = Abc_EdgeToNode( pNtk, pTemp->TravId );
854 // pFaninNew1->fPhase = Ivy_IsComplement( pTemp->pEquiv );
855  pFaninNew->pData = pFaninNew1;
856  pFaninNew = pFaninNew1;
857  }
858  pFaninNew->pData = NULL;
859 // printf( "Writing choice node %d.\n", pNode->Id );
860  }
861  }
862  // connect the PO nodes
863  Abc_NtkForEachPo( pNtkOld, pObj, i )
864  {
865  pFaninNew = Abc_ObjFanin0Ivy( pNtk, Ivy_ManPo(pMan, i) );
866  Abc_ObjAddFanin( pObj->pCopy, pFaninNew );
867  }
868  // connect the latches
869  Ivy_ManForEachNodeVec( pMan, vLatches, pNode, i )
870  {
871  pFaninNew = Abc_ObjFanin0Ivy( pNtk, pNode );
872  Abc_ObjAddFanin( Abc_ObjFanin0(Abc_NtkBox(pNtk, i)), pFaninNew );
873  }
874  Vec_IntFree( vLatches );
875  Vec_IntFree( vNodes );
876  if ( !Abc_NtkCheck( pNtk ) )
877  fprintf( stdout, "Abc_NtkFromIvySeq(): Network check has failed.\n" );
878  return pNtk;
879 }
int TravId
Definition: ivy.h:76
static int Ivy_IsComplement(Ivy_Obj_t *p)
Definition: ivy.h:196
Definition: ivy.h:68
static Ivy_Obj_t * Ivy_ManConst1(Ivy_Man_t *p)
Definition: ivy.h:199
static Abc_Obj_t * Abc_EdgeToNode(Abc_Ntk_t *p, Abc_Edge_t Edge)
Definition: abcIvy.c:60
static Abc_Edge_t Abc_EdgeFromNode(Abc_Obj_t *pNode)
Definition: abcIvy.c:59
static Ivy_Obj_t * Ivy_ManPi(Ivy_Man_t *p, int i)
Definition: ivy.h:201
ABC_DLL Abc_Obj_t * Abc_AigConst1(Abc_Ntk_t *pNtk)
Definition: abcAig.c:683
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition: abcCheck.c:61
static void Abc_LatchSetInitDc(Abc_Obj_t *pLatch)
Definition: abc.h:420
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
Definition: abc.h:373
DECLARATIONS ///.
Definition: abcAig.c:52
ABC_DLL void Abc_ObjAddFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
Definition: abcFanio.c:84
Vec_Int_t * Ivy_ManDfsSeq(Ivy_Man_t *p, Vec_Int_t **pvLatches)
Definition: ivyDfs.c:121
ABC_DLL Abc_Obj_t * Abc_AigXor(Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1)
Definition: abcAig.c:735
static Abc_Obj_t * Abc_NtkCreateBo(Abc_Ntk_t *pNtk)
Definition: abc.h:306
void * pManFunc
Definition: abc.h:191
ABC_DLL Abc_Obj_t * Abc_AigAnd(Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1)
Definition: abcAig.c:700
Abc_Obj_t * pCopy
Definition: abc.h:148
static Abc_Obj_t * Abc_ObjFanin0Ivy(Abc_Ntk_t *p, Ivy_Obj_t *pObj)
Definition: abcIvy.c:62
static int Ivy_ObjRefs(Ivy_Obj_t *pObj)
Definition: ivy.h:264
Definition: ivy.h:73
ABC_DLL void Abc_NtkAddDummyBoxNames(Abc_Ntk_t *pNtk)
Definition: abcNames.c:418
static Ivy_Obj_t * Ivy_Regular(Ivy_Obj_t *p)
Definition: ivy.h:193
static Abc_Obj_t * Abc_ObjFanin1Ivy(Abc_Ntk_t *p, Ivy_Obj_t *pObj)
Definition: abcIvy.c:63
static Abc_Obj_t * Abc_NtkCreateLatch(Abc_Ntk_t *pNtk)
Definition: abc.h:309
static Abc_Obj_t * Abc_NtkBox(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:319
static void Abc_LatchSetInit1(Abc_Obj_t *pLatch)
Definition: abc.h:419
static int Ivy_ObjIsExor(Ivy_Obj_t *pObj)
Definition: ivy.h:243
ABC_DLL Abc_Ntk_t * Abc_NtkStartFromNoLatches(Abc_Ntk_t *pNtk, Abc_NtkType_t Type, Abc_NtkFunc_t Func)
Definition: abcNtk.c:248
#define Ivy_ManForEachNodeVec(p, vIds, pObj, i)
Definition: ivy.h:408
static int Ivy_ObjIsBuf(Ivy_Obj_t *pObj)
Definition: ivy.h:244
Definition: ivy.h:67
#define assert(ex)
Definition: util_old.h:213
static Ivy_Obj_t * Ivy_ManPo(Ivy_Man_t *p, int i)
Definition: ivy.h:202
void * pData
Definition: abc.h:145
#define Abc_NtkForEachPo(pNtk, pPo, i)
Definition: abc.h:517
static Abc_Obj_t * Abc_NtkCreateBi(Abc_Ntk_t *pNtk)
Definition: abc.h:305
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
static void Abc_LatchSetInit0(Abc_Obj_t *pLatch)
Definition: abc.h:418
static Ivy_Init_t Ivy_ObjInit(Ivy_Obj_t *pObj)
Definition: ivy.h:232
#define Abc_NtkForEachPi(pNtk, pPi, i)
Definition: abc.h:513
Ivy_Obj_t * pEquiv
Definition: ivy.h:93
Abc_Ntk_t* Abc_NtkIvy ( Abc_Ntk_t pNtk)

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

Synopsis [Gives the current ABC network to AIG manager for processing.]

Description []

SideEffects []

SeeAlso []

Definition at line 625 of file abcIvy.c.

626 {
627 // Abc_Ntk_t * pNtkAig;
628  Ivy_Man_t * pMan;//, * pTemp;
629 // int fCleanup = 1;
630 // int nNodes;
631 // int nLatches = Abc_NtkLatchNum(pNtk);
632  Vec_Int_t * vInit = Abc_NtkCollectLatchValuesIvy( pNtk, 0 );
633 
634  assert( !Abc_NtkIsNetlist(pNtk) );
635  if ( Abc_NtkIsBddLogic(pNtk) )
636  {
637  if ( !Abc_NtkBddToSop(pNtk, 0) )
638  {
639  Vec_IntFree( vInit );
640  printf( "Abc_NtkIvy(): Converting to SOPs has failed.\n" );
641  return NULL;
642  }
643  }
644  if ( Abc_NtkCountSelfFeedLatches(pNtk) )
645  {
646  printf( "Warning: The network has %d self-feeding latches. Quitting.\n", Abc_NtkCountSelfFeedLatches(pNtk) );
647  return NULL;
648  }
649 
650  // print warning about choice nodes
651  if ( Abc_NtkGetChoiceNum( pNtk ) )
652  printf( "Warning: The choice nodes in the initial AIG are removed by strashing.\n" );
653 
654  // convert to the AIG manager
655  pMan = Abc_NtkToIvy( pNtk );
656  if ( !Ivy_ManCheck( pMan ) )
657  {
658  Vec_IntFree( vInit );
659  printf( "AIG check has failed.\n" );
660  Ivy_ManStop( pMan );
661  return NULL;
662  }
663 
664 // Ivy_MffcTest( pMan );
665 // Ivy_ManPrintStats( pMan );
666 
667 // pMan = Ivy_ManBalance( pTemp = pMan, 1 );
668 // Ivy_ManStop( pTemp );
669 
670 // Ivy_ManSeqRewrite( pMan, 0, 0 );
671 // Ivy_ManTestCutsAlg( pMan );
672 // Ivy_ManTestCutsBool( pMan );
673 // Ivy_ManRewriteAlg( pMan, 1, 1 );
674 
675 // pMan = Ivy_ManResyn( pTemp = pMan, 1, 0 );
676 // Ivy_ManStop( pTemp );
677 
678 // Ivy_ManTestCutsAll( pMan );
679 // Ivy_ManTestCutsTravAll( pMan );
680 
681 // Ivy_ManPrintStats( pMan );
682 
683 // Ivy_ManPrintStats( pMan );
684 // Ivy_ManRewritePre( pMan, 1, 0, 0 );
685 // Ivy_ManPrintStats( pMan );
686 // printf( "\n" );
687 
688 // Ivy_ManPrintStats( pMan );
689 // Ivy_ManMakeSeq( pMan, nLatches, pInit );
690 // Ivy_ManPrintStats( pMan );
691 
692 // Ivy_ManRequiredLevels( pMan );
693 
694 // Ivy_FastMapPerform( pMan, 8 );
695  Ivy_ManStop( pMan );
696  return NULL;
697 
698 
699 /*
700  // convert from the AIG manager
701  pNtkAig = Abc_NtkFromIvy( pNtk, pMan );
702 // pNtkAig = Abc_NtkFromIvySeq( pNtk, pMan );
703  Ivy_ManStop( pMan );
704 
705  // report the cleanup results
706  if ( fCleanup && (nNodes = Abc_AigCleanup(pNtkAig->pManFunc)) )
707  printf( "Warning: AIG cleanup removed %d nodes (this is not a bug).\n", nNodes );
708  // duplicate EXDC
709  if ( pNtk->pExdc )
710  pNtkAig->pExdc = Abc_NtkDup( pNtk->pExdc );
711  // make sure everything is okay
712  if ( !Abc_NtkCheck( pNtkAig ) )
713  {
714  ABC_FREE( pInit );
715  printf( "Abc_NtkStrash: The network check has failed.\n" );
716  Abc_NtkDelete( pNtkAig );
717  return NULL;
718  }
719 
720  ABC_FREE( pInit );
721  return pNtkAig;
722 */
723 }
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static int Abc_NtkIsNetlist(Abc_Ntk_t *pNtk)
Definition: abc.h:249
ABC_DLL int Abc_NtkGetChoiceNum(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:430
void Ivy_ManStop(Ivy_Man_t *p)
Definition: ivyMan.c:238
static Vec_Int_t * Abc_NtkCollectLatchValuesIvy(Abc_Ntk_t *pNtk, int fUseDcs)
Definition: abcIvy.c:1119
static Ivy_Man_t * Abc_NtkToIvy(Abc_Ntk_t *pNtkOld)
Definition: abcIvy.c:892
typedefABC_NAMESPACE_HEADER_START struct Ivy_Man_t_ Ivy_Man_t
INCLUDES ///.
Definition: ivy.h:46
ABC_DLL int Abc_NtkBddToSop(Abc_Ntk_t *pNtk, int fDirect)
Definition: abcFunc.c:359
static int Abc_NtkIsBddLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:265
#define assert(ex)
Definition: util_old.h:213
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
ABC_DLL int Abc_NtkCountSelfFeedLatches(Abc_Ntk_t *pNtk)
Definition: abcLatch.c:89
int Ivy_ManCheck(Ivy_Man_t *p)
DECLARATIONS ///.
Definition: ivyCheck.c:45
Abc_Ntk_t* Abc_NtkIvyAfter ( Abc_Ntk_t pNtk,
Ivy_Man_t pMan,
int  fSeq,
int  fHaig 
)

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

Synopsis [Prepares the IVY package.]

Description []

SideEffects []

SeeAlso []

Definition at line 137 of file abcIvy.c.

138 {
139  Abc_Ntk_t * pNtkAig;
140  int nNodes, fCleanup = 1;
141  // convert from the AIG manager
142  if ( fSeq )
143  pNtkAig = Abc_NtkFromIvySeq( pNtk, pMan, fHaig );
144  else
145  pNtkAig = Abc_NtkFromIvy( pNtk, pMan );
146  // report the cleanup results
147  if ( !fHaig && fCleanup && (nNodes = Abc_AigCleanup((Abc_Aig_t *)pNtkAig->pManFunc)) )
148  printf( "Warning: AIG cleanup removed %d nodes (this is not a bug).\n", nNodes );
149  // duplicate EXDC
150  if ( pNtk->pExdc )
151  pNtkAig->pExdc = Abc_NtkDup( pNtk->pExdc );
152  // make sure everything is okay
153  if ( !Abc_NtkCheck( pNtkAig ) )
154  {
155  printf( "Abc_NtkStrash: The network check has failed.\n" );
156  Abc_NtkDelete( pNtkAig );
157  return NULL;
158  }
159  return pNtkAig;
160 }
Abc_Ntk_t * pExdc
Definition: abc.h:201
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:419
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition: abcCheck.c:61
DECLARATIONS ///.
Definition: abcAig.c:52
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
void * pManFunc
Definition: abc.h:191
ABC_DLL int Abc_AigCleanup(Abc_Aig_t *pMan)
Definition: abcAig.c:194
static Abc_Ntk_t * Abc_NtkFromIvySeq(Abc_Ntk_t *pNtkOld, Ivy_Man_t *pMan, int fHaig)
Definition: abcIvy.c:794
static Abc_Ntk_t * Abc_NtkFromIvy(Abc_Ntk_t *pNtkOld, Ivy_Man_t *pMan)
DECLARATIONS ///.
Definition: abcIvy.c:738
Ivy_Man_t* Abc_NtkIvyBefore ( Abc_Ntk_t pNtk,
int  fSeq,
int  fUseDc 
)

FUNCTION DEFINITIONS ///.

DECLARATIONS ///.

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

Synopsis [Prepares the IVY package.]

Description []

SideEffects []

SeeAlso []

Definition at line 84 of file abcIvy.c.

85 {
86  Ivy_Man_t * pMan;
87 //timeRetime = Abc_Clock();
88  assert( !Abc_NtkIsNetlist(pNtk) );
89  if ( Abc_NtkIsBddLogic(pNtk) )
90  {
91  if ( !Abc_NtkBddToSop(pNtk, 0) )
92  {
93  printf( "Abc_NtkIvyBefore(): Converting to SOPs has failed.\n" );
94  return NULL;
95  }
96  }
97  if ( fSeq && Abc_NtkCountSelfFeedLatches(pNtk) )
98  {
99  printf( "Warning: The network has %d self-feeding latches.\n", Abc_NtkCountSelfFeedLatches(pNtk) );
100 // return NULL;
101  }
102  // print warning about choice nodes
103  if ( Abc_NtkGetChoiceNum( pNtk ) )
104  printf( "Warning: The choice nodes in the initial AIG are removed by strashing.\n" );
105  // convert to the AIG manager
106  pMan = Abc_NtkToIvy( pNtk );
107  if ( !Ivy_ManCheck( pMan ) )
108  {
109  printf( "AIG check has failed.\n" );
110  Ivy_ManStop( pMan );
111  return NULL;
112  }
113 // Ivy_ManPrintStats( pMan );
114  if ( fSeq )
115  {
116  int nLatches = Abc_NtkLatchNum(pNtk);
117  Vec_Int_t * vInit = Abc_NtkCollectLatchValuesIvy( pNtk, fUseDc );
118  Ivy_ManMakeSeq( pMan, nLatches, vInit->pArray );
119  Vec_IntFree( vInit );
120 // Ivy_ManPrintStats( pMan );
121  }
122 //timeRetime = Abc_Clock() - timeRetime;
123  return pMan;
124 }
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static int Abc_NtkIsNetlist(Abc_Ntk_t *pNtk)
Definition: abc.h:249
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
void Ivy_ManMakeSeq(Ivy_Man_t *p, int nLatches, int *pInits)
Definition: ivyMan.c:482
ABC_DLL int Abc_NtkGetChoiceNum(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:430
void Ivy_ManStop(Ivy_Man_t *p)
Definition: ivyMan.c:238
static Vec_Int_t * Abc_NtkCollectLatchValuesIvy(Abc_Ntk_t *pNtk, int fUseDcs)
Definition: abcIvy.c:1119
static Ivy_Man_t * Abc_NtkToIvy(Abc_Ntk_t *pNtkOld)
Definition: abcIvy.c:892
typedefABC_NAMESPACE_HEADER_START struct Ivy_Man_t_ Ivy_Man_t
INCLUDES ///.
Definition: ivy.h:46
ABC_DLL int Abc_NtkBddToSop(Abc_Ntk_t *pNtk, int fDirect)
Definition: abcFunc.c:359
static int Abc_NtkIsBddLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:265
#define assert(ex)
Definition: util_old.h:213
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
ABC_DLL int Abc_NtkCountSelfFeedLatches(Abc_Ntk_t *pNtk)
Definition: abcLatch.c:89
int Ivy_ManCheck(Ivy_Man_t *p)
DECLARATIONS ///.
Definition: ivyCheck.c:45
void Abc_NtkIvyCuts ( Abc_Ntk_t pNtk,
int  nInputs 
)

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

Synopsis [Gives the current ABC network to AIG manager for processing.]

Description []

SideEffects []

SeeAlso []

Definition at line 264 of file abcIvy.c.

265 {
266  Ivy_Man_t * pMan;
267  pMan = Abc_NtkIvyBefore( pNtk, 1, 0 );
268  if ( pMan == NULL )
269  return;
270  Ivy_CutComputeAll( pMan, nInputs );
271  Ivy_ManStop( pMan );
272 }
void Ivy_ManStop(Ivy_Man_t *p)
Definition: ivyMan.c:238
typedefABC_NAMESPACE_HEADER_START struct Ivy_Man_t_ Ivy_Man_t
INCLUDES ///.
Definition: ivy.h:46
Ivy_Man_t * Abc_NtkIvyBefore(Abc_Ntk_t *pNtk, int fSeq, int fUseDc)
FUNCTION DEFINITIONS ///.
Definition: abcIvy.c:84
void Ivy_CutComputeAll(Ivy_Man_t *p, int nInputs)
Definition: ivySeq.c:1108
Abc_Ntk_t* Abc_NtkIvyFraig ( Abc_Ntk_t pNtk,
int  nConfLimit,
int  fDoSparse,
int  fProve,
int  fTransfer,
int  fVerbose 
)

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

Synopsis [Gives the current ABC network to AIG manager for processing.]

Description []

SideEffects []

SeeAlso []

Definition at line 456 of file abcIvy.c.

457 {
458  Ivy_FraigParams_t Params, * pParams = &Params;
459  Abc_Ntk_t * pNtkAig;
460  Ivy_Man_t * pMan, * pTemp;
461  pMan = Abc_NtkIvyBefore( pNtk, 0, 0 );
462  if ( pMan == NULL )
463  return NULL;
464  Ivy_FraigParamsDefault( pParams );
465  pParams->nBTLimitNode = nConfLimit;
466  pParams->fVerbose = fVerbose;
467  pParams->fProve = fProve;
468  pParams->fDoSparse = fDoSparse;
469  pMan = Ivy_FraigPerform( pTemp = pMan, pParams );
470  // transfer the pointers
471  if ( fTransfer == 1 )
472  {
473  Vec_Ptr_t * vCopies;
474  vCopies = Abc_NtkSaveCopy( pNtk );
475  pNtkAig = Abc_NtkIvyAfter( pNtk, pMan, 0, 0 );
476  Abc_NtkLoadCopy( pNtk, vCopies );
477  Vec_PtrFree( vCopies );
478  Abc_NtkTransferPointers( pNtk, pNtkAig );
479  }
480  else
481  pNtkAig = Abc_NtkIvyAfter( pNtk, pMan, 0, 0 );
482  Ivy_ManStop( pTemp );
483  Ivy_ManStop( pMan );
484  return pNtkAig;
485 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
void Ivy_FraigParamsDefault(Ivy_FraigParams_t *pParams)
FUNCTION DEFINITIONS ///.
Definition: ivyFraig.c:225
int nBTLimitNode
Definition: ivy.h:143
void Ivy_ManStop(Ivy_Man_t *p)
Definition: ivyMan.c:238
typedefABC_NAMESPACE_HEADER_START struct Ivy_Man_t_ Ivy_Man_t
INCLUDES ///.
Definition: ivy.h:46
void Abc_NtkTransferPointers(Abc_Ntk_t *pNtk, Abc_Ntk_t *pNtkAig)
Definition: abcIvy.c:419
Ivy_Man_t * Abc_NtkIvyBefore(Abc_Ntk_t *pNtk, int fSeq, int fUseDc)
FUNCTION DEFINITIONS ///.
Definition: abcIvy.c:84
ABC_DLL Vec_Ptr_t * Abc_NtkSaveCopy(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:595
Ivy_Man_t * Ivy_FraigPerform(Ivy_Man_t *pManAig, Ivy_FraigParams_t *pParams)
Definition: ivyFraig.c:451
ABC_DLL void Abc_NtkLoadCopy(Abc_Ntk_t *pNtk, Vec_Ptr_t *vCopies)
Definition: abcUtil.c:617
Abc_Ntk_t * Abc_NtkIvyAfter(Abc_Ntk_t *pNtk, Ivy_Man_t *pMan, int fSeq, int fHaig)
Definition: abcIvy.c:137
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
Abc_Ntk_t* Abc_NtkIvyHaig ( Abc_Ntk_t pNtk,
int  nIters,
int  fUseZeroCost,
int  fVerbose 
)

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

Synopsis [Gives the current ABC network to AIG manager for processing.]

Description []

SideEffects []

SeeAlso []

Definition at line 196 of file abcIvy.c.

197 {
198  Abc_Ntk_t * pNtkAig;
199  Ivy_Man_t * pMan;
200  abctime clk;
201 // int i;
202 /*
203 extern int nMoves;
204 extern int nMovesS;
205 extern int nClauses;
206 extern int timeInv;
207 
208 nMoves = 0;
209 nMovesS = 0;
210 nClauses = 0;
211 timeInv = 0;
212 */
213  pMan = Abc_NtkIvyBefore( pNtk, 1, 1 );
214  if ( pMan == NULL )
215  return NULL;
216 //timeRetime = Abc_Clock();
217 
218 clk = Abc_Clock();
219  Ivy_ManHaigStart( pMan, fVerbose );
220 // Ivy_ManRewriteSeq( pMan, 0, 0 );
221 // for ( i = 0; i < nIters; i++ )
222 // Ivy_ManRewriteSeq( pMan, fUseZeroCost, 0 );
223 
224 //printf( "%d ", Ivy_ManNodeNum(pMan) );
225  Ivy_ManRewriteSeq( pMan, 0, 0 );
226  Ivy_ManRewriteSeq( pMan, 0, 0 );
227  Ivy_ManRewriteSeq( pMan, 1, 0 );
228 //printf( "%d ", Ivy_ManNodeNum(pMan) );
229 //printf( "%d ", Ivy_ManNodeNum(pMan->pHaig) );
230 //ABC_PRT( " ", Abc_Clock() - clk );
231 //printf( "\n" );
232 /*
233  printf( "Moves = %d. ", nMoves );
234  printf( "MovesS = %d. ", nMovesS );
235  printf( "Clauses = %d. ", nClauses );
236  ABC_PRT( "Time", timeInv );
237 */
238 // Ivy_ManRewriteSeq( pMan, 1, 0 );
239 //printf( "Haig size = %d.\n", Ivy_ManNodeNum(pMan->pHaig) );
240 // Ivy_ManHaigPostprocess( pMan, fVerbose );
241 //timeRetime = Abc_Clock() - timeRetime;
242 
243  // write working AIG into the current network
244 // pNtkAig = Abc_NtkIvyAfter( pNtk, pMan, 1, 0 );
245  // write HAIG into the current network
246  pNtkAig = Abc_NtkIvyAfter( pNtk, pMan->pHaig, 1, 1 );
247 
248  Ivy_ManHaigStop( pMan );
249  Ivy_ManStop( pMan );
250  return pNtkAig;
251 }
static abctime Abc_Clock()
Definition: abc_global.h:279
void Ivy_ManStop(Ivy_Man_t *p)
Definition: ivyMan.c:238
int Ivy_ManRewriteSeq(Ivy_Man_t *p, int fUseZeroCost, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition: ivySeq.c:63
typedefABC_NAMESPACE_HEADER_START struct Ivy_Man_t_ Ivy_Man_t
INCLUDES ///.
Definition: ivy.h:46
void Ivy_ManHaigStart(Ivy_Man_t *p, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition: ivyHaig.c:94
void Ivy_ManHaigStop(Ivy_Man_t *p)
Definition: ivyHaig.c:159
Ivy_Man_t * Abc_NtkIvyBefore(Abc_Ntk_t *pNtk, int fSeq, int fUseDc)
FUNCTION DEFINITIONS ///.
Definition: abcIvy.c:84
ABC_INT64_T abctime
Definition: abc_global.h:278
Abc_Ntk_t * Abc_NtkIvyAfter(Abc_Ntk_t *pNtk, Ivy_Man_t *pMan, int fSeq, int fHaig)
Definition: abcIvy.c:137
int Abc_NtkIvyProve ( Abc_Ntk_t **  ppNtk,
void *  pPars 
)

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

Synopsis [Gives the current ABC network to AIG manager for processing.]

Description []

SideEffects []

SeeAlso []

Definition at line 498 of file abcIvy.c.

499 {
500  Prove_Params_t * pParams = (Prove_Params_t *)pPars;
501  Abc_Ntk_t * pNtk = *ppNtk, * pNtkTemp;
502  Abc_Obj_t * pObj, * pFanin;
503  Ivy_Man_t * pMan;
504  Aig_Man_t * pMan2;
505  int RetValue;
506  assert( Abc_NtkIsStrash(pNtk) || Abc_NtkIsLogic(pNtk) );
507  // experiment with various parameters settings
508 // pParams->fUseBdds = 1;
509 // pParams->fBddReorder = 1;
510 // pParams->nTotalBacktrackLimit = 10000;
511 
512  // strash the network if it is not strashed already
513  if ( !Abc_NtkIsStrash(pNtk) )
514  {
515  pNtk = Abc_NtkStrash( pNtkTemp = pNtk, 0, 1, 0 );
516  Abc_NtkDelete( pNtkTemp );
517  }
518 
519  // check the case when the 0000 simulation pattern detect the bug
520  pObj = Abc_NtkPo(pNtk,0);
521  pFanin = Abc_ObjFanin0(pObj);
522  if ( Abc_ObjFanin0(pObj)->fPhase != (unsigned)Abc_ObjFaninC0(pObj) )
523  {
524  pNtk->pModel = ABC_CALLOC( int, Abc_NtkCiNum(pNtk) );
525  return 0;
526  }
527 
528  // changed in "src\sat\fraig\fraigMan.c"
529  // pParams->nMiteringLimitStart = 300; // starting mitering limit
530  // to be
531  // pParams->nMiteringLimitStart = 5000; // starting mitering limit
532 
533  // if SAT only, solve without iteration
534 // RetValue = Abc_NtkMiterSat( pNtk, 2*(ABC_INT64_T)pParams->nMiteringLimitStart, (ABC_INT64_T)0, 0, NULL, NULL );
535  pMan2 = Abc_NtkToDar( pNtk, 0, 0 );
536  RetValue = Fra_FraigSat( pMan2, (ABC_INT64_T)pParams->nMiteringLimitStart, (ABC_INT64_T)0, 0, 0, 0, 1, 0, 0, 0 );
537  pNtk->pModel = (int *)pMan2->pData, pMan2->pData = NULL;
538  Aig_ManStop( pMan2 );
539 // pNtk->pModel = Aig_ManReleaseData( pMan2 );
540  if ( RetValue >= 0 )
541  return RetValue;
542 
543  // apply AIG rewriting
544  if ( pParams->fUseRewriting && Abc_NtkNodeNum(pNtk) > 500 )
545  {
546 // abctime clk = Abc_Clock();
547 //printf( "Before rwsat = %d. ", Abc_NtkNodeNum(pNtk) );
548  pParams->fUseRewriting = 0;
549  pNtk = Abc_NtkBalance( pNtkTemp = pNtk, 0, 0, 0 );
550  Abc_NtkDelete( pNtkTemp );
551  Abc_NtkRewrite( pNtk, 0, 0, 0, 0, 0 );
552  pNtk = Abc_NtkBalance( pNtkTemp = pNtk, 0, 0, 0 );
553  Abc_NtkDelete( pNtkTemp );
554  Abc_NtkRewrite( pNtk, 0, 0, 0, 0, 0 );
555  Abc_NtkRefactor( pNtk, 10, 16, 0, 0, 0, 0 );
556 //printf( "After rwsat = %d. ", Abc_NtkNodeNum(pNtk) );
557 //ABC_PRT( "Time", Abc_Clock() - clk );
558  }
559 
560  // convert ABC network into IVY network
561  pMan = Abc_NtkIvyBefore( pNtk, 0, 0 );
562 
563  // solve the CEC problem
564  RetValue = Ivy_FraigProve( &pMan, pParams );
565 // RetValue = -1;
566 
567  // convert IVY network into ABC network
568  pNtk = Abc_NtkIvyAfter( pNtkTemp = pNtk, pMan, 0, 0 );
569  Abc_NtkDelete( pNtkTemp );
570  // transfer model if given
571  pNtk->pModel = (int *)pMan->pData; pMan->pData = NULL;
572  Ivy_ManStop( pMan );
573 
574  // try to prove it using brute force SAT with good CNF encoding
575  if ( RetValue < 0 )
576  {
577  pMan2 = Abc_NtkToDar( pNtk, 0, 0 );
578  // dump the miter before entering high-effort solving
579  if ( pParams->fVerbose )
580  {
581  char pFileName[100];
582  sprintf( pFileName, "cecmiter.aig" );
583  Ioa_WriteAiger( pMan2, pFileName, 0, 0 );
584  printf( "Intermediate reduced miter is written into file \"%s\".\n", pFileName );
585  }
586  RetValue = Fra_FraigSat( pMan2, pParams->nMiteringLimitLast, 0, 0, 0, 0, 0, 0, 0, pParams->fVerbose );
587  pNtk->pModel = (int *)pMan2->pData, pMan2->pData = NULL;
588  Aig_ManStop( pMan2 );
589  }
590 
591  // try to prove it using brute force BDDs
592  if ( RetValue < 0 && pParams->fUseBdds )
593  {
594  if ( pParams->fVerbose )
595  {
596  printf( "Attempting BDDs with node limit %d ...\n", pParams->nBddSizeLimit );
597  fflush( stdout );
598  }
599  pNtk = Abc_NtkCollapse( pNtkTemp = pNtk, pParams->nBddSizeLimit, 0, pParams->fBddReorder, 0 );
600  if ( pNtk )
601  {
602  Abc_NtkDelete( pNtkTemp );
603  RetValue = ( (Abc_NtkNodeNum(pNtk) == 1) && (Abc_ObjFanin0(Abc_NtkPo(pNtk,0))->pData == Cudd_ReadLogicZero((DdManager *)pNtk->pManFunc)) );
604  }
605  else
606  pNtk = pNtkTemp;
607  }
608 
609  // return the result
610  *ppNtk = pNtk;
611  return RetValue;
612 }
ABC_NAMESPACE_IMPL_START Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
DECLARATIONS ///.
Definition: abcDar.c:233
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Definition: abc.h:250
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
Definition: abcStrash.c:265
DdNode * Cudd_ReadLogicZero(DdManager *dd)
Definition: cuddAPI.c:1058
static int Abc_ObjFaninC0(Abc_Obj_t *pObj)
Definition: abc.h:377
static int Abc_NtkCiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:287
int Ivy_FraigProve(Ivy_Man_t **ppManAig, void *pPars)
Definition: ivyFraig.c:255
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
Definition: abc.h:373
void Ivy_ManStop(Ivy_Man_t *p)
Definition: ivyMan.c:238
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Definition: abcNtk.c:1233
void Aig_ManStop(Aig_Man_t *pMan)
Definition: aigMan.c:187
int * pModel
Definition: abc.h:198
ABC_DLL Abc_Ntk_t * Abc_NtkCollapse(Abc_Ntk_t *pNtk, int fBddSizeMax, int fDualRail, int fReorder, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition: abcCollapse.c:49
void * pManFunc
Definition: abc.h:191
static int Abc_NtkNodeNum(Abc_Ntk_t *pNtk)
Definition: abc.h:293
ABC_DLL int Abc_NtkRewrite(Abc_Ntk_t *pNtk, int fUpdateLevel, int fUseZeros, int fVerbose, int fVeryVerbose, int fPlaceEnable)
FUNCTION DEFINITIONS ///.
Definition: abcRewrite.c:61
ABC_DLL int Abc_NtkRefactor(Abc_Ntk_t *pNtk, int nNodeSizeMax, int nConeSizeMax, int fUpdateLevel, int fUseZeros, int fUseDcs, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition: abcRefactor.c:89
char * sprintf()
void Ioa_WriteAiger(Aig_Man_t *pMan, char *pFileName, int fWriteSymbols, int fCompact)
Definition: ioaWriteAig.c:446
typedefABC_NAMESPACE_HEADER_START struct Ivy_Man_t_ Ivy_Man_t
INCLUDES ///.
Definition: ivy.h:46
Ivy_Man_t * Abc_NtkIvyBefore(Abc_Ntk_t *pNtk, int fSeq, int fUseDc)
FUNCTION DEFINITIONS ///.
Definition: abcIvy.c:84
static Abc_Obj_t * Abc_NtkPo(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:316
ABC_DLL Abc_Ntk_t * Abc_NtkBalance(Abc_Ntk_t *pNtk, int fDuplicate, int fSelective, int fUpdateLevel)
FUNCTION DEFINITIONS ///.
Definition: abcBalance.c:53
#define ABC_CALLOC(type, num)
Definition: abc_global.h:230
#define assert(ex)
Definition: util_old.h:213
void * pData
Definition: abc.h:145
Abc_Ntk_t * Abc_NtkIvyAfter(Abc_Ntk_t *pNtk, Ivy_Man_t *pMan, int fSeq, int fHaig)
Definition: abcIvy.c:137
int Fra_FraigSat(Aig_Man_t *pMan, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, int nLearnedStart, int nLearnedDelta, int nLearnedPerce, int fFlipBits, int fAndOuts, int fNewSolver, int fVerbose)
ITERATORS ///.
Definition: fraCec.c:47
Abc_Ntk_t* Abc_NtkIvyResyn ( Abc_Ntk_t pNtk,
int  fUpdateLevel,
int  fVerbose 
)

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

Synopsis [Gives the current ABC network to AIG manager for processing.]

Description []

SideEffects []

SeeAlso []

Definition at line 364 of file abcIvy.c.

365 {
366  Abc_Ntk_t * pNtkAig;
367  Ivy_Man_t * pMan, * pTemp;
368  pMan = Abc_NtkIvyBefore( pNtk, 0, 0 );
369  if ( pMan == NULL )
370  return NULL;
371  pMan = Ivy_ManResyn( pTemp = pMan, fUpdateLevel, fVerbose );
372  Ivy_ManStop( pTemp );
373  pNtkAig = Abc_NtkIvyAfter( pNtk, pMan, 0, 0 );
374  Ivy_ManStop( pMan );
375  return pNtkAig;
376 }
void Ivy_ManStop(Ivy_Man_t *p)
Definition: ivyMan.c:238
Ivy_Man_t * Ivy_ManResyn(Ivy_Man_t *p, int fUpdateLevel, int fVerbose)
Definition: ivyResyn.c:86
typedefABC_NAMESPACE_HEADER_START struct Ivy_Man_t_ Ivy_Man_t
INCLUDES ///.
Definition: ivy.h:46
Ivy_Man_t * Abc_NtkIvyBefore(Abc_Ntk_t *pNtk, int fSeq, int fUseDc)
FUNCTION DEFINITIONS ///.
Definition: abcIvy.c:84
Abc_Ntk_t * Abc_NtkIvyAfter(Abc_Ntk_t *pNtk, Ivy_Man_t *pMan, int fSeq, int fHaig)
Definition: abcIvy.c:137
Abc_Ntk_t* Abc_NtkIvyResyn0 ( Abc_Ntk_t pNtk,
int  fUpdateLevel,
int  fVerbose 
)

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

Synopsis [Gives the current ABC network to AIG manager for processing.]

Description []

SideEffects []

SeeAlso []

Definition at line 339 of file abcIvy.c.

340 {
341  Abc_Ntk_t * pNtkAig;
342  Ivy_Man_t * pMan, * pTemp;
343  pMan = Abc_NtkIvyBefore( pNtk, 0, 0 );
344  if ( pMan == NULL )
345  return NULL;
346  pMan = Ivy_ManResyn0( pTemp = pMan, fUpdateLevel, fVerbose );
347  Ivy_ManStop( pTemp );
348  pNtkAig = Abc_NtkIvyAfter( pNtk, pMan, 0, 0 );
349  Ivy_ManStop( pMan );
350  return pNtkAig;
351 }
void Ivy_ManStop(Ivy_Man_t *p)
Definition: ivyMan.c:238
typedefABC_NAMESPACE_HEADER_START struct Ivy_Man_t_ Ivy_Man_t
INCLUDES ///.
Definition: ivy.h:46
Ivy_Man_t * Abc_NtkIvyBefore(Abc_Ntk_t *pNtk, int fSeq, int fUseDc)
FUNCTION DEFINITIONS ///.
Definition: abcIvy.c:84
Ivy_Man_t * Ivy_ManResyn0(Ivy_Man_t *p, int fUpdateLevel, int fVerbose)
DECLARATIONS ///.
Definition: ivyResyn.c:45
Abc_Ntk_t * Abc_NtkIvyAfter(Abc_Ntk_t *pNtk, Ivy_Man_t *pMan, int fSeq, int fHaig)
Definition: abcIvy.c:137
Abc_Ntk_t* Abc_NtkIvyRewrite ( Abc_Ntk_t pNtk,
int  fUpdateLevel,
int  fUseZeroCost,
int  fVerbose 
)

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

Synopsis [Gives the current ABC network to AIG manager for processing.]

Description []

SideEffects []

SeeAlso []

Definition at line 285 of file abcIvy.c.

286 {
287  Abc_Ntk_t * pNtkAig;
288  Ivy_Man_t * pMan;
289  pMan = Abc_NtkIvyBefore( pNtk, 0, 0 );
290  if ( pMan == NULL )
291  return NULL;
292 //timeRetime = Abc_Clock();
293  Ivy_ManRewritePre( pMan, fUpdateLevel, fUseZeroCost, fVerbose );
294 //timeRetime = Abc_Clock() - timeRetime;
295  pNtkAig = Abc_NtkIvyAfter( pNtk, pMan, 0, 0 );
296  Ivy_ManStop( pMan );
297  return pNtkAig;
298 }
void Ivy_ManStop(Ivy_Man_t *p)
Definition: ivyMan.c:238
typedefABC_NAMESPACE_HEADER_START struct Ivy_Man_t_ Ivy_Man_t
INCLUDES ///.
Definition: ivy.h:46
Ivy_Man_t * Abc_NtkIvyBefore(Abc_Ntk_t *pNtk, int fSeq, int fUseDc)
FUNCTION DEFINITIONS ///.
Definition: abcIvy.c:84
int Ivy_ManRewritePre(Ivy_Man_t *p, int fUpdateLevel, int fUseZeroCost, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition: ivyRwr.c:55
Abc_Ntk_t * Abc_NtkIvyAfter(Abc_Ntk_t *pNtk, Ivy_Man_t *pMan, int fSeq, int fHaig)
Definition: abcIvy.c:137
Abc_Ntk_t* Abc_NtkIvyRewriteSeq ( Abc_Ntk_t pNtk,
int  fUseZeroCost,
int  fVerbose 
)

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

Synopsis [Gives the current ABC network to AIG manager for processing.]

Description []

SideEffects []

SeeAlso []

Definition at line 311 of file abcIvy.c.

312 {
313  Abc_Ntk_t * pNtkAig;
314  Ivy_Man_t * pMan;
315  pMan = Abc_NtkIvyBefore( pNtk, 1, 1 );
316  if ( pMan == NULL )
317  return NULL;
318 //timeRetime = Abc_Clock();
319  Ivy_ManRewriteSeq( pMan, fUseZeroCost, fVerbose );
320 //timeRetime = Abc_Clock() - timeRetime;
321 // Ivy_ManRewriteSeq( pMan, 1, 0 );
322 // Ivy_ManRewriteSeq( pMan, 1, 0 );
323  pNtkAig = Abc_NtkIvyAfter( pNtk, pMan, 1, 0 );
324  Ivy_ManStop( pMan );
325  return pNtkAig;
326 }
void Ivy_ManStop(Ivy_Man_t *p)
Definition: ivyMan.c:238
int Ivy_ManRewriteSeq(Ivy_Man_t *p, int fUseZeroCost, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition: ivySeq.c:63
typedefABC_NAMESPACE_HEADER_START struct Ivy_Man_t_ Ivy_Man_t
INCLUDES ///.
Definition: ivy.h:46
Ivy_Man_t * Abc_NtkIvyBefore(Abc_Ntk_t *pNtk, int fSeq, int fUseDc)
FUNCTION DEFINITIONS ///.
Definition: abcIvy.c:84
Abc_Ntk_t * Abc_NtkIvyAfter(Abc_Ntk_t *pNtk, Ivy_Man_t *pMan, int fSeq, int fHaig)
Definition: abcIvy.c:137
Abc_Ntk_t* Abc_NtkIvySat ( Abc_Ntk_t pNtk,
int  nConfLimit,
int  fVerbose 
)

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

Synopsis [Gives the current ABC network to AIG manager for processing.]

Description []

SideEffects []

SeeAlso []

Definition at line 389 of file abcIvy.c.

390 {
391  Ivy_FraigParams_t Params, * pParams = &Params;
392  Abc_Ntk_t * pNtkAig;
393  Ivy_Man_t * pMan, * pTemp;
394  pMan = Abc_NtkIvyBefore( pNtk, 0, 0 );
395  if ( pMan == NULL )
396  return NULL;
397  Ivy_FraigParamsDefault( pParams );
398  pParams->nBTLimitMiter = nConfLimit;
399  pParams->fVerbose = fVerbose;
400 // pMan = Ivy_FraigPerform( pTemp = pMan, pParams );
401  pMan = Ivy_FraigMiter( pTemp = pMan, pParams );
402  Ivy_ManStop( pTemp );
403  pNtkAig = Abc_NtkIvyAfter( pNtk, pMan, 0, 0 );
404  Ivy_ManStop( pMan );
405  return pNtkAig;
406 }
void Ivy_FraigParamsDefault(Ivy_FraigParams_t *pParams)
FUNCTION DEFINITIONS ///.
Definition: ivyFraig.c:225
Ivy_Man_t * Ivy_FraigMiter(Ivy_Man_t *pManAig, Ivy_FraigParams_t *pParams)
Definition: ivyFraig.c:480
void Ivy_ManStop(Ivy_Man_t *p)
Definition: ivyMan.c:238
typedefABC_NAMESPACE_HEADER_START struct Ivy_Man_t_ Ivy_Man_t
INCLUDES ///.
Definition: ivy.h:46
Ivy_Man_t * Abc_NtkIvyBefore(Abc_Ntk_t *pNtk, int fSeq, int fUseDc)
FUNCTION DEFINITIONS ///.
Definition: abcIvy.c:84
Abc_Ntk_t * Abc_NtkIvyAfter(Abc_Ntk_t *pNtk, Ivy_Man_t *pMan, int fSeq, int fHaig)
Definition: abcIvy.c:137
int nBTLimitMiter
Definition: ivy.h:144
Abc_Ntk_t* Abc_NtkIvyStrash ( Abc_Ntk_t pNtk)

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

Synopsis [Gives the current ABC network to AIG manager for processing.]

Description []

SideEffects []

SeeAlso []

Definition at line 173 of file abcIvy.c.

174 {
175  Abc_Ntk_t * pNtkAig;
176  Ivy_Man_t * pMan;
177  pMan = Abc_NtkIvyBefore( pNtk, 1, 0 );
178  if ( pMan == NULL )
179  return NULL;
180  pNtkAig = Abc_NtkIvyAfter( pNtk, pMan, 1, 0 );
181  Ivy_ManStop( pMan );
182  return pNtkAig;
183 }
void Ivy_ManStop(Ivy_Man_t *p)
Definition: ivyMan.c:238
typedefABC_NAMESPACE_HEADER_START struct Ivy_Man_t_ Ivy_Man_t
INCLUDES ///.
Definition: ivy.h:46
Ivy_Man_t * Abc_NtkIvyBefore(Abc_Ntk_t *pNtk, int fSeq, int fUseDc)
FUNCTION DEFINITIONS ///.
Definition: abcIvy.c:84
Abc_Ntk_t * Abc_NtkIvyAfter(Abc_Ntk_t *pNtk, Ivy_Man_t *pMan, int fSeq, int fHaig)
Definition: abcIvy.c:137
void Abc_NtkStrashPerformAig ( Abc_Ntk_t pNtk,
Ivy_Man_t pMan 
)
static

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

Synopsis [Prepares the network for strashing.]

Description []

SideEffects []

SeeAlso []

Definition at line 930 of file abcIvy.c.

931 {
932 // ProgressBar * pProgress;
933  Vec_Ptr_t * vNodes;
934  Abc_Obj_t * pNode;
935  int i;
936  vNodes = Abc_NtkDfs( pNtk, 0 );
937 // pProgress = Extra_ProgressBarStart( stdout, vNodes->nSize );
938  Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pNode, i )
939  {
940 // Extra_ProgressBarUpdate( pProgress, i, NULL );
941  pNode->pCopy = (Abc_Obj_t *)Abc_NodeStrashAig( pMan, pNode );
942  }
943 // Extra_ProgressBarStop( pProgress );
944  Vec_PtrFree( vNodes );
945 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
ABC_DLL Vec_Ptr_t * Abc_NtkDfs(Abc_Ntk_t *pNtk, int fCollectAll)
Definition: abcDfs.c:81
Abc_Obj_t * pCopy
Definition: abc.h:148
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
static Ivy_Obj_t * Abc_NodeStrashAig(Ivy_Man_t *pMan, Abc_Obj_t *pNode)
Definition: abcIvy.c:958
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
ABC_NAMESPACE_IMPL_START Aig_Man_t* Abc_NtkToDar ( Abc_Ntk_t pNtk,
int  fExors,
int  fRegisters 
)

DECLARATIONS ///.

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

FileName [abcIvy.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Network and node package.]

Synopsis [Strashing of the current network.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

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

Revision [

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

]

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

Synopsis [Converts the network from the AIG manager into ABC.]

Description [Assumes that registers are ordered after PIs/POs.]

SideEffects []

SeeAlso []

Definition at line 233 of file abcDar.c.

234 {
235  Vec_Ptr_t * vNodes;
236  Aig_Man_t * pMan;
237  Aig_Obj_t * pObjNew;
238  Abc_Obj_t * pObj;
239  int i, nNodes, nDontCares;
240  // make sure the latches follow PIs/POs
241  if ( fRegisters )
242  {
243  assert( Abc_NtkBoxNum(pNtk) == Abc_NtkLatchNum(pNtk) );
244  Abc_NtkForEachCi( pNtk, pObj, i )
245  if ( i < Abc_NtkPiNum(pNtk) )
246  {
247  assert( Abc_ObjIsPi(pObj) );
248  if ( !Abc_ObjIsPi(pObj) )
249  Abc_Print( 1, "Abc_NtkToDar(): Temporary bug: The PI ordering is wrong!\n" );
250  }
251  else
252  assert( Abc_ObjIsBo(pObj) );
253  Abc_NtkForEachCo( pNtk, pObj, i )
254  if ( i < Abc_NtkPoNum(pNtk) )
255  {
256  assert( Abc_ObjIsPo(pObj) );
257  if ( !Abc_ObjIsPo(pObj) )
258  Abc_Print( 1, "Abc_NtkToDar(): Temporary bug: The PO ordering is wrong!\n" );
259  }
260  else
261  assert( Abc_ObjIsBi(pObj) );
262  // print warning about initial values
263  nDontCares = 0;
264  Abc_NtkForEachLatch( pNtk, pObj, i )
265  if ( Abc_LatchIsInitDc(pObj) )
266  {
267  Abc_LatchSetInit0(pObj);
268  nDontCares++;
269  }
270  if ( nDontCares )
271  {
272  Abc_Print( 1, "Warning: %d registers in this network have don't-care init values.\n", nDontCares );
273  Abc_Print( 1, "The don't-care are assumed to be 0. The result may not verify.\n" );
274  Abc_Print( 1, "Use command \"print_latch\" to see the init values of registers.\n" );
275  Abc_Print( 1, "Use command \"zero\" to convert or \"init\" to change the values.\n" );
276  }
277  }
278  // create the manager
279  pMan = Aig_ManStart( Abc_NtkNodeNum(pNtk) + 100 );
280  pMan->fCatchExor = fExors;
281  pMan->nConstrs = pNtk->nConstrs;
282  pMan->nBarBufs = pNtk->nBarBufs;
283  pMan->pName = Extra_UtilStrsav( pNtk->pName );
284  pMan->pSpec = Extra_UtilStrsav( pNtk->pSpec );
285  // transfer the pointers to the basic nodes
286  Abc_AigConst1(pNtk)->pCopy = (Abc_Obj_t *)Aig_ManConst1(pMan);
287  Abc_NtkForEachCi( pNtk, pObj, i )
288  {
289  pObj->pCopy = (Abc_Obj_t *)Aig_ObjCreateCi(pMan);
290  // initialize logic level of the CIs
291  ((Aig_Obj_t *)pObj->pCopy)->Level = pObj->Level;
292  }
293  // complement the 1-values registers
294  if ( fRegisters ) {
295  Abc_NtkForEachLatch( pNtk, pObj, i )
296  if ( Abc_LatchIsInit1(pObj) )
297  Abc_ObjFanout0(pObj)->pCopy = Abc_ObjNot(Abc_ObjFanout0(pObj)->pCopy);
298  }
299  // perform the conversion of the internal nodes (assumes DFS ordering)
300 // pMan->fAddStrash = 1;
301  vNodes = Abc_NtkDfs( pNtk, 0 );
302  Vec_PtrForEachEntry( Abc_Obj_t *, vNodes, pObj, i )
303 // Abc_NtkForEachNode( pNtk, pObj, i )
304  {
305  pObj->pCopy = (Abc_Obj_t *)Aig_And( pMan, (Aig_Obj_t *)Abc_ObjChild0Copy(pObj), (Aig_Obj_t *)Abc_ObjChild1Copy(pObj) );
306 // Abc_Print( 1, "%d->%d ", pObj->Id, ((Aig_Obj_t *)pObj->pCopy)->Id );
307  }
308  Vec_PtrFree( vNodes );
309  pMan->fAddStrash = 0;
310  // create the POs
311  Abc_NtkForEachCo( pNtk, pObj, i )
312  Aig_ObjCreateCo( pMan, (Aig_Obj_t *)Abc_ObjChild0Copy(pObj) );
313  // complement the 1-valued registers
314  Aig_ManSetRegNum( pMan, Abc_NtkLatchNum(pNtk) );
315  if ( fRegisters )
316  Aig_ManForEachLiSeq( pMan, pObjNew, i )
318  pObjNew->pFanin0 = Aig_Not(pObjNew->pFanin0);
319  // remove dangling nodes
320  nNodes = (Abc_NtkGetChoiceNum(pNtk) == 0)? Aig_ManCleanup( pMan ) : 0;
321  if ( !fExors && nNodes )
322  Abc_Print( 1, "Abc_NtkToDar(): Unexpected %d dangling nodes when converting to AIG!\n", nNodes );
323 //Aig_ManDumpVerilog( pMan, "test.v" );
324  // save the number of registers
325  if ( fRegisters )
326  {
327  Aig_ManSetRegNum( pMan, Abc_NtkLatchNum(pNtk) );
328  pMan->vFlopNums = Vec_IntStartNatural( pMan->nRegs );
329 // pMan->vFlopNums = NULL;
330 // pMan->vOnehots = Abc_NtkConverLatchNamesIntoNumbers( pNtk );
331  if ( pNtk->vOnehots )
332  pMan->vOnehots = (Vec_Ptr_t *)Vec_VecDupInt( (Vec_Vec_t *)pNtk->vOnehots );
333  }
334  if ( !Aig_ManCheck( pMan ) )
335  {
336  Abc_Print( 1, "Abc_NtkToDar: AIG check has failed.\n" );
337  Aig_ManStop( pMan );
338  return NULL;
339  }
340  return pMan;
341 }
Aig_Obj_t * Aig_ObjCreateCo(Aig_Man_t *p, Aig_Obj_t *pDriver)
Definition: aigObj.c:66
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
ABC_DLL int Aig_ManCheck(Aig_Man_t *p)
FUNCTION DECLARATIONS ///.
Definition: aigCheck.c:45
unsigned Level
Definition: aig.h:82
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
Definition: vecVec.h:42
ABC_DLL Abc_Obj_t * Abc_AigConst1(Abc_Ntk_t *pNtk)
Definition: abcAig.c:683
static int Abc_ObjIsBo(Abc_Obj_t *pObj)
Definition: abc.h:350
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Definition: aig.h:50
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
static int Abc_NtkBoxNum(Abc_Ntk_t *pNtk)
Definition: abc.h:289
Aig_Man_t * Aig_ManStart(int nNodesMax)
DECLARATIONS ///.
Definition: aigMan.c:47
static Abc_Obj_t * Abc_ObjChild1Copy(Abc_Obj_t *pObj)
Definition: abc.h:387
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
Definition: abc.h:294
static int Abc_ObjIsPi(Abc_Obj_t *pObj)
Definition: abc.h:347
Aig_Obj_t * Aig_ObjCreateCi(Aig_Man_t *p)
DECLARATIONS ///.
Definition: aigObj.c:45
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition: abc.h:519
static Aig_Obj_t * Aig_Not(Aig_Obj_t *p)
Definition: aig.h:247
ABC_DLL Vec_Ptr_t * Abc_NtkDfs(Abc_Ntk_t *pNtk, int fCollectAll)
Definition: abcDfs.c:81
static Vec_Int_t * Vec_IntStartNatural(int nSize)
Definition: bblif.c:192
ABC_DLL int Abc_NtkGetChoiceNum(Abc_Ntk_t *pNtk)
Definition: abcUtil.c:430
unsigned Level
Definition: abc.h:142
char * Extra_UtilStrsav(const char *s)
Aig_Obj_t * Aig_And(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
Definition: aigOper.c:104
static Abc_Obj_t * Abc_NtkCo(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:318
static Vec_Vec_t * Vec_VecDupInt(Vec_Vec_t *p)
Definition: vecVec.h:395
static int Abc_NtkNodeNum(Abc_Ntk_t *pNtk)
Definition: abc.h:293
static Abc_Obj_t * Abc_ObjChild0Copy(Abc_Obj_t *pObj)
Definition: abc.h:386
Abc_Obj_t * pCopy
Definition: abc.h:148
void Aig_ManSetRegNum(Aig_Man_t *p, int nRegs)
Definition: aigMan.c:438
static int Abc_LatchIsInitDc(Abc_Obj_t *pLatch)
Definition: abc.h:424
if(last==0)
Definition: sparse_int.h:34
Definition: aig.h:69
#define Abc_NtkForEachLatch(pNtk, pObj, i)
Definition: abc.h:497
static int Abc_LatchIsInit1(Abc_Obj_t *pLatch)
Definition: abc.h:423
static void Abc_Print(int level, const char *format,...)
Definition: abc_global.h:313
static Aig_Obj_t * Aig_ManConst1(Aig_Man_t *p)
Definition: aig.h:264
static int Abc_ObjIsBi(Abc_Obj_t *pObj)
Definition: abc.h:349
#define Abc_NtkForEachCi(pNtk, pCi, i)
Definition: abc.h:515
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
Definition: abc.h:286
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
Definition: abc.h:285
static int Abc_ObjIsPo(Abc_Obj_t *pObj)
Definition: abc.h:348
#define assert(ex)
Definition: util_old.h:213
#define Aig_ManForEachLiSeq(p, pObj, i)
Definition: aig.h:447
static Abc_Obj_t * Abc_ObjNot(Abc_Obj_t *p)
Definition: abc.h:324
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition: vecPtr.h:55
static void Abc_LatchSetInit0(Abc_Obj_t *pLatch)
Definition: abc.h:418
int Aig_ManCleanup(Aig_Man_t *p)
Definition: aigMan.c:265
static Abc_Obj_t * Abc_ObjFanout0(Abc_Obj_t *pObj)
Definition: abc.h:371
Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
DECLARATIONS ///.
Definition: abcDar.c:233
static void Vec_PtrFree(Vec_Ptr_t *p)
Definition: vecPtr.h:223
Ivy_Man_t * Abc_NtkToIvy ( Abc_Ntk_t pNtkOld)
static

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

Synopsis [Converts the network from the AIG manager into ABC.]

Description []

SideEffects []

SeeAlso []

Definition at line 892 of file abcIvy.c.

893 {
894  Ivy_Man_t * pMan;
895  Abc_Obj_t * pObj;
896  Ivy_Obj_t * pFanin;
897  int i;
898  // create the manager
899  assert( Abc_NtkHasSop(pNtkOld) || Abc_NtkIsStrash(pNtkOld) );
900  pMan = Ivy_ManStart();
901  // create the PIs
902  if ( Abc_NtkIsStrash(pNtkOld) )
903  Abc_AigConst1(pNtkOld)->pCopy = (Abc_Obj_t *)Ivy_ManConst1(pMan);
904  Abc_NtkForEachCi( pNtkOld, pObj, i )
905  pObj->pCopy = (Abc_Obj_t *)Ivy_ObjCreatePi(pMan);
906  // perform the conversion of the internal nodes
907  Abc_NtkStrashPerformAig( pNtkOld, pMan );
908  // create the POs
909  Abc_NtkForEachCo( pNtkOld, pObj, i )
910  {
911  pFanin = (Ivy_Obj_t *)Abc_ObjFanin0(pObj)->pCopy;
912  pFanin = Ivy_NotCond( pFanin, Abc_ObjFaninC0(pObj) );
913  Ivy_ObjCreatePo( pMan, pFanin );
914  }
915  Ivy_ManCleanup( pMan );
916  return pMan;
917 }
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Definition: abc.h:251
static int Abc_NtkHasSop(Abc_Ntk_t *pNtk)
Definition: abc.h:253
static Ivy_Obj_t * Ivy_ManConst1(Ivy_Man_t *p)
Definition: ivy.h:199
ABC_DLL Abc_Obj_t * Abc_AigConst1(Abc_Ntk_t *pNtk)
Definition: abcAig.c:683
static int Abc_ObjFaninC0(Abc_Obj_t *pObj)
Definition: abc.h:377
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition: abc.h:519
static void Abc_NtkStrashPerformAig(Abc_Ntk_t *pNtk, Ivy_Man_t *pMan)
Definition: abcIvy.c:930
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
Definition: abc.h:373
Ivy_Man_t * Ivy_ManStart()
DECLARATIONS ///.
Definition: ivyMan.c:45
Ivy_Obj_t * Ivy_ObjCreatePo(Ivy_Man_t *p, Ivy_Obj_t *pDriver)
Definition: ivyObj.c:61
Abc_Obj_t * pCopy
Definition: abc.h:148
Definition: ivy.h:73
typedefABC_NAMESPACE_HEADER_START struct Ivy_Man_t_ Ivy_Man_t
INCLUDES ///.
Definition: ivy.h:46
#define Abc_NtkForEachCi(pNtk, pCi, i)
Definition: abc.h:515
static Ivy_Obj_t * Ivy_NotCond(Ivy_Obj_t *p, int c)
Definition: ivy.h:195
#define assert(ex)
Definition: util_old.h:213
Ivy_Obj_t * Ivy_ObjCreatePi(Ivy_Man_t *p)
DECLARATIONS ///.
Definition: ivyObj.c:45
int Ivy_ManCleanup(Ivy_Man_t *p)
Definition: ivyMan.c:265
void Abc_NtkTransferPointers ( Abc_Ntk_t pNtk,
Abc_Ntk_t pNtkAig 
)

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

Synopsis [Sets the final nodes to point to the original nodes.]

Description []

SideEffects []

SeeAlso []

Definition at line 419 of file abcIvy.c.

420 {
421  Abc_Obj_t * pObj;
422  Ivy_Obj_t * pObjIvy, * pObjFraig;
423  int i;
424  pObj = Abc_AigConst1(pNtk);
425  pObj->pCopy = Abc_AigConst1(pNtkAig);
426  Abc_NtkForEachCi( pNtk, pObj, i )
427  pObj->pCopy = Abc_NtkCi(pNtkAig, i);
428  Abc_NtkForEachCo( pNtk, pObj, i )
429  pObj->pCopy = Abc_NtkCo(pNtkAig, i);
430  Abc_NtkForEachLatch( pNtk, pObj, i )
431  pObj->pCopy = Abc_NtkBox(pNtkAig, i);
432  Abc_NtkForEachNode( pNtk, pObj, i )
433  {
434  pObjIvy = (Ivy_Obj_t *)pObj->pCopy;
435  if ( pObjIvy == NULL )
436  continue;
437  pObjFraig = Ivy_ObjEquiv( pObjIvy );
438  if ( pObjFraig == NULL )
439  continue;
440  pObj->pCopy = Abc_EdgeToNode( pNtkAig, Ivy_Regular(pObjFraig)->TravId );
441  pObj->pCopy = Abc_ObjNotCond( pObj->pCopy, Ivy_IsComplement(pObjFraig) );
442  }
443 }
static int Ivy_IsComplement(Ivy_Obj_t *p)
Definition: ivy.h:196
static Abc_Obj_t * Abc_EdgeToNode(Abc_Ntk_t *p, Abc_Edge_t Edge)
Definition: abcIvy.c:60
ABC_DLL Abc_Obj_t * Abc_AigConst1(Abc_Ntk_t *pNtk)
Definition: abcAig.c:683
#define Abc_NtkForEachCo(pNtk, pCo, i)
Definition: abc.h:519
static Abc_Obj_t * Abc_NtkCi(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:317
static Abc_Obj_t * Abc_NtkCo(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:318
Abc_Obj_t * pCopy
Definition: abc.h:148
if(last==0)
Definition: sparse_int.h:34
Definition: ivy.h:73
static Ivy_Obj_t * Ivy_Regular(Ivy_Obj_t *p)
Definition: ivy.h:193
#define Abc_NtkForEachLatch(pNtk, pObj, i)
Definition: abc.h:497
#define Abc_NtkForEachNode(pNtk, pNode, i)
Definition: abc.h:461
static Abc_Obj_t * Abc_NtkBox(Abc_Ntk_t *pNtk, int i)
Definition: abc.h:319
#define Abc_NtkForEachCi(pNtk, pCi, i)
Definition: abc.h:515
static Abc_Obj_t * Abc_ObjNotCond(Abc_Obj_t *p, int c)
Definition: abc.h:325
static Ivy_Obj_t * Ivy_ObjEquiv(Ivy_Obj_t *pObj)
Definition: ivy.h:277
static Abc_Obj_t* Abc_ObjFanin0Ivy ( Abc_Ntk_t p,
Ivy_Obj_t pObj 
)
inlinestatic

Definition at line 62 of file abcIvy.c.

62 { return Abc_ObjNotCond( Abc_EdgeToNode(p, Ivy_ObjFanin0(pObj)->TravId), Ivy_ObjFaninC0(pObj) ); }
static Abc_Obj_t * Abc_EdgeToNode(Abc_Ntk_t *p, Abc_Edge_t Edge)
Definition: abcIvy.c:60
static Ivy_Obj_t * Ivy_ObjFanin0(Ivy_Obj_t *pObj)
Definition: ivy.h:271
static Abc_Obj_t * Abc_ObjNotCond(Abc_Obj_t *p, int c)
Definition: abc.h:325
static int Ivy_ObjFaninC0(Ivy_Obj_t *pObj)
Definition: ivy.h:269
static Abc_Obj_t* Abc_ObjFanin1Ivy ( Abc_Ntk_t p,
Ivy_Obj_t pObj 
)
inlinestatic

Definition at line 63 of file abcIvy.c.

63 { return Abc_ObjNotCond( Abc_EdgeToNode(p, Ivy_ObjFanin1(pObj)->TravId), Ivy_ObjFaninC1(pObj) ); }
static Abc_Obj_t * Abc_EdgeToNode(Abc_Ntk_t *p, Abc_Edge_t Edge)
Definition: abcIvy.c:60
static Ivy_Obj_t * Ivy_ObjFanin1(Ivy_Obj_t *pObj)
Definition: ivy.h:272
static int Ivy_ObjFaninC1(Ivy_Obj_t *pObj)
Definition: ivy.h:270
static Abc_Obj_t * Abc_ObjNotCond(Abc_Obj_t *p, int c)
Definition: abc.h:325
void Aig_ManStop ( Aig_Man_t p)

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

Synopsis [Stops the AIG manager.]

Description []

SideEffects []

SeeAlso []

Definition at line 187 of file aigMan.c.

188 {
189  Aig_Obj_t * pObj;
190  int i;
191  if ( p->time1 ) { ABC_PRT( "time1", p->time1 ); }
192  if ( p->time2 ) { ABC_PRT( "time2", p->time2 ); }
193  // make sure the nodes have clean marks
194  Aig_ManForEachObj( p, pObj, i )
195  assert( !pObj->fMarkA && !pObj->fMarkB );
196  Tim_ManStopP( (Tim_Man_t **)&p->pManTime );
197  if ( p->pFanData )
198  Aig_ManFanoutStop( p );
199  if ( p->pManExdc )
200  Aig_ManStop( p->pManExdc );
201 // Aig_TableProfile( p );
202  Aig_MmFixedStop( p->pMemObjs, 0 );
203  Vec_PtrFreeP( &p->vCis );
204  Vec_PtrFreeP( &p->vCos );
205  Vec_PtrFreeP( &p->vObjs );
206  Vec_PtrFreeP( &p->vBufs );
207  //--jlong -- begin
208  Vec_PtrFreeP( &p->unfold2_type_I );
209  Vec_PtrFreeP( &p->unfold2_type_II );
210  //--jlong -- end
211  Vec_IntFreeP( &p->vLevelR );
212  Vec_VecFreeP( &p->vLevels );
213  Vec_IntFreeP( &p->vFlopNums );
214  Vec_IntFreeP( &p->vFlopReprs );
215  Vec_VecFreeP( (Vec_Vec_t **)&p->vOnehots );
216  Vec_VecFreeP( &p->vClockDoms );
217  Vec_IntFreeP( &p->vProbs );
218  Vec_IntFreeP( &p->vCiNumsOrig );
219  Vec_PtrFreeP( &p->vMapped );
220  if ( p->vSeqModelVec )
221  Vec_PtrFreeFree( p->vSeqModelVec );
222  ABC_FREE( p->pTerSimData );
223  ABC_FREE( p->pFastSim );
224  ABC_FREE( p->pData );
225  ABC_FREE( p->pSeqModel );
226  ABC_FREE( p->pName );
227  ABC_FREE( p->pSpec );
228  ABC_FREE( p->pObjCopies );
229  ABC_FREE( p->pReprs );
230  ABC_FREE( p->pEquivs );
231  ABC_FREE( p->pTable );
232  ABC_FREE( p );
233 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
Definition: vecVec.h:42
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Aig_MmFixedStop(Aig_MmFixed_t *p, int fVerbose)
Definition: aigMem.c:132
static void Vec_PtrFreeFree(Vec_Ptr_t *p)
Definition: vecPtr.h:569
void Aig_ManFanoutStop(Aig_Man_t *p)
Definition: aigFanout.c:89
if(last==0)
Definition: sparse_int.h:34
Definition: aig.h:69
static void Vec_IntFreeP(Vec_Int_t **p)
Definition: vecInt.h:289
void Tim_ManStopP(Tim_Man_t **p)
Definition: timMan.c:384
void Aig_ManStop(Aig_Man_t *p)
Definition: aigMan.c:187
#define Aig_ManForEachObj(p, pObj, i)
Definition: aig.h:403
#define ABC_FREE(obj)
Definition: abc_global.h:232
#define ABC_PRT(a, t)
Definition: abc_global.h:220
static void Vec_PtrFreeP(Vec_Ptr_t **p)
Definition: vecPtr.h:240
static void Vec_VecFreeP(Vec_Vec_t **p)
Definition: vecVec.h:367
#define assert(ex)
Definition: util_old.h:213
typedefABC_NAMESPACE_HEADER_START struct Tim_Man_t_ Tim_Man_t
INCLUDES ///.
Definition: tim.h:92
Ivy_Obj_t* Dec_GraphToNetworkIvy ( Ivy_Man_t pMan,
Dec_Graph_t pGraph 
)

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

Synopsis [Transforms the decomposition graph into the AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 329 of file decAbc.c.

330 {
331  Dec_Node_t * pNode = NULL; // Suppress "might be used uninitialized"
332  Ivy_Obj_t * pAnd0, * pAnd1;
333  int i;
334  // check for constant function
335  if ( Dec_GraphIsConst(pGraph) )
336  return Ivy_NotCond( Ivy_ManConst1(pMan), Dec_GraphIsComplement(pGraph) );
337  // check for a literal
338  if ( Dec_GraphIsVar(pGraph) )
339  return Ivy_NotCond( (Ivy_Obj_t *)Dec_GraphVar(pGraph)->pFunc, Dec_GraphIsComplement(pGraph) );
340  // build the AIG nodes corresponding to the AND gates of the graph
341  Dec_GraphForEachNode( pGraph, pNode, i )
342  {
343  pAnd0 = Ivy_NotCond( (Ivy_Obj_t *)Dec_GraphNode(pGraph, pNode->eEdge0.Node)->pFunc, pNode->eEdge0.fCompl );
344  pAnd1 = Ivy_NotCond( (Ivy_Obj_t *)Dec_GraphNode(pGraph, pNode->eEdge1.Node)->pFunc, pNode->eEdge1.fCompl );
345  pNode->pFunc = Ivy_And( pMan, pAnd0, pAnd1 );
346  }
347  // complement the result if necessary
348  return Ivy_NotCond( (Ivy_Obj_t *)pNode->pFunc, Dec_GraphIsComplement(pGraph) );
349 }
static Ivy_Obj_t * Ivy_ManConst1(Ivy_Man_t *p)
Definition: ivy.h:199
static int Dec_GraphIsConst(Dec_Graph_t *pGraph)
Definition: dec.h:324
static int Dec_GraphIsComplement(Dec_Graph_t *pGraph)
Definition: dec.h:372
static Dec_Node_t * Dec_GraphVar(Dec_Graph_t *pGraph)
Definition: dec.h:517
Definition: ivy.h:73
Dec_Edge_t eEdge0
Definition: dec.h:52
#define Dec_GraphForEachNode(pGraph, pAnd, i)
Definition: dec.h:101
void * pFunc
Definition: dec.h:56
static Ivy_Obj_t * Ivy_NotCond(Ivy_Obj_t *p, int c)
Definition: ivy.h:195
static int Dec_GraphIsVar(Dec_Graph_t *pGraph)
Definition: dec.h:485
static Dec_Node_t * Dec_GraphNode(Dec_Graph_t *pGraph, int i)
Definition: dec.h:437
Dec_Edge_t eEdge1
Definition: dec.h:53
Ivy_Obj_t * Ivy_And(Ivy_Man_t *p, Ivy_Obj_t *p0, Ivy_Obj_t *p1)
Definition: ivyOper.c:84
void Ivy_CutComputeAll ( Ivy_Man_t p,
int  nInputs 
)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 1108 of file ivySeq.c.

1109 {
1110  Ivy_Store_t * pStore;
1111  Ivy_Obj_t * pObj;
1112  int i, nCutsTotal, nCutsTotalM, nNodeTotal, nNodeOver;
1113  abctime clk = Abc_Clock();
1114  if ( nInputs > IVY_CUT_INPUT )
1115  {
1116  printf( "Cannot compute cuts for more than %d inputs.\n", IVY_CUT_INPUT );
1117  return;
1118  }
1119  nNodeTotal = nNodeOver = 0;
1120  nCutsTotal = nCutsTotalM = -Ivy_ManNodeNum(p);
1121  Ivy_ManForEachObj( p, pObj, i )
1122  {
1123  if ( !Ivy_ObjIsNode(pObj) )
1124  continue;
1125  pStore = Ivy_CutComputeForNode( p, pObj, nInputs );
1126  nCutsTotal += pStore->nCuts;
1127  nCutsTotalM += pStore->nCutsM;
1128  nNodeOver += pStore->fSatur;
1129  nNodeTotal++;
1130  }
1131  printf( "All = %6d. Minus = %6d. Triv = %6d. Node = %6d. Satur = %6d. ",
1132  nCutsTotal, nCutsTotalM, Ivy_ManPiNum(p) + Ivy_ManNodeNum(p), nNodeTotal, nNodeOver );
1133  ABC_PRT( "Time", Abc_Clock() - clk );
1134 }
int nCutsM
Definition: ivy.h:169
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static Ivy_Store_t * Ivy_CutComputeForNode(Ivy_Man_t *p, Ivy_Obj_t *pObj, int nLeaves)
Definition: ivySeq.c:1027
static abctime Abc_Clock()
Definition: abc_global.h:279
int fSatur
Definition: ivy.h:171
#define IVY_CUT_INPUT
Definition: ivy.h:153
int nCuts
Definition: ivy.h:168
Definition: ivy.h:73
static int Ivy_ObjIsNode(Ivy_Obj_t *pObj)
Definition: ivy.h:245
static int Ivy_ManPiNum(Ivy_Man_t *p)
Definition: ivy.h:218
#define ABC_PRT(a, t)
Definition: abc_global.h:220
static int Ivy_ManNodeNum(Ivy_Man_t *p)
Definition: ivy.h:227
#define Ivy_ManForEachObj(p, pObj, i)
Definition: ivy.h:393
ABC_INT64_T abctime
Definition: abc_global.h:278

Variable Documentation

int timeRetime

DECLARATIONS ///.

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

FileName [retCore.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Retiming package.]

Synopsis [The core retiming procedures.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - Oct 31, 2006.]

Revision [

Id:
retCore.c,v 1.00 2006/10/31 00:00:00 alanmi Exp

]

Definition at line 30 of file retCore.c.