diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2008-11-13 23:30:37 -0800 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2008-11-13 23:30:37 -0800 |
commit | 7a4d75bae31cfe2064fe0718c7f982f769659b3c (patch) | |
tree | 4a03f89edbee4f8d79983f4fe4541edebedfbbe9 /src/mem | |
parent | bcfd284d24e1321de863b7578e7ba567a69ba44f (diff) | |
download | gem5-7a4d75bae31cfe2064fe0718c7f982f769659b3c.tar.xz |
CPU: Refactor read/write in the simple timing CPU.
Diffstat (limited to 'src/mem')
-rw-r--r-- | src/mem/request.hh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/mem/request.hh b/src/mem/request.hh index c3a523d9b..007c33acf 100644 --- a/src/mem/request.hh +++ b/src/mem/request.hh @@ -43,6 +43,7 @@ #include "base/fast_alloc.hh" #include "base/flags.hh" +#include "base/misc.hh" #include "sim/host.hh" #include "sim/core.hh" @@ -233,6 +234,24 @@ class Request : public FastAlloc } /** + * Generate two requests as if this request had been split into two + * pieces. The original request can't have been translated already. + */ + void splitOnVaddr(Addr split_addr, RequestPtr &req1, RequestPtr &req2) + { + assert(flags.any(VALID_VADDR)); + assert(flags.none(VALID_PADDR)); + assert(split_addr > vaddr && split_addr < vaddr + size); + req1 = new Request; + *req1 = *this; + req2 = new Request; + *req2 = *this; + req1->size = split_addr - vaddr; + req2->vaddr = split_addr; + req2->size = size - req1->size; + } + + /** * Accessor for paddr. */ Addr |