ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
kitAig.c File Reference
#include "kit.h"
#include "aig/aig/aig.h"
Include dependency graph for kitAig.c:

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START Aig_Obj_tKit_GraphToAigInternal (Aig_Man_t *pMan, Kit_Graph_t *pGraph)
 DECLARATIONS ///.
 
Aig_Obj_tKit_GraphToAig (Aig_Man_t *pMan, Aig_Obj_t **pFanins, Kit_Graph_t *pGraph)
 
Aig_Obj_tKit_TruthToAig (Aig_Man_t *pMan, Aig_Obj_t **pFanins, unsigned *pTruth, int nVars, Vec_Int_t *vMemory)
 

Function Documentation

◆ Kit_GraphToAig()

Aig_Obj_t * Kit_GraphToAig ( Aig_Man_t * pMan,
Aig_Obj_t ** pFanins,
Kit_Graph_t * pGraph )

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

Synopsis [Strashes one logic node using its SOP.]

Description []

SideEffects []

SeeAlso []

Definition at line 79 of file kitAig.c.

80{
81 Kit_Node_t * pNode = NULL;
82 int i;
83 // collect the fanins
84 Kit_GraphForEachLeaf( pGraph, pNode, i )
85 pNode->pFunc = pFanins[i];
86 // perform strashing
87 return Kit_GraphToAigInternal( pMan, pGraph );
88}
ABC_NAMESPACE_IMPL_START Aig_Obj_t * Kit_GraphToAigInternal(Aig_Man_t *pMan, Kit_Graph_t *pGraph)
DECLARATIONS ///.
Definition kitAig.c:46
struct Kit_Node_t_ Kit_Node_t
Definition kit.h:69
#define Kit_GraphForEachLeaf(pGraph, pLeaf, i)
Definition kit.h:505
void * pFunc
Definition kit.h:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Kit_GraphToAigInternal()

ABC_NAMESPACE_IMPL_START Aig_Obj_t * Kit_GraphToAigInternal ( Aig_Man_t * pMan,
Kit_Graph_t * pGraph )

DECLARATIONS ///.

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

FileName [kitAig.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Computation kit.]

Synopsis [Procedures involving AIGs.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - Dec 6, 2006.]

Revision [

Id
kitAig.c,v 1.00 2006/12/06 00:00:00 alanmi Exp

] FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis [Transforms the decomposition graph into the AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 46 of file kitAig.c.

47{
48 Kit_Node_t * pNode = NULL;
49 Aig_Obj_t * pAnd0, * pAnd1;
50 int i;
51 // check for constant function
52 if ( Kit_GraphIsConst(pGraph) )
53 return Aig_NotCond( Aig_ManConst1(pMan), Kit_GraphIsComplement(pGraph) );
54 // check for a literal
55 if ( Kit_GraphIsVar(pGraph) )
56 return Aig_NotCond( (Aig_Obj_t *)Kit_GraphVar(pGraph)->pFunc, Kit_GraphIsComplement(pGraph) );
57 // build the AIG nodes corresponding to the AND gates of the graph
58 Kit_GraphForEachNode( pGraph, pNode, i )
59 {
60 pAnd0 = Aig_NotCond( (Aig_Obj_t *)Kit_GraphNode(pGraph, pNode->eEdge0.Node)->pFunc, pNode->eEdge0.fCompl );
61 pAnd1 = Aig_NotCond( (Aig_Obj_t *)Kit_GraphNode(pGraph, pNode->eEdge1.Node)->pFunc, pNode->eEdge1.fCompl );
62 pNode->pFunc = Aig_And( pMan, pAnd0, pAnd1 );
63 }
64 // complement the result if necessary
65 return Aig_NotCond( (Aig_Obj_t *)pNode->pFunc, Kit_GraphIsComplement(pGraph) );
66}
Aig_Obj_t * Aig_And(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
Definition aigOper.c:104
struct Aig_Obj_t_ Aig_Obj_t
Definition aig.h:51
#define Kit_GraphForEachNode(pGraph, pAnd, i)
Definition kit.h:507
unsigned fCompl
Definition kit.h:65
unsigned Node
Definition kit.h:66
Kit_Edge_t eEdge0
Definition kit.h:72
Kit_Edge_t eEdge1
Definition kit.h:73
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Kit_TruthToAig()

Aig_Obj_t * Kit_TruthToAig ( Aig_Man_t * pMan,
Aig_Obj_t ** pFanins,
unsigned * pTruth,
int nVars,
Vec_Int_t * vMemory )

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

Synopsis [Strashed onen logic nodes using its truth table.]

Description []

SideEffects []

SeeAlso []

Definition at line 101 of file kitAig.c.

102{
103 Aig_Obj_t * pObj;
104 Kit_Graph_t * pGraph;
105 // transform truth table into the decomposition tree
106 if ( vMemory == NULL )
107 {
108 vMemory = Vec_IntAlloc( 0 );
109 pGraph = Kit_TruthToGraph( pTruth, nVars, vMemory );
110 Vec_IntFree( vMemory );
111 }
112 else
113 pGraph = Kit_TruthToGraph( pTruth, nVars, vMemory );
114 // derive the AIG for the decomposition tree
115 pObj = Kit_GraphToAig( pMan, pFanins, pGraph );
116 Kit_GraphFree( pGraph );
117 return pObj;
118}
Aig_Obj_t * Kit_GraphToAig(Aig_Man_t *pMan, Aig_Obj_t **pFanins, Kit_Graph_t *pGraph)
Definition kitAig.c:79
struct Kit_Graph_t_ Kit_Graph_t
Definition kit.h:88
void Kit_GraphFree(Kit_Graph_t *pGraph)
Definition kitGraph.c:132
Kit_Graph_t * Kit_TruthToGraph(unsigned *pTruth, int nVars, Vec_Int_t *vMemory)
Definition kitGraph.c:356
Here is the call graph for this function: