Go to the documentation of this file.
52 #include "params/CheckerCPU.hh"
67 systemPtr(NULL), icachePort(NULL), dcachePort(NULL),
68 tc(NULL), thread(NULL),
69 unverifiedReq(nullptr),
70 unverifiedMemData(nullptr)
98 const Params &
p = params();
108 mmu,
p.isa[0],
p.decoder[0]);
112 threadContexts.push_back(
tc);
143 int& frag_size,
int& size_left)
const
145 frag_size = std::min(
148 size_left -= frag_size;
153 auto it_start = byte_enable.cbegin() + (size - (frag_size +
155 auto it_end = byte_enable.cbegin() + (size - size_left);
157 mem_req = std::make_shared<Request>(frag_addr, frag_size,
171 assert(byte_enable.size() == size);
174 bool checked_flags =
false;
175 bool flags_match =
true;
180 int size_left = size;
186 byte_enable, frag_size,
189 predicate = (mem_req !=
nullptr);
198 mem_req->getPaddr(), mem_req->getFlags());
199 pAddr = mem_req->getPaddr();
200 checked_flags =
true;
204 if (predicate && fault ==
NoFault &&
210 if (!(mem_req->isUncacheable() || mem_req->isLocalAccess())) {
222 if (mem_req->isPrefetch()) {
235 frag_addr += frag_size;
241 warn(
"%lli: Flags do not match CPU:%#x %#x %#x Checker:%#x %#x %#x\n",
255 assert(byte_enable.size() == size);
258 bool checked_flags =
false;
259 bool flags_match =
true;
261 static uint8_t zero_data[64] = {};
265 int size_left = size;
271 byte_enable, frag_size,
274 predicate = (mem_req !=
nullptr);
282 mem_req->getPaddr(), mem_req->getFlags());
283 pAddr = mem_req->getPaddr();
284 checked_flags =
true;
294 bool was_prefetch = mem_req->isPrefetch();
297 if (fault !=
NoFault || size_left == 0)
299 if (fault !=
NoFault && was_prefetch) {
305 frag_addr += frag_size;
309 warn(
"%lli: Flags do not match CPU:%#x %#x Checker:%#x %#x %#x\n",
326 bool extraData =
false;
337 assert(
sizeof(zero_data) <= size);
343 warn(
"%lli: Store value does not match value sent to memory! "
359 Addr unverifiedVAddr = unverified_req->getVaddr();
360 Addr unverifiedPAddr = unverified_req->getPaddr();
361 int unverifiedFlags = unverified_req->getFlags();
363 if (unverifiedVAddr != vAddr ||
364 unverifiedPAddr != pAddr ||
365 unverifiedFlags !=
flags) {
375 warn(
"%lli: Checker PC:%s",
377 panic(
"Checker found an error!");
Tick curTick()
The universal simulation clock.
CheckerCPU(const Params &p)
Addr instAddr() const
Returns the memory address of the instruction this PC points to.
constexpr decltype(nullptr) NoFault
void serialize(CheckpointOut &cp) const override
@ NO_ACCESS
The request should not cause a memory access.
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.
std::vector< Process * > workload
virtual ContextID contextId() const =0
Addr addrBlockOffset(Addr addr, Addr block_size)
Calculates the offset of a given address wrt aligned fixed-size blocks.
The SimpleThread object provides a combination of the ThreadState object and the ThreadContext interf...
Fault writeMem(uint8_t *data, unsigned size, Addr addr, Request::Flags flags, uint64_t *res, const std::vector< bool > &byte_enable) override
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
virtual Fault translateFunctional(const RequestPtr &req, ThreadContext *tc, Mode mode)
void dataStatic(T *p)
Set the data pointer to the following value that should not be freed.
void sendFunctional(PacketPtr pkt) const
Send a functional request packet, where the data is instantly updated everywhere in the memory system...
std::shared_ptr< FaultBase > Fault
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
std::shared_ptr< Request > RequestPtr
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.
virtual void setThreadContext(ThreadContext *_tc)
RequestorID getRequestorId(const SimObject *requestor, std::string subrequestor={})
Request an id used to create a request object in the system.
RequestorID requestorId
id attached to all issued requests
const PCStateBase & pcState() const override
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Fault readMem(Addr addr, uint8_t *data, unsigned size, Request::Flags flags, const std::vector< bool > &byte_enable) override
bool checkFlags(const RequestPtr &unverified_req, Addr vAddr, Addr pAddr, int flags)
Checks if the flags set by the Checker and Checkee match.
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
ThreadContext * getTC()
Returns the pointer to this SimpleThread's ThreadContext.
static const FlagsType STORE_NO_DATA
void unserialize(CheckpointIn &cp) override
StaticInstPtr curStaticInst
void setDcachePort(RequestPort *dcache_port)
void setIcachePort(RequestPort *icache_port)
virtual BaseISA * getIsaPtr() const =0
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
static PacketPtr createRead(const RequestPtr &req)
Constructor-like methods that return Packets based on Request objects.
StaticInstPtr curMacroStaticInst
uint8_t * unverifiedMemData
#define panic(...)
This implements a cprintf based panic() function.
void setSystem(System *system)
Generated on Thu Jun 16 2022 10:41:37 for gem5 by doxygen 1.8.17