00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef _SST_TIMELORD_H
00014 #define _SST_TIMELORD_H
00015
00016 #include <string>
00017 #include <map>
00018
00019 #include <sst/core/sst.h>
00020 #include <sst/core/simulation.h>
00021
00022 namespace SST {
00023
00024 class TimeConverter;
00025
00026
00027
00028
00029 class TimeLord {
00030 typedef std::map<SimTime_t,TimeConverter*> TimeConverterMap_t;
00031 typedef std::map<std::string,TimeConverter*> StringToTCMap_t;
00032
00033 public:
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045 TimeConverter* getTimeConverter(std::string ts);
00046 SimTime_t getSimCycles(std::string timeString, std::string where);
00047
00048 TimeConverter* getNano() {return nano;}
00049 TimeConverter* getMicro() {return micro;}
00050 TimeConverter* getMilli() {return milli;}
00051
00052 private:
00053 friend class SST::SimulationBase;
00054 friend int Simulation::WireUp(Graph& graph, SDL_CompMap_t& sdlMap,
00055 int minPart, int myRank);
00056
00057
00058
00059 TimeConverter *getTimeConverter(SimTime_t simCycles);
00060
00061 TimeLord(std::string timeBaseString);
00062 ~TimeLord();
00063
00064 TimeLord();
00065 TimeLord(TimeLord const&);
00066 void operator=(TimeLord const&);
00067
00068
00069 std::string timeBaseString;
00070 TimeConverterMap_t tcMap;
00071
00072
00073
00074 double sec_factor;
00075 StringToTCMap_t parseCache;
00076
00077 TimeConverter* nano;
00078 TimeConverter* micro;
00079 TimeConverter* milli;
00080 };
00081
00082 }
00083
00084 #endif