port.hh (9235:5aa4896ed55a) port.hh (9294:8fb03b13de02)
1/*
2 * Copyright (c) 2011-2012 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 103 unchanged lines hidden (view full) ---

112 const std::string name() const { return portName; }
113
114 /** Get the port id. */
115 PortID getId() const { return id; }
116
117};
118
119/** Forward declaration */
1/*
2 * Copyright (c) 2011-2012 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 103 unchanged lines hidden (view full) ---

112 const std::string name() const { return portName; }
113
114 /** Get the port id. */
115 PortID getId() const { return id; }
116
117};
118
119/** Forward declaration */
120class BaseSlavePort;
121
122/**
123 * A BaseMasterPort is a protocol-agnostic master port, responsible
124 * only for the structural connection to a slave port. The final
125 * master port that inherits from the base class must override the
126 * bind member function for the specific slave port class.
127 */
128class BaseMasterPort : public Port
129{
130
131 protected:
132
133 BaseSlavePort* _baseSlavePort;
134
135 BaseMasterPort(const std::string& name, MemObject* owner,
136 PortID id = InvalidPortID);
137 virtual ~BaseMasterPort();
138
139 public:
140
141 virtual void bind(BaseSlavePort& slave_port) = 0;
142 virtual void unbind() = 0;
143 BaseSlavePort& getSlavePort() const;
144 bool isConnected() const;
145
146};
147
148/**
149 * A BaseSlavePort is a protocol-agnostic slave port, responsible
150 * only for the structural connection to a master port.
151 */
152class BaseSlavePort : public Port
153{
154
155 protected:
156
157 BaseMasterPort* _baseMasterPort;
158
159 BaseSlavePort(const std::string& name, MemObject* owner,
160 PortID id = InvalidPortID);
161 virtual ~BaseSlavePort();
162
163 public:
164
165 BaseMasterPort& getMasterPort() const;
166 bool isConnected() const;
167
168};
169
170/** Forward declaration */
120class SlavePort;
121
122/**
171class SlavePort;
172
173/**
123 * A MasterPort is a specialisation of a port. In addition to the
124 * basic functionality of sending packets to its slave peer, it also
125 * has functions specific to a master, e.g. to receive range changes
126 * or determine if the port is snooping or not.
174 * A MasterPort is a specialisation of a BaseMasterPort, which
175 * implements the default protocol for the three different level of
176 * transport functions. In addition to the basic functionality of
177 * sending packets, it also has functions to receive range changes or
178 * determine if the port is snooping or not.
127 */
179 */
128class MasterPort : public Port
180class MasterPort : public BaseMasterPort
129{
130
131 friend class SlavePort;
132
133 private:
134
135 SlavePort* _slavePort;
136
137 public:
138
139 MasterPort(const std::string& name, MemObject* owner,
140 PortID id = InvalidPortID);
141 virtual ~MasterPort();
142
143 /**
144 * Bind this master port to a slave port. This also does the
145 * mirror action and binds the slave port to the master port.
146 */
181{
182
183 friend class SlavePort;
184
185 private:
186
187 SlavePort* _slavePort;
188
189 public:
190
191 MasterPort(const std::string& name, MemObject* owner,
192 PortID id = InvalidPortID);
193 virtual ~MasterPort();
194
195 /**
196 * Bind this master port to a slave port. This also does the
197 * mirror action and binds the slave port to the master port.
198 */
147 void bind(SlavePort& slave_port);
199 void bind(BaseSlavePort& slave_port);
148
149 /**
150 * Unbind this master port and the associated slave port.
151 */
152 void unbind();
153
200
201 /**
202 * Unbind this master port and the associated slave port.
203 */
204 void unbind();
205
154 SlavePort& getSlavePort() const;
155 bool isConnected() const;
156
157 /**
158 * Send an atomic request packet, where the data is moved and the
159 * state is updated in zero time, without interleaving with other
160 * memory accesses.
161 *
162 * @param pkt Packet to send.
163 *
164 * @return Estimated latency of access.

--- 122 unchanged lines hidden (view full) ---

287};
288
289/**
290 * A SlavePort is a specialisation of a port. In addition to the
291 * basic functionality of sending packets to its master peer, it also
292 * has functions specific to a slave, e.g. to send range changes
293 * and get the address ranges that the port responds to.
294 */
206 /**
207 * Send an atomic request packet, where the data is moved and the
208 * state is updated in zero time, without interleaving with other
209 * memory accesses.
210 *
211 * @param pkt Packet to send.
212 *
213 * @return Estimated latency of access.

--- 122 unchanged lines hidden (view full) ---

336};
337
338/**
339 * A SlavePort is a specialisation of a port. In addition to the
340 * basic functionality of sending packets to its master peer, it also
341 * has functions specific to a slave, e.g. to send range changes
342 * and get the address ranges that the port responds to.
343 */
295class SlavePort : public Port
344class SlavePort : public BaseSlavePort
296{
297
298 friend class MasterPort;
299
300 private:
301
302 MasterPort* _masterPort;
303
304 public:
305
306 SlavePort(const std::string& name, MemObject* owner,
307 PortID id = InvalidPortID);
308 virtual ~SlavePort();
309
345{
346
347 friend class MasterPort;
348
349 private:
350
351 MasterPort* _masterPort;
352
353 public:
354
355 SlavePort(const std::string& name, MemObject* owner,
356 PortID id = InvalidPortID);
357 virtual ~SlavePort();
358
310 MasterPort& getMasterPort() const;
311 bool isConnected() const;
312
313 /**
314 * Send an atomic snoop request packet, where the data is moved
315 * and the state is updated in zero time, without interleaving
316 * with other memory accesses.
317 *
318 * @param pkt Snoop packet to send.
319 *
320 * @return Estimated latency of access.

--- 120 unchanged lines hidden ---
359 /**
360 * Send an atomic snoop request packet, where the data is moved
361 * and the state is updated in zero time, without interleaving
362 * with other memory accesses.
363 *
364 * @param pkt Snoop packet to send.
365 *
366 * @return Estimated latency of access.

--- 120 unchanged lines hidden ---