Go to the documentation of this file.
38 #include "debug/ProtocolTest.hh"
45 threadEvent(this,
"TesterThread tick"),
46 deadlockCheckEvent(this),
47 threadId(
p.thread_id),
48 numLanes(
p.num_lanes),
49 tester(nullptr), addrManager(nullptr), port(nullptr),
50 scalarPort(nullptr), sqcPort(nullptr), curEpisode(nullptr),
51 curAction(nullptr), pendingLdStCount(0), pendingFenceCount(0),
52 pendingAtomicCount(0), lastActiveCycle(
Cycles(0)),
53 deadlockThreshold(
p.deadlock_threshold)
60 assert(
ep !=
nullptr);
217 for (
int lane = 0; lane <
numLanes; ++lane) {
244 panic(
"The tester got an invalid action\n");
278 panic(
"The tester got an invalid action\n");
296 OutstandingReqTable::iterator it = req_table.find(address);
299 if (it == req_table.end()) {
305 (it->second).push_back(req);
312 OutstandingReqTable::iterator it = req_table.find(
addr);
315 assert(it != req_table.end());
319 assert(!req_list.empty());
328 if (req_list.empty()) {
339 std::stringstream
ss;
343 ss <<
threadName <<
": Atomic Op returned unexpected value\n"
345 <<
"\tLane ID " << lane <<
"\n"
347 <<
"\tAtomic Op's return value " << ret_val <<
"\n";
363 std::stringstream
ss;
367 ss <<
threadName <<
": Loaded value is not consistent with "
368 <<
"the last stored value\n"
369 <<
"\tTesterThread " <<
threadId <<
"\n"
371 <<
"\tLane ID " << lane <<
"\n"
373 <<
"\tLoaded value " << ret_val <<
"\n"
402 std::stringstream
ss;
406 <<
"\tCurrent cycle: " <<
curCycle() <<
"\n"
424 std::stringstream&
ss)
const
428 for (
const auto&
m : table) {
429 for (
const auto& req :
m.second) {
431 <<
": delta (curCycle - issueCycle) = "
432 << (cur_cycle - req.issueCycle) << std::endl;
441 ss <<
"\t\tOutstanding Loads:\n";
443 ss <<
"\t\tOutstanding Stores:\n";
445 ss <<
"\t\tOutstanding Atomics:\n";
447 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 Sep 7 2021 14:53:45 for gem5 by doxygen 1.8.17