Go to the documentation of this file.
52 #include "params/CheckerCPU.hh"
61 requestorId = systemPtr->getRequestorId(
this);
65 :
BaseCPU(
p, true), systemPtr(NULL), icachePort(NULL), dcachePort(NULL),
66 tc(NULL), thread(NULL),
67 unverifiedReq(nullptr),
68 unverifiedMemData(nullptr)
141 int& frag_size,
int& size_left)
const
143 frag_size = std::min(
146 size_left -= frag_size;
150 if (!byte_enable.empty()) {
152 auto it_start = byte_enable.cbegin() + (size - (frag_size +
154 auto it_end = byte_enable.cbegin() + (size - size_left);
156 mem_req = std::make_shared<Request>(frag_addr, frag_size,
162 mem_req = std::make_shared<Request>(frag_addr, frag_size,
175 assert(byte_enable.empty() || byte_enable.size() == size);
178 bool checked_flags =
false;
179 bool flags_match =
true;
184 int size_left = size;
190 byte_enable, frag_size,
193 predicate = (mem_req !=
nullptr);
202 mem_req->getPaddr(), mem_req->getFlags());
203 pAddr = mem_req->getPaddr();
204 checked_flags =
true;
208 if (predicate && fault ==
NoFault &&
214 if (!(mem_req->isUncacheable() || mem_req->isLocalAccess())) {
226 if (mem_req->isPrefetch()) {
239 frag_addr += frag_size;
245 warn(
"%lli: Flags do not match CPU:%#x %#x %#x Checker:%#x %#x %#x\n",
259 assert(byte_enable.empty() || byte_enable.size() == size);
262 bool checked_flags =
false;
263 bool flags_match =
true;
265 static uint8_t zero_data[64] = {};
269 int size_left = size;
275 byte_enable, frag_size,
278 predicate = (mem_req !=
nullptr);
286 mem_req->getPaddr(), mem_req->getFlags());
287 pAddr = mem_req->getPaddr();
288 checked_flags =
true;
298 bool was_prefetch = mem_req->isPrefetch();
301 if (fault !=
NoFault || size_left == 0)
303 if (fault !=
NoFault && was_prefetch) {
309 frag_addr += frag_size;
313 warn(
"%lli: Flags do not match CPU:%#x %#x Checker:%#x %#x %#x\n",
330 bool extraData =
false;
341 assert(
sizeof(zero_data) <= size);
347 warn(
"%lli: Store value does not match value sent to memory! "
361 Addr pAddr,
int flags)
363 Addr unverifiedVAddr = unverified_req->getVaddr();
364 Addr unverifiedPAddr = unverified_req->getPaddr();
365 int unverifiedFlags = unverified_req->getFlags();
367 if (unverifiedVAddr != vAddr ||
368 unverifiedPAddr != pAddr ||
369 unverifiedFlags != flags) {
379 warn(
"%lli: Checker PC:%s",
381 panic(
"Checker found an error!");
Fault writeMem(uint8_t *data, unsigned size, Addr addr, Request::Flags flags, uint64_t *res, const std::vector< bool > &byte_enable=std::vector< bool >()) override
TheISA::PCState pcState() const override
void serialize(CheckpointOut &cp) const override
@ NO_ACCESS
The request should not cause a memory access.
unsigned int cacheLineSize() const
Get the cache line size of the system.
std::vector< Process * > workload
void setSystem(System *system)
Fault readMem(Addr addr, uint8_t *data, unsigned size, Request::Flags flags, const std::vector< bool > &byte_enable=std::vector< bool >()) override
std::shared_ptr< Request > RequestPtr
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
void sendFunctional(PacketPtr pkt) const
Send a functional request packet, where the data is instantly updated everywhere in the memory system...
The SimpleThread object provides a combination of the ThreadState object and the ThreadContext interf...
bool isAnyActiveElement(const std::vector< bool >::const_iterator &it_start, const std::vector< bool >::const_iterator &it_end)
Test if there is any active element in an enablement range.
StaticInstPtr curStaticInst
void unserialize(CheckpointIn &cp) override
ThreadContext * getTC()
Returns the pointer to this SimpleThread's ThreadContext.
std::shared_ptr< FaultBase > Fault
static PacketPtr createRead(const RequestPtr &req)
Constructor-like methods that return Packets based on Request objects.
virtual Fault translateFunctional(const RequestPtr &req, ThreadContext *tc, Mode mode)
std::vector< ThreadContext * > threadContexts
void setIcachePort(RequestPort *icache_port)
virtual ContextID contextId() const =0
Addr addrBlockOffset(Addr addr, Addr block_size)
Calculates the offset of a given address wrt aligned fixed-size blocks.
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
constexpr decltype(nullptr) NoFault
RequestorID requestorId
id attached to all issued requests
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
bool checkFlags(const RequestPtr &unverified_req, Addr vAddr, Addr pAddr, int flags)
Checks if the flags set by the Checker and Checkee match.
Overload hash function for BasicBlockRange type.
StaticInstPtr curMacroStaticInst
void dataStatic(T *p)
Set the data pointer to the following value that should not be freed.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
void setDcachePort(RequestPort *dcache_port)
static const FlagsType STORE_NO_DATA
RequestPtr genMemFragmentRequest(Addr frag_addr, int size, Request::Flags flags, const std::vector< bool > &byte_enable, int &frag_size, int &size_left) const
Helper function used to generate the request for a single fragment of a memory access.
uint8_t * unverifiedMemData
#define panic(...)
This implements a cprintf based panic() function.
Tick curTick()
The current simulated tick.
Generated on Wed Sep 30 2020 14:01:58 for gem5 by doxygen 1.8.17