00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef TORC_COMMON_DEVICES_HPP
00020 #define TORC_COMMON_DEVICES_HPP
00021
00022 #include "torc/common/DeviceDesignator.hpp"
00023 #include <boost/algorithm/string.hpp>
00024 #include <string>
00025 #include <vector>
00026 #include <map>
00027
00028 namespace torc {
00029 namespace common {
00030
00031
00032 enum EDevice {
00033 eDeviceInvalid = 0,
00034
00035
00036 eXC3S100E, eXC3S250E, eXC3S500E, eXC3S1200E, eXC3S1600E,
00037
00038
00039 eXC6SLX4, eXC6SLX9, eXC6SLX16, eXC6SLX25, eXC6SLX45, eXC6SLX75,
00040 eXC6SLX100, eXC6SLX150,
00041
00042 eXC6SLX25T, eXC6SLX45T, eXC6SLX75T, eXC6SLX100T, eXC6SLX150T,
00043
00044 eXC6SLX4L, eXC6SLX9L, eXC6SLX16L, eXC6SLX25L, eXC6SLX45L, eXC6SLX75L,
00045 eXC6SLX100L, eXC6SLX150L,
00046
00047
00048 eXCV50, eXCV100, eXCV150, eXCV200, eXCV300, eXCV400, eXCV600, eXCV800, eXCV1000,
00049
00050
00051 eXCV50E, eXCV100E, eXCV200E, eXCV300E, eXCV400E, eXCV600E, eXCV1000E, eXCV1600E,
00052 eXCV2000E, eXCV2600E, eXCV3200E,
00053
00054 eXCV405E, eXCV812E,
00055
00056
00057 eXC2V40, eXC2V80, eXC2V250, eXC2V500, eXC2V1000, eXC2V1500, eXC2V2000, eXC2V3000,
00058 eXC2V4000, eXC2V6000, eXC2V8000,
00059
00060
00061 eXC2VP2, eXC2VP4, eXC2VP7, eXC2VP20, eXC2VP30, eXC2VP40, eXC2VP50, eXC2VP70, eXC2VP100,
00062
00063 eXC2VPX20, eXC2VPX70,
00064
00065
00066 eXC4VFX12, eXC4VFX20, eXC4VFX40, eXC4VFX60, eXC4VFX100, eXC4VFX140,
00067
00068 eXC4VLX15, eXC4VLX25, eXC4VLX40, eXC4VLX60, eXC4VLX80, eXC4VLX100, eXC4VLX160,
00069 eXC4VLX200,
00070
00071 eXC4VSX25, eXC4VSX35, eXC4VSX55,
00072
00073
00074 eXC5VFX30T, eXC5VFX70T, eXC5VFX100T, eXC5VFX130T, eXC5VFX200T,
00075
00076 eXC5VLX30, eXC5VLX50, eXC5VLX85, eXC5VLX110, eXC5VLX155, eXC5VLX220, eXC5VLX330,
00077
00078 eXC5VLX20T, eXC5VLX30T, eXC5VLX50T, eXC5VLX85T, eXC5VLX110T, eXC5VLX155T, eXC5VLX220T,
00079 eXC5VLX330T,
00080
00081 eXC5VSX35T, eXC5VSX50T, eXC5VSX95T, eXC5VSX240T,
00082
00083 eXC5VTX150T, eXC5VTX240T,
00084
00085
00086 eXC6VCX75T, eXC6VCX130T, eXC6VCX195T, eXC6VCX240T,
00087
00088 eXC6VHX250T, eXC6VHX255T, eXC6VHX380T, eXC6VHX565T,
00089
00090 eXC6VLX75T, eXC6VLX130T, eXC6VLX195T, eXC6VLX240T, eXC6VLX365T, eXC6VLX550T,
00091 eXC6VLX760,
00092
00093 eXC6VSX315T, eXC6VSX475T,
00094
00095
00096 eXC6VLX75TL, eXC6VLX130TL, eXC6VLX195TL, eXC6VLX240TL, eXC6VLX365TL, eXC6VLX550TL,
00097 eXC6VLX760L,
00098
00099 eXC6VSX315TL, eXC6VSX475TL,
00100
00101
00102 eXC7V285T, eXC7V450T, eXC7V585T, eXC7V855T, eXC7V1500T, eXC7V2000T,
00103
00104 eXC7VX485T,
00105
00106
00107 eXC7V285TL, eXC7V450TL, eXC7V585TL, eXC7V855TL, eXC7V1500TL,
00108 eXC7V2000TL,
00109
00110
00111 eXC7K30T, eXC7K70T, eXC7K160T, eXC7K325T, eXC7K410T,
00112
00113
00114 eXC7K30TL, eXC7K70TL, eXC7K160TL, eXC7K325TL, eXC7K410TL,
00115
00116 eDeviceCount
00117 };
00118
00119
00120 typedef std::vector<std::string> DeviceVector;
00121
00122
00123 typedef std::map<std::string, enum EDevice> DeviceNameMap;
00124
00125
00126 class Devices {
00127 protected:
00128
00129
00130 typedef std::string string;
00131
00132
00133 DeviceVector mVirtexDevices;
00134
00135 DeviceVector mVirtexEDevices;
00136
00137 DeviceVector mVirtex2Devices;
00138
00139 DeviceVector mVirtex2PDevices;
00140
00141 DeviceVector mVirtex4Devices;
00142
00143 DeviceVector mVirtex5Devices;
00144
00145 DeviceVector mVirtex6Devices;
00146
00147 DeviceVector mVirtex6LDevices;
00148
00149 DeviceVector mVirtex7Devices;
00150
00151 DeviceVector mVirtex7LDevices;
00152
00153 DeviceVector mKintex7Devices;
00154
00155 DeviceVector mKintex7LDevices;
00156
00157 DeviceVector mSpartan3EDevices;
00158
00159 DeviceVector mSpartan6Devices;
00160
00161 DeviceVector mSpartan6LDevices;
00162
00163 DeviceVector mSupportedDevices;
00164
00165 DeviceVector mUnitTestDevices;
00166
00167 DeviceVector mDeviceNames;
00168
00169 DeviceNameMap mDeviceNameMap;
00170
00171 static Devices sDevices;
00172
00173
00174 void addToSupportedDevices(const DeviceVector& inDeviceVector) {
00175 mSupportedDevices.insert(mSupportedDevices.end(), inDeviceVector.begin(),
00176 inDeviceVector.end());
00177 }
00178 public:
00179
00180
00181 Devices(void);
00182
00183
00184 static const DeviceVector& getVirtexDevices(void) { return sDevices.mVirtexDevices; }
00185
00186 static const DeviceVector& getVirtexEDevices(void) { return sDevices.mVirtexEDevices; }
00187
00188 static const DeviceVector& getVirtex2Devices(void) { return sDevices.mVirtex2Devices; }
00189
00190 static const DeviceVector& getVirtex2PDevices(void) { return sDevices.mVirtex2PDevices; }
00191
00192 static const DeviceVector& getVirtex4Devices(void) { return sDevices.mVirtex4Devices; }
00193
00194 static const DeviceVector& getVirtex5Devices(void) { return sDevices.mVirtex5Devices; }
00195
00196 static const DeviceVector& getVirtex6Devices(void) { return sDevices.mVirtex6Devices; }
00197
00198 static const DeviceVector& getVirtex6LDevices(void) { return sDevices.mVirtex6LDevices; }
00199
00200 static const DeviceVector& getVirtex7Devices(void) { return sDevices.mVirtex7Devices; }
00201
00202 static const DeviceVector& getVirtex7LDevices(void) { return sDevices.mVirtex7LDevices; }
00203
00204 static const DeviceVector& getKintex7Devices(void) { return sDevices.mKintex7Devices; }
00205
00206 static const DeviceVector& getKintex7LDevices(void) { return sDevices.mKintex7LDevices; }
00207
00208 static const DeviceVector& getSpartan3EDevices(void) { return sDevices.mSpartan3EDevices; }
00209
00210 static const DeviceVector& getSpartan6Devices(void) { return sDevices.mSpartan6Devices; }
00211
00212 static const DeviceVector& getSpartan6LDevices(void) { return sDevices.mSpartan6LDevices; }
00213
00214 static const DeviceVector& getSupportedDevices(void) { return sDevices.mSupportedDevices; }
00215
00216 static const DeviceVector& getUnitTestDevices(void) { return sDevices.mUnitTestDevices; }
00217
00218 static const DeviceVector& getDeviceNames(void) { return sDevices.mDeviceNames; }
00219
00220 static const DeviceNameMap& getDeviceNameMap(void) { return sDevices.mDeviceNameMap; }
00221
00222
00223 static EDevice getDeviceEnum(const string& inName) {
00224 DeviceDesignator designator(inName);
00225 std::string name = designator.getDeviceName();
00226 const DeviceNameMap& deviceNameMap = getDeviceNameMap();
00227 DeviceNameMap::const_iterator p = deviceNameMap.find(name);
00228 DeviceNameMap::const_iterator e = deviceNameMap.end();
00229 if(p == e) return eDeviceInvalid;
00230 return p->second;
00231 }
00232
00233 static const string& getDeviceName(EDevice inEnum) {
00234
00235 return getDeviceNames()[inEnum];
00236 }
00237 };
00238
00239 }
00240 }
00241
00242 #endif // TORC_COMMON_DEVICES_HPP