gem5 v24.0.0.0
|
The ByteTracker keeps track of transactions for the same byte – all outstanding reads, the completed reads (and what they observed) and write clusters (see WriteCluster). More...
#include <mem_checker.hh>
Public Member Functions | |
ByteTracker (Addr addr=0, const MemChecker *parent=NULL) | |
void | startRead (Serial serial, Tick start) |
Starts a read transaction. | |
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 such a read is expected to see. | |
bool | completeRead (Serial serial, Tick complete, uint8_t data) |
Completes a read transaction that is still outstanding. | |
void | startWrite (Serial serial, Tick start, uint8_t data) |
Starts a write transaction. | |
void | completeWrite (Serial serial, Tick complete) |
Completes a write transaction. | |
void | abortWrite (Serial serial) |
Aborts a write transaction. | |
const std::vector< uint8_t > & | lastExpectedData () const |
This function returns the expected data that inExpectedData iterated through in the last call. | |
Public Member Functions inherited from gem5::Named | |
Named (const std::string &name_) | |
virtual | ~Named ()=default |
virtual std::string | name () const |
Private Member Functions | |
WriteCluster * | getIncompleteWriteCluster () |
Convenience function to return the most recent incomplete write cluster. | |
template<class TList > | |
TList::iterator | lastCompletedTransaction (TList *l, Tick before) |
Helper function to return an iterator to the entry of a container of Transaction compatible classes, before a certain tick. | |
void | pruneTransactions () |
Prunes no longer needed transactions. | |
Private Attributes | |
std::map< Serial, Transaction > | outstandingReads |
Maintains a map of Serial -> Transaction for all outstanding reads. | |
TransactionList | readObservations |
List of completed reads, i.e. | |
WriteClusterList | writeClusters |
List of write clusters for this address. | |
std::vector< uint8_t > | _lastExpectedData |
See lastExpectedData(). | |
The ByteTracker keeps track of transactions for the same byte – all outstanding reads, the completed reads (and what they observed) and write clusters (see WriteCluster).
Definition at line 205 of file mem_checker.hh.
|
inline |
Definition at line 209 of file mem_checker.hh.
References gem5::MemChecker::DATA_INITIAL, readObservations, gem5::MemChecker::SERIAL_INITIAL, and gem5::MemChecker::TICK_INITIAL.
void gem5::MemChecker::ByteTracker::abortWrite | ( | MemChecker::Serial | serial | ) |
Aborts a write transaction.
Wrapper to abortWrite of WriteCluster instance.
serial | Unique identifier of a write previously started. |
Definition at line 276 of file mem_checker.cc.
Referenced by gem5::MemChecker::abortWrite().
bool gem5::MemChecker::ByteTracker::completeRead | ( | MemChecker::Serial | serial, |
Tick | complete, | ||
uint8_t | data ) |
Completes a read transaction that is still outstanding.
serial | Unique identifier of a read previously started. |
complete | When the read got a response. |
data | The data returned by the memory subsystem. |
Definition at line 226 of file mem_checker.cc.
Referenced by gem5::MemChecker::completeRead().
void gem5::MemChecker::ByteTracker::completeWrite | ( | MemChecker::Serial | serial, |
Tick | complete ) |
Completes a write transaction.
Wrapper to startWrite of WriteCluster instance.
serial | Unique identifier of a write previously started. |
complete | When the write was sent off to the memory subsystem. |
Definition at line 268 of file mem_checker.cc.
Referenced by gem5::MemChecker::completeWrite().
|
private |
Convenience function to return the most recent incomplete write cluster.
Instantiates new write cluster if the most recent one has been completed.
Definition at line 251 of file mem_checker.cc.
Given a start and end time (of any read transaction), this function iterates through all data that such a read is expected to see.
The data parameter is the actual value that we observed, and the function immediately returns true when a match is found, false otherwise.
The set of expected data are:
start | Start time of transaction to validate. |
complete | End time of transaction to validate. |
data | The value that we have actually seen. |
Definition at line 132 of file mem_checker.cc.
References gem5::MemChecker::Transaction::complete, data, gem5::MemChecker::Transaction::data, DPRINTF, gem5::MemChecker::Transaction::start, and gem5::MemChecker::TICK_INITIAL.
|
inlineprivate |
Helper function to return an iterator to the entry of a container of Transaction compatible classes, before a certain tick.
before | Tick value which should be greater than the completion tick of the returned element. |
Definition at line 325 of file mem_checker.hh.
References gem5::MipsISA::l.
|
inline |
This function returns the expected data that inExpectedData iterated through in the last call.
If inExpectedData last returned true, the set may be incomplete; if inExpectedData last returned false, the vector will contain the full set.
Definition at line 301 of file mem_checker.hh.
References _lastExpectedData.
Referenced by gem5::MemChecker::completeRead().
|
private |
Prunes no longer needed transactions.
We only keep up to the last / most recent of each, readObservations and writeClusters, before the first outstanding read.
It depends on the contention / overlap between memory operations to the same location of a particular workload how large each of them would grow.
Definition at line 282 of file mem_checker.cc.
References gem5::curTick().
void gem5::MemChecker::ByteTracker::startRead | ( | MemChecker::Serial | serial, |
Tick | start ) |
Starts a read transaction.
serial | Unique identifier for the read. |
start | When the read was sent off to the memory subsystem. |
Definition at line 125 of file mem_checker.cc.
References gem5::MemChecker::TICK_FUTURE.
Referenced by gem5::MemChecker::startRead().
void gem5::MemChecker::ByteTracker::startWrite | ( | MemChecker::Serial | serial, |
Tick | start, | ||
uint8_t | data ) |
Starts a write transaction.
Wrapper to startWrite of WriteCluster instance.
serial | Unique identifier of the write. |
start | When the write was sent off to the memory subsystem. |
data | The data that this write passed to the memory subsystem. |
Definition at line 261 of file mem_checker.cc.
References data, and gem5::MemChecker::WriteCluster::startWrite().
Referenced by gem5::MemChecker::startWrite().
|
private |
See lastExpectedData().
Definition at line 372 of file mem_checker.hh.
Referenced by lastExpectedData().
|
private |
Maintains a map of Serial -> Transaction for all outstanding reads.
Use an ordered map here, as this makes pruneTransactions() more efficient (find first outstanding read).
Definition at line 357 of file mem_checker.hh.
|
private |
List of completed reads, i.e.
observations of reads.
Definition at line 362 of file mem_checker.hh.
Referenced by ByteTracker().
|
private |
List of write clusters for this address.
Definition at line 367 of file mem_checker.hh.