torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
torc::common::DeviceDesignator Class Reference

Encapsulation of a device designator and its constituent elements. More...

#include <DeviceDesignator.hpp>

+ Collaboration diagram for torc::common::DeviceDesignator:

Public Types

enum  EFamily {
  eFamilyUnknown = 0, eFamilySpartan2, eFamilySpartan2E, eFamilySpartan3,
  eFamilySpartan3A, eFamilySpartan3E, eFamilySpartan6, eFamilyVirtex,
  eFamilyVirtexE, eFamilyVirtex2, eFamilyVirtex2P, eFamilyVirtex4,
  eFamilyVirtex5, eFamilyVirtex6, eFamilyArtix7, eFamilyKintex7,
  eFamilyVirtex7, eFamilyZynq7000, eFamilyCount
}
 

Public Member Functions

 DeviceDesignator (const string &inDeviceDesignator)
 Basic constructor. More...
 
const stringgetDeviceDesignator (void) const
 Returns the device designator. More...
 
const EFamilygetFamily (void) const
 Returns the device family. More...
 
const stringgetDeviceName (void) const
 Returns the device name. More...
 
const stringgetDevicePackage (void) const
 Returns the device package. More...
 
const stringgetDeviceSpeedGrade (void) const
 Returns the device speed grade. More...
 

Protected Types

typedef std::string string
 Imported type name. More...
 

Protected Member Functions

bool parse (const string &inDeviceDesignator, const boost::regex &inRegEx)
 Parses the device name into constituent device, package, and speed components. More...
 

Protected Attributes

string mDeviceDesignator
 The full device designator. More...
 
EFamily mFamily
 The family type. More...
 
string mDeviceName
 The device name. More...
 
string mDevicePackage
 The device package. More...
 
string mDeviceSpeedGrade
 The device speed grade. More...
 

Static Protected Attributes

static boost::regex sSpartan2RegEx
 Regular expression for Spartan2 devices. More...
 
static boost::regex sSpartan2ERegEx
 Regular expression for Spartan2E devices. More...
 
static boost::regex sSpartan3RegEx
 Regular expression for Spartan3 devices. More...
 
static boost::regex sSpartan3ARegEx
 Regular expression for Spartan3A devices. More...
 
static boost::regex sSpartan3ERegEx
 Regular expression for Spartan3E devices. More...
 
static boost::regex sSpartan6RegEx
 Regular expression for Spartan3E devices. More...
 
static boost::regex sVirtexRegEx
 Regular expression for Virtex devices. More...
 
static boost::regex sVirtexERegEx
 Regular expression for VirtexE devices. More...
 
static boost::regex sVirtex2RegEx
 Regular expression for Virtex2 devices. More...
 
static boost::regex sVirtex2PRegEx
 Regular expression for Virtex2P devices. More...
 
static boost::regex sVirtex4RegEx
 Regular expression for Virtex4 devices. More...
 
static boost::regex sVirtex5RegEx
 Regular expression for Virtex5 devices. More...
 
static boost::regex sVirtex6RegEx
 Regular expression for Virtex6 devices. More...
 
static boost::regex sArtix7RegEx
 Regular expression for Artix7 devices. More...
 
static boost::regex sKintex7RegEx
 Regular expression for Kintex7 devices. More...
 
static boost::regex sVirtex7RegEx
 Regular expression for Virtex7 devices. More...
 
static boost::regex sZynq7000RegEx
 Regular expression for Zynq7000 devices. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const DeviceDesignator &rhs)
 Stream insertion operator. More...
 

Detailed Description

Encapsulation of a device designator and its constituent elements.

Definition at line 30 of file common/DeviceDesignator.hpp.

Member Typedef Documentation

typedef std::string torc::common::DeviceDesignator::string
protected

Imported type name.

Definition at line 48 of file common/DeviceDesignator.hpp.

Member Enumeration Documentation

