Go to the documentation of this file.
52 #include "params/CheckerCPU.hh"
67 zeroReg(params().isa[0]->regClasses().
at(
IntRegClass).zeroReg()),
68 systemPtr(NULL), icachePort(NULL), dcachePort(NULL),
69 tc(NULL), thread(NULL),
70 unverifiedReq(nullptr),
71 unverifiedMemData(nullptr)
99 const Params &
p = params();
109 mmu,
p.isa[0],
p.decoder[0]);
113 threadContexts.push_back(
tc);
144 int& frag_size,
int& size_left)
const
146 frag_size = std::min(
149 size_left -= frag_size;
154 auto it_start = byte_enable.cbegin() + (size - (frag_size +
156 auto it_end = byte_enable.cbegin() + (size - size_left);
158 mem_req = std::make_shared<Request>(frag_addr, frag_size,
172 assert(byte_enable.size() == size);
175 bool checked_flags =
false;
176 bool flags_match =
true;
181 int size_left = size;
187 byte_enable, frag_size,
190 predicate = (mem_req !=
nullptr);
199 mem_req->getPaddr(), mem_req->getFlags());
200 pAddr = mem_req->getPaddr();
201 checked_flags =
true;
205 if (predicate && fault ==
NoFault &&
211 if (!(mem_req->isUncacheable() || mem_req->isLocalAccess())) {
223 if (mem_req->isPrefetch()) {
236 frag_addr += frag_size;
242 warn(
"%lli: Flags do not match CPU:%#x %#x %#x Checker:%#x %#x %#x\n",
256 assert(byte_enable.size() == size);
259 bool checked_flags =
false;
260 bool flags_match =
true;
262 static uint8_t zero_data[64] = {};
266 int size_left = size;
272 byte_enable, frag_size,
275 predicate = (mem_req !=
nullptr);
283 mem_req->getPaddr(), mem_req->getFlags());
284 pAddr = mem_req->getPaddr();
285 checked_flags =
true;
295 bool was_prefetch = mem_req->isPrefetch();
298 if (fault !=
NoFault || size_left == 0)
300 if (fault !=
NoFault && was_prefetch) {
306 frag_addr += frag_size;
310 warn(
"%lli: Flags do not match CPU:%#x %#x Checker:%#x %#x %#x\n",
327 bool extraData =
false;
338 assert(
sizeof(zero_data) <= size);
344 warn(
"%lli: Store value does not match value sent to memory! "
358 Addr pAddr,
int flags)
360 Addr unverifiedVAddr = unverified_req->getVaddr();
361 Addr unverifiedPAddr = unverified_req->getPaddr();
362 int unverifiedFlags = unverified_req->getFlags();
364 if (unverifiedVAddr != vAddr ||
365 unverifiedPAddr != pAddr ||
366 unverifiedFlags != flags) {
376 warn(
"%lli: Checker PC:%s",
378 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
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...
virtual BaseISA * getIsaPtr()=0
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
@ NO_ACCESS
The request should not cause a memory access.
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
@ IntRegClass
Integer register.
void unserialize(CheckpointIn &cp) override
StaticInstPtr curStaticInst
void setDcachePort(RequestPort *dcache_port)
void setIcachePort(RequestPort *icache_port)
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 Tue Dec 21 2021 11:34:19 for gem5 by doxygen 1.8.17