#include "abc.h"
Go to the source code of this file.
Functions | |
static Abc_Ntk_t * | Abc_NtkFromGlobalBdds (Abc_Ntk_t *pNtk) |
static Abc_Obj_t * | Abc_NodeFromGlobalBdds (Abc_Ntk_t *pNtkNew, DdManager *dd, DdNode *bFunc) |
Abc_Ntk_t * | Abc_NtkCollapse (Abc_Ntk_t *pNtk, int fBddSizeMax, int fDualRail, int fReorder, int fVerbose) |
Function*************************************************************
Synopsis [Derives the network with the given global BDD.]
Description []
SideEffects []
SeeAlso []
Definition at line 143 of file abcClpBdd.c.
00144 { 00145 Abc_Obj_t * pNodeNew, * pTemp; 00146 int i; 00147 // create a new node 00148 pNodeNew = Abc_NtkCreateNode( pNtkNew ); 00149 // add the fanins in the order, in which they appear in the reordered manager 00150 Abc_NtkForEachCi( pNtkNew, pTemp, i ) 00151 Abc_ObjAddFanin( pNodeNew, Abc_NtkCi(pNtkNew, dd->invperm[i]) ); 00152 // transfer the function 00153 pNodeNew->pData = Extra_TransferLevelByLevel( dd, pNtkNew->pManFunc, bFunc ); Cudd_Ref( pNodeNew->pData ); 00154 return pNodeNew; 00155 }
Abc_Ntk_t* Abc_NtkCollapse | ( | Abc_Ntk_t * | pNtk, | |
int | fBddSizeMax, | |||
int | fDualRail, | |||
int | fReorder, | |||
int | fVerbose | |||
) |
FUNCTION DEFINITIONS ///Function*************************************************************
Synopsis [Collapses the network.]
Description []
SideEffects []
SeeAlso []
Definition at line 45 of file abcClpBdd.c.
00046 { 00047 Abc_Ntk_t * pNtkNew; 00048 int clk = clock(); 00049 00050 assert( Abc_NtkIsStrash(pNtk) ); 00051 // compute the global BDDs 00052 if ( Abc_NtkBuildGlobalBdds(pNtk, fBddSizeMax, 1, fReorder, fVerbose) == NULL ) 00053 return NULL; 00054 if ( fVerbose ) 00055 { 00056 DdManager * dd = Abc_NtkGlobalBddMan( pNtk ); 00057 printf( "Shared BDD size = %6d nodes. ", Cudd_ReadKeys(dd) - Cudd_ReadDead(dd) ); 00058 PRT( "BDD construction time", clock() - clk ); 00059 } 00060 00061 // create the new network 00062 pNtkNew = Abc_NtkFromGlobalBdds( pNtk ); 00063 // Abc_NtkFreeGlobalBdds( pNtk ); 00064 Abc_NtkFreeGlobalBdds( pNtk, 1 ); 00065 if ( pNtkNew == NULL ) 00066 { 00067 // Cudd_Quit( pNtk->pManGlob ); 00068 // pNtk->pManGlob = NULL; 00069 return NULL; 00070 } 00071 // Extra_StopManager( pNtk->pManGlob ); 00072 // pNtk->pManGlob = NULL; 00073 00074 // make the network minimum base 00075 Abc_NtkMinimumBase( pNtkNew ); 00076 00077 if ( pNtk->pExdc ) 00078 pNtkNew->pExdc = Abc_NtkDup( pNtk->pExdc ); 00079 00080 // make sure that everything is okay 00081 if ( !Abc_NtkCheck( pNtkNew ) ) 00082 { 00083 printf( "Abc_NtkCollapse: The network check has failed.\n" ); 00084 Abc_NtkDelete( pNtkNew ); 00085 return NULL; 00086 } 00087 return pNtkNew; 00088 }
CFile****************************************************************
FileName [abcCollapse.c]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [Network and node package.]
Synopsis [Collapsing the network into two-levels.]
Author [Alan Mishchenko]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - June 20, 2005.]
Revision [
] DECLARATIONS ///
Function*************************************************************
Synopsis [Derives the network with the given global BDD.]
Description []
SideEffects []
SeeAlso []
Definition at line 101 of file abcClpBdd.c.
00102 { 00103 ProgressBar * pProgress; 00104 Abc_Ntk_t * pNtkNew; 00105 Abc_Obj_t * pNode, * pDriver, * pNodeNew; 00106 // DdManager * dd = pNtk->pManGlob; 00107 DdManager * dd = Abc_NtkGlobalBddMan( pNtk ); 00108 int i; 00109 // start the new network 00110 pNtkNew = Abc_NtkStartFrom( pNtk, ABC_NTK_LOGIC, ABC_FUNC_BDD ); 00111 // make sure the new manager has the same number of inputs 00112 Cudd_bddIthVar( pNtkNew->pManFunc, dd->size-1 ); 00113 // process the POs 00114 pProgress = Extra_ProgressBarStart( stdout, Abc_NtkCoNum(pNtk) ); 00115 Abc_NtkForEachCo( pNtk, pNode, i ) 00116 { 00117 Extra_ProgressBarUpdate( pProgress, i, NULL ); 00118 pDriver = Abc_ObjFanin0(pNode); 00119 if ( Abc_ObjIsCi(pDriver) && !strcmp(Abc_ObjName(pNode), Abc_ObjName(pDriver)) ) 00120 { 00121 Abc_ObjAddFanin( pNode->pCopy, pDriver->pCopy ); 00122 continue; 00123 } 00124 // pNodeNew = Abc_NodeFromGlobalBdds( pNtkNew, dd, Vec_PtrEntry(pNtk->vFuncsGlob, i) ); 00125 pNodeNew = Abc_NodeFromGlobalBdds( pNtkNew, dd, Abc_ObjGlobalBdd(pNode) ); 00126 Abc_ObjAddFanin( pNode->pCopy, pNodeNew ); 00127 } 00128 Extra_ProgressBarStop( pProgress ); 00129 return pNtkNew; 00130 }