Enumerator
eFamilyUnknown 
eFamilySpartan2 
eFamilySpartan2E 
eFamilySpartan3 
eFamilySpartan3A 
eFamilySpartan3E 
eFamilySpartan6 
eFamilyVirtex 
eFamilyVirtexE 
eFamilyVirtex2 
eFamilyVirtex2P 
eFamilyVirtex4 
eFamilyVirtex5 
eFamilyVirtex6 
eFamilyArtix7 
eFamilyKintex7 
eFamilyVirtex7 
eFamilyZynq7000 
eFamilyCount 

Definition at line 33 of file common/DeviceDesignator.hpp.

33  {
34  // unknown families
35  eFamilyUnknown = 0,
36  // Spartan families
39  // Virtex families
43  // number of defined families
45  };

Constructor & Destructor Documentation

torc::common::DeviceDesignator::DeviceDesignator ( const string inDeviceDesignator)

Basic constructor.

Definition at line 145 of file DeviceDesignator.cpp.

145  {
146  mDeviceDesignator = inDeviceDesignator;
147  if(parse(inDeviceDesignator, sSpartan2RegEx)) { mFamily = eFamilySpartan2; } else
148  if(parse(inDeviceDesignator, sSpartan2ERegEx)) { mFamily = eFamilySpartan2E; } else
149  if(parse(inDeviceDesignator, sSpartan3RegEx)) { mFamily = eFamilySpartan3; } else
150  if(parse(inDeviceDesignator, sSpartan3ARegEx)) { mFamily = eFamilySpartan3A; } else
151  if(parse(inDeviceDesignator, sSpartan3ERegEx)) { mFamily = eFamilySpartan3E; } else
152  if(parse(inDeviceDesignator, sSpartan6RegEx)) { mFamily = eFamilySpartan6; } else
153  if(parse(inDeviceDesignator, sVirtexRegEx)) { mFamily = eFamilyVirtex; } else
154  if(parse(inDeviceDesignator, sVirtexERegEx)) { mFamily = eFamilyVirtexE; } else
155  if(parse(inDeviceDesignator, sVirtex2RegEx)) { mFamily = eFamilyVirtex2; } else
156  if(parse(inDeviceDesignator, sVirtex2PRegEx)) { mFamily = eFamilyVirtex2P; } else
157  if(parse(inDeviceDesignator, sVirtex4RegEx)) { mFamily = eFamilyVirtex4; } else
158  if(parse(inDeviceDesignator, sVirtex5RegEx)) { mFamily = eFamilyVirtex5; } else
159  if(parse(inDeviceDesignator, sVirtex6RegEx)) { mFamily = eFamilyVirtex6; } else
160  if(parse(inDeviceDesignator, sArtix7RegEx)) { mFamily = eFamilyArtix7; } else
161  if(parse(inDeviceDesignator, sKintex7RegEx)) { mFamily = eFamilyKintex7; } else
162  if(parse(inDeviceDesignator, sVirtex7RegEx)) { mFamily = eFamilyVirtex7; } else
163  if(parse(inDeviceDesignator, sZynq7000RegEx)) { mFamily = eFamilyZynq7000; } else
164  { mFamily = eFamilyUnknown; }
165  }
static boost::regex sArtix7RegEx
Regular expression for Artix7 devices.
static boost::regex sVirtexERegEx
Regular expression for VirtexE devices.
static boost::regex sVirtex4RegEx
Regular expression for Virtex4 devices.
static boost::regex sSpartan6RegEx
Regular expression for Spartan3E devices.
static boost::regex sKintex7RegEx
Regular expression for Kintex7 devices.
bool parse(const string &inDeviceDesignator, const boost::regex &inRegEx)
Parses the device name into constituent device, package, and speed components.
string mDeviceDesignator
The full device designator.
static boost::regex sSpartan3RegEx
Regular expression for Spartan3 devices.
static boost::regex sVirtex6RegEx
Regular expression for Virtex6 devices.
static boost::regex sSpartan2RegEx
Regular expression for Spartan2 devices.
static boost::regex sVirtexRegEx
Regular expression for Virtex devices.
static boost::regex sSpartan3ERegEx
Regular expression for Spartan3E devices.
static boost::regex sSpartan3ARegEx
Regular expression for Spartan3A devices.
static boost::regex sVirtex2PRegEx
Regular expression for Virtex2P devices.
static boost::regex sVirtex7RegEx
Regular expression for Virtex7 devices.
static boost::regex sVirtex5RegEx
Regular expression for Virtex5 devices.
static boost::regex sZynq7000RegEx
Regular expression for Zynq7000 devices.
static boost::regex sSpartan2ERegEx
Regular expression for Spartan2E devices.
static boost::regex sVirtex2RegEx
Regular expression for Virtex2 devices.

