00001
00019 #include "reo.h"
00020
00024
00028
00047 reo_man * Extra_ReorderInit( int nDdVarsMax, int nNodesMax )
00048 {
00049 reo_man * p;
00050
00051 p = ALLOC( reo_man, 1 );
00052 memset( p, 0, sizeof(reo_man) );
00053
00054 reoResizeStructures( p, nDdVarsMax, nNodesMax, 100 );
00055
00056 p->fMinApl = 0;
00057 p->fMinWidth = 0;
00058 p->fRemapUp = 0;
00059 p->fVerbose = 0;
00060 p->fVerify = 0;
00061 p->nIters = 1;
00062 return p;
00063 }
00064
00076 void Extra_ReorderQuit( reo_man * p )
00077 {
00078 free( p->pTops );
00079 free( p->pSupp );
00080 free( p->pOrderInt );
00081 free( p->pWidthCofs );
00082 free( p->pMapToPlanes );
00083 free( p->pMapToDdVarsOrig );
00084 free( p->pMapToDdVarsFinal );
00085 free( p->pPlanes );
00086 free( p->pVarCosts );
00087 free( p->pLevelOrder );
00088 free( p->HTable );
00089 free( p->pRefNodes );
00090 reoUnitsStopDispenser( p );
00091 free( p->pMemChunks );
00092 free( p );
00093 }
00094
00119 void Extra_ReorderSetMinimizationType( reo_man * p, reo_min_type fMinType )
00120 {
00121 if ( fMinType == REO_MINIMIZE_NODES )
00122 {
00123 p->fMinWidth = 0;
00124 p->fMinApl = 0;
00125 }
00126 else if ( fMinType == REO_MINIMIZE_WIDTH )
00127 {
00128 p->fMinWidth = 1;
00129 p->fMinApl = 0;
00130 }
00131 else if ( fMinType == REO_MINIMIZE_APL )
00132 {
00133 p->fMinWidth = 0;
00134 p->fMinApl = 1;
00135 }
00136 else
00137 {
00138 assert( 0 );
00139 }
00140 }
00141
00169 void Extra_ReorderSetRemapping( reo_man * p, int fRemapUp )
00170 {
00171 p->fRemapUp = fRemapUp;
00172 }
00173
00189 void Extra_ReorderSetIterations( reo_man * p, int nIters )
00190 {
00191 p->nIters = nIters;
00192 }
00193
00209 void Extra_ReorderSetVerification( reo_man * p, int fVerify )
00210 {
00211 p->fVerify = fVerify;
00212 }
00213
00226 void Extra_ReorderSetVerbosity( reo_man * p, int fVerbose )
00227 {
00228 p->fVerbose = fVerbose;
00229 }
00230
00259 DdNode * Extra_Reorder( reo_man * p, DdManager * dd, DdNode * Func, int * pOrder )
00260 {
00261 DdNode * FuncRes;
00262 Extra_ReorderArray( p, dd, &Func, &FuncRes, 1, pOrder );
00263 Cudd_Deref( FuncRes );
00264 return FuncRes;
00265 }
00266
00280 void Extra_ReorderArray( reo_man * p, DdManager * dd, DdNode * Funcs[], DdNode * FuncsRes[], int nFuncs, int * pOrder )
00281 {
00282 reoReorderArray( p, dd, Funcs, FuncsRes, nFuncs, pOrder );
00283 }
00284
00285
00289