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/Pad.hpp $ 00003 // $Id: Pad.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 Header for the Pad class. 00018 00019 #ifndef TORC_ARCHITECTURE_PAD_HPP 00020 #define TORC_ARCHITECTURE_PAD_HPP 00021 00022 #include "torc/architecture/XilinxDatabaseTypes.hpp" 00023 #include "torc/architecture/Array.hpp" 00024 #include <string> 00025 00026 namespace torc { 00027 namespace architecture { 00028 00029 namespace architecture { class PadUnitTest; } 00030 namespace architecture { class PackageUnitTest; } 00031 00032 /// \brief Encapsulation of the site index, pin name, and pin flags for a package. 00033 class Pad { 00034 protected: 00035 /// \brief The Sites class has access to our internals. 00036 friend class Sites; 00037 /// \brief Our unit test class has access to our internals. 00038 friend class torc::architecture::architecture::PadUnitTest; 00039 /// \brief The Package unit test class has access to our internals. 00040 friend class torc::architecture::architecture::PackageUnitTest; 00041 // types 00042 typedef std::string string; ///< \brief Imported type name. 00043 typedef xilinx::SiteIndex SiteIndex; ///< \brief Imported type name. 00044 typedef xilinx::SiteFlags SiteFlags; ///< \brief Imported type name. 00045 // members 00046 /// \brief The index of the site corresponding to this pad. 00047 SiteIndex mSiteIndex; 00048 /// \brief The name of the pad in its physical package. 00049 string mName; 00050 /// \brief The site flags for this pad, specifically including bonding. 00051 SiteFlags mFlags; 00052 // constructors 00053 /// \brief Protected constructor. 00054 Pad(SiteIndex inSiteIndex, const string& inName, SiteFlags inFlags) 00055 : mSiteIndex(inSiteIndex), mName(inName), mFlags(inFlags) {} 00056 public: 00057 // constructors 00058 /// \brief Null constructor. 00059 Pad(void) : mSiteIndex(), mName(), mFlags() {}; 00060 // accessors 00061 /// \brief Returns the index of the site corresponding to this pad. 00062 SiteIndex getSiteIndex(void) const { return mSiteIndex; } 00063 /// \brief Returns the name of the pad in its physical package. 00064 const string& getName(void) const { return mName; } 00065 /// \brief Returns the site flags for this pad, specifically including bonding. 00066 SiteFlags getFlags(void) const { return mFlags; } 00067 }; 00068 00069 /// \brief Array of constant Pad objects. 00070 typedef Array<const Pad> PadArray; 00071 00072 } // namespace architecture 00073 } // namespace torc 00074 00075 #endif // TORC_ARCHITECTURE_PAD_HPP