torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
physical/OutputStreamHelpers.cpp
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 Source for torc::physical output stream helpers.
18 
21 #include <iostream>
22 
23 namespace torc {
24 namespace physical {
25 
26  std::ostream& operator << (std::ostream& os, const Design& rhs) {
27  return os << rhs.getName() << " [" << rhs.getDevice() << rhs.getPackage()
28  << rhs.getSpeedGrade() << ", " << rhs.getXdlVersion() << "]";
29  }
30 
31  std::ostream& operator << (std::ostream& os, const Module& rhs) {
32  return os << rhs.getName() << " [" << rhs.getAnchor() << "]";
33  }
34 
35  std::ostream& operator <<(std::ostream& os, const Instance& rhs) {
36  return os << rhs.getName();
37  }
38 
39  std::ostream& operator << (std::ostream& os, const Net& rhs) {
40  return os << rhs.getName();
41  }
42 
43  std::ostream& operator <<(std::ostream& os, const InstancePin& rhs) {
44  InstanceWeakPtr instancePtr = rhs.getInstancePtr();
45  return os << (instancePtr.expired() ? "[unnamed]" : instancePtr.lock()->getName()) << '.'
46  << rhs.getPinName();
47  }
48 
49  std::ostream& operator <<(std::ostream& os, const Pip& rhs) {
50  return os << rhs.getTileName() << ' ' << rhs.getSourceWireName() << ' '
51  << rhs.getDirectionString() << ' ' << rhs.getSinkWireName();
52  }
53 
54  std::ostream& operator <<(std::ostream& os, const Config& rhs) {
55  return os << rhs.getName() << ':' << rhs.getValue();
56  }
57 
58 } // namespace physical
59 } // namespace torc
const string & getPackage(void) const
Returns the device package for this design.
const PinName & getPinName(void) const
Returns the pin name.
Physical netlist design.
const string & getAnchor(void) const
Returns the anchor instance name for this module.
Definition: Module.hpp:91
const WireName & getSinkWireName(void) const
Returns the pip sink wire.
Definition: Pip.hpp:77
Physical design instance.
Configuration. A {name:value} pair.
Definition: Config.hpp:39
Physical design net.
Header for torc::physical output stream helpers.
const string & getName(void) const
Returns the object name.
Definition: Named.hpp:51
Physical design instance-pin pair, suitable for specifying a net endpoint.
const string & getValue(void) const
Return the configuration value.
Definition: Config.hpp:86
const TileName & getTileName(void) const
Returns the pip tile.
Definition: Pip.hpp:73
Physical design programmable interconnect point.
Definition: Pip.hpp:34
const WireName & getSourceWireName(void) const
Returns the pip source wire.
Definition: Pip.hpp:75
const string & getXdlVersion(void) const
Returns the XDL version for this design.
const InstanceWeakPtr & getInstancePtr(void) const
Returns the weak instance pointer.
const string & getSpeedGrade(void) const
Returns the device speed grade for this design.
const string & getDevice(void) const
Returns the target device for this design.
Header for the Factory class.
boost::weak_ptr< Instance > InstanceWeakPtr
Weak pointer encapsulation of an Instance.
Hierarchical module.
Definition: Module.hpp:33
static const char * getDirectionString(EPipDirection inPipDirection)
Returns the pip directionality as a string.
Definition: Pip.cpp:36
std::ostream & operator<<(std::ostream &os, const Design &rhs)
Design stream inserter.