torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
architecture/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::architecture output stream helpers.
18 
25 
26 namespace torc {
27 namespace architecture {
28 
29 using namespace torc::architecture::xilinx;
30 
31  std::ostream& operator <<(std::ostream& os, const Tilewire& rhs) {
32  const DDB* ddbPtr = DDBStreamHelper::getDDBPtr(os);
33  if(ddbPtr) {
34  // the database is available: look up the extended tilewire information
35  os << ExtendedWireInfo(*ddbPtr, rhs);
36  } else {
37  // the database is not available: write out the basic tilewire information
38  os << rhs.getWireIndex() << "@" << rhs.getTileIndex();
39  }
40  return os;
41  }
42 
43  std::ostream& operator <<(std::ostream& os, const ExtendedWireInfo& rhs) {
44  // handle uninitialized wire info
45  if(rhs.mTileIndex.isUndefined()) return os << "[UNINITIALIZED]";
46 
47  // handle regular wire info
48  return os << rhs.mWireName << "@[" << rhs.mTileRow << "," << rhs.mTileCol << "] "
49  << rhs.mTileTypeName << " \"" << rhs.mTileName << "\" (" << rhs.mWireIndex << "@"
50  << rhs.mTileIndex << ")"
51  << (WireInfo::isHidden(rhs.mWireFlags) ? " HIDDEN" : "")
52  << (WireInfo::isInput(rhs.mWireFlags) ? " INPUT" : "")
53  << (WireInfo::isOutput(rhs.mWireFlags) ? " OUTPUT" : "")
54  << (WireInfo::isRemote(rhs.mWireFlags) ? " REMOTE" : "")
55  << (WireInfo::isRemoteNodeCapable(rhs.mWireFlags) ? " REMOTE_NODE_CAPABLE" : "")
56  << (WireInfo::isRemoteArcCapable(rhs.mWireFlags) ? " REMOTE_ARC_CAPABLE" : "")
57  ;
58  }
59 
60  std::ostream& operator <<(std::ostream& os, const Arc& rhs) {
61  return os << rhs.getSourceTilewire() << " >> " << rhs.getSinkTilewire();
62  }
63 
64 } // namespace architecture
65 } // namespace torc
const WireIndex & getWireIndex(void) const
Returns the wire index.
Definition: Tilewire.hpp:66
const char * mTileTypeName
The tile type name.
bool isOutput(void) const
Returns true if the wire is a logic output.
Definition: WireInfo.hpp:132
Encapsulation of an arc between two tilewires.
Definition: Arc.hpp:28
Device database, including complete wiring and logic support.
Definition: DDB.hpp:42
const char * mWireName
The wire name.
bool isInput(void) const
Returns true if the wire is a logic input.
Definition: WireInfo.hpp:130
Header for the Arc class.
Header for the DDBStreamHelper class.
bool isHidden(void) const
Returns true if the wire is hidden in traces.
Definition: WireInfo.hpp:128
std::ostream & operator<<(std::ostream &os, const DDB &ddb)
const Tilewire & getSourceTilewire(void) const
Returns the source tilewire.
Definition: Arc.hpp:45
const Tilewire & getSinkTilewire(void) const
Returns the sink tilewire.
Definition: Arc.hpp:47
static const class DDB * getDDBPtr(std::ostream &os)
Return the device database pointer associated with this stream.
const char * mTileName
The tile name.
Header for torc::physical output stream helpers.
bool isRemoteArcCapable(void) const
Returns true if the wire may be referenced by a remote arc.
Definition: WireInfo.hpp:140
Encapsulation of a device tile and wire pair.
Definition: Tilewire.hpp:39
Verbose encapsulation of a wire's information.
Header for the Tilewire class.
WireIndex mWireIndex
The wire index.
Header for the DDB class.
TileIndex mTileIndex
The tile index.
const TileIndex & getTileIndex(void) const
Returns the tile index.
Definition: Tilewire.hpp:64
Header for the Tiles class.
bool isRemote(void) const
Returns true if the wire is a remote wire.
Definition: WireInfo.hpp:134
WireFlags mWireFlags
The wire flags.
bool isRemoteNodeCapable(void) const
Returns true if the wire may be referenced by a remote wire.
Definition: WireInfo.hpp:138