torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
architecture/InstancePin.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 InstancePin class.
18 
19 #ifndef TORC_ARCHITECTURE_INSTANCEPIN_HPP
20 #define TORC_ARCHITECTURE_INSTANCEPIN_HPP
21 
24 
25 namespace torc {
26 namespace architecture {
27 
28  /// \brief Physical design instance-pin pair, suitable for specifying a net endpoint.
29  /// \details This class is a Tilewire-aware version of torc::physical::InstancePin. It
30  /// functions as an encapsulation of an InstancePin and its corresponding Tilewire.
32  protected:
33  // constructors
34  /// \brief Protected constructor.
35  /// \param inInstancePtr The pin instance pointer.
36  /// \param inPinName The pin name.
37  InstancePin(torc::physical::InstanceSharedPtr inInstancePtr, const string& inPinName)
38  : InstancePinBase(inInstancePtr, inPinName), Tilewire() {}
39  private:
40  // constructors
41  /// \brief Disabled copy constructor.
43  public:
44  // typedefs
45  typedef boost::shared_ptr<class ::torc::architecture::InstancePin> ArchitectureInstancePinPtr;
46  typedef boost::shared_ptr<class ::torc::physical::InstancePin> PhysicalInstancePinPtr;
47  // statics
48  /// \brief Typecasts a torc::physical::InstancePin to a torc::architecture::InstancePin.
50  PhysicalInstancePinPtr& inInstancePinSharedPtr) {
51  return reinterpret_cast<ArchitectureInstancePinPtr&>(inInstancePinSharedPtr);
52  }
54  ArchitectureInstancePinPtr& inInstancePinSharedPtr) {
55  return reinterpret_cast<PhysicalInstancePinPtr&>(inInstancePinSharedPtr);
56  }
57  // functions
58  /// \brief Updates the Tilewire from the instance and pin names.
59  void updateTilewire(class DDB& inDDB);
60  // accessors
61  /// \brief Returns the Tilewire designated by this instance pin.
62  Tilewire& getTilewire(void) { return static_cast<Tilewire&>(*this); }
63  };
64 
65  /// \brief Shared pointer encapsulation of an InstancePin.
66  typedef boost::shared_ptr<InstancePin> InstancePinSharedPtr;
67 
68  /// \brief Weak pointer encapsulation of an InstancePin.
69  typedef boost::weak_ptr<InstancePin> InstancePinWeakPtr;
70 
71  /// \brief Vector of InstancePin shared pointers.
72  typedef std::vector<InstancePinSharedPtr> InstancePinSharedPtrVector;
73 
74  /// \brief Reinterpret the given torc::physical::InstancePinSharedPtr as a
75  /// torc::architecture::InstancePinSharedPtr.
76  #define INSTANCE_PIN_PHYSICAL_TO_ARCHITECTURE(x) \
77  ::torc::architecture::InstancePin::physicalToArchitecture(x)
78 
79  /// \brief Reinterpret the given torc::architecture::InstancePinSharedPtr as a
80  /// torc::physical::InstancePinSharedPtr.
81  #define INSTANCE_PIN_ARCHITECTURE_TO_PHYSICAL(x) \
82  ::torc::architecture::InstancePin::architectureToPhysical(x)
83 
84 } // namespace architecture
85 } // namespace torc
86 
87 #endif // TORC_ARCHITECTURE_INSTANCEPIN_HPP
Physical design instance-pin pair, suitable for specifying a net endpoint.
Device database, including complete wiring and logic support.
Definition: DDB.hpp:42
InstancePin(torc::physical::InstanceSharedPtr inInstancePtr, const string &inPinName)
Protected constructor.
InstancePin(const InstancePin &rhs)
Disabled copy constructor.
static ArchitectureInstancePinPtr & physicalToArchitecture(PhysicalInstancePinPtr &inInstancePinSharedPtr)
Typecasts a torc::physical::InstancePin to a torc::architecture::InstancePin.
std::vector< InstancePinSharedPtr > InstancePinSharedPtrVector
Vector of InstancePin shared pointers.
static PhysicalInstancePinPtr & architectureToPhysical(ArchitectureInstancePinPtr &inInstancePinSharedPtr)
InstancePinBase(InstanceSharedPtr inInstancePtr, const string &inPinName)
Protected constructor.
Encapsulation of a device tile and wire pair.
Definition: Tilewire.hpp:39
void updateTilewire(class DDB &inDDB)
Updates the Tilewire from the instance and pin names.
boost::shared_ptr< Instance > InstanceSharedPtr
Shared pointer encapsulation of an Instance.
boost::shared_ptr< class::torc::architecture::InstancePin > ArchitectureInstancePinPtr
Header for the Tilewire class.
Tilewire & getTilewire(void)
Returns the Tilewire designated by this instance pin.
boost::weak_ptr< InstancePin > InstancePinWeakPtr
Weak pointer encapsulation of an InstancePin.
Physical design instance-pin pair, suitable for specifying a net endpoint.
boost::shared_ptr< class::torc::physical::InstancePin > PhysicalInstancePinPtr
Header for the InstancePin class.
boost::shared_ptr< InstancePin > InstancePinSharedPtr
Shared pointer encapsulation of an InstancePin.