00001 // Torc - Copyright 2011 University of Southern California. All Rights Reserved. 00002 // $HeadURL: https://torc-isi.svn.sourceforge.net/svnroot/torc-isi/branches/staging/0.9/src/torc/architecture/XilinxDatabaseTypes.hpp $ 00003 // $Id: XilinxDatabaseTypes.hpp 10 2011-10-12 18:40:16Z nsteiner $ 00004 00005 // This program is free software: you can redistribute it and/or modify it under the terms of the 00006 // GNU General Public License as published by the Free Software Foundation, either version 3 of the 00007 // License, or (at your option) any later version. 00008 // 00009 // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 00010 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 00011 // the GNU General Public License for more details. 00012 // 00013 // You should have received a copy of the GNU General Public License along with this program. If 00014 // not, see <http://www.gnu.org/licenses/>. 00015 00016 /// \file 00017 /// \brief Device database types for Xilinx architectures. 00018 00019 #ifndef TORC_ARCHITECTURE_XILINXDATABASETYPES_HPP 00020 #define TORC_ARCHITECTURE_XILINXDATABASETYPES_HPP 00021 00022 #include "torc/common/EncapsulatedInteger.hpp" 00023 #include <boost/cstdint.hpp> 00024 00025 namespace torc { 00026 namespace architecture { 00027 namespace xilinx { 00028 00029 // -------------------------------------------------------------------------------------------- 00030 // ------------------------------------------- Wires ------------------------------------------ 00031 // -------------------------------------------------------------------------------------------- 00032 00033 /// \brief Encapsulation of a wire count in an unsigned 16-bit integer. 00034 /// \details This type supports counts between 0 and 65,535 inclusive. 00035 struct WireCount : public torc::common::EncapsulatedInteger<boost::uint16_t> { 00036 explicit WireCount(void) : type() {} ///< \brief Null constructor. 00037 explicit WireCount(const pod& rhs) : type(rhs) {} ///< \brief Data type constructor. 00038 explicit WireCount(const type& rhs) : type(rhs) {} ///< \brief Copy constructor. 00039 }; 00040 /// \brief Encapsulation of a wire index in an unsigned 16-bit integer. 00041 /// \details This type supports indexes between 0 and 65,535 inclusive. 00042 struct WireIndex : public WireCount { 00043 explicit WireIndex(void) : WireCount() {} ///< \brief Null constructor. 00044 explicit WireIndex(const pod& rhs) : WireCount(rhs) {} ///< \brief Data type constructor. 00045 explicit WireIndex(const type& rhs) : WireCount(rhs) {} ///< \brief Copy constructor. 00046 }; 00047 /// \brief Encapsulation of wire attribute flags in an unsigned 16-bit integer. 00048 /// \details This type supports a maximum of sixteen unique one-bit flags. 00049 struct WireFlags : public torc::common::EncapsulatedInteger<boost::uint16_t> { 00050 explicit WireFlags(void) : type() {} ///< \brief Null constructor. 00051 explicit WireFlags(const pod& rhs) : type(rhs) {} ///< \brief Data type constructor. 00052 explicit WireFlags(const type& rhs) : type(rhs) {} ///< \brief Copy constructor. 00053 }; 00054 00055 // -------------------------------------------------------------------------------------------- 00056 // ------------------------------------------- Tiles ------------------------------------------ 00057 // -------------------------------------------------------------------------------------------- 00058 00059 /// \brief Encapsulation of a tile count in an unsigned 32-bit integer. 00060 /// \details This type supports counts between 0 and 4,294,967,295 inclusive. 00061 struct TileCount : public torc::common::EncapsulatedInteger<boost::uint32_t> { 00062 explicit TileCount(void) : type() {} ///< \brief Null constructor. 00063 explicit TileCount(const pod& rhs) : type(rhs) {} ///< \brief Data type constructor. 00064 explicit TileCount(const type& rhs) : type(rhs) {} ///< \brief Copy constructor. 00065 }; 00066 /// \brief Encapsulation of a tile index in an unsigned 32-bit integer. 00067 /// \details This type supports indexes between 0 and 4,294,967,295 inclusive. 00068 struct TileIndex : public TileCount { 00069 explicit TileIndex(void) : TileCount() {} ///< \brief Null constructor. 00070 explicit TileIndex(const pod& rhs) : TileCount(rhs) {} ///< \brief Data type constructor. 00071 explicit TileIndex(const type& rhs) : TileCount(rhs) {} ///< \brief Copy constructor. 00072 }; 00073 /// \brief Encapsulation of a tile offset in an unsigned 32-bit integer. 00074 /// \details This type supports offsets between 0 and 4,294,967,295 inclusive. Note that 00075 /// although an offset would normally be a signed data type, this type is only used in 00076 /// explicit compact segments, to express positive offsets from an anchor tile index. 00077 struct TileOffset : public torc::common::EncapsulatedInteger<boost::uint32_t> { 00078 explicit TileOffset(void) : type() {} ///< \brief Null constructor. 00079 explicit TileOffset(const pod& rhs) : type(rhs) {} ///< \brief Data type constructor. 00080 explicit TileOffset(const type& rhs) : type(rhs) {} ///< \brief Copy constructor. 00081 explicit TileOffset(const TileIndex& rhs) : type(rhs) {} ///< \brief Conversion constructor. 00082 }; 00083 /// \brief Addition operator to add an anchor tile index to a relative tile offset. 00084 TileIndex operator +(const TileOffset& inTileOffset, const TileIndex& inTileIndex); 00085 /// \brief Encapsulation of a tile row in an unsigned 16-bit integer. 00086 /// \details This type supports row positions between 0 and 65,535 inclusive. 00087 struct TileRow : public torc::common::EncapsulatedInteger<boost::uint16_t> { 00088 explicit TileRow(void) : type() {} ///< \brief Null constructor. 00089 explicit TileRow(const pod& rhs) : type(rhs) {} ///< \brief Data type constructor. 00090 explicit TileRow(const type& rhs) : type(rhs) {} ///< \brief Copy constructor. 00091 }; 00092 /// \brief Encapsulation of a tile column in an unsigned 16-bit integer. 00093 /// \details This type supports column positions between 0 and 65,535 inclusive. 00094 struct TileCol : public torc::common::EncapsulatedInteger<boost::uint16_t> { 00095 explicit TileCol(void) : type() {} ///< \brief Null constructor. 00096 explicit TileCol(const pod& rhs) : type(rhs) {} ///< \brief Data type constructor. 00097 explicit TileCol(const type& rhs) : type(rhs) {} ///< \brief Copy constructor. 00098 }; 00099 00100 // -------------------------------------------------------------------------------------------- 00101 // ----------------------------------------- Tile types --------------------------------------- 00102 // -------------------------------------------------------------------------------------------- 00103 00104 /// \brief Encapsulation of a tile type count in an unsigned 16-bit integer. 00105 /// \details This type supports tile type counts between 0 and 65,535 inclusive. 00106 struct TileTypeCount : public torc::common::EncapsulatedInteger<boost::uint16_t> { 00107 explicit TileTypeCount(void) : type() {} ///< \brief Null constructor. 00108 explicit TileTypeCount(const pod& rhs) : type(rhs) {} ///< \brief Data type constructor. 00109 explicit TileTypeCount(const type& rhs) : type(rhs) {} ///< \brief Copy constructor. 00110 }; 00111 /// \brief Encapsulation of a tile type index in an unsigned 16-bit integer. 00112 /// \details This type supports tile type indexes between 0 and 65,535 inclusive. 00113 struct TileTypeIndex : public TileTypeCount { 00114 explicit TileTypeIndex(void) : TileTypeCount() {} 00115 ///< \brief Null constructor. 00116 explicit TileTypeIndex(const pod& rhs) : TileTypeCount(rhs) {} 00117 ///< \brief Data type constructor. 00118 explicit TileTypeIndex(const type& rhs) : TileTypeCount(rhs) {} 00119 ///< \brief Copy constructor. 00120 }; 00121 00122 // -------------------------------------------------------------------------------------------- 00123 // ------------------------------------- Compact segments ------------------------------------- 00124 // -------------------------------------------------------------------------------------------- 00125 00126 /// \brief Encapsulation of a compact segment count in an unsigned 32-bit integer. 00127 /// \details This type supports compact segment counts between 0 and 4,294,967,295 inclusive. 00128 struct CompactSegmentCount : public torc::common::EncapsulatedInteger<boost::uint32_t> { 00129 explicit CompactSegmentCount(void) : type() {} 00130 ///< \brief Null constructor. 00131 explicit CompactSegmentCount(const pod& rhs) : type(rhs) {} 00132 ///< \brief Data type constructor. 00133 explicit CompactSegmentCount(const type& rhs) : type(rhs) {} 00134 ///< \brief Copy constructor. 00135 }; 00136 /// \brief Encapsulation of a compact segment index in an unsigned 32-bit integer. 00137 /// \details This type supports compact segment indexes between 0 and 4,294,967,295 inclusive. 00138 struct CompactSegmentIndex : public CompactSegmentCount { 00139 explicit CompactSegmentIndex(void) : CompactSegmentCount() {} 00140 ///< \brief Null constructor. 00141 explicit CompactSegmentIndex(const pod& rhs) : CompactSegmentCount(rhs) {} 00142 ///< \brief Data type constructor. 00143 explicit CompactSegmentIndex(const type& rhs) : CompactSegmentCount(rhs) {} 00144 ///< \brief Copy constructor. 00145 }; 00146 00147 // -------------------------------------------------------------------------------------------- 00148 // ------------------------------------------- Sites ------------------------------------------ 00149 // -------------------------------------------------------------------------------------------- 00150 00151 /// \brief Encapsulation of a site count in an unsigned 32-bit integer. 00152 /// \details This type supports counts between 0 and 4,294,967,295 inclusive. 00153 struct SiteCount : public torc::common::EncapsulatedInteger<boost::uint32_t> { 00154 explicit SiteCount(void) : type() {} ///< \brief Null constructor. 00155 explicit SiteCount(const pod& rhs) : type(rhs) {} ///< \brief Data type constructor. 00156 explicit SiteCount(const type& rhs) : type(rhs) {} ///< \brief Copy constructor. 00157 }; 00158 /// \brief Encapsulation of a site index in an unsigned 32-bit integer. 00159 /// \details This type supports indexes between 0 and 4,294,967,295 inclusive. 00160 struct SiteIndex : public SiteCount { 00161 explicit SiteIndex(void) : SiteCount() {} ///< \brief Null constructor. 00162 explicit SiteIndex(const pod& rhs) : SiteCount(rhs) {} ///< \brief Data type constructor. 00163 explicit SiteIndex(const type& rhs) : SiteCount(rhs) {} ///< \brief Copy constructor. 00164 }; 00165 /// \brief Encapsulation of site attribute flags in an unsigned 16-bit integer. 00166 /// \details This type supports a maximum of sixteen unique one-bit flags. 00167 struct SiteFlags : public torc::common::EncapsulatedInteger<boost::uint16_t> { 00168 explicit SiteFlags(void) : type() {} ///< \brief Null constructor. 00169 explicit SiteFlags(const pod& rhs) : type(rhs) {} ///< \brief Data type constructor. 00170 explicit SiteFlags(const type& rhs) : type(rhs) {} ///< \brief Copy constructor. 00171 }; 00172 00173 // -------------------------------------------------------------------------------------------- 00174 // ----------------------------------------- Site defs ---------------------------------------- 00175 // -------------------------------------------------------------------------------------------- 00176 00177 /// \brief Encapsulation of a site type count in an unsigned 16-bit integer. 00178 /// \details This type supports site type counts between 0 and 65,535 inclusive. 00179 struct SiteTypeCount : public torc::common::EncapsulatedInteger<boost::uint16_t> { 00180 explicit SiteTypeCount(void) : type() {} ///< \brief Null constructor. 00181 explicit SiteTypeCount(const pod& rhs) : type(rhs) {} ///< \brief Data type constructor. 00182 explicit SiteTypeCount(const type& rhs) : type(rhs) {} ///< \brief Copy constructor. 00183 }; 00184 /// \brief Encapsulation of a site type index in an unsigned 16-bit integer. 00185 /// \details This type supports site type indexes between 0 and 65,535 inclusive. 00186 struct SiteTypeIndex : public SiteTypeCount { 00187 explicit SiteTypeIndex(void) : SiteTypeCount() {} 00188 ///< \brief Null constructor. 00189 explicit SiteTypeIndex(const pod& rhs) : SiteTypeCount(rhs) {} 00190 ///< \brief Data type constructor. 00191 explicit SiteTypeIndex(const type& rhs) : SiteTypeCount(rhs) {} 00192 ///< \brief Copy constructor. 00193 }; 00194 00195 // -------------------------------------------------------------------------------------------- 00196 // ------------------------------------------- Pins ------------------------------------------- 00197 // -------------------------------------------------------------------------------------------- 00198 00199 /// \brief Encapsulation of a pin count in an unsigned 32-bit integer. 00200 /// \details This type supports counts between 0 and 4,294,967,295 inclusive. 00201 struct PinCount : public torc::common::EncapsulatedInteger<boost::uint32_t> { 00202 explicit PinCount(void) : type() {} ///< \brief Null constructor. 00203 explicit PinCount(const pod& rhs) : type(rhs) {} ///< \brief Data type constructor. 00204 explicit PinCount(const type& rhs) : type(rhs) {} ///< \brief Copy constructor. 00205 }; 00206 /// \brief Encapsulation of a pin index in an unsigned 32-bit integer. 00207 /// \details This type supports indexes between 0 and 4,294,967,295 inclusive. 00208 struct PinIndex : public PinCount { 00209 explicit PinIndex(void) : PinCount() {} ///< \brief Null constructor. 00210 explicit PinIndex(const pod& rhs) : PinCount(rhs) {} ///< \brief Data type constructor. 00211 explicit PinIndex(const type& rhs) : PinCount(rhs) {} ///< \brief Copy constructor. 00212 }; 00213 /// \brief Encapsulation of pin attribute flags in an unsigned 16-bit integer. 00214 /// \details This type supports a maximum of sixteen unique one-bit flags. 00215 struct PinFlags : public torc::common::EncapsulatedInteger<boost::uint16_t> { 00216 explicit PinFlags(void) : type() {} ///< \brief Null constructor. 00217 explicit PinFlags(const pod& rhs) : type(rhs) {} ///< \brief Data type constructor. 00218 explicit PinFlags(const type& rhs) : type(rhs) {} ///< \brief Copy constructor. 00219 }; 00220 00221 // -------------------------------------------------------------------------------------------- 00222 // ----------------------------------------- Packages ----------------------------------------- 00223 // -------------------------------------------------------------------------------------------- 00224 00225 /// \brief Encapsulation of a package count in an unsigned 16-bit integer. 00226 /// \details This type supports counts between 0 and 65,535 inclusive. 00227 struct PackageCount : public torc::common::EncapsulatedInteger<boost::uint16_t> { 00228 explicit PackageCount(void) : type() {} ///< \brief Null constructor. 00229 explicit PackageCount(const pod& rhs) : type(rhs) {} ///< \brief Data type constructor. 00230 explicit PackageCount(const type& rhs) : type(rhs) {} ///< \brief Copy constructor. 00231 }; 00232 00233 /// \brief Encapsulation of a package index in an unsigned 16-bit integer. 00234 /// \details This type supports package indexes between 0 and 65,535 inclusive. 00235 struct PackageIndex : public PackageCount { 00236 explicit PackageIndex(void) : PackageCount() {} ///< \brief Null constructor. 00237 explicit PackageIndex(const pod& rhs) : PackageCount(rhs) {} ///< \brief Data type constructor. 00238 explicit PackageIndex(const type& rhs) : PackageCount(rhs) {} ///< \brief Copy constructor. 00239 }; 00240 00241 // -------------------------------------------------------------------------------------------- 00242 // ------------------------------------------- Pads ------------------------------------------- 00243 // -------------------------------------------------------------------------------------------- 00244 00245 /// \brief Encapsulation of a pad count in an unsigned 32-bit integer. 00246 /// \details This type supports counts between 0 and 4,294,967,295 inclusive. 00247 struct PadCount : public torc::common::EncapsulatedInteger<boost::uint32_t> { 00248 explicit PadCount(void) : type() {} ///< \brief Null constructor. 00249 explicit PadCount(const pod& rhs) : type(rhs) {} ///< \brief Data type constructor. 00250 explicit PadCount(const type& rhs) : type(rhs) {} ///< \brief Copy constructor. 00251 }; 00252 /// \brief Encapsulation of a pad index in an unsigned 32-bit integer. 00253 /// \details This type supports indexes between 0 and 4,294,967,295 inclusive. 00254 struct PadIndex : public PadCount { 00255 explicit PadIndex(void) : PadCount() {} ///< \brief Null constructor. 00256 explicit PadIndex(const pod& rhs) : PadCount(rhs) {} ///< \brief Data type constructor. 00257 explicit PadIndex(const type& rhs) : PadCount(rhs) {} ///< \brief Copy constructor. 00258 }; 00259 00260 } // namespace xilinx 00261 } // namespace architecture 00262 } // namespace torc 00263 00264 #endif // TORC_ARCHITECTURE_XILINXDATABASETYPES_HPP