summaryrefslogtreecommitdiff
path: root/src/cpu/testers/rubytest/Check.cc
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2015-08-14 12:04:51 -0500
committerNilay Vaish <nilay@cs.wisc.edu>2015-08-14 12:04:51 -0500
commit91a84c5b3cfb888794ac0245c066a4724b9a0871 (patch)
tree79a8b41aff56655dbd187934d2709fdd7488c6ed /src/cpu/testers/rubytest/Check.cc
parent9ea5d9cad9381e05004de28ef25309ebe94c3a79 (diff)
downloadgem5-91a84c5b3cfb888794ac0245c066a4724b9a0871.tar.xz
ruby: replace Address by Addr
This patch eliminates the type Address defined by the ruby memory system. This memory system would now use the type Addr that is in use by the rest of the system.
Diffstat (limited to 'src/cpu/testers/rubytest/Check.cc')
-rw-r--r--src/cpu/testers/rubytest/Check.cc34
1 files changed, 16 insertions, 18 deletions
diff --git a/src/cpu/testers/rubytest/Check.cc b/src/cpu/testers/rubytest/Check.cc
index 5f9aa497b..4cdaf9b2f 100644
--- a/src/cpu/testers/rubytest/Check.cc
+++ b/src/cpu/testers/rubytest/Check.cc
@@ -34,8 +34,8 @@
typedef RubyTester::SenderState SenderState;
-Check::Check(const Address& address, const Address& pc,
- int _num_writers, int _num_readers, RubyTester* _tester)
+Check::Check(Addr address, Addr pc, int _num_writers, int _num_readers,
+ RubyTester* _tester)
: m_num_writers(_num_writers), m_num_readers(_num_readers),
m_tester_ptr(_tester)
{
@@ -103,8 +103,8 @@ Check::initiatePrefetch()
}
// Prefetches are assumed to be 0 sized
- Request *req = new Request(m_address.getAddress(), 0, flags,
- m_tester_ptr->masterId(), curTick(), m_pc.getAddress());
+ Request *req = new Request(m_address, 0, flags,
+ m_tester_ptr->masterId(), curTick(), m_pc);
req->setThreadContext(index, 0);
PacketPtr pkt = new Packet(req, cmd);
@@ -142,8 +142,8 @@ Check::initiateFlush()
Request::Flags flags;
- Request *req = new Request(m_address.getAddress(), CHECK_SIZE, flags,
- m_tester_ptr->masterId(), curTick(), m_pc.getAddress());
+ Request *req = new Request(m_address, CHECK_SIZE, flags,
+ m_tester_ptr->masterId(), curTick(), m_pc);
Packet::Command cmd;
@@ -172,12 +172,11 @@ Check::initiateAction()
Request::Flags flags;
// Create the particular address for the next byte to be written
- Address writeAddr(m_address.getAddress() + m_store_count);
+ Addr writeAddr(m_address + m_store_count);
// Stores are assumed to be 1 byte-sized
- Request *req = new Request(writeAddr.getAddress(), 1, flags,
- m_tester_ptr->masterId(), curTick(),
- m_pc.getAddress());
+ Request *req = new Request(writeAddr, 1, flags, m_tester_ptr->masterId(),
+ curTick(), m_pc);
req->setThreadContext(index, 0);
Packet::Command cmd;
@@ -238,8 +237,8 @@ Check::initiateCheck()
}
// Checks are sized depending on the number of bytes written
- Request *req = new Request(m_address.getAddress(), CHECK_SIZE, flags,
- m_tester_ptr->masterId(), curTick(), m_pc.getAddress());
+ Request *req = new Request(m_address, CHECK_SIZE, flags,
+ m_tester_ptr->masterId(), curTick(), m_pc);
req->setThreadContext(index, 0);
PacketPtr pkt = new Packet(req, MemCmd::ReadReq);
@@ -273,12 +272,12 @@ Check::initiateCheck()
void
Check::performCallback(NodeID proc, SubBlock* data, Cycles curTime)
{
- Address address = data->getAddress();
+ Addr address = data->getAddress();
// This isn't exactly right since we now have multi-byte checks
// assert(getAddress() == address);
- assert(getAddress().getLineAddress() == address.getLineAddress());
+ assert(makeLineAddress(m_address) == makeLineAddress(address));
assert(data != NULL);
DPRINTF(RubyTest, "RubyTester Callback\n");
@@ -325,13 +324,13 @@ Check::performCallback(NodeID proc, SubBlock* data, Cycles curTime)
}
DPRINTF(RubyTest, "proc: %d, Address: 0x%x\n", proc,
- getAddress().getLineAddress());
+ makeLineAddress(m_address));
DPRINTF(RubyTest, "Callback done\n");
debugPrint();
}
void
-Check::changeAddress(const Address& address)
+Check::changeAddress(Addr address)
{
assert(m_status == TesterStatus_Idle || m_status == TesterStatus_Ready);
m_status = TesterStatus_Idle;
@@ -375,7 +374,6 @@ Check::debugPrint()
{
DPRINTF(RubyTest,
"[%#x, value: %d, status: %s, initiating node: %d, store_count: %d]\n",
- m_address.getAddress(), (int)m_value,
- TesterStatus_to_string(m_status).c_str(),
+ m_address, (int)m_value, TesterStatus_to_string(m_status).c_str(),
m_initiatingNode, m_store_count);
}