+ Here is the call graph for this function:

Member Function Documentation

const string& torc::common::DeviceDesignator::getDeviceDesignator ( void  ) const
inline

Returns the device designator.

Definition at line 90 of file common/DeviceDesignator.hpp.

90 { return mDeviceDesignator; }
string mDeviceDesignator
The full device designator.
const string& torc::common::DeviceDesignator::getDeviceName ( void  ) const
inline

Returns the device name.

Definition at line 94 of file common/DeviceDesignator.hpp.

94 { return mDeviceName; }

+ Here is the caller graph for this function:

const string& torc::common::DeviceDesignator::getDevicePackage ( void  ) const
inline

Returns the device package.

Definition at line 96 of file common/DeviceDesignator.hpp.

96 { return mDevicePackage; }
string mDevicePackage
The device package.

+ Here is the caller graph for this function:

const string& torc::common::DeviceDesignator::getDeviceSpeedGrade ( void  ) const
inline

Returns the device speed grade.

Definition at line 98 of file common/DeviceDesignator.hpp.

98 { return mDeviceSpeedGrade; }
string mDeviceSpeedGrade
The device speed grade.

+ Here is the caller graph for this function:

const EFamily& torc::common::DeviceDesignator::getFamily ( void  ) const
inline

Returns the device family.

Definition at line 92 of file common/DeviceDesignator.hpp.

92 { return mFamily; }

+ Here is the caller graph for this function:

bool torc::common::DeviceDesignator::parse ( const string inDeviceDesignator,
const boost::regex &  inRegEx 
)
protected

Parses the device name into constituent device, package, and speed components.

Definition at line 167 of file DeviceDesignator.cpp.

167  {
168  boost::smatch what;
169  string designator = inDeviceDesignator;
170  boost::to_lower(designator);
171  if(boost::regex_match(designator, what, inRegEx, boost::match_default)) {
172  if(what[1].matched) mDeviceName = std::string(what[1].first, what[1].second);
173  if(what[2].matched) mDevicePackage = std::string(what[2].first, what[2].second);
174  if(what[3].matched) mDeviceSpeedGrade = std::string(what[3].first, what[3].second);
175  if(what[1].matched) {
176  // this will have to change when we support other Xilinx and non-Xilinx devices
177  mDeviceName = boost::regex_replace(mDeviceName, boost::regex("^x?c?"), "xc");
178  }
179  return true;
180  } else {
181  return false;
182  }
183  }
string mDevicePackage
The device package.
string mDeviceSpeedGrade
The device speed grade.
std::string string

+ Here is the caller graph for this function:

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const DeviceDesignator rhs 
)
friend

Stream insertion operator.

Definition at line 185 of file DeviceDesignator.cpp.

185  {
186  os << rhs.getDeviceName();
187  if(rhs.getDevicePackage().length()) os << rhs.getDevicePackage();
188  if(rhs.getDeviceSpeedGrade().length()) os << rhs.getDeviceSpeedGrade();
189  return os;
190  }

Field Documentation

string torc::common::DeviceDesignator::mDeviceDesignator
protected

The full device designator.

Definition at line 51 of file common/DeviceDesignator.hpp.

