src/aig/kit/kitHop.c File Reference

#include "kit.h"
#include "hop.h"
Include dependency graph for kitHop.c:

Go to the source code of this file.

Functions

Hop_Obj_tKit_GraphToHopInternal (Hop_Man_t *pMan, Kit_Graph_t *pGraph)
Hop_Obj_tKit_GraphToHop (Hop_Man_t *pMan, Kit_Graph_t *pGraph)
Hop_Obj_tKit_TruthToHop (Hop_Man_t *pMan, unsigned *pTruth, int nVars, Vec_Int_t *vMemory)
Hop_Obj_tKit_CoverToHop (Hop_Man_t *pMan, Vec_Int_t *vCover, int nVars, Vec_Int_t *vMemory)

Function Documentation

Hop_Obj_t* Kit_CoverToHop ( Hop_Man_t pMan,
Vec_Int_t vCover,
int  nVars,
Vec_Int_t vMemory 
)

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

Synopsis [Strashes one logic node using its SOP.]

Description []

SideEffects []

SeeAlso []

Definition at line 128 of file kitHop.c.

00129 {
00130     Kit_Graph_t * pGraph;
00131     Hop_Obj_t * pFunc;
00132     // perform factoring
00133     pGraph = Kit_SopFactor( vCover, 0, nVars, vMemory );
00134     // convert graph to the AIG
00135     pFunc = Kit_GraphToHop( pMan, pGraph );
00136     Kit_GraphFree( pGraph );
00137     return pFunc;
00138 }

Hop_Obj_t* Kit_GraphToHop ( Hop_Man_t pMan,
Kit_Graph_t pGraph 
)

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

Synopsis [Strashes one logic node using its SOP.]

Description []

SideEffects []

SeeAlso []

Definition at line 76 of file kitHop.c.

00077 {
00078     Kit_Node_t * pNode = NULL;
00079     int i;
00080     // collect the fanins
00081     Kit_GraphForEachLeaf( pGraph, pNode, i )
00082         pNode->pFunc = Hop_IthVar( pMan, i );
00083     // perform strashing
00084     return Kit_GraphToHopInternal( pMan, pGraph );
00085 }

Hop_Obj_t* Kit_GraphToHopInternal ( Hop_Man_t pMan,
Kit_Graph_t pGraph 
)

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

FileName [kitHop.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
kitHop.c,v 1.00 2006/12/06 00:00:00 alanmi Exp

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

Synopsis [Transforms the decomposition graph into the AIG.]

Description []

SideEffects []

SeeAlso []

Definition at line 43 of file kitHop.c.

00044 {
00045     Kit_Node_t * pNode = NULL;
00046     Hop_Obj_t * pAnd0, * pAnd1;
00047     int i;
00048     // check for constant function
00049     if ( Kit_GraphIsConst(pGraph) )
00050         return Hop_NotCond( Hop_ManConst1(pMan), Kit_GraphIsComplement(pGraph) );
00051     // check for a literal
00052     if ( Kit_GraphIsVar(pGraph) )
00053         return Hop_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 = Hop_NotCond( Kit_GraphNode(pGraph, pNode->eEdge0.Node)->pFunc, pNode->eEdge0.fCompl ); 
00058         pAnd1 = Hop_NotCond( Kit_GraphNode(pGraph, pNode->eEdge1.Node)->pFunc, pNode->eEdge1.fCompl ); 
00059         pNode->pFunc = Hop_And( pMan, pAnd0, pAnd1 );
00060     }
00061     // complement the result if necessary
00062     return Hop_NotCond( pNode->pFunc, Kit_GraphIsComplement(pGraph) );
00063 }

Hop_Obj_t* Kit_TruthToHop ( Hop_Man_t pMan,
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 kitHop.c.

00099 {
00100     Hop_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_GraphToHop( pMan, pGraph );
00113     Kit_GraphFree( pGraph );
00114     return pObj;
00115 }


Generated on Tue Jan 5 12:18:28 2010 for abc70930 by  doxygen 1.6.1