diff options
author | Nikos Nikoleris <nikos.nikoleris@arm.com> | 2016-08-15 12:00:35 +0100 |
---|---|---|
committer | Nikos Nikoleris <nikos.nikoleris@arm.com> | 2016-08-15 12:00:35 +0100 |
commit | 698767e5384a664b3bad52c9b40d62daf0eabbfc (patch) | |
tree | 2cb02cf387574c233367bfd6602b9ac271815384 /src/cpu | |
parent | 608a37c844829715c2a15ef079f7dd8db428779b (diff) | |
download | gem5-698767e5384a664b3bad52c9b40d62daf0eabbfc.tar.xz |
cpu, arch: fix the type used for the request flags
Change-Id: I183b9942929c873c3272ce6d1abd4ebc472c7132
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'src/cpu')
-rw-r--r-- | src/cpu/base_dyn_inst.hh | 14 | ||||
-rw-r--r-- | src/cpu/checker/cpu.cc | 5 | ||||
-rw-r--r-- | src/cpu/checker/cpu.hh | 7 | ||||
-rw-r--r-- | src/cpu/exec_context.hh | 7 | ||||
-rw-r--r-- | src/cpu/minor/exec_context.hh | 5 | ||||
-rw-r--r-- | src/cpu/minor/lsq.cc | 3 | ||||
-rw-r--r-- | src/cpu/minor/lsq.hh | 3 | ||||
-rw-r--r-- | src/cpu/simple/atomic.cc | 11 | ||||
-rw-r--r-- | src/cpu/simple/atomic.hh | 8 | ||||
-rw-r--r-- | src/cpu/simple/base.hh | 7 | ||||
-rw-r--r-- | src/cpu/simple/exec_context.hh | 7 | ||||
-rw-r--r-- | src/cpu/simple/timing.cc | 7 | ||||
-rw-r--r-- | src/cpu/simple/timing.hh | 7 |
13 files changed, 53 insertions, 38 deletions
diff --git a/src/cpu/base_dyn_inst.hh b/src/cpu/base_dyn_inst.hh index e846f6790..6d9a53253 100644 --- a/src/cpu/base_dyn_inst.hh +++ b/src/cpu/base_dyn_inst.hh @@ -65,6 +65,7 @@ #include "cpu/static_inst.hh" #include "cpu/translation.hh" #include "mem/packet.hh" +#include "mem/request.hh" #include "sim/byteswap.hh" #include "sim/system.hh" @@ -313,10 +314,10 @@ class BaseDynInst : public ExecContext, public RefCounted cpu->demapPage(vaddr, asn); } - Fault initiateMemRead(Addr addr, unsigned size, unsigned flags); + Fault initiateMemRead(Addr addr, unsigned size, Request::Flags flags); - Fault writeMem(uint8_t *data, unsigned size, - Addr addr, unsigned flags, uint64_t *res); + Fault writeMem(uint8_t *data, unsigned size, Addr addr, + Request::Flags flags, uint64_t *res); /** Splits a request in two if it crosses a dcache block. */ void splitRequest(RequestPtr req, RequestPtr &sreqLow, @@ -873,7 +874,8 @@ class BaseDynInst : public ExecContext, public RefCounted template<class Impl> Fault -BaseDynInst<Impl>::initiateMemRead(Addr addr, unsigned size, unsigned flags) +BaseDynInst<Impl>::initiateMemRead(Addr addr, unsigned size, + Request::Flags flags) { instFlags[ReqMade] = true; Request *req = NULL; @@ -925,8 +927,8 @@ BaseDynInst<Impl>::initiateMemRead(Addr addr, unsigned size, unsigned flags) template<class Impl> Fault -BaseDynInst<Impl>::writeMem(uint8_t *data, unsigned size, - Addr addr, unsigned flags, uint64_t *res) +BaseDynInst<Impl>::writeMem(uint8_t *data, unsigned size, Addr addr, + Request::Flags flags, uint64_t *res) { if (traceData) traceData->setMem(addr, size, flags); diff --git a/src/cpu/checker/cpu.cc b/src/cpu/checker/cpu.cc index 4d5919cdf..9aae8b812 100644 --- a/src/cpu/checker/cpu.cc +++ b/src/cpu/checker/cpu.cc @@ -139,7 +139,8 @@ CheckerCPU::unserialize(CheckpointIn &cp) } Fault -CheckerCPU::readMem(Addr addr, uint8_t *data, unsigned size, unsigned flags) +CheckerCPU::readMem(Addr addr, uint8_t *data, unsigned size, + Request::Flags flags) { Fault fault = NoFault; int fullSize = size; @@ -225,7 +226,7 @@ CheckerCPU::readMem(Addr addr, uint8_t *data, unsigned size, unsigned flags) Fault CheckerCPU::writeMem(uint8_t *data, unsigned size, - Addr addr, unsigned flags, uint64_t *res) + Addr addr, Request::Flags flags, uint64_t *res) { Fault fault = NoFault; bool checked_flags = false; diff --git a/src/cpu/checker/cpu.hh b/src/cpu/checker/cpu.hh index 93ab9defd..21ff9c7f7 100644 --- a/src/cpu/checker/cpu.hh +++ b/src/cpu/checker/cpu.hh @@ -57,6 +57,7 @@ #include "cpu/simple_thread.hh" #include "cpu/static_inst.hh" #include "debug/Checker.hh" +#include "mem/request.hh" #include "params/CheckerCPU.hh" #include "sim/eventq.hh" @@ -374,9 +375,9 @@ class CheckerCPU : public BaseCPU, public ExecContext } Fault readMem(Addr addr, uint8_t *data, unsigned size, - unsigned flags) override; - Fault writeMem(uint8_t *data, unsigned size, - Addr addr, unsigned flags, uint64_t *res) override; + Request::Flags flags) override; + Fault writeMem(uint8_t *data, unsigned size, Addr addr, + Request::Flags flags, uint64_t *res) override; unsigned int readStCondFailures() const override { return thread->readStCondFailures(); diff --git a/src/cpu/exec_context.hh b/src/cpu/exec_context.hh index 951c9c2b3..dd718b56a 100644 --- a/src/cpu/exec_context.hh +++ b/src/cpu/exec_context.hh @@ -51,6 +51,7 @@ #include "cpu/base.hh" #include "cpu/static_inst_fwd.hh" #include "cpu/translation.hh" +#include "mem/request.hh" /** * The ExecContext is an abstract base class the provides the @@ -182,7 +183,7 @@ class ExecContext { * should never be called). */ virtual Fault readMem(Addr addr, uint8_t *data, unsigned int size, - unsigned int flags) + Request::Flags flags) { panic("ExecContext::readMem() should be overridden\n"); } @@ -195,7 +196,7 @@ class ExecContext { * should never be called). */ virtual Fault initiateMemRead(Addr addr, unsigned int size, - unsigned int flags) + Request::Flags flags) { panic("ExecContext::initiateMemRead() should be overridden\n"); } @@ -205,7 +206,7 @@ class ExecContext { * For timing-mode contexts, initiate a timing memory write operation. */ virtual Fault writeMem(uint8_t *data, unsigned int size, Addr addr, - unsigned int flags, uint64_t *res) = 0; + Request::Flags flags, uint64_t *res) = 0; /** * Sets the number of consecutive store conditional failures. diff --git a/src/cpu/minor/exec_context.hh b/src/cpu/minor/exec_context.hh index a5d646b6c..4a56c01fe 100644 --- a/src/cpu/minor/exec_context.hh +++ b/src/cpu/minor/exec_context.hh @@ -58,6 +58,7 @@ #include "cpu/minor/pipeline.hh" #include "cpu/base.hh" #include "cpu/simple_thread.hh" +#include "mem/request.hh" #include "debug/MinorExecute.hh" namespace Minor @@ -103,7 +104,7 @@ class ExecContext : public ::ExecContext } Fault - initiateMemRead(Addr addr, unsigned int size, unsigned int flags) + initiateMemRead(Addr addr, unsigned int size, Request::Flags flags) { execute.getLSQ().pushRequest(inst, true /* load */, nullptr, size, addr, flags, NULL); @@ -112,7 +113,7 @@ class ExecContext : public ::ExecContext Fault writeMem(uint8_t *data, unsigned int size, Addr addr, - unsigned int flags, uint64_t *res) + Request::Flags flags, uint64_t *res) { execute.getLSQ().pushRequest(inst, false /* store */, data, size, addr, flags, res); diff --git a/src/cpu/minor/lsq.cc b/src/cpu/minor/lsq.cc index 5995a52c2..476f9d474 100644 --- a/src/cpu/minor/lsq.cc +++ b/src/cpu/minor/lsq.cc @@ -1471,7 +1471,8 @@ LSQ::needsToTick() void LSQ::pushRequest(MinorDynInstPtr inst, bool isLoad, uint8_t *data, - unsigned int size, Addr addr, unsigned int flags, uint64_t *res) + unsigned int size, Addr addr, Request::Flags flags, + uint64_t *res) { bool needs_burst = transferNeedsBurst(addr, size, lineWidth); LSQRequestPtr request; diff --git a/src/cpu/minor/lsq.hh b/src/cpu/minor/lsq.hh index e0b72177c..1a9094806 100644 --- a/src/cpu/minor/lsq.hh +++ b/src/cpu/minor/lsq.hh @@ -712,7 +712,8 @@ class LSQ : public Named /** Single interface for readMem/writeMem to issue requests into * the LSQ */ void pushRequest(MinorDynInstPtr inst, bool isLoad, uint8_t *data, - unsigned int size, Addr addr, unsigned int flags, uint64_t *res); + unsigned int size, Addr addr, Request::Flags flags, + uint64_t *res); /** Push a predicate failed-representing request into the queues just * to maintain commit order */ diff --git a/src/cpu/simple/atomic.cc b/src/cpu/simple/atomic.cc index a8e97f14c..8dd81ae0b 100644 --- a/src/cpu/simple/atomic.cc +++ b/src/cpu/simple/atomic.cc @@ -334,8 +334,8 @@ AtomicSimpleCPU::AtomicCPUDPort::recvFunctionalSnoop(PacketPtr pkt) } Fault -AtomicSimpleCPU::readMem(Addr addr, uint8_t * data, - unsigned size, unsigned flags) +AtomicSimpleCPU::readMem(Addr addr, uint8_t * data, unsigned size, + Request::Flags flags) { SimpleExecContext& t_info = *threadInfo[curThread]; SimpleThread* thread = t_info.thread; @@ -422,15 +422,16 @@ AtomicSimpleCPU::readMem(Addr addr, uint8_t * data, } Fault -AtomicSimpleCPU::initiateMemRead(Addr addr, unsigned size, unsigned flags) +AtomicSimpleCPU::initiateMemRead(Addr addr, unsigned size, + Request::Flags flags) { panic("initiateMemRead() is for timing accesses, and should " "never be called on AtomicSimpleCPU.\n"); } Fault -AtomicSimpleCPU::writeMem(uint8_t *data, unsigned size, - Addr addr, unsigned flags, uint64_t *res) +AtomicSimpleCPU::writeMem(uint8_t *data, unsigned size, Addr addr, + Request::Flags flags, uint64_t *res) { SimpleExecContext& t_info = *threadInfo[curThread]; SimpleThread* thread = t_info.thread; diff --git a/src/cpu/simple/atomic.hh b/src/cpu/simple/atomic.hh index 098ecd759..cdc1890de 100644 --- a/src/cpu/simple/atomic.hh +++ b/src/cpu/simple/atomic.hh @@ -45,6 +45,7 @@ #include "cpu/simple/base.hh" #include "cpu/simple/exec_context.hh" +#include "mem/request.hh" #include "params/AtomicSimpleCPU.hh" #include "sim/probe/probe.hh" @@ -202,12 +203,13 @@ class AtomicSimpleCPU : public BaseSimpleCPU void suspendContext(ThreadID thread_num) override; Fault readMem(Addr addr, uint8_t *data, unsigned size, - unsigned flags) override; + Request::Flags flags) override; - Fault initiateMemRead(Addr addr, unsigned size, unsigned flags) override; + Fault initiateMemRead(Addr addr, unsigned size, + Request::Flags flags) override; Fault writeMem(uint8_t *data, unsigned size, - Addr addr, unsigned flags, uint64_t *res) override; + Addr addr, Request::Flags flags, uint64_t *res) override; void regProbePoints() override; diff --git a/src/cpu/simple/base.hh b/src/cpu/simple/base.hh index 9164a2960..15ab2aba4 100644 --- a/src/cpu/simple/base.hh +++ b/src/cpu/simple/base.hh @@ -143,12 +143,13 @@ class BaseSimpleCPU : public BaseCPU void startup() override; virtual Fault readMem(Addr addr, uint8_t* data, unsigned size, - unsigned flags) = 0; + Request::Flags flags) = 0; - virtual Fault initiateMemRead(Addr addr, unsigned size, unsigned flags) = 0; + virtual Fault initiateMemRead(Addr addr, unsigned size, + Request::Flags flags) = 0; virtual Fault writeMem(uint8_t* data, unsigned size, Addr addr, - unsigned flags, uint64_t* res) = 0; + Request::Flags flags, uint64_t* res) = 0; void countInst(); Counter totalInsts() const override; diff --git a/src/cpu/simple/exec_context.hh b/src/cpu/simple/exec_context.hh index f9d80d0d5..430790c09 100644 --- a/src/cpu/simple/exec_context.hh +++ b/src/cpu/simple/exec_context.hh @@ -53,6 +53,7 @@ #include "cpu/simple/base.hh" #include "cpu/static_inst_fwd.hh" #include "cpu/translation.hh" +#include "mem/request.hh" class BaseSimpleCPU; @@ -286,19 +287,19 @@ class SimpleExecContext : public ExecContext { { panic("BaseSimpleCPU::getEA() not implemented\n"); } Fault readMem(Addr addr, uint8_t *data, unsigned int size, - unsigned int flags) override + Request::Flags flags) override { return cpu->readMem(addr, data, size, flags); } Fault initiateMemRead(Addr addr, unsigned int size, - unsigned int flags) override + Request::Flags flags) override { return cpu->initiateMemRead(addr, size, flags); } Fault writeMem(uint8_t *data, unsigned int size, Addr addr, - unsigned int flags, uint64_t *res) override + Request::Flags flags, uint64_t *res) override { return cpu->writeMem(data, size, addr, flags, res); } diff --git a/src/cpu/simple/timing.cc b/src/cpu/simple/timing.cc index 515d6b23c..65fea15ee 100644 --- a/src/cpu/simple/timing.cc +++ b/src/cpu/simple/timing.cc @@ -409,14 +409,15 @@ TimingSimpleCPU::buildSplitPacket(PacketPtr &pkt1, PacketPtr &pkt2, Fault TimingSimpleCPU::readMem(Addr addr, uint8_t *data, - unsigned size, unsigned flags) + unsigned size, Request::Flags flags) { panic("readMem() is for atomic accesses, and should " "never be called on TimingSimpleCPU.\n"); } Fault -TimingSimpleCPU::initiateMemRead(Addr addr, unsigned size, unsigned flags) +TimingSimpleCPU::initiateMemRead(Addr addr, unsigned size, + Request::Flags flags) { SimpleExecContext &t_info = *threadInfo[curThread]; SimpleThread* thread = t_info.thread; @@ -489,7 +490,7 @@ TimingSimpleCPU::handleWritePacket() Fault TimingSimpleCPU::writeMem(uint8_t *data, unsigned size, - Addr addr, unsigned flags, uint64_t *res) + Addr addr, Request::Flags flags, uint64_t *res) { SimpleExecContext &t_info = *threadInfo[curThread]; SimpleThread* thread = t_info.thread; diff --git a/src/cpu/simple/timing.hh b/src/cpu/simple/timing.hh index 035f05158..eebf884ca 100644 --- a/src/cpu/simple/timing.hh +++ b/src/cpu/simple/timing.hh @@ -279,12 +279,13 @@ class TimingSimpleCPU : public BaseSimpleCPU void suspendContext(ThreadID thread_num) override; Fault readMem(Addr addr, uint8_t *data, unsigned size, - unsigned flags) override; + Request::Flags flags) override; - Fault initiateMemRead(Addr addr, unsigned size, unsigned flags) override; + Fault initiateMemRead(Addr addr, unsigned size, + Request::Flags flags) override; Fault writeMem(uint8_t *data, unsigned size, - Addr addr, unsigned flags, uint64_t *res) override; + Addr addr, Request::Flags flags, uint64_t *res) override; void fetch(); void sendFetch(const Fault &fault, RequestPtr req, ThreadContext *tc); |