/**Function************************************************************* Synopsis [] Description [] SideEffects [] SeeAlso [] ***********************************************************************/ void Abc_FrameDeallocate( Abc_Frame_t * p ) { extern void Rwt_ManGlobalStop(); extern void undefine_cube_size(); // extern void Ivy_TruthManStop(); // Abc_HManStop(); // undefine_cube_size(); Rwt_ManGlobalStop(); // Ivy_TruthManStop(); if ( p->vAbcObjIds) Vec_IntFree( p->vAbcObjIds ); if ( p->vCexVec ) Vec_PtrFreeFree( p->vCexVec ); if ( p->vPoEquivs ) Vec_VecFree( (Vec_Vec_t *)p->vPoEquivs ); if ( p->vStatuses ) Vec_IntFree( p->vStatuses ); if ( p->pLibVer ) Abc_LibFree( (Abc_Lib_t *)p->pLibVer, NULL ); if ( p->pManDec ) Dec_ManStop( (Dec_Man_t *)p->pManDec ); if ( p->dd ) Extra_StopManager( p->dd ); if ( p->vStore ) Vec_PtrFree( p->vStore ); if ( p->pSave1 ) Aig_ManStop( (Aig_Man_t *)p->pSave1 ); if ( p->pSave2 ) Aig_ManStop( (Aig_Man_t *)p->pSave2 ); if ( p->pSave3 ) Aig_ManStop( (Aig_Man_t *)p->pSave3 ); if ( p->pSave4 ) Aig_ManStop( (Aig_Man_t *)p->pSave4 ); if ( p->vPlugInComBinPairs ) { char * pTemp; int i; Vec_PtrForEachEntry( char *, p->vPlugInComBinPairs, pTemp, i ) ABC_FREE( pTemp ); Vec_PtrFree( p->vPlugInComBinPairs ); }
/**Function************************************************************* Synopsis [Extracts sequential DCs of the network.] Description [] SideEffects [] SeeAlso [] ***********************************************************************/ int Abc_NtkExtractSequentialDcs( Abc_Ntk_t * pNtk, int fVerbose ) { int fReorder = 1; DdManager * dd; DdNode * bRelation, * bInitial, * bUnreach; // remove EXDC network if present if ( pNtk->pExdc ) { Abc_NtkDelete( pNtk->pExdc ); pNtk->pExdc = NULL; } // compute the global BDDs of the latches dd = Abc_NtkBuildGlobalBdds( pNtk, 10000000, 1, 1, fVerbose ); if ( dd == NULL ) return 0; if ( fVerbose ) printf( "Shared BDD size = %6d nodes.\n", Cudd_ReadKeys(dd) - Cudd_ReadDead(dd) ); // create the transition relation (dereferenced global BDDs) bRelation = Abc_NtkTransitionRelation( dd, pNtk, fVerbose ); Cudd_Ref( bRelation ); // create the initial state and the variable map bInitial = Abc_NtkInitStateAndVarMap( dd, pNtk, fVerbose ); Cudd_Ref( bInitial ); // compute the unreachable states bUnreach = Abc_NtkComputeUnreachable( dd, pNtk, bRelation, bInitial, fVerbose ); Cudd_Ref( bUnreach ); Cudd_RecursiveDeref( dd, bRelation ); Cudd_RecursiveDeref( dd, bInitial ); // reorder and disable reordering if ( fReorder ) { if ( fVerbose ) fprintf( stdout, "BDD nodes in the unreachable states before reordering %d.\n", Cudd_DagSize(bUnreach) ); Cudd_ReduceHeap( dd, CUDD_REORDER_SYMM_SIFT, 1 ); Cudd_AutodynDisable( dd ); if ( fVerbose ) fprintf( stdout, "BDD nodes in the unreachable states after reordering %d.\n", Cudd_DagSize(bUnreach) ); } // allocate ZDD variables Cudd_zddVarsFromBddVars( dd, 2 ); // create the EXDC network representing the unreachable states if ( pNtk->pExdc ) Abc_NtkDelete( pNtk->pExdc ); pNtk->pExdc = Abc_NtkConstructExdc( dd, pNtk, bUnreach ); Cudd_RecursiveDeref( dd, bUnreach ); Extra_StopManager( dd ); // pNtk->pManGlob = NULL; // make sure that everything is okay if ( pNtk->pExdc && !Abc_NtkCheck( pNtk->pExdc ) ) { printf( "Abc_NtkExtractSequentialDcs: The network check has failed.\n" ); Abc_NtkDelete( pNtk->pExdc ); return 0; } return 1; }
/**Function************************************************************* Synopsis [] Description [] SideEffects [] SeeAlso [] ***********************************************************************/ void Abc_MvExperiment() { Mv_Man_t * p; // get the functions p = ALLOC( Mv_Man_t, 1 ); memset( p, 0, sizeof(Mv_Man_t) ); p->dd = Cudd_Init( 32, 0, CUDD_UNIQUE_SLOTS, CUDD_CACHE_SLOTS, 0 ); p->nFuncs = 15; p->nInputs = 9; Abc_MvRead( p ); // process the functions Abc_MvPrintStats( p ); // Cudd_ReduceHeap( p->dd, CUDD_REORDER_SYMM_SIFT, 1 ); // Abc_MvPrintStats( p ); // try detecting support reducing bound set Abc_MvDecompose( p ); // remove the manager Abc_MvDeref( p ); Extra_StopManager( p->dd ); free( p ); }
/**Function************************************************************* Synopsis [] Description [] SideEffects [] SeeAlso [] ***********************************************************************/ void Abc_FrameDeallocate( Abc_Frame_t * p ) { extern void Rwt_ManGlobalStop(); extern void undefine_cube_size(); // extern void Ivy_TruthManStop(); // Abc_HManStop(); // undefine_cube_size(); Rwt_ManGlobalStop(); // Ivy_TruthManStop(); if ( p->pLibVer ) Abc_LibFree( (Abc_Lib_t *)p->pLibVer, NULL ); if ( p->pManDec ) Dec_ManStop( (Dec_Man_t *)p->pManDec ); if ( p->dd ) Extra_StopManager( p->dd ); if ( p->vStore ) Vec_PtrFree( p->vStore ); if ( p->pSave1 ) Aig_ManStop( (Aig_Man_t *)p->pSave1 ); if ( p->pSave2 ) Aig_ManStop( (Aig_Man_t *)p->pSave2 ); if ( p->pSave3 ) Aig_ManStop( (Aig_Man_t *)p->pSave3 ); if ( p->pSave4 ) Aig_ManStop( (Aig_Man_t *)p->pSave4 ); Abc_FrameDeleteAllNetworks( p ); ABC_FREE( p->pCex ); ABC_FREE( p ); s_GlobalFrame = NULL; }
/**Function************************************************************* Synopsis [Performs renoding as technology mapping.] Description [] SideEffects [] SeeAlso [] ***********************************************************************/ Abc_Ntk_t * Abc_NtkRenode( Abc_Ntk_t * pNtk, int nFaninMax, int nCubeMax, int nFlowIters, int nAreaIters, int fArea, int fUseBdds, int fUseSops, int fUseCnfs, int fUseMv, int fVerbose ) { extern Abc_Ntk_t * Abc_NtkIf( Abc_Ntk_t * pNtk, If_Par_t * pPars ); If_Par_t Pars, * pPars = &Pars; Abc_Ntk_t * pNtkNew; if ( Abc_NtkGetChoiceNum( pNtk ) ) printf( "Performing renoding with choices.\n" ); nDsdCounter = 0; // set defaults memset( pPars, 0, sizeof(If_Par_t) ); // user-controlable paramters pPars->nLutSize = nFaninMax; pPars->nCutsMax = nCubeMax; pPars->nFlowIters = nFlowIters; pPars->nAreaIters = nAreaIters; pPars->DelayTarget = -1; pPars->Epsilon = (float)0.005; pPars->fPreprocess = 1; pPars->fArea = fArea; pPars->fFancy = 0; pPars->fExpRed = 0; // pPars->fLatchPaths = 0; pPars->fVerbose = fVerbose; // internal parameters pPars->fTruth = 1; pPars->fUsePerm = 1; pPars->nLatchesCi = 0; pPars->nLatchesCo = 0; pPars->pLutLib = NULL; // Abc_FrameReadLibLut(); pPars->pTimesArr = NULL; pPars->pTimesArr = NULL; pPars->fUseBdds = fUseBdds; pPars->fUseSops = fUseSops; pPars->fUseCnfs = fUseCnfs; pPars->fUseMv = fUseMv; if ( fUseBdds ) pPars->pFuncCost = Abc_NtkRenodeEvalBdd; else if ( fUseSops ) pPars->pFuncCost = Abc_NtkRenodeEvalSop; else if ( fUseCnfs ) { pPars->fArea = 1; pPars->pFuncCost = Abc_NtkRenodeEvalCnf; } else if ( fUseMv ) pPars->pFuncCost = Abc_NtkRenodeEvalMv; else pPars->pFuncCost = Abc_NtkRenodeEvalAig; // start the manager if ( fUseBdds ) { assert( s_pReo == NULL ); s_pDd = Cudd_Init( nFaninMax, 0, CUDD_UNIQUE_SLOTS, CUDD_CACHE_SLOTS, 0 ); s_pReo = Extra_ReorderInit( nFaninMax, 100 ); pPars->pReoMan = s_pReo; } else { assert( s_vMemory == NULL ); s_vMemory = Vec_IntAlloc( 1 << 16 ); s_vMemory2 = Vec_IntAlloc( 1 << 16 ); } // perform mapping/renoding pNtkNew = Abc_NtkIf( pNtk, pPars ); // start the manager if ( fUseBdds ) { Extra_StopManager( s_pDd ); Extra_ReorderQuit( s_pReo ); s_pReo = NULL; s_pDd = NULL; } else { Vec_IntFree( s_vMemory ); Vec_IntFree( s_vMemory2 ); s_vMemory = NULL; s_vMemory2 = NULL; } // printf( "Decomposed %d functions.\n", nDsdCounter ); return pNtkNew; }