#include "kit.h"
#include "aig.h"
Go to the source code of this file.
Functions | |
Aig_Obj_t * | Kit_GraphToAigInternal (Aig_Man_t *pMan, Kit_Graph_t *pGraph) |
Aig_Obj_t * | Kit_GraphToAig (Aig_Man_t *pMan, Aig_Obj_t **pFanins, Kit_Graph_t *pGraph) |
Aig_Obj_t * | Kit_TruthToAig (Aig_Man_t *pMan, Aig_Obj_t **pFanins, unsigned *pTruth, int nVars, Vec_Int_t *vMemory) |
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 76 of file kitAig.c.
00077 { 00078 Kit_Node_t * pNode = NULL; 00079 int i; 00080 // collect the fanins 00081 Kit_GraphForEachLeaf( pGraph, pNode, i ) 00082 pNode->pFunc = pFanins[i]; 00083 // perform strashing 00084 return Kit_GraphToAigInternal( pMan, pGraph ); 00085 }
Aig_Obj_t* Kit_GraphToAigInternal | ( | Aig_Man_t * | pMan, | |
Kit_Graph_t * | pGraph | |||
) |
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 [
] DECLARATIONS /// FUNCTION DEFINITIONS ///Function*************************************************************
Synopsis [Transforms the decomposition graph into the AIG.]
Description []
SideEffects []
SeeAlso []
Definition at line 43 of file kitAig.c.
00044 { 00045 Kit_Node_t * pNode = NULL; 00046 Aig_Obj_t * pAnd0, * pAnd1; 00047 int i; 00048 // check for constant function 00049 if ( Kit_GraphIsConst(pGraph) ) 00050 return Aig_NotCond( Aig_ManConst1(pMan), Kit_GraphIsComplement(pGraph) ); 00051 // check for a literal 00052 if ( Kit_GraphIsVar(pGraph) ) 00053 return Aig_NotCond( Kit_GraphVar(pGraph)->pFunc, Kit_GraphIsComplement(pGraph) ); 00054 // build the AIG nodes corresponding to the AND gates of the graph 00055 Kit_GraphForEachNode( pGraph, pNode, i ) 00056 { 00057 pAnd0 = Aig_NotCond( Kit_GraphNode(pGraph, pNode->eEdge0.Node)->pFunc, pNode->eEdge0.fCompl ); 00058 pAnd1 = Aig_NotCond( Kit_GraphNode(pGraph, pNode->eEdge1.Node)->pFunc, pNode->eEdge1.fCompl ); 00059 pNode->pFunc = Aig_And( pMan, pAnd0, pAnd1 ); 00060 } 00061 // complement the result if necessary 00062 return Aig_NotCond( pNode->pFunc, Kit_GraphIsComplement(pGraph) ); 00063 }
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 98 of file kitAig.c.
00099 { 00100 Aig_Obj_t * pObj; 00101 Kit_Graph_t * pGraph; 00102 // transform truth table into the decomposition tree 00103 if ( vMemory == NULL ) 00104 { 00105 vMemory = Vec_IntAlloc( 0 ); 00106 pGraph = Kit_TruthToGraph( pTruth, nVars, vMemory ); 00107 Vec_IntFree( vMemory ); 00108 } 00109 else 00110 pGraph = Kit_TruthToGraph( pTruth, nVars, vMemory ); 00111 // derive the AIG for the decomposition tree 00112 pObj = Kit_GraphToAig( pMan, pFanins, pGraph ); 00113 Kit_GraphFree( pGraph ); 00114 return pObj; 00115 }