diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2006-01-18 08:01:00 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2006-01-18 08:01:00 -0800 |
commit | c0ef1f469a3204adbd26edec0b9d3af56532d794 (patch) | |
tree | f9c957991a7fa2a50198ce0b97a215f2ada97f1b /src/opt | |
parent | 9e073ed8506c086d6e827f5588d1ee56c57703da (diff) | |
download | abc-c0ef1f469a3204adbd26edec0b9d3af56532d794.tar.gz abc-c0ef1f469a3204adbd26edec0b9d3af56532d794.tar.bz2 abc-c0ef1f469a3204adbd26edec0b9d3af56532d794.zip |
Version abc60118
Diffstat (limited to 'src/opt')
-rw-r--r-- | src/opt/dec/decAbc.c | 35 | ||||
-rw-r--r-- | src/opt/fxu/fxu.c | 2 |
2 files changed, 36 insertions, 1 deletions
diff --git a/src/opt/dec/decAbc.c b/src/opt/dec/decAbc.c index 1416cf0d..b24773be 100644 --- a/src/opt/dec/decAbc.c +++ b/src/opt/dec/decAbc.c @@ -18,6 +18,7 @@ #include "abc.h" #include "dec.h" +#include "aig.h" //////////////////////////////////////////////////////////////////////// /// DECLARATIONS /// @@ -201,6 +202,40 @@ void Dec_GraphUpdateNetwork( Abc_Obj_t * pRoot, Dec_Graph_t * pGraph, bool fUpda assert( nGain <= nNodesOld - nNodesNew ); } + +/**Function************************************************************* + + Synopsis [Transforms the decomposition graph into the AIG.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +Aig_Node_t * Dec_GraphToNetworkAig( Aig_Man_t * pMan, Dec_Graph_t * pGraph ) +{ + Dec_Node_t * pNode; + Aig_Node_t * pAnd0, * pAnd1; + int i; + // check for constant function + if ( Dec_GraphIsConst(pGraph) ) + return Aig_NotCond( Aig_ManConst1(pMan), Dec_GraphIsComplement(pGraph) ); + // check for a literal + if ( Dec_GraphIsVar(pGraph) ) + return Aig_NotCond( Dec_GraphVar(pGraph)->pFunc, Dec_GraphIsComplement(pGraph) ); + // build the AIG nodes corresponding to the AND gates of the graph + Dec_GraphForEachNode( pGraph, pNode, i ) + { + pAnd0 = Aig_NotCond( Dec_GraphNode(pGraph, pNode->eEdge0.Node)->pFunc, pNode->eEdge0.fCompl ); + pAnd1 = Aig_NotCond( Dec_GraphNode(pGraph, pNode->eEdge1.Node)->pFunc, pNode->eEdge1.fCompl ); + pNode->pFunc = Aig_And( pMan, pAnd0, pAnd1 ); + } + // complement the result if necessary + return Aig_NotCond( pNode->pFunc, Dec_GraphIsComplement(pGraph) ); +} + //////////////////////////////////////////////////////////////////////// /// END OF FILE /// //////////////////////////////////////////////////////////////////////// diff --git a/src/opt/fxu/fxu.c b/src/opt/fxu/fxu.c index 9da34fde..169fb218 100644 --- a/src/opt/fxu/fxu.c +++ b/src/opt/fxu/fxu.c @@ -159,7 +159,7 @@ int Fxu_FastExtract( Fxu_Data_t * pData ) if ( pData->nNodesNew ) Fxu_CreateCovers( p, pData ); Fxu_MatrixDelete( p ); -// printf( "Memory usage after delocation: Total = %d. Peak = %d.\n", s_MemoryTotal, s_MemoryPeak ); +// printf( "Memory usage after deallocation: Total = %d. Peak = %d.\n", s_MemoryTotal, s_MemoryPeak ); if ( pData->nNodesNew == pData->nNodesExt ) printf( "Warning: The limit on the number of extracted divisors has been reached.\n" ); return pData->nNodesNew; |