port.hh (2642:c162e0359b49) port.hh (2657:b119b774656b)
1/*
2 * Copyright (c) 2002-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

87 { }
88
89 /** Return port name (for DPRINTF). */
90 const std::string &name() const { return portName; }
91
92 virtual ~Port() {};
93
94 // mey be better to use subclasses & RTTI?
1/*
2 * Copyright (c) 2002-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

87 { }
88
89 /** Return port name (for DPRINTF). */
90 const std::string &name() const { return portName; }
91
92 virtual ~Port() {};
93
94 // mey be better to use subclasses & RTTI?
95 /** Holds the ports status. Keeps track if it is blocked, or has
96 calculated a range change. */
95 /** Holds the ports status. Currently just that a range recomputation needs
96 * to be done. */
97 enum Status {
97 enum Status {
98 Blocked,
99 Unblocked,
100 RangeChange
101 };
102
103 private:
104
105 /** A pointer to the peer port. Ports always come in pairs, that way they
106 can use a standardized interface to communicate between different
107 memory objects. */

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

135
136 /** Called to recieve a status change from the peer port. */
137 virtual void recvStatusChange(Status status) = 0;
138
139 /** Called by a peer port if the send was unsuccesful, and had to
140 wait. This shouldn't be valid for response paths (IO Devices).
141 so it is set to panic if it isn't already defined.
142 */
98 RangeChange
99 };
100
101 private:
102
103 /** A pointer to the peer port. Ports always come in pairs, that way they
104 can use a standardized interface to communicate between different
105 memory objects. */

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

133
134 /** Called to recieve a status change from the peer port. */
135 virtual void recvStatusChange(Status status) = 0;
136
137 /** Called by a peer port if the send was unsuccesful, and had to
138 wait. This shouldn't be valid for response paths (IO Devices).
139 so it is set to panic if it isn't already defined.
140 */
143 virtual Packet *recvRetry() { panic("??"); }
141 virtual void recvRetry() { panic("??"); }
144
145 /** Called by a peer port in order to determine the block size of the
146 device connected to this port. It sometimes doesn't make sense for
147 this function to be called, a DMA interface doesn't really have a
148 block size, so it is defaulted to a panic.
149 */
150 virtual int deviceBlockSize() { panic("??"); }
151

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

160
161 public:
162
163 /** Function called by associated memory device (cache, memory, iodevice)
164 in order to send a timing request to the port. Simply calls the peer
165 port receive function.
166 @return This function returns if the send was succesful in it's
167 recieve. If it was a failure, then the port will wait for a recvRetry
142
143 /** Called by a peer port in order to determine the block size of the
144 device connected to this port. It sometimes doesn't make sense for
145 this function to be called, a DMA interface doesn't really have a
146 block size, so it is defaulted to a panic.
147 */
148 virtual int deviceBlockSize() { panic("??"); }
149

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

158
159 public:
160
161 /** Function called by associated memory device (cache, memory, iodevice)
162 in order to send a timing request to the port. Simply calls the peer
163 port receive function.
164 @return This function returns if the send was succesful in it's
165 recieve. If it was a failure, then the port will wait for a recvRetry
168 at which point it can issue a successful sendTiming. This is used in
166 at which point it can possibly issue a successful sendTiming. This is used in
169 case a cache has a higher priority request come in while waiting for
170 the bus to arbitrate.
171 */
172 bool sendTiming(Packet *pkt) { return peer->recvTiming(pkt); }
173
174 /** Function called by the associated device to send an atomic access,
175 an access in which the data is moved and the state is updated in one
176 cycle, without interleaving with other memory accesses.

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

189 /** Called by the associated device to send a status change to the device
190 connected to the peer interface.
191 */
192 void sendStatusChange(Status status) {peer->recvStatusChange(status); }
193
194 /** When a timing access doesn't return a success, some time later the
195 Retry will be sent.
196 */
167 case a cache has a higher priority request come in while waiting for
168 the bus to arbitrate.
169 */
170 bool sendTiming(Packet *pkt) { return peer->recvTiming(pkt); }
171
172 /** Function called by the associated device to send an atomic access,
173 an access in which the data is moved and the state is updated in one
174 cycle, without interleaving with other memory accesses.

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

187 /** Called by the associated device to send a status change to the device
188 connected to the peer interface.
189 */
190 void sendStatusChange(Status status) {peer->recvStatusChange(status); }
191
192 /** When a timing access doesn't return a success, some time later the
193 Retry will be sent.
194 */
197 Packet *sendRetry() { return peer->recvRetry(); }
195 void sendRetry() { return peer->recvRetry(); }
198
199 /** Called by the associated device if it wishes to find out the blocksize
200 of the device on attached to the peer port.
201 */
202 int peerBlockSize() { return peer->deviceBlockSize(); }
203
204 /** Called by the associated device if it wishes to find out the address
205 ranges connected to the peer ports devices.

--- 65 unchanged lines hidden ---
196
197 /** Called by the associated device if it wishes to find out the blocksize
198 of the device on attached to the peer port.
199 */
200 int peerBlockSize() { return peer->deviceBlockSize(); }
201
202 /** Called by the associated device if it wishes to find out the address
203 ranges connected to the peer ports devices.

--- 65 unchanged lines hidden ---