string torc::common::DeviceDesignator::mDeviceName
protected

The device name.

Definition at line 55 of file common/DeviceDesignator.hpp.

string torc::common::DeviceDesignator::mDevicePackage
protected

The device package.

Definition at line 57 of file common/DeviceDesignator.hpp.

string torc::common::DeviceDesignator::mDeviceSpeedGrade
protected

The device speed grade.

Definition at line 59 of file common/DeviceDesignator.hpp.

EFamily torc::common::DeviceDesignator::mFamily
protected

The family type.

Definition at line 53 of file common/DeviceDesignator.hpp.

boost::regex torc::common::DeviceDesignator::sArtix7RegEx
staticprotected

Regular expression for Artix7 devices.

Definition at line 77 of file common/DeviceDesignator.hpp.

boost::regex torc::common::DeviceDesignator::sKintex7RegEx
staticprotected

Regular expression for Kintex7 devices.

Definition at line 78 of file common/DeviceDesignator.hpp.

boost::regex torc::common::DeviceDesignator::sSpartan2ERegEx
staticprotected

Regular expression for Spartan2E devices.

Definition at line 65 of file common/DeviceDesignator.hpp.

boost::regex torc::common::DeviceDesignator::sSpartan2RegEx
staticprotected

Regular expression for Spartan2 devices.

Definition at line 64 of file common/DeviceDesignator.hpp.

boost::regex torc::common::DeviceDesignator::sSpartan3ARegEx
staticprotected

Regular expression for Spartan3A devices.

Definition at line 67 of file common/DeviceDesignator.hpp.

boost::regex torc::common::DeviceDesignator::sSpartan3ERegEx
staticprotected

Regular expression for Spartan3E devices.

Definition at line 68 of file common/DeviceDesignator.hpp.

boost::regex torc::common::DeviceDesignator::sSpartan3RegEx
staticprotected

Regular expression for Spartan3 devices.

Definition at line 66 of file common/DeviceDesignator.hpp.

boost::regex torc::common::DeviceDesignator::sSpartan6RegEx
staticprotected

Regular expression for Spartan3E devices.

Definition at line 69 of file common/DeviceDesignator.hpp.

boost::regex torc::common::DeviceDesignator::sVirtex2PRegEx
staticprotected

Regular expression for Virtex2P devices.

Definition at line 73 of file common/DeviceDesignator.hpp.

boost::regex torc::common::DeviceDesignator::sVirtex2RegEx
staticprotected

Regular expression for Virtex2 devices.

Definition at line 72 of file common/DeviceDesignator.hpp.

boost::regex torc::common::DeviceDesignator::sVirtex4RegEx
staticprotected

Regular expression for Virtex4 devices.

Definition at line 74 of file common/DeviceDesignator.hpp.

boost::regex torc::common::DeviceDesignator::sVirtex5RegEx
staticprotected

Regular expression for Virtex5 devices.

Definition at line 75 of file common/DeviceDesignator.hpp.

boost::regex torc::common::DeviceDesignator::sVirtex6RegEx
staticprotected

Regular expression for Virtex6 devices.

Definition at line 76 of file common/DeviceDesignator.hpp.

boost::regex torc::common::DeviceDesignator::sVirtex7RegEx
staticprotected

Regular expression for Virtex7 devices.

Definition at line 79 of file common/DeviceDesignator.hpp.

boost::regex torc::common::DeviceDesignator::sVirtexERegEx
staticprotected

Regular expression for VirtexE devices.

Definition at line 71 of file common/DeviceDesignator.hpp.

boost::regex torc::common::DeviceDesignator::sVirtexRegEx
staticprotected

Regular expression for Virtex devices.

Definition at line 70 of file common/DeviceDesignator.hpp.

boost::regex torc::common::DeviceDesignator::sZynq7000RegEx
staticprotected

Regular expression for Zynq7000 devices.

Definition at line 80 of file common/DeviceDesignator.hpp.


The documentation for this class was generated from the following files: