Go to the documentation of this file.
36 #include "debug/ProtocolTest.hh"
43 threadEvent(this,
"TesterThread tick"),
44 deadlockCheckEvent(this),
45 threadId(
p.thread_id),
46 numLanes(
p.num_lanes),
47 tester(nullptr), addrManager(nullptr), port(nullptr),
48 scalarPort(nullptr), sqcPort(nullptr), curEpisode(nullptr),
49 curAction(nullptr), pendingLdStCount(0), pendingFenceCount(0),
50 pendingAtomicCount(0), lastActiveCycle(
Cycles(0)),
51 deadlockThreshold(
p.deadlock_threshold)
58 assert(
ep !=
nullptr);
215 for (
int lane = 0; lane <
numLanes; ++lane) {
242 panic(
"The tester got an invalid action\n");
276 panic(
"The tester got an invalid action\n");
294 OutstandingReqTable::iterator it = req_table.find(address);
297 if (it == req_table.end()) {
303 (it->second).push_back(req);
310 OutstandingReqTable::iterator it = req_table.find(
addr);
313 assert(it != req_table.end());
317 assert(!req_list.empty());
326 if (req_list.empty()) {
337 std::stringstream
ss;
341 ss <<
threadName <<
": Atomic Op returned unexpected value\n"
343 <<
"\tLane ID " << lane <<
"\n"
345 <<
"\tAtomic Op's return value " << ret_val <<
"\n";
361 std::stringstream
ss;
365 ss <<
threadName <<
": Loaded value is not consistent with "
366 <<
"the last stored value\n"
367 <<
"\tTesterThread " <<
threadId <<
"\n"
369 <<
"\tLane ID " << lane <<
"\n"
371 <<
"\tLoaded value " << ret_val <<
"\n"
400 std::stringstream
ss;
404 <<
"\tCurrent cycle: " <<
curCycle() <<
"\n"
422 std::stringstream&
ss)
const
426 for (
const auto&
m : table) {
427 for (
const auto& req :
m.second) {
429 <<
": delta (curCycle - issueCycle) = "
430 << (cur_cycle - req.issueCycle) << std::endl;
439 ss <<
"\t\tOutstanding Loads:\n";
441 ss <<
"\t\tOutstanding Stores:\n";
443 ss <<
"\t\tOutstanding Atomics:\n";
445 ss <<
"\t\tNumber of outstanding acquires & releases: "
ProtocolTester::GMTokenPort * tokenPort
TesterThreadParams Params
Tick curTick()
The universal simulation clock.
DeadlockCheckEvent deadlockCheckEvent
Cycles curCycle() const
Determine the current cycle, corresponding to a tick aligned to a clock edge.
virtual void issueLoadOps()=0
std::string printAddress(Addr addr)
bool hasMoreActions() const
virtual void issueAtomicOps()=0
ProtocolTester::SeqPort * port
virtual void issueReleaseOp()=0
const Episode::Action * curAction
OutstandingReqTable outstandingAtomics
bool validateAtomicResp(Location loc, Value ret_val)
TesterThreadEvent threadEvent
void schedule(Event &event, Tick when)
virtual void issueStoreOps()=0
EpisodeHistory episodeHistory
Cycles is a wrapper class for representing cycle counts, i.e.
void attachTesterThreadToPorts(ProtocolTester *_tester, ProtocolTester::SeqPort *_port, ProtocolTester::GMTokenPort *_tokenPort=nullptr, ProtocolTester::SeqPort *_sqcPort=nullptr, ProtocolTester::SeqPort *_scalarPort=nullptr)
int getEpisodeLength() const
bool haveTokens(int num_tokens)
Query if there are at least num_tokens tokens available to acquire.
OutstandingReqTable outstandingStores
OutstandingReq popOutstandingReq(OutstandingReqTable &req_table, Addr address)
const Action * peekCurAction() const
void validateLoadResp(Location loc, int lane, Value ret_val)
virtual void issueAcquireOp()=0
ProtocolTester::SeqPort * sqcPort
void acquireTokens(int num_tokens)
Acquire tokens by decrementing the number of available tokens across the port.
std::vector< OutstandingReq > OutstandingReqList
void dumpErrorLog(std::stringstream &ss)
Location getLocation(int lane) const
void printOutstandingReqs(const OutstandingReqTable &table, std::stringstream &ss) const
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
AddressManager::Location Location
AddressManager * addrManager
ProtocolTester::SeqPort * scalarPort
static const int INVALID_LOCATION
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
void addOutstandingReqs(OutstandingReqTable &req_table, Addr addr, int lane, Location loc, Value stored_val=AddressManager::INVALID_VALUE)
OutstandingReqTable outstandingLoads
void scheduleDeadlockCheckEvent()
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 printAllOutstandingReqs(std::stringstream &ss) const
bool checkDRF(Location atomic_loc, Location loc, bool isStore, int max_lane) const
bool checkDRF(Location atomic_loc, Location loc, bool isStore) const
AddressManager * getAddressManager() const
void validateAtomicResp(Location loc, int lane, Value ret_val)
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Value getLoggedValue(Location loc) const
std::unordered_map< Addr, OutstandingReqList > OutstandingReqTable
TesterThread(const Params &p)
AddressManager::Value Value
std::string printLastWriter(Location loc) const
bool scheduled() const
Determine if the current event is scheduled.
#define panic(...)
This implements a cprintf based panic() function.
Addr getAddress(Location loc)
Generated on Tue Dec 21 2021 11:34:27 for gem5 by doxygen 1.8.17