diff options
author | Giacomo Gabrielli <giacomo.gabrielli@arm.com> | 2017-07-07 14:13:11 +0100 |
---|---|---|
committer | Giacomo Gabrielli <giacomo.gabrielli@arm.com> | 2019-05-11 12:48:58 +0000 |
commit | c58cb8c9dbeef377da180f1fdaaa1c0eadf85550 (patch) | |
tree | 7591abeb888d8c8e645332749bcaea627628f9bf /src/mem/request.hh | |
parent | d0e4cdc9c36466a3dbef8c9f9f509cce8f1a6c34 (diff) | |
download | gem5-c58cb8c9dbeef377da180f1fdaaa1c0eadf85550.tar.xz |
cpu,mem: Add support for partial loads/stores and wide mem. accesses
This changeset adds support for partial (or masked) loads/stores, i.e.
loads/stores that can disable accesses to individual bytes within the
target address range. In addition, this changeset extends the code to
crack memory accesses across most CPU models (TimingSimpleCPU still
TBD), so that arbitrarily wide memory accesses are supported. These
changes are required for supporting ISAs with wide vectors.
Additional authors:
- Gabor Dozsa <gabor.dozsa@arm.com>
- Tiago Muck <tiago.muck@arm.com>
Change-Id: Ibad33541c258ad72925c0b1d5abc3e5e8bf92d92
Signed-off-by: Giacomo Gabrielli <giacomo.gabrielli@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/13518
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Diffstat (limited to 'src/mem/request.hh')
-rw-r--r-- | src/mem/request.hh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/mem/request.hh b/src/mem/request.hh index 2a53c21a4..324ae382e 100644 --- a/src/mem/request.hh +++ b/src/mem/request.hh @@ -320,6 +320,9 @@ class Request */ unsigned _size; + /** Byte-enable mask for writes. */ + std::vector<bool> _byteEnable; + /** The requestor ID which is unique in the system for all ports * that are capable of issuing a transaction */ @@ -567,6 +570,9 @@ class Request * Generate two requests as if this request had been split into two * pieces. The original request can't have been translated already. */ + // TODO: this function is still required by TimingSimpleCPU - should be + // removed once TimingSimpleCPU will support arbitrarily long multi-line + // mem. accesses void splitOnVaddr(Addr split_addr, RequestPtr &req1, RequestPtr &req2) { assert(privateFlags.isSet(VALID_VADDR)); @@ -577,6 +583,14 @@ class Request req1->_size = split_addr - _vaddr; req2->_vaddr = split_addr; req2->_size = _size - req1->_size; + if (!_byteEnable.empty()) { + req1->_byteEnable = std::vector<bool>( + _byteEnable.begin(), + _byteEnable.begin() + req1->_size); + req2->_byteEnable = std::vector<bool>( + _byteEnable.begin() + req1->_size, + _byteEnable.end()); + } } /** @@ -628,6 +642,19 @@ class Request return _size; } + const std::vector<bool>& + getByteEnable() const + { + return _byteEnable; + } + + void + setByteEnable(const std::vector<bool>& be) + { + assert(be.empty() || be.size() == _size); + _byteEnable = be; + } + /** Accessor for time. */ Tick time() const |