diff options
author | Andreas Hansson <andreas.hansson@arm.com> | 2012-02-24 11:46:39 -0500 |
---|---|---|
committer | Andreas Hansson <andreas.hansson@arm.com> | 2012-02-24 11:46:39 -0500 |
commit | 485d103255c0f64ebf697650c899fe7a80db1d6d (patch) | |
tree | 3826b9e0a3d340a4318bb4900ded5742734824aa /src/mem/port.hh | |
parent | 9e3c8de30bafe33f35e4b9e82fb49418941f8cb7 (diff) | |
download | gem5-485d103255c0f64ebf697650c899fe7a80db1d6d.tar.xz |
MEM: Move all read/write blob functions from Port to PortProxy
This patch moves the readBlob/writeBlob/memsetBlob from the Port class
to the PortProxy class, thus making a clear separation of the basic
port functionality (recv/send functional/atomic/timing), and the
higher-level functional accessors available on the port proxies.
There are only a few places in the code base where the blob functions
were used on ports, and they are all for peeking into the memory
system without making a normal memory access (in the memtest, and the
malta and tsunami pchip). The memtest also exemplifies how easy it is
to create a non-translating proxy if desired. The malta and tsunami
pchip used a slave port to perform a functional read, and this is now
changed to rely on the physProxy of the system (to which they already
have a pointer).
Diffstat (limited to 'src/mem/port.hh')
-rw-r--r-- | src/mem/port.hh | 33 |
1 files changed, 2 insertions, 31 deletions
diff --git a/src/mem/port.hh b/src/mem/port.hh index 98b3ad5f1..fef0c839d 100644 --- a/src/mem/port.hh +++ b/src/mem/port.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 ARM Limited + * Copyright (c) 2011-2012 ARM Limited * All rights reserved * * The license below extends only to copyright in the software and shall @@ -38,6 +38,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Authors: Ron Dreslinski + * Andreas Hansson */ /** @@ -54,11 +55,8 @@ #include <list> -#include "base/misc.hh" #include "base/range.hh" -#include "base/types.hh" #include "mem/packet.hh" -#include "mem/request.hh" /** This typedef is used to clean up getAddrRanges(). It's declared * outside the Port object since it's also used by some mem objects. @@ -227,37 +225,10 @@ class Port */ unsigned peerBlockSize() const { return peer->deviceBlockSize(); } - /** This function is a wrapper around sendFunctional() - that breaks a larger, arbitrarily aligned access into - appropriate chunks. The default implementation can use - getBlockSize() to determine the block size and go from there. - */ - virtual void readBlob(Addr addr, uint8_t *p, int size); - - /** This function is a wrapper around sendFunctional() - that breaks a larger, arbitrarily aligned access into - appropriate chunks. The default implementation can use - getBlockSize() to determine the block size and go from there. - */ - virtual void writeBlob(Addr addr, uint8_t *p, int size); - - /** Fill size bytes starting at addr with byte value val. This - should not need to be virtual, since it can be implemented in - terms of writeBlob(). However, it shouldn't be - performance-critical either, so it could be if we wanted to. - */ - virtual void memsetBlob(Addr addr, uint8_t val, int size); - /** Inject a PrintReq for the given address to print the state of * that address throughout the memory system. For debugging. */ void printAddr(Addr a); - - private: - - /** Internal helper function for read/writeBlob(). - */ - void blobHelper(Addr addr, uint8_t *p, int size, MemCmd cmd); }; #endif //__MEM_PORT_HH__ |