Go to the documentation of this file.
38 #include "debug/ProtocolTest.hh"
42 threadEvent(this,
"TesterThread tick"),
43 deadlockCheckEvent(this),
44 threadId(
p.thread_id),
45 numLanes(
p.num_lanes),
46 tester(nullptr), addrManager(nullptr), port(nullptr),
47 scalarPort(nullptr), sqcPort(nullptr), curEpisode(nullptr),
48 curAction(nullptr), pendingLdStCount(0), pendingFenceCount(0),
49 pendingAtomicCount(0), lastActiveCycle(
Cycles(0)),
50 deadlockThreshold(
p.deadlock_threshold)
57 assert(
ep !=
nullptr);
214 for (
int lane = 0; lane <
numLanes; ++lane) {
241 panic(
"The tester got an invalid action\n");
275 panic(
"The tester got an invalid action\n");
293 OutstandingReqTable::iterator it = req_table.find(address);
296 if (it == req_table.end()) {
302 (it->second).push_back(req);
309 OutstandingReqTable::iterator it = req_table.find(
addr);
312 assert(it != req_table.end());
316 assert(!req_list.empty());
325 if (req_list.empty()) {
336 std::stringstream
ss;
340 ss <<
threadName <<
": Atomic Op returned unexpected value\n"
342 <<
"\tLane ID " << lane <<
"\n"
344 <<
"\tAtomic Op's return value " << ret_val <<
"\n";
360 std::stringstream
ss;
364 ss <<
threadName <<
": Loaded value is not consistent with "
365 <<
"the last stored value\n"
366 <<
"\tTesterThread " <<
threadId <<
"\n"
368 <<
"\tLane ID " << lane <<
"\n"
370 <<
"\tLoaded value " << ret_val <<
"\n"
399 std::stringstream
ss;
403 <<
"\tCurrent cycle: " <<
curCycle() <<
"\n"
421 std::stringstream&
ss)
const
425 for (
const auto&
m : table) {
426 for (
const auto& req :
m.second) {
428 <<
": delta (curCycle - issueCycle) = "
429 << (cur_cycle - req.issueCycle) << std::endl;
438 ss <<
"\t\tOutstanding Loads:\n";
440 ss <<
"\t\tOutstanding Stores:\n";
442 ss <<
"\t\tOutstanding Atomics:\n";
444 ss <<
"\t\tNumber of outstanding acquires & releases: "
bool validateAtomicResp(Location loc, Value ret_val)
Location getLocation(int lane) const
OutstandingReqTable outstandingStores
bool scheduled() const
Determine if the current event is scheduled.
AddressManager::Value Value
virtual void issueStoreOps()=0
ProtocolTester::SeqPort * scalarPort
Addr getAddress(Location loc)
void printAllOutstandingReqs(std::stringstream &ss) const
virtual void issueReleaseOp()=0
std::unordered_map< Addr, OutstandingReqList > OutstandingReqTable
AddressManager * addrManager
void scheduleDeadlockCheckEvent()
std::vector< OutstandingReq > OutstandingReqList
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
OutstandingReqTable outstandingLoads
virtual void issueAtomicOps()=0
void schedule(Event &event, Tick when)
bool checkDRF(Location atomic_loc, Location loc, bool isStore) const
Value getLoggedValue(Location loc) const
void acquireTokens(int num_tokens)
Acquire tokens by decrementing the number of available tokens across the port.
virtual void issueAcquireOp()=0
bool checkDRF(Location atomic_loc, Location loc, bool isStore, int max_lane) const
AddressManager * getAddressManager() const
Cycles curCycle() const
Determine the current cycle, corresponding to a tick aligned to a clock edge.
DeadlockCheckEvent deadlockCheckEvent
const Episode::Action * curAction
OutstandingReq popOutstandingReq(OutstandingReqTable &req_table, Addr address)
ProtocolTester::SeqPort * sqcPort
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void validateAtomicResp(Location loc, int lane, Value ret_val)
void printOutstandingReqs(const OutstandingReqTable &table, std::stringstream &ss) const
virtual void issueLoadOps()=0
TesterThreadParams Params
bool hasMoreActions() const
TesterThread(const Params &p)
OutstandingReqTable outstandingAtomics
void dumpErrorLog(std::stringstream &ss)
bool haveTokens(int num_tokens)
Query if there are at least num_tokens tokens available to acquire.
int getEpisodeLength() const
std::string printLastWriter(Location loc) const
EpisodeHistory episodeHistory
Cycles is a wrapper class for representing cycle counts, i.e.
TesterThreadEvent threadEvent
Tick nextCycle() const
Based on the clock of the object, determine the start tick of the first cycle that is at least one cy...
void attachTesterThreadToPorts(ProtocolTester *_tester, ProtocolTester::SeqPort *_port, ProtocolTester::GMTokenPort *_tokenPort=nullptr, ProtocolTester::SeqPort *_sqcPort=nullptr, ProtocolTester::SeqPort *_scalarPort=nullptr)
Tick curTick()
The universal simulation clock.
AddressManager::Location Location
void addOutstandingReqs(OutstandingReqTable &req_table, Addr addr, int lane, Location loc, Value stored_val=AddressManager::INVALID_VALUE)
ProtocolTester::GMTokenPort * tokenPort
const Action * peekCurAction() const
static const int INVALID_LOCATION
std::string printAddress(Addr addr)
ProtocolTester::SeqPort * port
void validateLoadResp(Location loc, int lane, Value ret_val)
#define panic(...)
This implements a cprintf based panic() function.
Generated on Tue Jun 22 2021 15:28:27 for gem5 by doxygen 1.8.17