port.hh (8711:c7e14f52c682) port.hh (8853:0216ed80991b)
1/*
1/*
2 * Copyright (c) 2011 ARM Limited
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
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated

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

33 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 *
40 * Authors: Ron Dreslinski
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
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated

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

33 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 *
40 * Authors: Ron Dreslinski
41 * Andreas Hansson
41 */
42
43/**
44 * @file
45 * Port Object Declaration. Ports are used to interface memory objects to
46 * each other. They will always come in pairs, and we refer to the other
47 * port object as the peer. These are used to make the design more
48 * modular so that a specific interface between every type of objcet doesn't
49 * have to be created.
50 */
51
52#ifndef __MEM_PORT_HH__
53#define __MEM_PORT_HH__
54
55#include <list>
56
42 */
43
44/**
45 * @file
46 * Port Object Declaration. Ports are used to interface memory objects to
47 * each other. They will always come in pairs, and we refer to the other
48 * port object as the peer. These are used to make the design more
49 * modular so that a specific interface between every type of objcet doesn't
50 * have to be created.
51 */
52
53#ifndef __MEM_PORT_HH__
54#define __MEM_PORT_HH__
55
56#include <list>
57
57#include "base/misc.hh"
58#include "base/range.hh"
58#include "base/range.hh"
59#include "base/types.hh"
60#include "mem/packet.hh"
59#include "mem/packet.hh"
61#include "mem/request.hh"
62
63/** This typedef is used to clean up getAddrRanges(). It's declared
64 * outside the Port object since it's also used by some mem objects.
65 * Eventually we should move this typedef to wherever Addr is
66 * defined.
67 */
68
69typedef std::list<Range<Addr> > AddrRangeList;

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

222 */
223 void sendRetry() { return peer->recvRetry(); }
224
225 /** Called by the associated device if it wishes to find out the blocksize
226 of the device on attached to the peer port.
227 */
228 unsigned peerBlockSize() const { return peer->deviceBlockSize(); }
229
60
61/** This typedef is used to clean up getAddrRanges(). It's declared
62 * outside the Port object since it's also used by some mem objects.
63 * Eventually we should move this typedef to wherever Addr is
64 * defined.
65 */
66
67typedef std::list<Range<Addr> > AddrRangeList;

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

220 */
221 void sendRetry() { return peer->recvRetry(); }
222
223 /** Called by the associated device if it wishes to find out the blocksize
224 of the device on attached to the peer port.
225 */
226 unsigned peerBlockSize() const { return peer->deviceBlockSize(); }
227
230 /** This function is a wrapper around sendFunctional()
231 that breaks a larger, arbitrarily aligned access into
232 appropriate chunks. The default implementation can use
233 getBlockSize() to determine the block size and go from there.
234 */
235 virtual void readBlob(Addr addr, uint8_t *p, int size);
236
237 /** This function is a wrapper around sendFunctional()
238 that breaks a larger, arbitrarily aligned access into
239 appropriate chunks. The default implementation can use
240 getBlockSize() to determine the block size and go from there.
241 */
242 virtual void writeBlob(Addr addr, uint8_t *p, int size);
243
244 /** Fill size bytes starting at addr with byte value val. This
245 should not need to be virtual, since it can be implemented in
246 terms of writeBlob(). However, it shouldn't be
247 performance-critical either, so it could be if we wanted to.
248 */
249 virtual void memsetBlob(Addr addr, uint8_t val, int size);
250
251 /** Inject a PrintReq for the given address to print the state of
252 * that address throughout the memory system. For debugging.
253 */
254 void printAddr(Addr a);
228 /** Inject a PrintReq for the given address to print the state of
229 * that address throughout the memory system. For debugging.
230 */
231 void printAddr(Addr a);
255
256 private:
257
258 /** Internal helper function for read/writeBlob().
259 */
260 void blobHelper(Addr addr, uint8_t *p, int size, MemCmd cmd);
261};
262
263#endif //__MEM_PORT_HH__
232};
233
234#endif //__MEM_PORT_HH__