lpSA.h

Go to the documentation of this file.
00001 #ifndef lpSizer__H
00002 #define lpSizer__H
00003 
00004 #include <stdio.h>
00005 #include <string.h>
00006 #include <utility>
00007 #include <map>
00008 #include <vector>
00009 #include <string>
00010 #include <iostream>
00011 #include <time.h>
00012 #include "oaDesignDB.h"
00013 
00014 #include "oagTimerCellData.h"
00015 #include "oagTimerDesignTool.h"
00016 #include "oagTimerTimer.h"
00017 #include "oagTimerUtil.h"
00018 #include "oagTimerTimerUtil.h"
00019 
00020 #include "solverIF.h"
00021 //#include "lp_lib.h"
00022 
00023 //#define ROBUST_SIZING
00024 
00025 using namespace std;
00026 using namespace oa;
00027 using namespace solver; 
00028 using namespace oagTimer;
00029 //using namespace modeling;
00030 
00031 /* Constants */
00032 
00033 //namespace tg {
00034 namespace oagTimer {
00035 
00036    /* tokens of p /d tradeoff */
00037     class sensToken {
00038       public:
00039       double DT; // Change in the delay 
00040       double DP; // Change in the power
00041       double size;
00042       oaString name;
00043       //int vth;
00044       //void fillData(** oaInst?);
00045     };
00046     
00047     class sensInfo {
00048     public:
00049       oaOccInst *inst;
00050       double size;
00051       vector<sensToken> data; //corresponding size
00052       void sort();
00053       double getSens(double);
00054       void modelSens(oaDesign *d, Timer *t,CellData *cell);
00055       double DTmin, DTmax;
00056       int DTminInd;
00057       //double wInSlack;
00058       oaString origSize;
00059       void assign(oaDesign *d, Timer* t, double);
00060       //int getInd(oaDesign *d, Timer* t, double);
00061     };
00062     
00063     class lpSA {
00064       private:
00065         int _N;
00066         oaDesign *topDesign;
00067         Timer *timer;
00068         vector<sensInfo> _sensInfo;
00069         vector <double> _allocSlack;
00070         solverIF s;
00071         //lprec * _lp;
00072         double *_lp;
00073         Util ut;
00074         map<oaModInst*,oaString> bestDesign;
00075         map<oaModInst*,oaString> currSizing;
00076       public:
00077         lpSA(oaDesign *des, Timer *t);
00078         
00079         static bool checkSlack;
00080         void run();
00081         void save();
00082         void reload();
00083         int iSA();
00084         int rSA();
00085         void checkAssign();
00086         void assign();
00087         void makeSensInfo();
00088         int getDriverIndex(oaOccInstTerm *i);
00089         void saveCurrSizing();
00090         void reloadSizing();
00091         void updateToken();
00092 //      //void checkSlack();
00093         double Tc;
00094         double tcPeriod;
00095         void printCurrConfig();
00096         vector<oaModInst*> topDsgn;
00097     };
00098 };
00099 
00100 #endif

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