Go to the documentation of this file.
65 writes.insert(std::make_pair(serial,
73 auto it = writes.find(serial);
75 if (it == writes.end()) {
76 warn(
"Could not locate write transaction: serial = %d, "
77 "complete = %d\n", serial, _complete);
83 it->second.complete = _complete;
86 if (completeMax < _complete) {
87 completeMax = _complete;
90 if (--numIncomplete == 0) {
97 complete = completeMax;
104 if (!writes.erase(serial)) {
105 warn(
"Could not locate write transaction: serial = %d\n", serial);
109 if (--numIncomplete == 0 && !writes.empty()) {
112 complete = completeMax;
123 outstandingReads.insert(std::make_pair(serial,
131 _lastExpectedData.clear();
133 bool wc_overlap =
true;
137 *lastCompletedTransaction(&readObservations, start);
142 for (
auto cluster = writeClusters.rbegin();
143 cluster != writeClusters.rend() && wc_overlap; ++cluster) {
144 for (
const auto& addr_write : cluster->writes) {
160 _lastExpectedData.push_back(write.
data);
180 last_obs_valid =
false;
187 if (last_obs_valid) {
196 _lastExpectedData.push_back(last_obs.
data);
202 if (!writeClusters.empty() && wc_overlap) {
204 assert(writeClusters.begin()->start < complete &&
205 writeClusters.rbegin()->complete > start);
210 if (_lastExpectedData.empty()) {
215 "complete = %d, data = %#x\n", start, complete,
data);
225 auto it = outstandingReads.find(serial);
227 if (it == outstandingReads.end()) {
229 warn(
"Could not locate read transaction: serial = %d, complete = %d\n",
234 Tick start = it->second.start;
235 outstandingReads.erase(it);
238 const bool result = inExpectedData(start, complete,
data);
240 readObservations.emplace_back(serial, start, complete,
data);
249 if (writeClusters.empty() || writeClusters.back().isComplete()) {
250 writeClusters.emplace_back();
253 return &writeClusters.back();
260 getIncompleteWriteCluster()->startWrite(serial, start,
data);
267 getIncompleteWriteCluster()->completeWrite(serial, complete);
274 getIncompleteWriteCluster()->abortWrite(serial);
283 const Tick before = outstandingReads.empty() ?
curTick() :
284 outstandingReads.begin()->second.start;
287 readObservations.erase(readObservations.begin(),
288 lastCompletedTransaction(&readObservations, before));
291 if (!writeClusters.empty()) {
292 writeClusters.erase(writeClusters.begin(),
293 lastCompletedTransaction(&writeClusters, before));
304 "completing read: serial = %d, complete = %d, "
305 "addr = %#llx, size = %d\n", serial, complete,
addr, size);
307 for (
size_t i = 0;
i < size; ++
i) {
321 "failed: received %#x, expected ",
345 for (
size_t i = 0;
i < size; ++
i) {
void startRead(Serial serial, Tick start)
Starts a read transaction.
const std::vector< uint8_t > & lastExpectedData() const
This function returns the expected data that inExpectedData iterated through in the last call.
void abortWrite(Serial serial)
Aborts a write transaction.
void abortWrite(Serial serial)
Aborts a write transaction.
uint8_t data
Depending on the memory operation, the data value either represents: for writes, the value written up...
void completeWrite(Serial serial, Tick complete)
Completes a write transaction.
The WriteCluster class captures sets of writes where all writes are overlapping with at least one oth...
uint64_t Tick
Tick count type.
ByteTracker * getByteTracker(Addr addr)
Returns the instance of ByteTracker for the requested location.
void startWrite(Serial serial, Tick start, uint8_t data)
Starts a write transaction.
void startWrite(Serial serial, Tick _start, uint8_t data)
Starts a write transaction.
void completeWrite(Serial serial, Tick _complete)
Completes a write transaction.
The ByteTracker keeps track of transactions for the same byte – all outstanding reads,...
std::unordered_map< Serial, Transaction > writes
Map of Serial --> Transaction of all writes in cluster; contains all, in-flight or already completed.
void reset()
Resets the entire checker.
Tick start
Start of earliest write in cluster.
std::string errorMessage
Detailed error message of the last violation in completeRead.
#define chatty_assert(cond,...)
The chatty assert macro will function like a normal assert, but will allow the specification of addit...
bool completeRead(Serial serial, Tick complete, uint8_t data)
Completes a read transaction that is still outstanding.
static const Tick TICK_INITIAL
The initial tick the system starts with.
bool inExpectedData(Tick start, Tick complete, uint8_t data)
Given a start and end time (of any read transaction), this function iterates through all data that su...
Tick complete
Completion tick.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
The Transaction class captures the lifetimes of read and write operations, and the values they consum...
static const Tick TICK_FUTURE
The maximum value that curTick() could ever return.
void pruneTransactions()
Prunes no longer needed transactions.
std::unordered_map< Addr, ByteTracker > byte_trackers
Maintain a map of address --> byte-tracker.
WriteCluster * getIncompleteWriteCluster()
Convenience function to return the most recent incomplete write cluster.
Tick curTick()
The universal simulation clock.
Tick complete
Completion of last write in cluster.
bool completeRead(Serial serial, Tick complete, Addr addr, size_t size, uint8_t *data)
Completes a previously started read transaction.
std::string csprintf(const char *format, const Args &...args)
uint64_t Serial
The Serial type is used to be able to uniquely identify a transaction as it passes through the system...
Generated on Tue Mar 23 2021 19:41:27 for gem5 by doxygen 1.8.17