GarnetLink.cc revision 11715
112866Sgabeblack@google.com/*
212866Sgabeblack@google.com * Copyright (c) 2008 Princeton University
312866Sgabeblack@google.com * Copyright (c) 2016 Georgia Institute of Technology
412866Sgabeblack@google.com * All rights reserved.
512866Sgabeblack@google.com *
612866Sgabeblack@google.com * Redistribution and use in source and binary forms, with or without
712866Sgabeblack@google.com * modification, are permitted provided that the following conditions are
812866Sgabeblack@google.com * met: redistributions of source code must retain the above copyright
912866Sgabeblack@google.com * notice, this list of conditions and the following disclaimer;
1012866Sgabeblack@google.com * redistributions in binary form must reproduce the above copyright
1112866Sgabeblack@google.com * notice, this list of conditions and the following disclaimer in the
1212866Sgabeblack@google.com * documentation and/or other materials provided with the distribution;
1312866Sgabeblack@google.com * neither the name of the copyright holders nor the names of its
1412866Sgabeblack@google.com * contributors may be used to endorse or promote products derived from
1512866Sgabeblack@google.com * this software without specific prior written permission.
1612866Sgabeblack@google.com *
1712866Sgabeblack@google.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1812866Sgabeblack@google.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1912866Sgabeblack@google.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
2012866Sgabeblack@google.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2112866Sgabeblack@google.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2212866Sgabeblack@google.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2312866Sgabeblack@google.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2412866Sgabeblack@google.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2512866Sgabeblack@google.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2612866Sgabeblack@google.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2712866Sgabeblack@google.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2812866Sgabeblack@google.com *
2912866Sgabeblack@google.com * Authors: Niket Agarwal
3012866Sgabeblack@google.com *          Tushar Krishna
3112866Sgabeblack@google.com */
3212866Sgabeblack@google.com
3312866Sgabeblack@google.com
3412866Sgabeblack@google.com#include "mem/ruby/network/garnet2.0/GarnetLink.hh"
3512866Sgabeblack@google.com
3612866Sgabeblack@google.com#include "mem/ruby/network/garnet2.0/CreditLink.hh"
3712866Sgabeblack@google.com#include "mem/ruby/network/garnet2.0/NetworkLink.hh"
3812866Sgabeblack@google.com
3912866Sgabeblack@google.comGarnetIntLink::GarnetIntLink(const Params *p)
4012866Sgabeblack@google.com    : BasicIntLink(p)
4112866Sgabeblack@google.com{
4212866Sgabeblack@google.com    // Uni-directional
4312866Sgabeblack@google.com
4412866Sgabeblack@google.com    m_network_link = p->network_link;
4512866Sgabeblack@google.com    m_credit_link = p->credit_link;
4612866Sgabeblack@google.com}
4713458Sgabeblack@google.com
4812866Sgabeblack@google.comvoid
4912866Sgabeblack@google.comGarnetIntLink::init()
5012866Sgabeblack@google.com{
5112866Sgabeblack@google.com}
5212866Sgabeblack@google.com
5312866Sgabeblack@google.comvoid
5412866Sgabeblack@google.comGarnetIntLink::print(std::ostream& out) const
5512866Sgabeblack@google.com{
5612866Sgabeblack@google.com    out << name();
5712866Sgabeblack@google.com}
5812866Sgabeblack@google.com
5912866Sgabeblack@google.comGarnetIntLink *
6012866Sgabeblack@google.comGarnetIntLinkParams::create()
6112866Sgabeblack@google.com{
6213458Sgabeblack@google.com    return new GarnetIntLink(this);
6313458Sgabeblack@google.com}
6412866Sgabeblack@google.com
6512866Sgabeblack@google.comGarnetExtLink::GarnetExtLink(const Params *p)
6612922Sgabeblack@google.com    : BasicExtLink(p)
6712869Sgabeblack@google.com{
6812866Sgabeblack@google.com    // Bi-directional
6912869Sgabeblack@google.com
7013458Sgabeblack@google.com    // In
7113458Sgabeblack@google.com    m_network_links[0] = p->network_links[0];
7212866Sgabeblack@google.com    m_credit_links[0] = p->credit_links[0];
7312866Sgabeblack@google.com
7412866Sgabeblack@google.com    // Out
7512866Sgabeblack@google.com    m_network_links[1] = p->network_links[1];
7612866Sgabeblack@google.com    m_credit_links[1] = p->credit_links[1];
7712866Sgabeblack@google.com}
7812866Sgabeblack@google.com
7912866Sgabeblack@google.comvoid
8012866Sgabeblack@google.comGarnetExtLink::init()
8112866Sgabeblack@google.com{
8212922Sgabeblack@google.com}
8312866Sgabeblack@google.com
8413098Sgabeblack@google.comvoid
8513098Sgabeblack@google.comGarnetExtLink::print(std::ostream& out) const
8613098Sgabeblack@google.com{
8713098Sgabeblack@google.com    out << name();
8812866Sgabeblack@google.com}
8912866Sgabeblack@google.com
9012869Sgabeblack@google.comGarnetExtLink *
9113098Sgabeblack@google.comGarnetExtLinkParams::create()
9212869Sgabeblack@google.com{
9312869Sgabeblack@google.com    return new GarnetExtLink(this);
9413656Sgabeblack@google.com}
9512869Sgabeblack@google.com