torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
common/DeviceDesignator.hpp
Go to the documentation of this file.
1 // Torc - Copyright 2011-2013 University of Southern California. All Rights Reserved.
2 // $HeadURL$
3 // $Id$
4 
5 // This program is free software: you can redistribute it and/or modify it under the terms of the
6 // GNU General Public License as published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
10 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
11 // the GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License along with this program. If
14 // not, see <http://www.gnu.org/licenses/>.
15 
16 /// \file
17 /// \brief Header for the DeviceDesignator class.
18 
19 #ifndef TORC_COMMON_DEVICEDESIGNATOR_HPP
20 #define TORC_COMMON_DEVICEDESIGNATOR_HPP
21 
22 #include <boost/regex.hpp>
23 #include <ostream>
24 #include <string>
25 
26 namespace torc {
27 namespace common {
28 
29  /// \brief Encapsulation of a device designator and its constituent elements.
31  public:
32  // enums
33  enum EFamily {
34  // unknown families
36  // Spartan families
39  // Virtex families
43  // number of defined families
45  };
46  protected:
47  // typedefs
48  typedef std::string string; ///< \brief Imported type name.
49  // members
50  /// \brief The full device designator.
52  /// \brief The family type.
54  /// \brief The device name.
55  string mDeviceName;
56  /// \brief The device package.
58  /// \brief The device speed grade.
60  // functions
61  /// \brief Parses the device name into constituent device, package, and speed components.
62  bool parse(const string& inDeviceDesignator, const boost::regex& inRegEx);
63  // statics
64  static boost::regex sSpartan2RegEx; ///< \brief Regular expression for Spartan2 devices.
65  static boost::regex sSpartan2ERegEx; ///< \brief Regular expression for Spartan2E devices.
66  static boost::regex sSpartan3RegEx; ///< \brief Regular expression for Spartan3 devices.
67  static boost::regex sSpartan3ARegEx; ///< \brief Regular expression for Spartan3A devices.
68  static boost::regex sSpartan3ERegEx; ///< \brief Regular expression for Spartan3E devices.
69  static boost::regex sSpartan6RegEx; ///< \brief Regular expression for Spartan3E devices.
70  static boost::regex sVirtexRegEx; ///< \brief Regular expression for Virtex devices.
71  static boost::regex sVirtexERegEx; ///< \brief Regular expression for VirtexE devices.
72  static boost::regex sVirtex2RegEx; ///< \brief Regular expression for Virtex2 devices.
73  static boost::regex sVirtex2PRegEx; ///< \brief Regular expression for Virtex2P devices.
74  static boost::regex sVirtex4RegEx; ///< \brief Regular expression for Virtex4 devices.
75  static boost::regex sVirtex5RegEx; ///< \brief Regular expression for Virtex5 devices.
76  static boost::regex sVirtex6RegEx; ///< \brief Regular expression for Virtex6 devices.
77  static boost::regex sArtix7RegEx; ///< \brief Regular expression for Artix7 devices.
78  static boost::regex sKintex7RegEx; ///< \brief Regular expression for Kintex7 devices.
79  static boost::regex sVirtex7RegEx; ///< \brief Regular expression for Virtex7 devices.
80  static boost::regex sZynq7000RegEx; ///< \brief Regular expression for Zynq7000 devices.
81  public:
82  // constructors
83  /// \brief Basic constructor.
84  DeviceDesignator(const string& inDeviceDesignator);
85  // operators
86  /// \brief Stream insertion operator.
87  friend std::ostream& operator<< (std::ostream& os, const DeviceDesignator& rhs);
88  // accessors
89  /// \brief Returns the device designator.
90  const string& getDeviceDesignator(void) const { return mDeviceDesignator; }
91  /// \brief Returns the device family.
92  const EFamily& getFamily(void) const { return mFamily; }
93  /// \brief Returns the device name.
94  const string& getDeviceName(void) const { return mDeviceName; }
95  /// \brief Returns the device package.
96  const string& getDevicePackage(void) const { return mDevicePackage; }
97  /// \brief Returns the device speed grade.
98  const string& getDeviceSpeedGrade(void) const { return mDeviceSpeedGrade; }
99  };
100 
101 } // namespace common
102 } // namespace torc
103 
104 #endif // TORC_COMMON_DEVICEDESIGNATOR_HPP
static boost::regex sArtix7RegEx
Regular expression for Artix7 devices.
Encapsulation of a device designator and its constituent elements.
string mDevicePackage
The device package.
static boost::regex sVirtexERegEx
Regular expression for VirtexE devices.
string mDeviceSpeedGrade
The device speed grade.
const EFamily & getFamily(void) const
Returns the device family.
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.
std::string string
static boost::regex sSpartan2RegEx
Regular expression for Spartan2 devices.
const string & getDeviceSpeedGrade(void) const
Returns the device speed grade.
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.
const string & getDevicePackage(void) const
Returns the device package.
const string & getDeviceName(void) const
Returns the device name.
static boost::regex sZynq7000RegEx
Regular expression for Zynq7000 devices.
friend std::ostream & operator<<(std::ostream &os, const DeviceDesignator &rhs)
Stream insertion operator.
DeviceDesignator(const string &inDeviceDesignator)
Basic constructor.
static boost::regex sSpartan2ERegEx
Regular expression for Spartan2E devices.
std::string string
Imported type name.
const string & getDeviceDesignator(void) const
Returns the device designator.
static boost::regex sVirtex2RegEx
Regular expression for Virtex2 devices.