oagTimerLR.h

Go to the documentation of this file.
00001 /************************************************************
00002 * 
00003 * File: oagTimerLR.h
00004 * Author: Santiago Mok (smok@ee.ucla.edu)
00005 * Created: 01-26-2011
00006 * Last Modified: Mon 14 Mar 2011 08:20:58 PM PDT
00007 *
00008 ************************************************************/
00009 #if !defined(oagTimerLR_P)
00010 #define oagTimerLR_P
00011 
00012 #include "oaDesignDB.h"
00013 #include "oagTimerTimer.h"
00014 #include "oagTimerUtil.h"
00015 
00016 #include <map>
00017 #include <vector>
00018 
00019 #define MAX_INNER_ITERATION 5
00020 namespace oagTimer{
00021 /*---------------------------------------------------------*/
00022 class LR{
00023   public:
00024     LR(oaDesign *d, Timer *t);
00025     ~LR();
00026 
00027     void runDebug();
00028     void printAll(oaOccInst *inst);
00029     void printTiming(oaOccInst *inst);
00030 
00031     void runDP(int type);
00032     //void run();
00033 
00034   private: 
00035     double getDelaySum();
00036     vector<int> getIndices(oaModInst *inst);
00037     void setLMIndex();
00038     void projectLM();
00039     void updateLM();
00040     double getMaxInArr(oaOccInst *inst);
00041     void reverseLM();
00042     void saveSizing(map<oaModInst*,oaString> &m);
00043     void reloadSizing(map<oaModInst*,oaString> &m);
00044 
00045     void runAssign();
00046 
00047     double getLRObjective();
00048     void runDPAssign();
00049     void DpRelaxation();
00050     void mergeFanoutSolutions(oaOccInstTerm *outTerm);
00051     void pruneSolutions(vector<lrData> &d);
00052     void copyVecData(vector<lrData> &src, vector<lrData> &dst);
00053     void DpRestoration();
00054     double getFanoutsMinObjSum(oaOccInstTerm *i, oaString currSize);
00055     oaString getSolution(CellData *c);
00056     double getMaxWeightedFaninObj(oaOccInstTerm *out, oaOccInstTerm *other, oaString otherSize);
00057     oaString resolveInconsistency(CellData *c);
00058 
00066     double getMaxArr(oaOccInstTerm *in, oaString prospSize);
00067 
00068     //Debug:
00069     void printLMAssignment();
00070     void printLMValues();
00071     void checkLMValues();
00072     void printMap(map<oaOccInstTerm*,oaString> m);
00073     void printDPGraph();
00074     double checkSum(oaModInst *inst);
00075     double globalLM;
00076 
00077   private:
00078     oaDesign *design;
00079     Timer *timing;
00080     double factor; //powerFactor;
00081     bool tolSet;
00082     bool iterRefine;
00083 
00084     int _N; // # of LM;
00085     double tau, alpha1, alpha2;
00086     Util ut;
00087     vector<oaModInst*> G; 
00088 
00089     map<oaOccInst*, oaString> dpSolutions;
00090 };
00091 /*---------------------------------------------------------*/
00092 }//namespace
00093 #endif

Generated on Thu Aug 25 14:24:05 2011 by  doxygen 1.3.9.1