From cd59a9afeb4fd0499285edd2cd83e414ad8b9935 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Wed, 4 Mar 2020 01:42:23 -0800 Subject: [PATCH] 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 Reviewed-by: Nikos Nikoleris Maintainer: Gabe Black --- src/cpu/testers/rubytest/Check.cc | 18 +++++++++++------- src/cpu/trace/trace_cpu.cc | 5 ++--- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/cpu/testers/rubytest/Check.cc b/src/cpu/testers/rubytest/Check.cc index 49332ab01..90e7b877e 100644 --- a/src/cpu/testers/rubytest/Check.cc +++ b/src/cpu/testers/rubytest/Check.cc @@ -107,8 +107,9 @@ Check::initiatePrefetch() } // Prefetches are assumed to be 0 sized - RequestPtr req = std::make_shared(m_address, 0, flags, - m_tester_ptr->masterId(), curTick(), m_pc); + RequestPtr req = std::make_shared( + 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(m_address, CHECK_SIZE, flags, - m_tester_ptr->masterId(), curTick(), m_pc); + RequestPtr req = std::make_shared( + 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( - 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(m_address, CHECK_SIZE, flags, - m_tester_ptr->masterId(), curTick(), m_pc); + RequestPtr req = std::make_shared( + m_address, CHECK_SIZE, flags, m_tester_ptr->masterId()); + req->setPC(m_pc); req->setContext(index); PacketPtr pkt = new Packet(req, MemCmd::ReadReq); diff --git a/src/cpu/trace/trace_cpu.cc b/src/cpu/trace/trace_cpu.cc index 729699001..a3d97707c 100644 --- a/src/cpu/trace/trace_cpu.cc +++ b/src/cpu/trace/trace_cpu.cc @@ -650,9 +650,8 @@ TraceCPU::ElasticDataGen::executeMemReq(GraphNode* node_ptr) // Create a request and the packet containing request auto req = std::make_shared( - 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 -- 2.30.2