BasicLink.cc revision 8258
16700SN/A/*
28257SBrad.Beckmann@amd.com * Copyright (c) 2011 Advanced Micro Devices, Inc.
36700SN/A * All rights reserved.
46700SN/A *
56700SN/A * Redistribution and use in source and binary forms, with or without
66700SN/A * modification, are permitted provided that the following conditions are
76700SN/A * met: redistributions of source code must retain the above copyright
86700SN/A * notice, this list of conditions and the following disclaimer;
96700SN/A * redistributions in binary form must reproduce the above copyright
106700SN/A * notice, this list of conditions and the following disclaimer in the
116700SN/A * documentation and/or other materials provided with the distribution;
126700SN/A * neither the name of the copyright holders nor the names of its
136700SN/A * contributors may be used to endorse or promote products derived from
146700SN/A * this software without specific prior written permission.
156700SN/A *
166700SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
176700SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
186700SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
196700SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
206700SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
216700SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
226700SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
236700SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
246700SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
256700SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
266700SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
276700SN/A */
286285SN/A
298257SBrad.Beckmann@amd.com#include "mem/ruby/network/BasicLink.hh"
306285SN/A
318257SBrad.Beckmann@amd.comBasicLink::BasicLink(const Params *p)
326876SN/A    : SimObject(p)
336285SN/A{
348257SBrad.Beckmann@amd.com    m_latency = p->latency;
358258SBrad.Beckmann@amd.com    m_bandwidth_factor = p->bandwidth_factor;
368257SBrad.Beckmann@amd.com    m_weight = p->weight;
376285SN/A}
386285SN/A
397054SN/Avoid
408257SBrad.Beckmann@amd.comBasicLink::init()
416285SN/A{
426285SN/A}
436493SN/A
448257SBrad.Beckmann@amd.comvoid
458257SBrad.Beckmann@amd.comBasicLink::print(std::ostream& out) const
466493SN/A{
478257SBrad.Beckmann@amd.com    out << name();
486493SN/A}
497054SN/A
508257SBrad.Beckmann@amd.comBasicLink *
518257SBrad.Beckmann@amd.comBasicLinkParams::create()
527054SN/A{
538257SBrad.Beckmann@amd.com    return new BasicLink(this);
547054SN/A}
558257SBrad.Beckmann@amd.com
568257SBrad.Beckmann@amd.comBasicExtLink::BasicExtLink(const Params *p)
578257SBrad.Beckmann@amd.com    : BasicLink(p)
588257SBrad.Beckmann@amd.com{
598257SBrad.Beckmann@amd.com    m_int_node = p->int_node;
608257SBrad.Beckmann@amd.com    m_ext_node = p->ext_node;
618257SBrad.Beckmann@amd.com}
628257SBrad.Beckmann@amd.com
638257SBrad.Beckmann@amd.comBasicExtLink *
648257SBrad.Beckmann@amd.comBasicExtLinkParams::create()
658257SBrad.Beckmann@amd.com{
668257SBrad.Beckmann@amd.com    return new BasicExtLink(this);
678257SBrad.Beckmann@amd.com}
688257SBrad.Beckmann@amd.com
698257SBrad.Beckmann@amd.comBasicIntLink::BasicIntLink(const Params *p)
708257SBrad.Beckmann@amd.com    : BasicLink(p)
718257SBrad.Beckmann@amd.com{
728257SBrad.Beckmann@amd.com    m_node_a = p->node_a;
738257SBrad.Beckmann@amd.com    m_node_b = p->node_b;
748257SBrad.Beckmann@amd.com}
758257SBrad.Beckmann@amd.com
768257SBrad.Beckmann@amd.comBasicIntLink *
778257SBrad.Beckmann@amd.comBasicIntLinkParams::create()
788257SBrad.Beckmann@amd.com{
798257SBrad.Beckmann@amd.com    return new BasicIntLink(this);
808257SBrad.Beckmann@amd.com}
81