52 #include "params/CheckerCPU.hh" 61 masterId = systemPtr->getMasterId(
this);
65 :
BaseCPU(p, true), systemPtr(NULL), icachePort(NULL), dcachePort(NULL),
66 tc(NULL), thread(NULL),
67 unverifiedReq(nullptr),
68 unverifiedMemData(nullptr)
143 int& frag_size,
int& size_left)
const 145 frag_size = std::min(
148 size_left -= frag_size;
152 if (!byte_enable.empty()) {
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,
164 mem_req = std::make_shared<Request>(frag_addr, frag_size,
177 assert(byte_enable.empty() || byte_enable.size() == size);
180 bool checked_flags =
false;
181 bool flags_match =
true;
186 int size_left = size;
192 byte_enable, frag_size,
195 predicate = (mem_req !=
nullptr);
204 mem_req->getPaddr(), mem_req->getFlags());
205 pAddr = mem_req->getPaddr();
206 checked_flags =
true;
210 if (predicate && fault ==
NoFault &&
216 if (!(mem_req->isUncacheable() || mem_req->isLocalAccess())) {
228 if (mem_req->isPrefetch()) {
241 frag_addr += frag_size;
247 warn(
"%lli: Flags do not match CPU:%#x %#x %#x Checker:%#x %#x %#x\n",
261 assert(byte_enable.empty() || byte_enable.size() == size);
264 bool checked_flags =
false;
265 bool flags_match =
true;
267 static uint8_t zero_data[64] = {};
271 int size_left = size;
277 byte_enable, frag_size,
280 predicate = (mem_req !=
nullptr);
288 mem_req->getPaddr(), mem_req->getFlags());
289 pAddr = mem_req->getPaddr();
290 checked_flags =
true;
300 bool was_prefetch = mem_req->isPrefetch();
303 if (fault !=
NoFault || size_left == 0)
305 if (fault !=
NoFault && was_prefetch) {
311 frag_addr += frag_size;
315 warn(
"%lli: Flags do not match CPU:%#x %#x Checker:%#x %#x %#x\n",
332 bool extraData =
false;
343 assert(
sizeof(zero_data) <= size);
349 warn(
"%lli: Store value does not match value sent to memory! " 350 "data: %#x inst_data: %#x",
curTick(), data,
363 Addr pAddr,
int flags)
365 Addr unverifiedVAddr = unverified_req->getVaddr();
366 Addr unverifiedPAddr = unverified_req->getPaddr();
367 int unverifiedFlags = unverified_req->getFlags();
369 if (unverifiedVAddr != vAddr ||
370 unverifiedPAddr != pAddr ||
371 unverifiedFlags != flags) {
381 warn(
"%lli: Checker PC:%s",
383 panic(
"Checker found an error!");
A MasterPort is a specialisation of a BaseMasterPort, which implements the default protocol for the t...
#define panic(...)
This implements a cprintf based panic() function.
Addr addrBlockOffset(Addr addr, Addr block_size)
Calculates the offset of a given address wrt aligned fixed-size blocks.
decltype(nullptr) constexpr NoFault
std::shared_ptr< Request > RequestPtr
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.
TheISA::PCState pcState() const override
The SimpleThread object provides a combination of the ThreadState object and the ThreadContext interf...
Overload hash function for BasicBlockRange type.
StaticInstPtr curMacroStaticInst
void setDcachePort(MasterPort *dcache_port)
void dataStatic(T *p)
Set the data pointer to the following value that should not be freed.
std::vector< ThreadContext * > threadContexts
Tick curTick()
The current simulated tick.
MasterID masterId
id attached to all issued requests
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.
Kernel::Statistics * kernelStats
uint8_t * unverifiedMemData
static const FlagsType STORE_NO_DATA
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
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
ThreadContext * getTC()
Returns the pointer to this SimpleThread's ThreadContext.
static PacketPtr createRead(const RequestPtr &req)
Constructor-like methods that return Packets based on Request objects.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Fault readMem(Addr addr, uint8_t *data, unsigned size, Request::Flags flags, const std::vector< bool > &byte_enable=std::vector< bool >()) override
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.
The request should not cause a memory access.
void setIcachePort(MasterPort *icache_port)
std::vector< Process * > workload
void setSystem(System *system)
const SimObjectParams * _params
Cached copy of the object parameters.
virtual ContextID contextId() const =0
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.
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.
StaticInstPtr curStaticInst
std::shared_ptr< FaultBase > Fault
void unserialize(CheckpointIn &cp) override
Reconstruct the state of this object from a checkpoint.
virtual Fault translateFunctional(const RequestPtr &req, ThreadContext *tc, Mode mode)