torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
XilinxDatabaseTypes.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 Device database types for Xilinx architectures.
18 
19 #ifndef TORC_ARCHITECTURE_XILINXDATABASETYPES_HPP
20 #define TORC_ARCHITECTURE_XILINXDATABASETYPES_HPP
21 
23 #include <boost/cstdint.hpp>
24 
25 namespace torc {
26 namespace architecture {
27 namespace xilinx {
28 
29  // --------------------------------------------------------------------------------------------
30  // ------------------------------------------- Wires ------------------------------------------
31  // --------------------------------------------------------------------------------------------
32 
33  /// \brief Encapsulation of a wire count in an unsigned 16-bit integer.
34  /// \details This type supports counts between 0 and 65,535 inclusive.
35  struct WireCount : public torc::common::EncapsulatedInteger<boost::uint16_t> {
36  explicit WireCount(void) : type() {} ///< \brief Null constructor.
37  explicit WireCount(const pod& rhs) : type(rhs) {} ///< \brief Data type constructor.
38  explicit WireCount(const type& rhs) : type(rhs) {} ///< \brief Copy constructor.
39  };
40  /// \brief Encapsulation of a wire index in an unsigned 16-bit integer.
41  /// \details This type supports indexes between 0 and 65,535 inclusive.
42  struct WireIndex : public WireCount {
43  explicit WireIndex(void) : WireCount() {} ///< \brief Null constructor.
44  explicit WireIndex(const pod& rhs) : WireCount(rhs) {} ///< \brief Data type constructor.
45  explicit WireIndex(const type& rhs) : WireCount(rhs) {} ///< \brief Copy constructor.
46  };
47  /// \brief Encapsulation of wire attribute flags in an unsigned 16-bit integer.
48  /// \details This type supports a maximum of sixteen unique one-bit flags.
49  struct WireFlags : public torc::common::EncapsulatedInteger<boost::uint16_t> {
50  explicit WireFlags(void) : type() {} ///< \brief Null constructor.
51  explicit WireFlags(const pod& rhs) : type(rhs) {} ///< \brief Data type constructor.
52  explicit WireFlags(const type& rhs) : type(rhs) {} ///< \brief Copy constructor.
53  };
54 
55  // --------------------------------------------------------------------------------------------
56  // ------------------------------------------- Tiles ------------------------------------------
57  // --------------------------------------------------------------------------------------------
58 
59  /// \brief Encapsulation of a tile count in an unsigned 32-bit integer.
60  /// \details This type supports counts between 0 and 4,294,967,295 inclusive.
61  struct TileCount : public torc::common::EncapsulatedInteger<boost::uint32_t> {
62  explicit TileCount(void) : type() {} ///< \brief Null constructor.
63  explicit TileCount(const pod& rhs) : type(rhs) {} ///< \brief Data type constructor.
64  explicit TileCount(const type& rhs) : type(rhs) {} ///< \brief Copy constructor.
65  };
66  /// \brief Encapsulation of a tile index in an unsigned 32-bit integer.
67  /// \details This type supports indexes between 0 and 4,294,967,295 inclusive.
68  struct TileIndex : public TileCount {
69  explicit TileIndex(void) : TileCount() {} ///< \brief Null constructor.
70  explicit TileIndex(const pod& rhs) : TileCount(rhs) {} ///< \brief Data type constructor.
71  explicit TileIndex(const type& rhs) : TileCount(rhs) {} ///< \brief Copy constructor.
72  };
73  /// \brief Encapsulation of a tile offset in an unsigned 32-bit integer.
74  /// \details This type supports offsets between 0 and 4,294,967,295 inclusive. Note that
75  /// although an offset would normally be a signed data type, this type is only used in
76  /// explicit compact segments, to express positive offsets from an anchor tile index.
77  struct TileOffset : public torc::common::EncapsulatedInteger<boost::uint32_t> {
78  explicit TileOffset(void) : type() {} ///< \brief Null constructor.
79  explicit TileOffset(const pod& rhs) : type(rhs) {} ///< \brief Data type constructor.
80  explicit TileOffset(const type& rhs) : type(rhs) {} ///< \brief Copy constructor.
81  explicit TileOffset(const TileIndex& rhs) : type(rhs) {} ///< \brief Conversion constructor.
82  };
83  /// \brief Addition operator to add an anchor tile index to a relative tile offset.
84  TileIndex operator +(const TileOffset& inTileOffset, const TileIndex& inTileIndex);
85  /// \brief Encapsulation of a tile row in an unsigned 16-bit integer.
86  /// \details This type supports row positions between 0 and 65,535 inclusive.
87  struct TileRow : public torc::common::EncapsulatedInteger<boost::uint16_t> {
88  explicit TileRow(void) : type() {} ///< \brief Null constructor.
89  explicit TileRow(const pod& rhs) : type(rhs) {} ///< \brief Data type constructor.
90  explicit TileRow(const type& rhs) : type(rhs) {} ///< \brief Copy constructor.
91  };
92  /// \brief Encapsulation of a tile column in an unsigned 16-bit integer.
93  /// \details This type supports column positions between 0 and 65,535 inclusive.
94  struct TileCol : public torc::common::EncapsulatedInteger<boost::uint16_t> {
95  explicit TileCol(void) : type() {} ///< \brief Null constructor.
96  explicit TileCol(const pod& rhs) : type(rhs) {} ///< \brief Data type constructor.
97  explicit TileCol(const type& rhs) : type(rhs) {} ///< \brief Copy constructor.
98  };
99 
100  // --------------------------------------------------------------------------------------------
101  // ----------------------------------------- Tile types ---------------------------------------
102  // --------------------------------------------------------------------------------------------
103 
104  /// \brief Encapsulation of a tile type count in an unsigned 16-bit integer.
105  /// \details This type supports tile type counts between 0 and 65,535 inclusive.
106  struct TileTypeCount : public torc::common::EncapsulatedInteger<boost::uint16_t> {
107  explicit TileTypeCount(void) : type() {} ///< \brief Null constructor.
108  explicit TileTypeCount(const pod& rhs) : type(rhs) {} ///< \brief Data type constructor.
109  explicit TileTypeCount(const type& rhs) : type(rhs) {} ///< \brief Copy constructor.
110  };
111  /// \brief Encapsulation of a tile type index in an unsigned 16-bit integer.
112  /// \details This type supports tile type indexes between 0 and 65,535 inclusive.
113  struct TileTypeIndex : public TileTypeCount {
114  explicit TileTypeIndex(void) : TileTypeCount() {}
115  ///< \brief Null constructor.
116  explicit TileTypeIndex(const pod& rhs) : TileTypeCount(rhs) {}
117  ///< \brief Data type constructor.
118  explicit TileTypeIndex(const type& rhs) : TileTypeCount(rhs) {}
119  ///< \brief Copy constructor.
120  };
121 
122  // --------------------------------------------------------------------------------------------
123  // ------------------------------------- Compact segments -------------------------------------
124  // --------------------------------------------------------------------------------------------
125 
126  /// \brief Encapsulation of a compact segment count in an unsigned 32-bit integer.
127  /// \details This type supports compact segment counts between 0 and 4,294,967,295 inclusive.
128  struct CompactSegmentCount : public torc::common::EncapsulatedInteger<boost::uint32_t> {
129  explicit CompactSegmentCount(void) : type() {}
130  ///< \brief Null constructor.
131  explicit CompactSegmentCount(const pod& rhs) : type(rhs) {}
132  ///< \brief Data type constructor.
133  explicit CompactSegmentCount(const type& rhs) : type(rhs) {}
134  ///< \brief Copy constructor.
135  };
136  /// \brief Encapsulation of a compact segment index in an unsigned 32-bit integer.
137  /// \details This type supports compact segment indexes between 0 and 4,294,967,295 inclusive.
140  ///< \brief Null constructor.
141  explicit CompactSegmentIndex(const pod& rhs) : CompactSegmentCount(rhs) {}
142  ///< \brief Data type constructor.
143  explicit CompactSegmentIndex(const type& rhs) : CompactSegmentCount(rhs) {}
144  ///< \brief Copy constructor.
145  };
146 
147  // --------------------------------------------------------------------------------------------
148  // ------------------------------------------- Sites ------------------------------------------
149  // --------------------------------------------------------------------------------------------
150 
151  /// \brief Encapsulation of a site count in an unsigned 32-bit integer.
152  /// \details This type supports counts between 0 and 4,294,967,295 inclusive.
153  struct SiteCount : public torc::common::EncapsulatedInteger<boost::uint32_t> {
154  explicit SiteCount(void) : type() {} ///< \brief Null constructor.
155  explicit SiteCount(const pod& rhs) : type(rhs) {} ///< \brief Data type constructor.
156  explicit SiteCount(const type& rhs) : type(rhs) {} ///< \brief Copy constructor.
157  };
158  /// \brief Encapsulation of a site index in an unsigned 32-bit integer.
159  /// \details This type supports indexes between 0 and 4,294,967,295 inclusive.
160  struct SiteIndex : public SiteCount {
161  explicit SiteIndex(void) : SiteCount() {} ///< \brief Null constructor.
162  explicit SiteIndex(const pod& rhs) : SiteCount(rhs) {} ///< \brief Data type constructor.
163  explicit SiteIndex(const type& rhs) : SiteCount(rhs) {} ///< \brief Copy constructor.
164  };
165  /// \brief Encapsulation of site attribute flags in an unsigned 16-bit integer.
166  /// \details This type supports a maximum of sixteen unique one-bit flags.
167  struct SiteFlags : public torc::common::EncapsulatedInteger<boost::uint16_t> {
168  explicit SiteFlags(void) : type() {} ///< \brief Null constructor.
169  explicit SiteFlags(const pod& rhs) : type(rhs) {} ///< \brief Data type constructor.
170  explicit SiteFlags(const type& rhs) : type(rhs) {} ///< \brief Copy constructor.
171  };
172 
173  // --------------------------------------------------------------------------------------------
174  // ----------------------------------------- Site defs ----------------------------------------
175  // --------------------------------------------------------------------------------------------
176 
177  /// \brief Encapsulation of a site type count in an unsigned 16-bit integer.
178  /// \details This type supports site type counts between 0 and 65,535 inclusive.
179  struct SiteTypeCount : public torc::common::EncapsulatedInteger<boost::uint16_t> {
180  explicit SiteTypeCount(void) : type() {} ///< \brief Null constructor.
181  explicit SiteTypeCount(const pod& rhs) : type(rhs) {} ///< \brief Data type constructor.
182  explicit SiteTypeCount(const type& rhs) : type(rhs) {} ///< \brief Copy constructor.
183  };
184  /// \brief Encapsulation of a site type index in an unsigned 16-bit integer.
185  /// \details This type supports site type indexes between 0 and 65,535 inclusive.
186  struct SiteTypeIndex : public SiteTypeCount {
187  explicit SiteTypeIndex(void) : SiteTypeCount() {}
188  ///< \brief Null constructor.
189  explicit SiteTypeIndex(const pod& rhs) : SiteTypeCount(rhs) {}
190  ///< \brief Data type constructor.
191  explicit SiteTypeIndex(const type& rhs) : SiteTypeCount(rhs) {}
192  ///< \brief Copy constructor.
193  };
194 
195  // --------------------------------------------------------------------------------------------
196  // ------------------------------------------- Pins -------------------------------------------
197  // --------------------------------------------------------------------------------------------
198 
199  /// \brief Encapsulation of a pin count in an unsigned 32-bit integer.
200  /// \details This type supports counts between 0 and 4,294,967,295 inclusive.
201  struct PinCount : public torc::common::EncapsulatedInteger<boost::uint32_t> {
202  explicit PinCount(void) : type() {} ///< \brief Null constructor.
203  explicit PinCount(const pod& rhs) : type(rhs) {} ///< \brief Data type constructor.
204  explicit PinCount(const type& rhs) : type(rhs) {} ///< \brief Copy constructor.
205  };
206  /// \brief Encapsulation of a pin index in an unsigned 32-bit integer.
207  /// \details This type supports indexes between 0 and 4,294,967,295 inclusive.
208  struct PinIndex : public PinCount {
209  explicit PinIndex(void) : PinCount() {} ///< \brief Null constructor.
210  explicit PinIndex(const pod& rhs) : PinCount(rhs) {} ///< \brief Data type constructor.
211  explicit PinIndex(const type& rhs) : PinCount(rhs) {} ///< \brief Copy constructor.
212  };
213  /// \brief Encapsulation of pin attribute flags in an unsigned 16-bit integer.
214  /// \details This type supports a maximum of sixteen unique one-bit flags.
215  struct PinFlags : public torc::common::EncapsulatedInteger<boost::uint16_t> {
216  explicit PinFlags(void) : type() {} ///< \brief Null constructor.
217  explicit PinFlags(const pod& rhs) : type(rhs) {} ///< \brief Data type constructor.
218  explicit PinFlags(const type& rhs) : type(rhs) {} ///< \brief Copy constructor.
219  };
220 
221  // --------------------------------------------------------------------------------------------
222  // ----------------------------------------- Packages -----------------------------------------
223  // --------------------------------------------------------------------------------------------
224 
225  /// \brief Encapsulation of a package count in an unsigned 16-bit integer.
226  /// \details This type supports counts between 0 and 65,535 inclusive.
227  struct PackageCount : public torc::common::EncapsulatedInteger<boost::uint16_t> {
228  explicit PackageCount(void) : type() {} ///< \brief Null constructor.
229  explicit PackageCount(const pod& rhs) : type(rhs) {} ///< \brief Data type constructor.
230  explicit PackageCount(const type& rhs) : type(rhs) {} ///< \brief Copy constructor.
231  };
232 
233  /// \brief Encapsulation of a package index in an unsigned 16-bit integer.
234  /// \details This type supports package indexes between 0 and 65,535 inclusive.
235  struct PackageIndex : public PackageCount {
236  explicit PackageIndex(void) : PackageCount() {} ///< \brief Null constructor.
237  explicit PackageIndex(const pod& rhs) : PackageCount(rhs) {} ///< \brief Data type constructor.
238  explicit PackageIndex(const type& rhs) : PackageCount(rhs) {} ///< \brief Copy constructor.
239  };
240 
241  // --------------------------------------------------------------------------------------------
242  // ------------------------------------------- Pads -------------------------------------------
243  // --------------------------------------------------------------------------------------------
244 
245  /// \brief Encapsulation of a pad count in an unsigned 32-bit integer.
246  /// \details This type supports counts between 0 and 4,294,967,295 inclusive.
247  struct PadCount : public torc::common::EncapsulatedInteger<boost::uint32_t> {
248  explicit PadCount(void) : type() {} ///< \brief Null constructor.
249  explicit PadCount(const pod& rhs) : type(rhs) {} ///< \brief Data type constructor.
250  explicit PadCount(const type& rhs) : type(rhs) {} ///< \brief Copy constructor.
251  };
252  /// \brief Encapsulation of a pad index in an unsigned 32-bit integer.
253  /// \details This type supports indexes between 0 and 4,294,967,295 inclusive.
254  struct PadIndex : public PadCount {
255  explicit PadIndex(void) : PadCount() {} ///< \brief Null constructor.
256  explicit PadIndex(const pod& rhs) : PadCount(rhs) {} ///< \brief Data type constructor.
257  explicit PadIndex(const type& rhs) : PadCount(rhs) {} ///< \brief Copy constructor.
258  };
259 
260 } // namespace xilinx
261 } // namespace architecture
262 } // namespace torc
263 
264 #endif // TORC_ARCHITECTURE_XILINXDATABASETYPES_HPP
TileCol(const pod &rhs)
Data type constructor.
Encapsulation of a tile index in an unsigned 32-bit integer.
SiteTypeIndex(const type &rhs)
Copy constructor.
Encapsulation of a tile row in an unsigned 16-bit integer.
SiteTypeCount(const pod &rhs)
Data type constructor.
Encapsulation of a tile column in an unsigned 16-bit integer.
Encapsulation of a compact segment count in an unsigned 32-bit integer.
Encapsulation of a pad count in an unsigned 32-bit integer.
PadCount(const pod &rhs)
Data type constructor.
WireIndex(const pod &rhs)
Data type constructor.
Encapsulation of a pin count in an unsigned 32-bit integer.
Encapsulation of wire attribute flags in an unsigned 16-bit integer.
SiteIndex(const type &rhs)
Copy constructor.
SiteTypeCount(const type &rhs)
Copy constructor.
Encapsulation of a site count in an unsigned 32-bit integer.
SiteCount(const pod &rhs)
Data type constructor.
CompactSegmentCount(const pod &rhs)
Data type constructor.
PinCount(const pod &rhs)
Data type constructor.
PackageIndex(const pod &rhs)
Data type constructor.
PackageCount(const type &rhs)
Copy constructor.
TileTypeCount(const pod &rhs)
Data type constructor.
SiteFlags(const pod &rhs)
Data type constructor.
Encapsulation of a pin index in an unsigned 32-bit integer.
Encapsulation of a wire index in an unsigned 16-bit integer.
TileTypeIndex(const pod &rhs)
Data type constructor.
WireFlags(const type &rhs)
Copy constructor.
Encapsulation of a tile offset in an unsigned 32-bit integer.
TileOffset(const type &rhs)
Copy constructor.
Encapsulation of a package count in an unsigned 16-bit integer.
PinIndex(const type &rhs)
Copy constructor.
PackageIndex(const type &rhs)
Copy constructor.
Encapsulation of a site type index in an unsigned 16-bit integer.
WireCount(const pod &rhs)
Data type constructor.
TileIndex operator+(const TileOffset &inTileOffset, const TileIndex &inTileIndex)
Addition operator to add an anchor tile index to a relative tile offset.
TileOffset(const pod &rhs)
Data type constructor.
PadIndex(const pod &rhs)
Data type constructor.
WireIndex(const type &rhs)
Copy constructor.
TileTypeCount(const type &rhs)
Copy constructor.
TileRow(const type &rhs)
Copy constructor.
SiteFlags(const type &rhs)
Copy constructor.
SiteTypeIndex(const pod &rhs)
Data type constructor.
TileRow(const pod &rhs)
Data type constructor.
Encapsulation of a wire count in an unsigned 16-bit integer.
Encapsulation of a tile count in an unsigned 32-bit integer.
SiteCount(const type &rhs)
Copy constructor.
TileOffset(const TileIndex &rhs)
Conversion constructor.
TileCount(const pod &rhs)
Data type constructor.
PadCount(const type &rhs)
Copy constructor.
WireFlags(const pod &rhs)
Data type constructor.
PadIndex(const type &rhs)
Copy constructor.
Encapsulation of a package index in an unsigned 16-bit integer.
Encapsulation of pin attribute flags in an unsigned 16-bit integer.
TileCount(const type &rhs)
Copy constructor.
TileCol(const type &rhs)
Copy constructor.
SiteIndex(const pod &rhs)
Data type constructor.
Encapsulation of a compact segment index in an unsigned 32-bit integer.
Encapsulation of a site type count in an unsigned 16-bit integer.
WireCount(const type &rhs)
Copy constructor.
Encapsulation of site attribute flags in an unsigned 16-bit integer.
TileIndex(const type &rhs)
Copy constructor.
Encapsulation of a tile type count in an unsigned 16-bit integer.
PinFlags(const pod &rhs)
Data type constructor.
PinIndex(const pod &rhs)
Data type constructor.
TileIndex(const pod &rhs)
Data type constructor.
Encapsulation of a site index in an unsigned 32-bit integer.
Encapsulation of a tile type index in an unsigned 16-bit integer.
PinCount(const type &rhs)
Copy constructor.
Template base for encapsulated integers, to enforce strong typing.
TileTypeIndex(const type &rhs)
Copy constructor.
PinFlags(const type &rhs)
Copy constructor.
CompactSegmentIndex(const pod &rhs)
Data type constructor.
CompactSegmentIndex(const type &rhs)
Copy constructor.
CompactSegmentCount(const type &rhs)
Copy constructor.
Encapsulation of a pad index in an unsigned 32-bit integer.
PackageCount(const pod &rhs)
Data type constructor.
Header for the EncapsulatedInteger template.
boost::uint16_t pod
Alias for the encapsulated Plain-Old-Data type.