00001
00002
00003
00004
00005
00006
00007
00008
00009 #if !defined(oagTimerDuetSensitivity_P)
00010 #define oagTimerDuetSensitivity_P
00011
00012 #include "oaDesignDB.h"
00013 #include "oagTimerTimer.h"
00014 #include "oagTimerSensitivity.h"
00015 #include "oagTimerTPoint.h"
00016 #include "oagTimerTPointMaster.h"
00017 #include "oagTimerDesignTool.h"
00018 #include "oagTimerCellData.h"
00019
00020 namespace oagTimer{
00021
00022 using namespace oa;
00023 using namespace std;
00024
00025 struct SensType{
00026 oaModInst *modInst;
00027 oaOccInst *occInst;
00028 oaString name;
00029 double dPower;
00030 double dDelay;
00031 double sens;
00032 };
00033
00034 static bool incr_order (SenseData a, SenseData b){
00035 if(a.delta < b.delta)
00036 return true;
00037 else
00038 return false;
00039 }
00040
00041 static bool decr_order (SenseData a, SenseData b){
00042 if(a.delta > b.delta)
00043 return true;
00044 else
00045 return false;
00046 }
00047
00048 static bool incr (SensType a, SensType b){
00049 if(a.sens < b.sens)
00050 return true;
00051 else
00052 return false;
00053 }
00054
00055 static bool decr (SensType a, SensType b){
00056 if(a.sens > b.sens)
00057 return true;
00058 else
00059 return false;
00060 }
00061
00062 class DuetSensitivity{
00063 public:
00064 DuetSensitivity(oaDesign* d,Timer* t);
00065 ~DuetSensitivity();
00066
00067 public:
00068 void enableDebug();
00069 float getSensitivity(oaInst *old_inst, oaInst *new_inst);
00070
00071
00072
00073
00074
00075 void duetTest(duetType type);
00076 void getDuetSensitivity(sensitivityList &list, duetType type);
00077
00078
00079 DelayType getDelay(oaModInst* inst);
00080 DelayType getSlack(Timer *timing, oaOccInstTerm* instTermObject);
00081 public:
00082 void run();
00083 private:
00084 void resetUpdList();
00085 void markInst(oaOccInst *inst);
00086 void updateSensList();
00087 bool needUpdate(oaOccInst* i);
00088 void splitCurrList();
00089
00090 void createSensList();
00091 void getSensData(CellData *c);
00092 void remove(oaModInst* currInst);
00093 void mergeList();
00094
00095 list<SensType> sensList;
00096 list<SensType> sensList_temp;
00097 list<SensType> bestList;
00098 list<SensType> regList;
00099
00100
00101 void printSensList();
00102 void print(SensType s);
00103
00104 sensitivityList createSwapList(duetType type);
00105 void find_and_remove(oaModInst* currInst,sensitivityList &list);
00106 void updateSwapList(oaModInst* inst,sensitivityList &list);
00107 void initDesign();
00108 void removeVisited(oaModInst* inst);
00109 void getOtherCells(vector<oaString> &list);
00110 void getDownSizePowerDelaySensitivities(sensitivityList &list, CellData *c);
00111
00112
00113 void printDuetList(sensitivityList list, duetType type,int pos);
00114 public:
00115 bool flag;
00116 private:
00117 oaDesign *design;
00118 Timer *timing;
00119 bool debug_flag;
00120 Util ut;
00121 vector<oaModInst*> Design_list;
00122 map<oaOccInst*,int> toUpdMap;
00123
00124
00125
00126 int numOfRoots;
00127 int numOfRootsWithgreaterFO4;
00128 int numOfRootsWithgreaterDepth10;
00129 int numOfRootsWithgreaterDepth20;
00130 int maxDepth;
00131 int maxFanout;
00132 };
00133
00134 }
00135 #endif