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/SitePin.hpp $ 00003 // $Id: SitePin.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 SitePin class. 00018 00019 #ifndef TORC_ARCHITECTURE_SITEPIN_HPP 00020 #define TORC_ARCHITECTURE_SITEPIN_HPP 00021 00022 #include "torc/architecture/XilinxDatabaseTypes.hpp" 00023 00024 namespace torc { 00025 namespace architecture { 00026 00027 /// \bried Encapsulation of pin directionality. 00028 /// \detail These directions are generated by the database build code, and are used by the 00029 /// SitePin and PrimitivePin clases. 00030 class PinDirection { 00031 public: 00032 // enumerations 00033 enum EPinDirection { ePinDirectionNone = 0, ePinDirectionInput = 2, 00034 ePinDirectionOutput = 4 }; 00035 }; 00036 00037 /// \brief Site type and population data for the family and the device. 00038 /// \details Each device has a collection of logic sites. Those sites are instantiations of 00039 /// family defined site types, with each instance also including a mapping from site pin 00040 /// to Tilewire. 00041 00042 00043 /// \brief Encapsulation of a site pin's name and flags. 00044 class SitePin : public PinDirection { 00045 friend class Sites; 00046 std::string mName; 00047 PinFlags mFlags; 00048 SitePin(const std::string& inName, PinFlags inFlags) : mName(inName), mFlags(inFlags) {} 00049 public: 00050 const std::string& getName(void) const { return mName; } 00051 PinFlags getFlags(void) const { return mFlags; } 00052 SitePin(void) : mName(), mFlags() {}; 00053 bool isInput(void) const { return (mFlags & ePinDirectionInput) != 0; } 00054 bool isOutput(void) const { return (mFlags & ePinDirectionOutput) != 0; } 00055 }; 00056 00057 } // namespace architecture 00058 } // namespace torc 00059 00060 #endif // TORC_ARCHITECTURE_SITEPIN_HPP