BasicRouter.hh revision 9465
172SN/A/* 21762SN/A * Copyright (c) 2011 Advanced Micro Devices, Inc. 372SN/A * All rights reserved. 472SN/A * 572SN/A * Redistribution and use in source and binary forms, with or without 672SN/A * modification, are permitted provided that the following conditions are 772SN/A * met: redistributions of source code must retain the above copyright 872SN/A * notice, this list of conditions and the following disclaimer; 972SN/A * redistributions in binary form must reproduce the above copyright 1072SN/A * notice, this list of conditions and the following disclaimer in the 1172SN/A * documentation and/or other materials provided with the distribution; 1272SN/A * neither the name of the copyright holders nor the names of its 1372SN/A * contributors may be used to endorse or promote products derived from 1472SN/A * this software without specific prior written permission. 1572SN/A * 1672SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1772SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1872SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 1972SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 2072SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2172SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 2272SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2372SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2472SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2572SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 2672SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 272665Ssaidi@eecs.umich.edu */ 282665Ssaidi@eecs.umich.edu 2972SN/A#ifndef __MEM_RUBY_NETWORK_BASIC_ROUTER_HH__ 3072SN/A#define __MEM_RUBY_NETWORK_BASIC_ROUTER_HH__ 312SN/A 328332Snate@binkert.org#include <iostream> 338332Snate@binkert.org#include <string> 342SN/A#include <vector> 352SN/A 362SN/A#include "params/BasicRouter.hh" 372SN/A#include "sim/clocked_object.hh" 382SN/A 392SN/Aclass BasicRouter : public ClockedObject 402SN/A{ 415543Ssaidi@eecs.umich.edu public: 425543Ssaidi@eecs.umich.edu typedef BasicRouterParams Params; 432SN/A BasicRouter(const Params *p); 442SN/A const Params *params() const { return (const Params *)_params; } 452SN/A 462SN/A void init(); 472SN/A 482SN/A void print(std::ostream& out) const; 492SN/A 502SN/A friend class Topology; 512SN/A 522SN/A protected: 532SN/A // 545543Ssaidi@eecs.umich.edu // ID in relation to other routers in the system 555543Ssaidi@eecs.umich.edu // 562SN/A uint32_t m_id; 572SN/A}; 582SN/A 592SN/Ainline std::ostream& 602SN/Aoperator<<(std::ostream& out, const BasicRouter& obj) 612SN/A{ 622SN/A obj.print(out); 632SN/A out << std::flush; 642SN/A return out; 652SN/A} 662SN/A 672SN/A#endif // __MEM_RUBY_NETWORK_BASIC_ROUTER_HH__ 682SN/A