#include "abc.h"
Go to the source code of this file.
Functions | |
static Hop_Man_t * | Abc_NtkToMini (Abc_Ntk_t *pNtk) |
static Abc_Ntk_t * | Abc_NtkFromMini (Abc_Ntk_t *pNtkOld, Hop_Man_t *pMan) |
Abc_Ntk_t * | Abc_NtkMiniBalance (Abc_Ntk_t *pNtk) |
Function*************************************************************
Synopsis [Converts the network from the AIG manager into ABC.]
Description []
SideEffects []
SeeAlso []
Definition at line 124 of file abcMini.c.
00125 { 00126 Vec_Ptr_t * vNodes; 00127 Abc_Ntk_t * pNtkNew; 00128 Hop_Obj_t * pObj; 00129 int i; 00130 // perform strashing 00131 pNtkNew = Abc_NtkStartFrom( pNtk, ABC_NTK_STRASH, ABC_FUNC_AIG ); 00132 // transfer the pointers to the basic nodes 00133 Hop_ManConst1(pMan)->pData = Abc_AigConst1(pNtkNew); 00134 Hop_ManForEachPi( pMan, pObj, i ) 00135 pObj->pData = Abc_NtkCi(pNtkNew, i); 00136 // rebuild the AIG 00137 vNodes = Hop_ManDfs( pMan ); 00138 Vec_PtrForEachEntry( vNodes, pObj, i ) 00139 pObj->pData = Abc_AigAnd( pNtkNew->pManFunc, (Abc_Obj_t *)Hop_ObjChild0Copy(pObj), (Abc_Obj_t *)Hop_ObjChild1Copy(pObj) ); 00140 Vec_PtrFree( vNodes ); 00141 // connect the PO nodes 00142 Hop_ManForEachPo( pMan, pObj, i ) 00143 Abc_ObjAddFanin( Abc_NtkCo(pNtkNew, i), (Abc_Obj_t *)Hop_ObjChild0Copy(pObj) ); 00144 if ( !Abc_NtkCheck( pNtkNew ) ) 00145 fprintf( stdout, "Abc_NtkFromMini(): Network check has failed.\n" ); 00146 return pNtkNew; 00147 }
FUNCTION DEFINITIONS ///Function*************************************************************
Synopsis [Gives the current ABC network to AIG manager for processing.]
Description []
SideEffects []
SeeAlso []
Definition at line 45 of file abcMini.c.
00046 { 00047 Abc_Ntk_t * pNtkAig; 00048 Hop_Man_t * pMan, * pTemp; 00049 assert( Abc_NtkIsStrash(pNtk) ); 00050 // convert to the AIG manager 00051 pMan = Abc_NtkToMini( pNtk ); 00052 if ( pMan == NULL ) 00053 return NULL; 00054 if ( !Hop_ManCheck( pMan ) ) 00055 { 00056 printf( "AIG check has failed.\n" ); 00057 Hop_ManStop( pMan ); 00058 return NULL; 00059 } 00060 // perform balance 00061 Hop_ManPrintStats( pMan ); 00062 // Hop_ManDumpBlif( pMan, "aig_temp.blif" ); 00063 pMan = Hop_ManBalance( pTemp = pMan, 1 ); 00064 Hop_ManStop( pTemp ); 00065 Hop_ManPrintStats( pMan ); 00066 // convert from the AIG manager 00067 pNtkAig = Abc_NtkFromMini( pNtk, pMan ); 00068 if ( pNtkAig == NULL ) 00069 return NULL; 00070 Hop_ManStop( pMan ); 00071 // make sure everything is okay 00072 if ( !Abc_NtkCheck( pNtkAig ) ) 00073 { 00074 printf( "Abc_NtkStrash: The network check has failed.\n" ); 00075 Abc_NtkDelete( pNtkAig ); 00076 return NULL; 00077 } 00078 return pNtkAig; 00079 }
CFile****************************************************************
FileName [abcMini.c]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [Network and node package.]
Synopsis [Interface to the minimalistic AIG package.]
Author [Alan Mishchenko]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - June 20, 2005.]
Revision [
] DECLARATIONS ///
Function*************************************************************
Synopsis [Converts the network from the AIG manager into ABC.]
Description []
SideEffects []
SeeAlso []
Definition at line 92 of file abcMini.c.
00093 { 00094 Hop_Man_t * pMan; 00095 Abc_Obj_t * pObj; 00096 int i; 00097 // create the manager 00098 pMan = Hop_ManStart(); 00099 // transfer the pointers to the basic nodes 00100 Abc_AigConst1(pNtk)->pCopy = (Abc_Obj_t *)Hop_ManConst1(pMan); 00101 Abc_NtkForEachCi( pNtk, pObj, i ) 00102 pObj->pCopy = (Abc_Obj_t *)Hop_ObjCreatePi(pMan); 00103 // perform the conversion of the internal nodes (assumes DFS ordering) 00104 Abc_NtkForEachNode( pNtk, pObj, i ) 00105 pObj->pCopy = (Abc_Obj_t *)Hop_And( pMan, (Hop_Obj_t *)Abc_ObjChild0Copy(pObj), (Hop_Obj_t *)Abc_ObjChild1Copy(pObj) ); 00106 // create the POs 00107 Abc_NtkForEachCo( pNtk, pObj, i ) 00108 Hop_ObjCreatePo( pMan, (Hop_Obj_t *)Abc_ObjChild0Copy(pObj) ); 00109 Hop_ManCleanup( pMan ); 00110 return pMan; 00111 }