gem5  v21.0.1.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
GarnetLink.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008 Princeton University
3  * Copyright (c) 2016 Georgia Institute of Technology
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are
8  * met: redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer;
10  * redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution;
13  * neither the name of the copyright holders nor the names of its
14  * contributors may be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28  */
29 
30 
32 
33 #include "debug/RubyNetwork.hh"
37 
39  : BasicIntLink(p)
40 {
41  // Uni-directional
42 
43  m_network_link = p.network_link;
44  m_credit_link = p.credit_link;
45 
46  srcCdcEn = p.src_cdc;
47  dstCdcEn = p.dst_cdc;
48 
49  srcSerdesEn = p.src_serdes;
50  dstSerdesEn = p.dst_serdes;
51 
52  srcBridgeEn = false;
53  dstBridgeEn = false;
54 
55  if (srcCdcEn || srcSerdesEn) {
56  srcBridgeEn = true;
57  srcNetBridge = p.src_net_bridge;
58  srcCredBridge = p.src_cred_bridge;
59  }
60  if (dstCdcEn || dstSerdesEn) {
61  dstBridgeEn = true;
62  dstNetBridge = p.dst_net_bridge;
63  dstCredBridge = p.dst_cred_bridge;
64  }
65 }
66 
67 void
69 {
70  if (srcBridgeEn) {
71  assert(srcNetBridge && srcCredBridge);
74  }
75 
76  if (dstBridgeEn) {
77  assert(dstNetBridge && dstCredBridge);
80  }
81 }
82 
83 void
84 GarnetIntLink::print(std::ostream& out) const
85 {
86  out << name();
87 }
88 
90  : BasicExtLink(p)
91 {
92  // Bi-directional
93 
94  // In
95  m_network_links[0] = p.network_links[0];
96  m_credit_links[0] = p.credit_links[0];
97 
98  // Out
99  m_network_links[1] = p.network_links[1];
100  m_credit_links[1] = p.credit_links[1];
101 
102 
103  extCdcEn = p.ext_cdc;
104  intCdcEn = p.int_cdc;
105 
106  extSerdesEn = p.ext_serdes;
107  intSerdesEn = p.int_serdes;
108 
109  extBridgeEn = false;
110  intBridgeEn = false;
111 
112  if (extCdcEn || extSerdesEn) {
113  extBridgeEn = true;
114  extNetBridge[0] = p.ext_net_bridge[0];
115  extCredBridge[0] = p.ext_cred_bridge[0];
116  extNetBridge[1] = p.ext_net_bridge[1];
117  extCredBridge[1] = p.ext_cred_bridge[1];
118  }
119 
120  if (intCdcEn || intSerdesEn) {
121  intBridgeEn = true;
122  intNetBridge[0] = p.int_net_bridge[0];
123  intNetBridge[1] = p.int_net_bridge[1];
124  intCredBridge[0] = p.int_cred_bridge[0];
125  intCredBridge[1] = p.int_cred_bridge[1];
126  }
127 }
128 
129 void
131 {
132  if (extBridgeEn) {
133  assert(extNetBridge[0] && extCredBridge[0] &&
134  extNetBridge[1] && extCredBridge[1]);
139  }
140 
141  if (intBridgeEn) {
142  assert(intNetBridge[0] && intCredBridge[0] &&
143  intNetBridge[1] && intCredBridge[1]);
148  }
149 }
150 
151 void
152 GarnetExtLink::print(std::ostream& out) const
153 {
154  out << name();
155 }
NetworkBridge.hh
NetworkBridge::initBridge
void initBridge(NetworkBridge *coBrid, bool cdc_en, bool serdes_en)
Definition: NetworkBridge.cc:80
SimObject::name
virtual const std::string name() const
Definition: sim_object.hh:182
MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323

Generated on Tue Jun 22 2021 15:28:29 for gem5 by doxygen 1.8.17