50 #include "arch/kernel_stats.hh"
51 #include "arch/vtophys.hh"
56 #include "params/CheckerCPU.hh"
60 using namespace TheISA;
65 masterId = systemPtr->getMasterId(
name());
69 :
BaseCPU(p, true), systemPtr(NULL), icachePort(NULL), dcachePort(NULL),
70 tc(NULL), thread(NULL)
100 const Params *
p(dynamic_cast<const Params *>(_params));
114 threadContexts.push_back(
tc);
148 Addr secondAddr =
roundDown(addr + size - 1, cacheLineSize());
149 bool checked_flags =
false;
150 bool flags_match =
true;
154 if (secondAddr > addr)
155 size = secondAddr -
addr;
169 checked_flags =
true;
206 if (secondAddr <= addr)
214 size = addr + fullSize - secondAddr;
219 warn(
"%lli: Flags do not match CPU:%#x %#x %#x Checker:%#x %#x %#x\n",
233 bool checked_flags =
false;
234 bool flags_match =
true;
236 static uint8_t zero_data[64] = {};
240 Addr secondAddr =
roundDown(addr + size - 1, cacheLineSize());
242 if (secondAddr > addr)
243 size = secondAddr -
addr;
257 checked_flags =
true;
272 if (fault !=
NoFault || secondAddr <= addr)
274 if (fault !=
NoFault && was_prefetch) {
281 size = addr + fullSize - secondAddr;
287 warn(
"%lli: Flags do not match CPU:%#x %#x Checker:%#x %#x %#x\n",
304 bool extraData =
false;
315 assert(
sizeof(zero_data) <= fullSize);
321 warn(
"%lli: Store value does not match value sent to memory! "
322 "data: %#x inst_data: %#x",
curTick(), data,
341 Addr pAddr,
int flags)
345 int unverifiedFlags = unverified_req->
getFlags();
347 if (unverifiedVAddr != vAddr ||
348 unverifiedPAddr != pAddr ||
349 unverifiedFlags != flags) {
359 warn(
"%lli: Checker PC:%s",
361 panic(
"Checker found an error!");
Fault writeMem(uint8_t *data, unsigned size, Addr addr, Request::Flags flags, uint64_t *res) override
A MasterPort is a specialisation of a BaseMasterPort, which implements the default protocol for the t...
bool isUncacheable() const
Accessor functions for flags.
decltype(nullptr) constexpr NoFault
const std::string & name()
uint64_t getExtraData() const
Accessor function for store conditional return value.
bool isMmappedIpr() const
bool FullSystem
The FullSystem variable can be used to determine the current mode of simulation.
The SimpleThread object provides a combination of the ThreadState object and the ThreadContext interf...
This is a write that is targeted and zeroing an entire cache block.
StaticInstPtr curMacroStaticInst
void setDcachePort(MasterPort *dcache_port)
void dataStatic(T *p)
Set the data pointer to the following value that should not be freed.
bool checkFlags(Request *unverified_req, Addr vAddr, Addr pAddr, int flags)
Checks if the flags set by the Checker and Checkee match.
Tick curTick()
The current simulated tick.
MasterID masterId
id attached to all issued requests
uint8_t * unverifiedMemData
T roundDown(const T &val, const U &align)
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.
bool extraDataValid() const
Accessor function to check if sc result is valid.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Addr dbg_vtophys(Addr addr)
void serialize(CheckpointOut &cp) const override
TheISA::PCState pcState()
Flags getFlags()
Accessor for flags.
TheISA::Kernel::Statistics * kernelStats
void setIcachePort(MasterPort *icache_port)
The request should not cause a memory access.
std::vector< Process * > workload
void setSystem(System *system)
virtual int contextId() const =0
static PacketPtr createRead(const RequestPtr req)
Constructor-like methods that return Packets based on Request objects.
StaticInstPtr curStaticInst
std::shared_ptr< FaultBase > Fault
Fault readMem(Addr addr, uint8_t *data, unsigned size, Request::Flags flags) override
void unserialize(CheckpointIn &cp) override
void sendFunctional(PacketPtr pkt)
Send a functional request packet, where the data is instantly updated everywhere in the memory system...