gem5  v20.1.0.0
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 
68 void
70 {
71  if (srcBridgeEn) {
72  assert(srcNetBridge && srcCredBridge);
75  }
76 
77  if (dstBridgeEn) {
78  assert(dstNetBridge && dstCredBridge);
81  }
82 }
83 
84 void
85 GarnetIntLink::print(std::ostream& out) const
86 {
87  out << name();
88 }
89 
91 GarnetIntLinkParams::create()
92 {
93  return new GarnetIntLink(this);
94 }
95 
97  : BasicExtLink(p)
98 {
99  // Bi-directional
100 
101  // In
102  m_network_links[0] = p->network_links[0];
103  m_credit_links[0] = p->credit_links[0];
104 
105  // Out
106  m_network_links[1] = p->network_links[1];
107  m_credit_links[1] = p->credit_links[1];
108 
109 
110  extCdcEn = p->ext_cdc;
111  intCdcEn = p->int_cdc;
112 
113  extSerdesEn = p->ext_serdes;
114  intSerdesEn = p->int_serdes;
115 
116  extBridgeEn = false;
117  intBridgeEn = false;
118 
119  if (extCdcEn || extSerdesEn) {
120  extBridgeEn = true;
121  extNetBridge[0] = p->ext_net_bridge[0];
122  extCredBridge[0] = p->ext_cred_bridge[0];
123  extNetBridge[1] = p->ext_net_bridge[1];
124  extCredBridge[1] = p->ext_cred_bridge[1];
125  }
126 
127  if (intCdcEn || intSerdesEn) {
128  intBridgeEn = true;
129  intNetBridge[0] = p->int_net_bridge[0];
130  intNetBridge[1] = p->int_net_bridge[1];
131  intCredBridge[0] = p->int_cred_bridge[0];
132  intCredBridge[1] = p->int_cred_bridge[1];
133  }
134 
135 }
136 
137 void
139 {
140  if (extBridgeEn) {
141  assert(extNetBridge[0] && extCredBridge[0] &&
142  extNetBridge[1] && extCredBridge[1]);
147  }
148 
149  if (intBridgeEn) {
150  assert(intNetBridge[0] && intCredBridge[0] &&
151  intNetBridge[1] && intCredBridge[1]);
156  }
157 }
158 
159 void
160 GarnetExtLink::print(std::ostream& out) const
161 {
162  out << name();
163 }
164 
166 GarnetExtLinkParams::create()
167 {
168  return new GarnetExtLink(this);
169 }
NetworkBridge.hh
NetworkBridge::initBridge
void initBridge(NetworkBridge *coBrid, bool cdc_en, bool serdes_en)
Definition: NetworkBridge.cc:82
SimObject::name
virtual const std::string name() const
Definition: sim_object.hh:133
MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323

Generated on Wed Sep 30 2020 14:02:13 for gem5 by doxygen 1.8.17