#include "cswInt.h"
Go to the source code of this file.
Functions | |
Csw_Man_t * | Csw_ManStart (Aig_Man_t *pMan, int nCutsMax, int nLeafMax, int fVerbose) |
void | Csw_ManStop (Csw_Man_t *p) |
CFile****************************************************************
FileName [cswMan.c]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [Cut sweeping.]
Synopsis []
Author [Alan Mishchenko]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - July 11, 2007.]
Revision [
] DECLARATIONS /// FUNCTION DEFINITIONS ///Function*************************************************************
Synopsis [Starts the cut sweeping manager.]
Description []
SideEffects []
SeeAlso []
Definition at line 42 of file cswMan.c.
00043 { 00044 Csw_Man_t * p; 00045 Aig_Obj_t * pObj; 00046 int i; 00047 assert( nCutsMax >= 2 ); 00048 assert( nLeafMax <= 16 ); 00049 // allocate the fraiging manager 00050 p = ALLOC( Csw_Man_t, 1 ); 00051 memset( p, 0, sizeof(Csw_Man_t) ); 00052 p->nCutsMax = nCutsMax; 00053 p->nLeafMax = nLeafMax; 00054 p->fVerbose = fVerbose; 00055 p->pManAig = pMan; 00056 // create the new manager 00057 p->pManRes = Aig_ManStartFrom( pMan ); 00058 assert( Aig_ManPiNum(p->pManAig) == Aig_ManPiNum(p->pManRes) ); 00059 // allocate room for cuts and equivalent nodes 00060 p->pnRefs = ALLOC( int, Aig_ManObjNumMax(pMan) ); 00061 p->pEquiv = ALLOC( Aig_Obj_t *, Aig_ManObjNumMax(pMan) ); 00062 p->pCuts = ALLOC( Csw_Cut_t *, Aig_ManObjNumMax(pMan) ); 00063 memset( p->pCuts, 0, sizeof(Aig_Obj_t *) * Aig_ManObjNumMax(pMan) ); 00064 memset( p->pnRefs, 0, sizeof(int) * Aig_ManObjNumMax(pMan) ); 00065 // allocate memory manager 00066 p->nTruthWords = Aig_TruthWordNum(nLeafMax); 00067 p->nCutSize = sizeof(Csw_Cut_t) + sizeof(int) * nLeafMax + sizeof(unsigned) * p->nTruthWords; 00068 p->pMemCuts = Aig_MmFixedStart( p->nCutSize * p->nCutsMax, 512 ); 00069 // allocate hash table for cuts 00070 p->nTableSize = Aig_PrimeCudd( Aig_ManNodeNum(pMan) * p->nCutsMax / 2 ); 00071 p->pTable = ALLOC( Csw_Cut_t *, p->nTableSize ); 00072 memset( p->pTable, 0, sizeof(Aig_Obj_t *) * p->nTableSize ); 00073 // set the pointers to the available fraig nodes 00074 Csw_ObjSetEquiv( p, Aig_ManConst1(p->pManAig), Aig_ManConst1(p->pManRes) ); 00075 Aig_ManForEachPi( p->pManAig, pObj, i ) 00076 Csw_ObjSetEquiv( p, pObj, Aig_ManPi(p->pManRes, i) ); 00077 // room for temporary truth tables 00078 p->puTemp[0] = ALLOC( unsigned, 4 * p->nTruthWords ); 00079 p->puTemp[1] = p->puTemp[0] + p->nTruthWords; 00080 p->puTemp[2] = p->puTemp[1] + p->nTruthWords; 00081 p->puTemp[3] = p->puTemp[2] + p->nTruthWords; 00082 return p; 00083 }
void Csw_ManStop | ( | Csw_Man_t * | p | ) |
Function*************************************************************
Synopsis [Stops the fraiging manager.]
Description []
SideEffects []
SeeAlso []
Definition at line 96 of file cswMan.c.
00097 { 00098 if ( p->fVerbose ) 00099 { 00100 int nNodesBeg = Aig_ManNodeNum(p->pManAig); 00101 int nNodesEnd = Aig_ManNodeNum(p->pManRes); 00102 printf( "Beg = %7d. End = %7d. (%6.2f %%) Try = %7d. Cuts = %8d.\n", 00103 nNodesBeg, nNodesEnd, 100.0*(nNodesBeg-nNodesEnd)/nNodesBeg, 00104 p->nNodesTried, Csw_TableCountCuts( p ) ); 00105 printf( "Triv0 = %6d. Triv1 = %6d. Triv2 = %6d. Cut-replace = %6d.\n", 00106 p->nNodesTriv0, p->nNodesTriv1, p->nNodesTriv2, p->nNodesCuts ); 00107 PRTP( "Cuts ", p->timeCuts, p->timeTotal ); 00108 PRTP( "Hashing ", p->timeHash, p->timeTotal ); 00109 PRTP( "Other ", p->timeOther, p->timeTotal ); 00110 PRTP( "TOTAL ", p->timeTotal, p->timeTotal ); 00111 } 00112 free( p->puTemp[0] ); 00113 Aig_MmFixedStop( p->pMemCuts, 0 ); 00114 free( p->pnRefs ); 00115 free( p->pEquiv ); 00116 free( p->pCuts ); 00117 free( p->pTable ); 00118 free( p ); 00119 }