summaryrefslogtreecommitdiff
path: root/src/mem/ruby/system/CacheRecorder.cc
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2015-01-22 05:00:53 -0500
committerAndreas Hansson <andreas.hansson@arm.com>2015-01-22 05:00:53 -0500
commitf49830ce0ba79c54c65c9c4b25bc3c6184aaf2a9 (patch)
tree00b2f9f0131ef65a411c9fd81339caecfc946b47 /src/mem/ruby/system/CacheRecorder.cc
parentbe3a952394e1f337d1c372448ee099203336181a (diff)
downloadgem5-f49830ce0ba79c54c65c9c4b25bc3c6184aaf2a9.tar.xz
mem: Clean up Request initialisation
This patch tidies up how we create and set the fields of a Request. In essence it tries to use the constructor where possible (as opposed to setPhys and setVirt), thus avoiding spreading the information across a number of locations. In fact, setPhys is made private as part of this patch, and a number of places where we callede setVirt instead uses the appropriate constructor.
Diffstat (limited to 'src/mem/ruby/system/CacheRecorder.cc')
-rw-r--r--src/mem/ruby/system/CacheRecorder.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mem/ruby/system/CacheRecorder.cc b/src/mem/ruby/system/CacheRecorder.cc
index 542d91aef..ab7d1cc91 100644
--- a/src/mem/ruby/system/CacheRecorder.cc
+++ b/src/mem/ruby/system/CacheRecorder.cc
@@ -109,21 +109,21 @@ CacheRecorder::enqueueNextFetchRequest()
for (int rec_bytes_read = 0; rec_bytes_read < m_block_size_bytes;
rec_bytes_read += RubySystem::getBlockSizeBytes()) {
- Request* req = new Request();
+ Request* req = nullptr;
MemCmd::Command requestType;
if (traceRecord->m_type == RubyRequestType_LD) {
requestType = MemCmd::ReadReq;
- req->setPhys(traceRecord->m_data_address + rec_bytes_read,
+ req = new Request(traceRecord->m_data_address + rec_bytes_read,
RubySystem::getBlockSizeBytes(), 0, Request::funcMasterId);
} else if (traceRecord->m_type == RubyRequestType_IFETCH) {
requestType = MemCmd::ReadReq;
- req->setPhys(traceRecord->m_data_address + rec_bytes_read,
+ req = new Request(traceRecord->m_data_address + rec_bytes_read,
RubySystem::getBlockSizeBytes(),
Request::INST_FETCH, Request::funcMasterId);
} else {
requestType = MemCmd::WriteReq;
- req->setPhys(traceRecord->m_data_address + rec_bytes_read,
+ req = new Request(traceRecord->m_data_address + rec_bytes_read,
RubySystem::getBlockSizeBytes(), 0, Request::funcMasterId);
}