Go to the documentation of this file.
52 #include "params/CheckerCPU.hh"
62 :
BaseCPU(
p, true), systemPtr(NULL), icachePort(NULL), dcachePort(NULL),
63 tc(NULL), thread(NULL),
64 unverifiedReq(nullptr),
65 unverifiedMemData(nullptr)
137 int& frag_size,
int& size_left)
const
139 frag_size = std::min(
142 size_left -= frag_size;
147 auto it_start = byte_enable.cbegin() + (size - (frag_size +
149 auto it_end = byte_enable.cbegin() + (size - size_left);
151 mem_req = std::make_shared<Request>(frag_addr, frag_size,
165 assert(byte_enable.size() == size);
168 bool checked_flags =
false;
169 bool flags_match =
true;
174 int size_left = size;
180 byte_enable, frag_size,
183 predicate = (mem_req !=
nullptr);
192 mem_req->getPaddr(), mem_req->getFlags());
193 pAddr = mem_req->getPaddr();
194 checked_flags =
true;
198 if (predicate && fault ==
NoFault &&
204 if (!(mem_req->isUncacheable() || mem_req->isLocalAccess())) {
216 if (mem_req->isPrefetch()) {
229 frag_addr += frag_size;
235 warn(
"%lli: Flags do not match CPU:%#x %#x %#x Checker:%#x %#x %#x\n",
249 assert(byte_enable.size() == size);
252 bool checked_flags =
false;
253 bool flags_match =
true;
255 static uint8_t zero_data[64] = {};
259 int size_left = size;
265 byte_enable, frag_size,
268 predicate = (mem_req !=
nullptr);
276 mem_req->getPaddr(), mem_req->getFlags());
277 pAddr = mem_req->getPaddr();
278 checked_flags =
true;
288 bool was_prefetch = mem_req->isPrefetch();
291 if (fault !=
NoFault || size_left == 0)
293 if (fault !=
NoFault && was_prefetch) {
299 frag_addr += frag_size;
303 warn(
"%lli: Flags do not match CPU:%#x %#x Checker:%#x %#x %#x\n",
320 bool extraData =
false;
331 assert(
sizeof(zero_data) <= size);
337 warn(
"%lli: Store value does not match value sent to memory! "
351 Addr pAddr,
int flags)
353 Addr unverifiedVAddr = unverified_req->getVaddr();
354 Addr unverifiedPAddr = unverified_req->getPaddr();
355 int unverifiedFlags = unverified_req->getFlags();
357 if (unverifiedVAddr != vAddr ||
358 unverifiedPAddr != pAddr ||
359 unverifiedFlags != flags) {
369 warn(
"%lli: Checker PC:%s",
371 panic(
"Checker found an error!");
RequestorID getRequestorId(const SimObject *requestor, std::string subrequestor=std::string())
Request an id used to create a request object in the system.
TheISA::PCState pcState() const override
Fault translateFunctional(const RequestPtr &req, ThreadContext *tc, BaseTLB::Mode mode)
void serialize(CheckpointOut &cp) const override
Serialize this object to the given output stream.
unsigned int cacheLineSize() const
Get the cache line size of the system.
std::vector< Process * > workload
void setSystem(System *system)
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...
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
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
Reconstruct the state of this object from a checkpoint.
ClockedObjectParams Params
Parameters of ClockedObject.
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.
Fault writeMem(uint8_t *data, unsigned size, Addr addr, Request::Flags flags, uint64_t *res, const std::vector< bool > &byte_enable) override
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.
@ NO_ACCESS
The request should not cause a memory access.
Fault readMem(Addr addr, uint8_t *data, unsigned size, Request::Flags flags, const std::vector< bool > &byte_enable) override
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)
Tick curTick()
The universal simulation clock.
CheckerCPU(const Params &p)
const Params & params() const
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.
Generated on Tue Jun 22 2021 15:28:19 for gem5 by doxygen 1.8.17