00001 // Torc - Copyright 2011 University of Southern California. All Rights Reserved. 00002 // $HeadURL: https://svn.east.isi.edu/torc/trunk/src/torc/physical/OutputStreamHelpers.cpp $ 00003 // $Id: OutputStreamHelpers.cpp 380 2011-02-23 04:05:26Z 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 Source for torc::physical output stream helpers. 00018 00019 #include "torc/physical/OutputStreamHelpers.hpp" 00020 #include "torc/physical/Factory.hpp" 00021 #include <iostream> 00022 00023 namespace torc { 00024 namespace physical { 00025 00026 std::ostream& operator << (std::ostream& os, const Design& rhs) { 00027 return os << rhs.getName() << " [" << rhs.getDevice() << rhs.getPackage() 00028 << rhs.getSpeedGrade() << ", " << rhs.getXdlVersion() << "]"; 00029 } 00030 00031 std::ostream& operator << (std::ostream& os, const Module& rhs) { 00032 return os << rhs.getName() << " [" << rhs.getAnchor() << "]"; 00033 } 00034 00035 std::ostream& operator <<(std::ostream& os, const Instance& rhs) { 00036 return os << rhs.getName(); 00037 } 00038 00039 std::ostream& operator << (std::ostream& os, const Net& rhs) { 00040 return os << rhs.getName(); 00041 } 00042 00043 std::ostream& operator <<(std::ostream& os, const InstancePin& rhs) { 00044 InstanceWeakPtr instancePtr = rhs.getInstancePtr(); 00045 return os << (instancePtr.expired() ? "[unnamed]" : instancePtr.lock()->getName()) << '.' 00046 << rhs.getPinName(); 00047 } 00048 00049 std::ostream& operator <<(std::ostream& os, const Pip& rhs) { 00050 return os << rhs.getTileName() << ' ' << rhs.getSourceWireName() << ' ' 00051 << rhs.getDirectionString() << ' ' << rhs.getSinkWireName(); 00052 } 00053 00054 std::ostream& operator <<(std::ostream& os, const Config& rhs) { 00055 return os << rhs.getName() << ':' << rhs.getValue(); 00056 } 00057 00058 } // namespace physical 00059 } // namespace torc