00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #if !defined(oagTimerLibData_P)
00014 #define oagTimerLibData_P
00015
00016 #include <map>
00017 #include <set>
00018 #include <vector>
00019 #include <string.h>
00020 #include <string>
00021
00022
00023 #include "oaDesignDB.h"
00024 #include "oagTimerModel.h"
00025
00026 using namespace oa;
00027 using namespace std;
00028 using namespace oagTimer;
00029
00030 namespace oagTimer {
00031 typedef vector<double> Index;
00032 typedef vector<oaString> libDataVector;
00034 struct lutData{
00035 string v1;
00036 string v2;
00037 Index index1;
00038 Index index2;
00039 };
00040
00041 typedef map<string,lutData> luTableMap;
00042
00044 class LibData {
00045 public:
00047 LibData() {
00048 cellScope = false;
00049 currentTimingSense = 0;
00050 isClock = false;
00051 currentLoadLimit = 0.0;
00052 currentRiseDelayModel = currentRiseSlewModel = currentRiseConsModel = currentRisePowerModel = 0;
00053 currentFallDelayModel = currentFallSlewModel = currentFallConsModel = currentFallPowerModel = 0;
00054 currentCellFootprint = NULL;
00055
00056 }
00058 ~LibData() { clear(); }
00059
00061 void clear();
00062
00063 private:
00065 void endCellScope();
00066
00067 public:
00069 oaString libString;
00071 oaString viewString;
00073 libDataVector libCellNames;
00075 std::string libType;
00076
00078 std::string currentPinDir;
00079 std::string var1;
00080 std::string var2;
00082 bool order;
00084 bool ffOrder;
00086 bool powerOrder;
00088 char *currentPinName;
00090 char *currentRelatedPin;
00092 int currentTimingSense;
00094 int currentTimingType;
00096 double currentPinCap;
00098 double currentLoadLimit;
00100 TimerModel currentModel;
00102 const TimerModel *currentRiseDelayModel;
00104 const TimerModel *currentRiseSlewModel;
00106 const TimerModel *currentFallDelayModel;
00108 const TimerModel *currentFallSlewModel;
00110 const TimerModel *currentRiseConsModel;
00112 const TimerModel *currentFallConsModel;
00114 const TimerModel *currentRisePowerModel;
00116 const TimerModel *currentFallPowerModel;
00117
00118
00120 double currentCellArea;
00122 double currentCellLeakPwr;
00124 char *currentCellFootprint;
00126 char *powerUnit;
00128 char *tUnit;
00130 char *capUnit;
00131
00132 double slew_low_fall;
00133
00134 double slew_low_rise;
00135
00136 double slew_high_fall;
00137
00138 double slew_high_rise;
00139
00140 int pushPowerUnit(const char *s);
00141 int pushTimeUnit(const char *s);
00142 int pushCapUnit(const char *s);
00143 int pushThresVal(double d, int pct, int slope);
00144
00145
00146 int pushPin(const char *s);
00147 int pushCellFootprintName(const char *s);
00148 int pushCurrentPinName(const char *s);
00149 int pushPinDir(const char *s);
00150 int pushTimingSense(const char *s);
00151 int pushTimingType(const char *s);
00152 int pushRelatedPin(const char *s);
00153
00154 int pushCell(const char *s);
00155 int pushCellFall();
00156 int pushCellRise();
00157 int pushFallTran();
00158 int pushRiseTran();
00159 int pushFallCons();
00160 int pushRiseCons();
00161 int pushPath();
00162 int pushRisePower();
00163 int pushFallPower();
00164
00165 int pushVar1(const char *s);
00166 int pushVar2(const char *s);
00167 int pushAxisOrder();
00168 void pushTempAxis();
00169
00170 int pushAxis1(double d);
00171 int pushAxis2(double d);
00172 int pushFFAxis1(double d);
00173 int pushFFAxis2(double d);
00174 int pushPowerAxis1(double d);
00175 int pushPowerAxis2(double d);
00176
00177 int pushTable(const char *s);
00178 int pushTableAxis1(double d);
00179 int pushTableAxis2(double d);
00180 void findIndex(const char *s);
00181 typedef vector<double> axisVector;
00182
00183 private:
00185 bool cellScope;
00186
00188 static oaVoidPointerAppDef<oaTerm> *masterAppDef;
00189
00190 public:
00192 void beginCellScope() {
00193 cellScope = true;
00194 #if defined(DEBUG)
00195 std::cout<< "begin" << std::endl;
00196 #endif
00197 }
00198
00199 private:
00201 bool isClock;
00202
00203 public:
00205 void pushClock() {
00206 isClock = true;
00207 #if defined(DEBUG)
00208 std::cout<< "push clock" << std::endl;
00209 #endif
00210 }
00211
00212 private:
00214 pinDataVector currentPins;
00216 pathDataVector currentPaths;
00218 luTableMap luTable;
00220 axisVector axis1;
00221 axisVector axis2;
00223 int state;
00224
00225 };
00226
00227 }
00228
00229 #endif