cpu: Switch away from some fringe Request constructors.

These are only used in these two files, one each, and pass one dummy
argument with a default value and one extra argument with an actual
value compared to the more common constructors.

Instead, switch to constructors without those two arguments and set the
one extra value explicitly after construction.

The constructor will likely be inlined, and merged with this additional
assignment.

Change-Id: I75ca539d5ca95b57b4f4322ffa050af2031544dd
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26229
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
This commit is contained in:
Gabe Black
2020-03-04 01:42:23 -08:00
parent 7b48b38a92
commit cd59a9afeb
2 changed files with 13 additions and 10 deletions

View File

@@ -107,8 +107,9 @@ Check::initiatePrefetch()
}
// Prefetches are assumed to be 0 sized
RequestPtr req = std::make_shared<Request>(m_address, 0, flags,
m_tester_ptr->masterId(), curTick(), m_pc);
RequestPtr req = std::make_shared<Request>(
m_address, 0, flags, m_tester_ptr->masterId());
req->setPC(m_pc);
req->setContext(index);
PacketPtr pkt = new Packet(req, cmd);
@@ -145,8 +146,9 @@ Check::initiateFlush()
Request::Flags flags;
RequestPtr req = std::make_shared<Request>(m_address, CHECK_SIZE, flags,
m_tester_ptr->masterId(), curTick(), m_pc);
RequestPtr req = std::make_shared<Request>(
m_address, CHECK_SIZE, flags, m_tester_ptr->masterId());
req->setPC(m_pc);
Packet::Command cmd;
@@ -179,7 +181,8 @@ Check::initiateAction()
// Stores are assumed to be 1 byte-sized
RequestPtr req = std::make_shared<Request>(
writeAddr, 1, flags, m_tester_ptr->masterId(), curTick(), m_pc);
writeAddr, 1, flags, m_tester_ptr->masterId());
req->setPC(m_pc);
req->setContext(index);
Packet::Command cmd;
@@ -242,8 +245,9 @@ Check::initiateCheck()
}
// Checks are sized depending on the number of bytes written
RequestPtr req = std::make_shared<Request>(m_address, CHECK_SIZE, flags,
m_tester_ptr->masterId(), curTick(), m_pc);
RequestPtr req = std::make_shared<Request>(
m_address, CHECK_SIZE, flags, m_tester_ptr->masterId());
req->setPC(m_pc);
req->setContext(index);
PacketPtr pkt = new Packet(req, MemCmd::ReadReq);

View File

@@ -650,9 +650,8 @@ TraceCPU::ElasticDataGen::executeMemReq(GraphNode* node_ptr)
// Create a request and the packet containing request
auto req = std::make_shared<Request>(
node_ptr->physAddr, node_ptr->size,
node_ptr->flags, masterID, node_ptr->seqNum,
ContextID(0));
node_ptr->physAddr, node_ptr->size, node_ptr->flags, masterID);
req->setReqInstSeqNum(node_ptr->seqNum);
req->setPC(node_ptr->pc);
// If virtual address is valid, set the asid and virtual address fields