SimpleLink.hh revision 8258
110399Sstephan.diestelhorst@arm.com/* 210399Sstephan.diestelhorst@arm.com * Copyright (c) 2011 Advanced Micro Devices, Inc. 310399Sstephan.diestelhorst@arm.com * All rights reserved. 410399Sstephan.diestelhorst@arm.com * 510399Sstephan.diestelhorst@arm.com * Redistribution and use in source and binary forms, with or without 610399Sstephan.diestelhorst@arm.com * modification, are permitted provided that the following conditions are 710399Sstephan.diestelhorst@arm.com * met: redistributions of source code must retain the above copyright 810399Sstephan.diestelhorst@arm.com * notice, this list of conditions and the following disclaimer; 910399Sstephan.diestelhorst@arm.com * redistributions in binary form must reproduce the above copyright 1010399Sstephan.diestelhorst@arm.com * notice, this list of conditions and the following disclaimer in the 1110399Sstephan.diestelhorst@arm.com * documentation and/or other materials provided with the distribution; 1210399Sstephan.diestelhorst@arm.com * neither the name of the copyright holders nor the names of its 1310399Sstephan.diestelhorst@arm.com * contributors may be used to endorse or promote products derived from 1410399Sstephan.diestelhorst@arm.com * this software without specific prior written permission. 1510399Sstephan.diestelhorst@arm.com * 1610399Sstephan.diestelhorst@arm.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1710399Sstephan.diestelhorst@arm.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1810399Sstephan.diestelhorst@arm.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 1910399Sstephan.diestelhorst@arm.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 2010399Sstephan.diestelhorst@arm.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2110399Sstephan.diestelhorst@arm.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 2210399Sstephan.diestelhorst@arm.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2310399Sstephan.diestelhorst@arm.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2410399Sstephan.diestelhorst@arm.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2510399Sstephan.diestelhorst@arm.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 2610399Sstephan.diestelhorst@arm.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2710399Sstephan.diestelhorst@arm.com */ 2810399Sstephan.diestelhorst@arm.com 2910399Sstephan.diestelhorst@arm.com#ifndef __MEM_RUBY_NETWORK_SIMPLE_LINK_HH__ 3010399Sstephan.diestelhorst@arm.com#define __MEM_RUBY_NETWORK_SIMPLE_LINK_HH__ 3110399Sstephan.diestelhorst@arm.com 3210399Sstephan.diestelhorst@arm.com#include <iostream> 3310399Sstephan.diestelhorst@arm.com#include <string> 3410399Sstephan.diestelhorst@arm.com#include <vector> 3510399Sstephan.diestelhorst@arm.com 3610399Sstephan.diestelhorst@arm.com#include "params/SimpleExtLink.hh" 3710399Sstephan.diestelhorst@arm.com#include "params/SimpleIntLink.hh" 3810399Sstephan.diestelhorst@arm.com#include "mem/ruby/network/BasicLink.hh" 3910399Sstephan.diestelhorst@arm.com 4010399Sstephan.diestelhorst@arm.comclass SimpleExtLink : public BasicExtLink 4110399Sstephan.diestelhorst@arm.com{ 4210399Sstephan.diestelhorst@arm.com public: 4310399Sstephan.diestelhorst@arm.com typedef SimpleExtLinkParams Params; 4410399Sstephan.diestelhorst@arm.com SimpleExtLink(const Params *p); 4510399Sstephan.diestelhorst@arm.com const Params *params() const { return (const Params *)_params; } 4610399Sstephan.diestelhorst@arm.com 4710399Sstephan.diestelhorst@arm.com friend class Topology; 4810399Sstephan.diestelhorst@arm.com void print(std::ostream& out) const; 4910399Sstephan.diestelhorst@arm.com 5010399Sstephan.diestelhorst@arm.com int m_bw_multiplier; 5110399Sstephan.diestelhorst@arm.com}; 5210399Sstephan.diestelhorst@arm.com 5310399Sstephan.diestelhorst@arm.cominline std::ostream& 5410399Sstephan.diestelhorst@arm.comoperator<<(std::ostream& out, const SimpleExtLink& obj) 5510399Sstephan.diestelhorst@arm.com{ 5610399Sstephan.diestelhorst@arm.com obj.print(out); 5710399Sstephan.diestelhorst@arm.com out << std::flush; 5810399Sstephan.diestelhorst@arm.com return out; 5910399Sstephan.diestelhorst@arm.com} 6010399Sstephan.diestelhorst@arm.com 6110399Sstephan.diestelhorst@arm.comclass SimpleIntLink : public BasicIntLink 6210399Sstephan.diestelhorst@arm.com{ 6310399Sstephan.diestelhorst@arm.com public: 6410399Sstephan.diestelhorst@arm.com typedef SimpleIntLinkParams Params; 6510399Sstephan.diestelhorst@arm.com SimpleIntLink(const Params *p); 6610399Sstephan.diestelhorst@arm.com const Params *params() const { return (const Params *)_params; } 6710399Sstephan.diestelhorst@arm.com 6810399Sstephan.diestelhorst@arm.com friend class Topology; 6910399Sstephan.diestelhorst@arm.com void print(std::ostream& out) const; 7010399Sstephan.diestelhorst@arm.com 7110399Sstephan.diestelhorst@arm.com int m_bw_multiplier; 7210399Sstephan.diestelhorst@arm.com}; 7310399Sstephan.diestelhorst@arm.com 7410399Sstephan.diestelhorst@arm.cominline std::ostream& 7510399Sstephan.diestelhorst@arm.comoperator<<(std::ostream& out, const SimpleIntLink& obj) 7610399Sstephan.diestelhorst@arm.com{ 7710399Sstephan.diestelhorst@arm.com obj.print(out); 7810399Sstephan.diestelhorst@arm.com out << std::flush; 7910399Sstephan.diestelhorst@arm.com return out; 8010399Sstephan.diestelhorst@arm.com} 8110399Sstephan.diestelhorst@arm.com 8210399Sstephan.diestelhorst@arm.com#endif // __MEM_RUBY_NETWORK_SIMPLE_LINK_HH__ 8310399Sstephan.diestelhorst@arm.com