52 if ( Kit_GraphIsConst(pGraph) )
53 return Abc_LitNotCond( 1, Kit_GraphIsComplement(pGraph) );
55 if ( Kit_GraphIsVar(pGraph) )
56 return Abc_LitNotCond( Kit_GraphVar(pGraph)->iFunc, Kit_GraphIsComplement(pGraph) );
65 pNode->
iFunc = Gia_ManAppendAnd2( pMan, pAnd0, pAnd1 );
68 return Abc_LitNotCond( pNode->
iFunc, Kit_GraphIsComplement(pGraph) );
76 pNode->
iFunc = vLeaves ? Vec_IntEntry(vLeaves, i) : Gia_Obj2Lit(pMan, Gia_ManPi(pMan, i));
85 if ( vMemory == NULL )
87 vMemory = Vec_IntAlloc( 0 );
89 Vec_IntFree( vMemory );
95 printf(
"Kit_TruthToGia(): Converting truth table to AIG has failed for function:\n" );
108 if ( vMemory == NULL )
110 vMemory = Vec_IntAlloc( 0 );
112 Vec_IntFree( vMemory );
116 if ( pGraph == NULL )
118 printf(
"Kit_TruthToGia2(): Converting truth table to AIG has failed for function:\n" );
144 if ( vMemory == NULL )
146 vMemory = Vec_IntAlloc( 0 );
148 Vec_IntFree( vMemory );
152 if ( pGraph == NULL )
154 printf(
"Kit_TruthToGia2(): Converting truth table to AIG has failed for function:\n" );
159 nNodes = Kit_GraphNodeNum( pGraph );
177 int nVars = Kit_GraphLeaveNum(pGraph);
178 assert( nVars >= 0 && nVars <= pGraph->nSize );
179 if ( Kit_GraphIsConst(pGraph) )
180 Vec_IntPush( vRes, Kit_GraphIsConst1(pGraph) );
181 else if ( Kit_GraphIsVar(pGraph) )
182 Vec_IntPush( vRes, 4 + Abc_Var2Lit(Kit_GraphVarInt(pGraph), Kit_GraphIsComplement(pGraph)) );
188 Kit_Node_t * pFan0 = Kit_GraphNodeFanin0( pGraph, pNode );
189 Kit_Node_t * pFan1 = Kit_GraphNodeFanin1( pGraph, pNode );
190 int iLit0 = Abc_Var2Lit( Kit_GraphNodeInt(pGraph, pFan0), pNode->
eEdge0.
fCompl );
191 int iLit1 = Abc_Var2Lit( Kit_GraphNodeInt(pGraph, pFan1), pNode->
eEdge1.
fCompl );
193 iLit0 ^= iLit1, iLit1 ^= iLit0, iLit0 ^= iLit1;
194 Vec_IntPushTwo( vRes, 4 + iLit0, 4 + iLit1 );
197 Vec_IntPush( vRes, 4 + Abc_Var2Lit(Kit_GraphNodeInt(pGraph, pNode), Kit_GraphIsComplement(pGraph)) );
206 if ( vMemory == NULL )
208 vMemory = Vec_IntAlloc( 0 );
210 Vec_IntFree( vMemory );
214 if ( pGraph == NULL )
216 printf(
"Kit_TruthToGia2(): Converting truth table to AIG has failed for function:\n" );
221 nNodes = Kit_GraphNodeNum( pGraph );
222 vRes = Vec_IntAlloc( 2*nNodes + 1 );
224 assert( Vec_IntSize(vRes) == 2*nNodes + 1 );
246 if ( Kit_GraphIsConst(pGraph) )
247 return Hop_NotCond( Hop_ManConst1(pMan), Kit_GraphIsComplement(pGraph) );
249 if ( Kit_GraphIsVar(pGraph) )
250 return Hop_NotCond( (
Hop_Obj_t *)Kit_GraphVar(pGraph)->pFunc, Kit_GraphIsComplement(pGraph) );
259 return Hop_NotCond( (
Hop_Obj_t *)pNode->
pFunc, Kit_GraphIsComplement(pGraph) );
276 if ( vMemory == NULL )
278 vMemory = Vec_IntAlloc( 0 );
280 Vec_IntFree( vMemory );
284 if ( pGraph == NULL )
286 printf(
"Kit_TruthToHop(): Converting truth table to AIG has failed for function:\n" );
311 Vec_IntClear( vMemory );
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
struct Gia_Man_t_ Gia_Man_t
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
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
Hop_Obj_t * Kit_GraphToHop(Hop_Man_t *pMan, Kit_Graph_t *pGraph)
int Kit_GraphToGia(Gia_Man_t *pMan, Kit_Graph_t *pGraph, Vec_Int_t *vLeaves, int fHash)
Hop_Obj_t * Kit_GraphToHopInternal(Hop_Man_t *pMan, Kit_Graph_t *pGraph)
ABC_NAMESPACE_IMPL_START int Kit_GraphToGiaInternal(Gia_Man_t *pMan, Kit_Graph_t *pGraph, int fHash)
DECLARATIONS ///.
int Kit_TruthToGia2(Gia_Man_t *pMan, unsigned *pTruth0, unsigned *pTruth1, int nVars, Vec_Int_t *vMemory, Vec_Int_t *vLeaves, int fHash)
Hop_Obj_t * Kit_TruthToHop(Hop_Man_t *pMan, unsigned *pTruth, int nVars, Vec_Int_t *vMemory)
int Kit_TruthToGia(Gia_Man_t *pMan, unsigned *pTruth, int nVars, Vec_Int_t *vMemory, Vec_Int_t *vLeaves, int fHash)
DECLARATIONS ///.
Vec_Int_t * Kit_IsopResub(unsigned *pTruth0, unsigned *pTruth1, int nVars, Vec_Int_t *vMemory)
Hop_Obj_t * Kit_CoverToHop(Hop_Man_t *pMan, Vec_Int_t *vCover, int nVars, Vec_Int_t *vMemory)
void Kit_IsopResubInt(Kit_Graph_t *pGraph, Vec_Int_t *vRes)
int Kit_IsopNodeNum(unsigned *pTruth0, unsigned *pTruth1, int nVars, Vec_Int_t *vMemory)
#define Kit_GraphForEachNode(pGraph, pAnd, i)
struct Kit_Graph_t_ Kit_Graph_t
Kit_Graph_t * Kit_SopFactor(Vec_Int_t *vCover, int fCompl, int nVars, Vec_Int_t *vMemory)
FUNCTION DEFINITIONS ///.
Kit_Graph_t * Kit_TruthToGraph2(unsigned *pTruth0, unsigned *pTruth1, int nVars, Vec_Int_t *vMemory)
struct Kit_Node_t_ Kit_Node_t
void Kit_DsdPrintFromTruth(unsigned *pTruth, int nVars)
void Kit_GraphFree(Kit_Graph_t *pGraph)
#define Kit_GraphForEachLeaf(pGraph, pLeaf, i)
Kit_Graph_t * Kit_TruthToGraph(unsigned *pTruth, int nVars, Vec_Int_t *vMemory)