52 if ( Dec_GraphIsConst(pGraph) )
53 return Abc_ObjNotCond(
Abc_AigConst1(pNtk), Dec_GraphIsComplement(pGraph) );
55 if ( Dec_GraphIsVar(pGraph) )
56 return Abc_ObjNotCond( (
Abc_Obj_t *)Dec_GraphVar(pGraph)->pFunc, Dec_GraphIsComplement(pGraph) );
60 pAnd0 = Abc_ObjNotCond( (
Abc_Obj_t *)Dec_GraphNode(pGraph, pNode->
eEdge0.Node)->pFunc, pNode->
eEdge0.fCompl );
61 pAnd1 = Abc_ObjNotCond( (
Abc_Obj_t *)Dec_GraphNode(pGraph, pNode->
eEdge1.Node)->pFunc, pNode->
eEdge1.fCompl );
65 return Abc_ObjNotCond( (
Abc_Obj_t *)pNode->
pFunc, Dec_GraphIsComplement(pGraph) );
87 pNode->
pFunc = Vec_PtrEntry( vFaninAigs, i );
89 Dec_GraphFree( pFForm );
110 pNode->
pFunc = Vec_PtrEntry( vFaninAigs, i );
133 if ( Dec_GraphIsConst(pGraph) )
134 return Abc_ObjNotCond(
Abc_AigConst1(pNtk), Dec_GraphIsComplement(pGraph) );
136 if ( Dec_GraphIsVar(pGraph) )
137 return Abc_ObjNotCond( (
Abc_Obj_t *)Dec_GraphVar(pGraph)->pFunc, Dec_GraphIsComplement(pGraph) );
141 pAnd0 = Abc_ObjNotCond( (
Abc_Obj_t *)Dec_GraphNode(pGraph, pNode->
eEdge0.Node)->pFunc, pNode->
eEdge0.fCompl );
142 pAnd1 = Abc_ObjNotCond( (
Abc_Obj_t *)Dec_GraphNode(pGraph, pNode->
eEdge1.Node)->pFunc, pNode->
eEdge1.fCompl );
144 pAnd = Abc_NtkCreateNode( pNtk );
150 return Abc_ObjNotCond( (
Abc_Obj_t *)pNode->
pFunc, Dec_GraphIsComplement(pGraph) );
172 int i, Counter, LevelNew, LevelOld;
174 if ( Dec_GraphIsConst(pGraph) || Dec_GraphIsVar(pGraph) )
184 pNode0 = Dec_GraphNode( pGraph, pNode->
eEdge0.Node );
185 pNode1 = Dec_GraphNode( pGraph, pNode->
eEdge1.Node );
189 if ( pAnd0 && pAnd1 )
192 pAnd0 = Abc_ObjNotCond( pAnd0, pNode->
eEdge0.fCompl );
193 pAnd1 = Abc_ObjNotCond( pAnd1, pNode->
eEdge1.fCompl );
196 if ( Abc_ObjRegular(pAnd) == pRoot )
202 if ( pAnd == NULL || Abc_NodeIsTravIdCurrent(Abc_ObjRegular(pAnd)) )
204 if ( ++Counter > NodeMax )
208 LevelNew = 1 + Abc_MaxInt( pNode0->
Level, pNode1->
Level );
213 else if ( Abc_ObjRegular(pAnd) == Abc_ObjRegular(pAnd0) )
214 LevelNew = (int)Abc_ObjRegular(pAnd0)->Level;
215 else if ( Abc_ObjRegular(pAnd) == Abc_ObjRegular(pAnd1) )
216 LevelNew = (int)Abc_ObjRegular(pAnd1)->Level;
217 LevelOld = (int)Abc_ObjRegular(pAnd)->Level;
220 if ( LevelNew > LevelMax )
223 pNode->
Level = LevelNew;
245 int nNodesNew, nNodesOld, RetValue;
246 nNodesOld = Abc_NtkNodeNum(pNtk);
252 nNodesNew = Abc_NtkNodeNum(pNtk);
275 if ( Dec_GraphIsConst(pGraph) )
276 return Hop_NotCond( Hop_ManConst1(pMan), Dec_GraphIsComplement(pGraph) );
278 if ( Dec_GraphIsVar(pGraph) )
279 return Hop_NotCond( (
Hop_Obj_t *)Dec_GraphVar(pGraph)->pFunc, Dec_GraphIsComplement(pGraph) );
283 pAnd0 = Hop_NotCond( (
Hop_Obj_t *)Dec_GraphNode(pGraph, pNode->
eEdge0.Node)->pFunc, pNode->
eEdge0.fCompl );
284 pAnd1 = Hop_NotCond( (
Hop_Obj_t *)Dec_GraphNode(pGraph, pNode->
eEdge1.Node)->pFunc, pNode->
eEdge1.fCompl );
288 return Hop_NotCond( (
Hop_Obj_t *)pNode->
pFunc, Dec_GraphIsComplement(pGraph) );
315 Dec_GraphFree( pFForm );
336 if ( Dec_GraphIsConst(pGraph) )
337 return Ivy_NotCond( Ivy_ManConst1(pMan), Dec_GraphIsComplement(pGraph) );
339 if ( Dec_GraphIsVar(pGraph) )
340 return Ivy_NotCond( (
Ivy_Obj_t *)Dec_GraphVar(pGraph)->pFunc, Dec_GraphIsComplement(pGraph) );
344 pAnd0 = Ivy_NotCond( (
Ivy_Obj_t *)Dec_GraphNode(pGraph, pNode->
eEdge0.Node)->pFunc, pNode->
eEdge0.fCompl );
345 pAnd1 = Ivy_NotCond( (
Ivy_Obj_t *)Dec_GraphNode(pGraph, pNode->
eEdge1.Node)->pFunc, pNode->
eEdge1.fCompl );
349 return Ivy_NotCond( (
Ivy_Obj_t *)pNode->
pFunc, Dec_GraphIsComplement(pGraph) );
struct Abc_Obj_t_ Abc_Obj_t
ABC_DLL void Abc_ObjAddFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
struct Abc_Aig_t_ Abc_Aig_t
struct Abc_Ntk_t_ Abc_Ntk_t
ABC_DLL Abc_Obj_t * Abc_AigAndLookup(Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1)
ABC_DLL Abc_Obj_t * Abc_AigAnd(Abc_Aig_t *pMan, Abc_Obj_t *p0, Abc_Obj_t *p1)
ABC_DLL int Abc_AigReplace(Abc_Aig_t *pMan, Abc_Obj_t *pOld, Abc_Obj_t *pNew, int fUpdateLevel)
ABC_DLL Abc_Obj_t * Abc_AigConst1(Abc_Ntk_t *pNtk)
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
int Dec_GraphToNetworkCount(Abc_Obj_t *pRoot, Dec_Graph_t *pGraph, int NodeMax, int LevelMax)
Ivy_Obj_t * Dec_GraphToNetworkIvy(Ivy_Man_t *pMan, Dec_Graph_t *pGraph)
Hop_Obj_t * Dec_GraphFactorSop(Hop_Man_t *pMan, char *pSop)
Hop_Obj_t * Dec_GraphToNetworkAig(Hop_Man_t *pMan, Dec_Graph_t *pGraph)
int Dec_GraphUpdateNetwork(Abc_Obj_t *pRoot, Dec_Graph_t *pGraph, int fUpdateLevel, int nGain)
Abc_Obj_t * Dec_GraphToAig(Abc_Ntk_t *pNtk, Dec_Graph_t *pFForm, Vec_Ptr_t *vFaninAigs)
Abc_Obj_t * Dec_GraphToNetworkNoStrash(Abc_Ntk_t *pNtk, Dec_Graph_t *pGraph)
Abc_Obj_t * Dec_SopToAig(Abc_Ntk_t *pNtk, char *pSop, Vec_Ptr_t *vFaninAigs)
ABC_NAMESPACE_IMPL_START Abc_Obj_t * Dec_GraphToNetwork(Abc_Ntk_t *pNtk, Dec_Graph_t *pGraph)
DECLARATIONS ///.
struct Dec_Node_t_ Dec_Node_t
#define Dec_GraphForEachLeaf(pGraph, pLeaf, i)
ITERATORS ///.
#define Dec_GraphForEachNode(pGraph, pAnd, i)
Dec_Graph_t * Dec_Factor(char *pSop)
FUNCTION DECLARATIONS ///.
struct Dec_Graph_t_ Dec_Graph_t
typedefABC_NAMESPACE_HEADER_START struct Hop_Man_t_ Hop_Man_t
INCLUDES ///.
Hop_Obj_t * Hop_IthVar(Hop_Man_t *p, int i)
FUNCTION DEFINITIONS ///.
Hop_Obj_t * Hop_And(Hop_Man_t *p, Hop_Obj_t *p0, Hop_Obj_t *p1)
struct Hop_Obj_t_ Hop_Obj_t
typedefABC_NAMESPACE_HEADER_START struct Ivy_Man_t_ Ivy_Man_t
INCLUDES ///.
struct Ivy_Obj_t_ Ivy_Obj_t
Ivy_Obj_t * Ivy_And(Ivy_Man_t *p, Ivy_Obj_t *p0, Ivy_Obj_t *p1)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.