gem5 v24.0.0.0
|
The elastic trace is a type of probe listener and listens to probe points in multiple stages of the O3CPU. More...
#include <elastic_trace.hh>
Classes | |
struct | ElasticTraceStats |
struct | InstExecInfo |
struct | TraceInfo |
Public Types | |
typedef std::pair< InstSeqNum, RegIndex > | SeqNumRegPair |
typedef ProtoMessage::InstDepRecord::RecordType | RecordType |
Trace record types corresponding to instruction node types. | |
typedef ProtoMessage::InstDepRecord | Record |
Public Types inherited from gem5::SimObject | |
typedef SimObjectParams | Params |
Public Member Functions | |
ElasticTrace (const ElasticTraceParams ¶ms) | |
Constructor. | |
void | regProbeListeners () |
Register the probe listeners that is the methods called on a probe point notify() call. | |
void | regEtraceListeners () |
Register all listeners. | |
void | flushTraces () |
Process any outstanding trace records, flush them out to the protobuf output streams and delete the streams at simulation exit. | |
void | fetchReqTrace (const RequestPtr &req) |
Take the fields of the request class object that are relevant to create an instruction fetch request. | |
void | recordExecTick (const DynInstConstPtr &dyn_inst) |
Populate the execute timestamp field in an InstExecInfo object for an instruction in flight. | |
void | recordToCommTick (const DynInstConstPtr &dyn_inst) |
Populate the timestamp field in an InstExecInfo object for an instruction in flight when it is execution is complete and it is ready to commit. | |
void | updateRegDep (const DynInstConstPtr &dyn_inst) |
Record a Read After Write physical register dependency if there has been a write to the source register and update the physical register map. | |
void | removeRegDepMapEntry (const SeqNumRegPair &inst_reg_pair) |
When an instruction gets squashed the destination register mapped to it is freed up in the rename stage. | |
void | addSquashedInst (const DynInstConstPtr &head_inst) |
Add an instruction that is at the head of the ROB and is squashed only if it is a load and a request was sent for it. | |
void | addCommittedInst (const DynInstConstPtr &head_inst) |
Add an instruction that is at the head of the ROB and is committed. | |
Public Member Functions inherited from gem5::ProbeListenerObject | |
ProbeListenerObject (const ProbeListenerObjectParams ¶ms) | |
virtual | ~ProbeListenerObject () |
ProbeManager * | getProbeManager () |
Public Member Functions inherited from gem5::SimObject | |
const Params & | params () const |
SimObject (const Params &p) | |
virtual | ~SimObject () |
virtual void | init () |
init() is called after all C++ SimObjects have been created and all ports are connected. | |
virtual void | loadState (CheckpointIn &cp) |
loadState() is called on each SimObject when restoring from a checkpoint. | |
virtual void | initState () |
initState() is called on each SimObject when not restoring from a checkpoint. | |
virtual void | regProbePoints () |
Register probe points for this object. | |
ProbeManager * | getProbeManager () |
Get the probe manager for this object. | |
virtual Port & | getPort (const std::string &if_name, PortID idx=InvalidPortID) |
Get a port with a given name and index. | |
virtual void | startup () |
startup() is the final initialization call before simulation. | |
DrainState | drain () override |
Provide a default implementation of the drain interface for objects that don't need draining. | |
virtual void | memWriteback () |
Write back dirty buffers to memory using functional writes. | |
virtual void | memInvalidate () |
Invalidate the contents of memory buffers. | |
void | serialize (CheckpointOut &cp) const override |
Serialize an object. | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. | |
Public Member Functions inherited from gem5::EventManager | |
EventQueue * | eventQueue () const |
void | schedule (Event &event, Tick when) |
void | deschedule (Event &event) |
void | reschedule (Event &event, Tick when, bool always=false) |
void | schedule (Event *event, Tick when) |
void | deschedule (Event *event) |
void | reschedule (Event *event, Tick when, bool always=false) |
void | wakeupEventQueue (Tick when=(Tick) -1) |
This function is not needed by the usual gem5 event loop but may be necessary in derived EventQueues which host gem5 on other schedulers. | |
void | setCurTick (Tick newVal) |
EventManager (EventManager &em) | |
Event manger manages events in the event queue. | |
EventManager (EventManager *em) | |
EventManager (EventQueue *eq) | |
Public Member Functions inherited from gem5::Serializable | |
Serializable () | |
virtual | ~Serializable () |
void | serializeSection (CheckpointOut &cp, const char *name) const |
Serialize an object into a new section. | |
void | serializeSection (CheckpointOut &cp, const std::string &name) const |
void | unserializeSection (CheckpointIn &cp, const char *name) |
Unserialize an a child object. | |
void | unserializeSection (CheckpointIn &cp, const std::string &name) |
Public Member Functions inherited from gem5::Drainable | |
DrainState | drainState () const |
Return the current drain state of an object. | |
virtual void | notifyFork () |
Notify a child process of a fork. | |
Public Member Functions inherited from gem5::statistics::Group | |
Group (Group *parent, const char *name=nullptr) | |
Construct a new statistics group. | |
virtual | ~Group () |
virtual void | regStats () |
Callback to set stat parameters. | |
virtual void | resetStats () |
Callback to reset stats. | |
virtual void | preDumpStats () |
Callback before stats are dumped. | |
void | addStat (statistics::Info *info) |
Register a stat with this group. | |
const std::map< std::string, Group * > & | getStatGroups () const |
Get all child groups associated with this object. | |
const std::vector< Info * > & | getStats () const |
Get all stats associated with this object. | |
void | addStatGroup (const char *name, Group *block) |
Add a stat block as a child of this block. | |
const Info * | resolveStat (std::string name) const |
Resolve a stat by its name within this group. | |
void | mergeStatGroup (Group *block) |
Merge the contents (stats & children) of a block to this block. | |
Group ()=delete | |
Group (const Group &)=delete | |
Group & | operator= (const Group &)=delete |
Public Member Functions inherited from gem5::Named | |
Named (const std::string &name_) | |
virtual | ~Named ()=default |
virtual std::string | name () const |
Public Attributes | |
EventFunctionWrapper | regEtraceListenersEvent |
Event to trigger registering this listener for all probe points. | |
Private Types | |
typedef std::vector< TraceInfo * >::iterator | depTraceItr |
Typedef of iterator to the instruction dependency trace. | |
typedef std::reverse_iterator< depTraceItr > | depTraceRevItr |
Typedef of the reverse iterator to the instruction dependency trace. | |
Private Member Functions | |
void | addDepTraceRecord (const DynInstConstPtr &head_inst, InstExecInfo *exec_info_ptr, bool commit) |
Add a record to the dependency trace depTrace which is a sequential container. | |
void | clearTempStoreUntil (const DynInstConstPtr &head_inst) |
Clear entries in the temporary store of execution info objects to free allocated memory until the present instruction being added to the trace. | |
void | compDelayRob (TraceInfo *past_record, TraceInfo *new_record) |
Calculate the computational delay between an instruction and a subsequent instruction that has an ROB (order) dependency on it. | |
void | compDelayPhysRegDep (TraceInfo *past_record, TraceInfo *new_record) |
Calculate the computational delay between an instruction and a subsequent instruction that has a Physical Register (data) dependency on it. | |
void | writeDepTrace (uint32_t num_to_write) |
Write out given number of records to the trace starting with the first record in depTrace and iterating through the trace in sequence. | |
void | updateCommitOrderDep (TraceInfo *new_record, bool find_load_not_store) |
Reverse iterate through the graph, search for a store-after-store or store-after-load dependency and update the new node's Rob dependency list. | |
void | updateIssueOrderDep (TraceInfo *new_record) |
Reverse iterate through the graph, search for an issue order dependency for a new node and update the new node's Rob dependency list. | |
void | assignRobDep (TraceInfo *past_record, TraceInfo *new_record) |
The new_record has an order dependency on a past_record, thus update the new record's Rob dependency list and increment the number of dependents of the past record. | |
bool | hasStoreCommitted (TraceInfo *past_record, Tick execute_tick) const |
Check if past record is a store sent earlier than the execute tick. | |
bool | hasLoadCompleted (TraceInfo *past_record, Tick execute_tick) const |
Check if past record is a load that completed earlier than the execute tick. | |
bool | hasLoadBeenSent (TraceInfo *past_record, Tick execute_tick) const |
Check if past record is a load sent earlier than the execute tick. | |
bool | hasCompCompleted (TraceInfo *past_record, Tick execute_tick) const |
Check if past record is a comp node that completed earlier than the execute tick. | |
Private Attributes | |
bool | firstWin |
Used for checking the first window for processing and writing of dependency trace. | |
std::unordered_map< InstSeqNum, InstExecInfo * > | tempStore |
Temporary store of InstExecInfo objects. | |
InstSeqNum | lastClearedSeqNum |
The last cleared instruction sequence number used to free up the memory allocated in the temporary store. | |
std::unordered_map< RegIndex, InstSeqNum > | physRegDepMap |
Map for recording the producer of a physical register to check Read After Write dependencies. | |
std::vector< TraceInfo * > | depTrace |
The instruction dependency trace containing TraceInfo objects. | |
std::unordered_map< InstSeqNum, TraceInfo * > | traceInfoMap |
Map where the instruction sequence number is mapped to the pointer to the TraceInfo object. | |
uint32_t | depWindowSize |
The maximum distance for a dependency and is set by a top level level parameter. | |
ProtoOutputStream * | dataTraceStream |
Protobuf output stream for data dependency trace. | |
ProtoOutputStream * | instTraceStream |
Protobuf output stream for instruction fetch trace. | |
const InstSeqNum | startTraceInst |
Number of instructions after which to enable tracing. | |
bool | allProbesReg |
Whther the elastic trace listener has been registered for all probes. | |
const bool | traceVirtAddr |
Whether to trace virtual addresses for memory requests. | |
CPU * | cpu |
Pointer to the O3CPU that is this listener's parent a.k.a. | |
gem5::o3::ElasticTrace::ElasticTraceStats | stats |
Additional Inherited Members | |
Static Public Member Functions inherited from gem5::SimObject | |
static void | serializeAll (const std::string &cpt_dir) |
Create a checkpoint by serializing all SimObjects in the system. | |
static SimObject * | find (const char *name) |
Find the SimObject with the given name and return a pointer to it. | |
static void | setSimObjectResolver (SimObjectResolver *resolver) |
There is a single object name resolver, and it is only set when simulation is restoring from checkpoints. | |
static SimObjectResolver * | getSimObjectResolver () |
There is a single object name resolver, and it is only set when simulation is restoring from checkpoints. | |
Static Public Member Functions inherited from gem5::Serializable | |
static const std::string & | currentSection () |
Gets the fully-qualified name of the active section. | |
static void | generateCheckpointOut (const std::string &cpt_dir, std::ofstream &outstream) |
Generate a checkpoint file so that the serialization can be routed to it. | |
Protected Member Functions inherited from gem5::Drainable | |
Drainable () | |
virtual | ~Drainable () |
virtual void | drainResume () |
Resume execution after a successful drain. | |
void | signalDrainDone () const |
Signal that an object is drained. | |
Protected Attributes inherited from gem5::ProbeListenerObject | |
ProbeManager * | manager |
std::vector< ProbeListener * > | listeners |
Protected Attributes inherited from gem5::SimObject | |
const SimObjectParams & | _params |
Cached copy of the object parameters. | |
Protected Attributes inherited from gem5::EventManager | |
EventQueue * | eventq |
A pointer to this object's event queue. | |
The elastic trace is a type of probe listener and listens to probe points in multiple stages of the O3CPU.
The notify method is called on a probe point typically when an instruction successfully progresses through that stage.
As different listener methods mapped to the different probe points execute, relevant information about the instruction, e.g. timestamps and register accesses, are captured and stored in temporary data structures. When the instruction progresses through the commit stage, the timing as well as dependency information about the instruction is finalised and encapsulated in a struct called TraceInfo. TraceInfo objects are collected in a list instead of writing them out to the trace file one a time. This is required as the trace is processed in chunks to evaluate order dependencies and computational delay in case an instruction does not have any register dependencies. By this we achieve a simpler algorithm during replay because every record in the trace can be hooked onto a record in its past. The trace is written out as a protobuf format output file.
The output trace can be read in and played back by the TraceCPU.
Definition at line 93 of file elastic_trace.hh.
|
private |
Typedef of iterator to the instruction dependency trace.
Definition at line 338 of file elastic_trace.hh.
|
private |
Typedef of the reverse iterator to the instruction dependency trace.
Definition at line 341 of file elastic_trace.hh.
typedef ProtoMessage::InstDepRecord gem5::o3::ElasticTrace::Record |
Definition at line 101 of file elastic_trace.hh.
typedef ProtoMessage::InstDepRecord::RecordType gem5::o3::ElasticTrace::RecordType |
Trace record types corresponding to instruction node types.
Definition at line 100 of file elastic_trace.hh.
Definition at line 97 of file elastic_trace.hh.
gem5::o3::ElasticTrace::ElasticTrace | ( | const ElasticTraceParams & | params | ) |
void gem5::o3::ElasticTrace::addCommittedInst | ( | const DynInstConstPtr & | head_inst | ) |
Add an instruction that is at the head of the ROB and is committed.
head_inst | pointer to dynamic instruction to be committed |
Definition at line 336 of file elastic_trace.cc.
References addDepTraceRecord(), clearTempStoreUntil(), DPRINTF, DPRINTFR, gem5::o3::ElasticTrace::InstExecInfo::executeTick, gem5::MaxTick, gem5::NoFault, tempStore, and gem5::o3::ElasticTrace::InstExecInfo::toCommitTick.
Referenced by regEtraceListeners().
|
private |
Add a record to the dependency trace depTrace which is a sequential container.
A record is inserted per committed instruction and in the same order as the order in which instructions are committed.
head_inst | Pointer to the instruction which is head of the ROB and ready to commit |
exec_info_ptr | Pointer to InstExecInfo for that instruction |
commit | True if instruction is committed, false if squashed |
Definition at line 395 of file elastic_trace.cc.
References gem5::o3::ElasticTrace::TraceInfo::commit, gem5::o3::ElasticTrace::TraceInfo::commitTick, gem5::o3::ElasticTrace::TraceInfo::compDelay, compDelayPhysRegDep(), gem5::curTick(), depTrace, depWindowSize, DPRINTF, gem5::o3::ElasticTrace::InstExecInfo::executeTick, gem5::o3::ElasticTrace::TraceInfo::executeTick, firstWin, gem5::o3::ElasticTrace::TraceInfo::instNum, gem5::o3::ElasticTrace::TraceInfo::numDepts, gem5::o3::ElasticTrace::ElasticTraceStats::numRegDep, gem5::o3::ElasticTrace::TraceInfo::pc, gem5::o3::ElasticTrace::TraceInfo::physAddr, gem5::o3::ElasticTrace::TraceInfo::physRegDepList, gem5::o3::ElasticTrace::InstExecInfo::physRegDepSet, gem5::o3::ElasticTrace::TraceInfo::reqFlags, gem5::o3::ElasticTrace::TraceInfo::robDepList, gem5::o3::ElasticTrace::TraceInfo::size, stats, gem5::o3::ElasticTrace::InstExecInfo::toCommitTick, gem5::o3::ElasticTrace::TraceInfo::toCommitTick, traceInfoMap, gem5::o3::ElasticTrace::TraceInfo::type, updateCommitOrderDep(), updateIssueOrderDep(), gem5::o3::ElasticTrace::TraceInfo::virtAddr, and writeDepTrace().
Referenced by addCommittedInst(), and addSquashedInst().
void gem5::o3::ElasticTrace::addSquashedInst | ( | const DynInstConstPtr & | head_inst | ) |
Add an instruction that is at the head of the ROB and is squashed only if it is a load and a request was sent for it.
head_inst | pointer to dynamic instruction to be squashed |
Definition at line 308 of file elastic_trace.cc.
References addDepTraceRecord(), clearTempStoreUntil(), DPRINTFR, gem5::o3::ElasticTrace::InstExecInfo::executeTick, gem5::MaxTick, gem5::NoFault, tempStore, and gem5::o3::ElasticTrace::InstExecInfo::toCommitTick.
Referenced by regEtraceListeners().
|
private |
The new_record has an order dependency on a past_record, thus update the new record's Rob dependency list and increment the number of dependents of the past record.
new_record | pointer to new record |
past_record | pointer to record that new_record has a rob dependency on |
Definition at line 610 of file elastic_trace.cc.
References compDelayRob(), DPRINTF, gem5::o3::ElasticTrace::TraceInfo::instNum, gem5::o3::ElasticTrace::ElasticTraceStats::maxNumDependents, gem5::o3::ElasticTrace::TraceInfo::numDepts, gem5::o3::ElasticTrace::TraceInfo::robDepList, stats, gem5::o3::ElasticTrace::TraceInfo::typeToStr(), and gem5::statistics::ScalarBase< Derived, Stor >::value().
Referenced by updateCommitOrderDep(), and updateIssueOrderDep().
|
private |
Clear entries in the temporary store of execution info objects to free allocated memory until the present instruction being added to the trace.
head_inst | pointer to dynamic instruction |
Definition at line 657 of file elastic_trace.cc.
References lastClearedSeqNum, and tempStore.
Referenced by addCommittedInst(), and addSquashedInst().
|
private |
Calculate the computational delay between an instruction and a subsequent instruction that has a Physical Register (data) dependency on it.
past_record | Pointer to instruction |
new_record | Pointer to subsequent instruction having a Physical Register dependency on the instruction pointed to by past_record |
Definition at line 722 of file elastic_trace.cc.
References gem5::o3::ElasticTrace::TraceInfo::commitTick, gem5::o3::ElasticTrace::TraceInfo::compDelay, DPRINTF, gem5::o3::ElasticTrace::TraceInfo::getExecuteTick(), gem5::o3::ElasticTrace::TraceInfo::instNum, gem5::o3::ElasticTrace::TraceInfo::isStore(), and gem5::o3::ElasticTrace::TraceInfo::toCommitTick.
Referenced by addDepTraceRecord().
|
private |
Calculate the computational delay between an instruction and a subsequent instruction that has an ROB (order) dependency on it.
past_record | Pointer to instruction |
new_record | Pointer to subsequent instruction having an ROB dependency on the instruction pointed to by past_record |
Definition at line 679 of file elastic_trace.cc.
References gem5::o3::ElasticTrace::TraceInfo::commitTick, gem5::o3::ElasticTrace::TraceInfo::compDelay, DPRINTF, gem5::o3::ElasticTrace::TraceInfo::executeTick, gem5::o3::ElasticTrace::TraceInfo::getExecuteTick(), gem5::o3::ElasticTrace::TraceInfo::instNum, gem5::o3::ElasticTrace::TraceInfo::isComp(), gem5::o3::ElasticTrace::TraceInfo::isLoad(), gem5::o3::ElasticTrace::TraceInfo::isStore(), and gem5::o3::ElasticTrace::TraceInfo::toCommitTick.
Referenced by assignRobDep().
void gem5::o3::ElasticTrace::fetchReqTrace | ( | const RequestPtr & | req | ) |
Take the fields of the request class object that are relevant to create an instruction fetch request.
It creates a protobuf message containing the request fields and writes it to instTraceStream.
req | pointer to the fetch request |
Definition at line 151 of file elastic_trace.cc.
References gem5::curTick(), DPRINTFR, instTraceStream, gem5::MemCmd::ReadReq, and ProtoOutputStream::write().
Referenced by regEtraceListeners().
void gem5::o3::ElasticTrace::flushTraces | ( | ) |
Process any outstanding trace records, flush them out to the protobuf output streams and delete the streams at simulation exit.
Definition at line 919 of file elastic_trace.cc.
References dataTraceStream, depTrace, instTraceStream, and writeDepTrace().
|
private |
Check if past record is a comp node that completed earlier than the execute tick.
past_record | pointer to past comp node |
execute_tick | tick with which to compare past comp node's completion tick |
Definition at line 650 of file elastic_trace.cc.
References gem5::o3::ElasticTrace::TraceInfo::isComp(), and gem5::o3::ElasticTrace::TraceInfo::toCommitTick.
Referenced by updateIssueOrderDep().
|
private |
Check if past record is a load sent earlier than the execute tick.
past_record | pointer to past load |
execute_tick | tick with which to compare past load's send tick |
Definition at line 641 of file elastic_trace.cc.
References gem5::o3::ElasticTrace::TraceInfo::commit, gem5::o3::ElasticTrace::TraceInfo::executeTick, and gem5::o3::ElasticTrace::TraceInfo::isLoad().
Referenced by updateIssueOrderDep().
|
private |
Check if past record is a load that completed earlier than the execute tick.
past_record | pointer to past load |
execute_tick | tick with which to compare past load's complete tick |
Definition at line 633 of file elastic_trace.cc.
References gem5::o3::ElasticTrace::TraceInfo::commit, gem5::o3::ElasticTrace::TraceInfo::isLoad(), and gem5::o3::ElasticTrace::TraceInfo::toCommitTick.
Referenced by updateCommitOrderDep().
|
private |
Check if past record is a store sent earlier than the execute tick.
past_record | pointer to past store |
execute_tick | tick with which to compare past store's commit tick |
Definition at line 626 of file elastic_trace.cc.
References gem5::o3::ElasticTrace::TraceInfo::commitTick, and gem5::o3::ElasticTrace::TraceInfo::isStore().
Referenced by updateCommitOrderDep(), and updateIssueOrderDep().
void gem5::o3::ElasticTrace::recordExecTick | ( | const DynInstConstPtr & | dyn_inst | ) |
Populate the execute timestamp field in an InstExecInfo object for an instruction in flight.
dyn_inst | pointer to dynamic instruction in flight |
Definition at line 173 of file elastic_trace.cc.
References gem5::curTick(), DPRINTFR, gem5::o3::ElasticTrace::InstExecInfo::executeTick, lastClearedSeqNum, gem5::o3::ElasticTrace::ElasticTraceStats::maxTempStoreSize, stats, tempStore, and gem5::statistics::ScalarBase< Derived, Stor >::value().
Referenced by regEtraceListeners().
void gem5::o3::ElasticTrace::recordToCommTick | ( | const DynInstConstPtr & | dyn_inst | ) |
Populate the timestamp field in an InstExecInfo object for an instruction in flight when it is execution is complete and it is ready to commit.
dyn_inst | pointer to dynamic instruction in flight |
Definition at line 210 of file elastic_trace.cc.
References gem5::curTick(), DPRINTFR, tempStore, and gem5::o3::ElasticTrace::InstExecInfo::toCommitTick.
Referenced by regEtraceListeners().
void gem5::o3::ElasticTrace::regEtraceListeners | ( | ) |
Register all listeners.
Definition at line 121 of file elastic_trace.cc.
References addCommittedInst(), addSquashedInst(), allProbesReg, cpu, gem5::curTick(), fetchReqTrace(), inform, gem5::ProbeListenerObject::listeners, gem5::BaseCPU::numSimulatedInsts(), recordExecTick(), recordToCommTick(), removeRegDepMapEntry(), and updateRegDep().
Referenced by ElasticTrace(), and regProbeListeners().
|
virtual |
Register the probe listeners that is the methods called on a probe point notify() call.
Reimplemented from gem5::SimObject.
Definition at line 104 of file elastic_trace.cc.
References cpu, gem5::curTick(), gem5::BaseCPU::getContext(), inform, regEtraceListeners(), regEtraceListenersEvent, gem5::ThreadContext::scheduleInstCountEvent(), and startTraceInst.
void gem5::o3::ElasticTrace::removeRegDepMapEntry | ( | const SeqNumRegPair & | inst_reg_pair | ) |
When an instruction gets squashed the destination register mapped to it is freed up in the rename stage.
Remove the register entry from the physRegDepMap as well to avoid dependencies on squashed instructions.
inst_reg_pair | pair of inst. sequence no. and the register |
Definition at line 298 of file elastic_trace.cc.
References DPRINTFR, and physRegDepMap.
Referenced by regEtraceListeners().
|
private |
Reverse iterate through the graph, search for a store-after-store or store-after-load dependency and update the new node's Rob dependency list.
If a dependency is found, then call the assignRobDep() method that updates the store with the dependency information. This function is only called when a new store node is added to the trace.
new_record | pointer to new store record |
find_load_not_store | true for searching store-after-load and false for searching store-after-store dependency |
Definition at line 523 of file elastic_trace.cc.
References assignRobDep(), gem5::curTick(), depTrace, depWindowSize, hasLoadCompleted(), hasStoreCommitted(), gem5::o3::ElasticTrace::TraceInfo::isStore(), gem5::o3::ElasticTrace::ElasticTraceStats::numRegDep, and stats.
Referenced by addDepTraceRecord().
|
private |
Reverse iterate through the graph, search for an issue order dependency for a new node and update the new node's Rob dependency list.
If a dependency is found, call the assignRobDep() method that updates the node with its dependency information. This function is called in case a new node to be added to the trace is dependency-free or its dependency got discarded because the dependency was outside the window.
new_record | pointer to new record to be added to the trace |
Definition at line 564 of file elastic_trace.cc.
References assignRobDep(), gem5::curTick(), depTrace, depWindowSize, gem5::o3::ElasticTrace::TraceInfo::executeTick, hasCompCompleted(), hasLoadBeenSent(), hasStoreCommitted(), gem5::o3::ElasticTrace::TraceInfo::isLoad(), gem5::o3::ElasticTrace::TraceInfo::isStore(), gem5::o3::ElasticTrace::ElasticTraceStats::numIssueOrderDepLoads, gem5::o3::ElasticTrace::ElasticTraceStats::numIssueOrderDepOther, gem5::o3::ElasticTrace::ElasticTraceStats::numIssueOrderDepStores, stats, and gem5::o3::ElasticTrace::TraceInfo::toCommitTick.
Referenced by addDepTraceRecord().
void gem5::o3::ElasticTrace::updateRegDep | ( | const DynInstConstPtr & | dyn_inst | ) |
Record a Read After Write physical register dependency if there has been a write to the source register and update the physical register map.
For this look up the physRegDepMap with this instruction as the writer of its destination register. If the dependency falls outside the window it is assumed as already complete. Duplicate entries are avoided.
dyn_inst | pointer to dynamic instruction in flight |
Definition at line 231 of file elastic_trace.cc.
References gem5::PhysRegId::className(), gem5::RegId::className(), depWindowSize, DPRINTFR, gem5::PhysRegId::flatIndex(), gem5::InvalidRegClass, gem5::RegId::is(), lastClearedSeqNum, gem5::o3::ElasticTrace::ElasticTraceStats::maxPhysRegDepMapSize, gem5::MiscRegClass, physRegDepMap, gem5::o3::ElasticTrace::InstExecInfo::physRegDepSet, stats, tempStore, and gem5::statistics::ScalarBase< Derived, Stor >::value().
Referenced by regEtraceListeners().
|
private |
Write out given number of records to the trace starting with the first record in depTrace and iterating through the trace in sequence.
A record is deleted after it is written.
num_to_write | Number of records to write to the trace |
Definition at line 781 of file elastic_trace.cc.
References gem5::o3::ElasticTrace::TraceInfo::commitTick, gem5::o3::ElasticTrace::TraceInfo::compDelay, dataTraceStream, depTrace, DPRINTFR, gem5::o3::ElasticTrace::TraceInfo::executeTick, firstWin, gem5::o3::ElasticTrace::TraceInfo::instNum, gem5::o3::ElasticTrace::TraceInfo::isComp(), gem5::o3::ElasticTrace::TraceInfo::isLoad(), gem5::o3::ElasticTrace::TraceInfo::isStore(), gem5::o3::ElasticTrace::TraceInfo::numDepts, gem5::o3::ElasticTrace::ElasticTraceStats::numFilteredNodes, gem5::o3::ElasticTrace::TraceInfo::pc, gem5::o3::ElasticTrace::TraceInfo::physAddr, gem5::o3::ElasticTrace::TraceInfo::physRegDepList, gem5::o3::ElasticTrace::TraceInfo::reqFlags, gem5::o3::ElasticTrace::TraceInfo::robDepList, gem5::o3::ElasticTrace::TraceInfo::size, stats, gem5::o3::ElasticTrace::TraceInfo::toCommitTick, traceInfoMap, traceVirtAddr, gem5::o3::ElasticTrace::TraceInfo::type, gem5::o3::ElasticTrace::TraceInfo::typeToStr(), gem5::o3::ElasticTrace::TraceInfo::virtAddr, and ProtoOutputStream::write().
Referenced by addDepTraceRecord(), and flushTraces().
|
private |
Whther the elastic trace listener has been registered for all probes.
When enabling tracing after a specified number of instructions have committed, check this to prevent re-registering the listener.
Definition at line 366 of file elastic_trace.hh.
Referenced by regEtraceListeners().
|
private |
Pointer to the O3CPU that is this listener's parent a.k.a.
manager
Definition at line 372 of file elastic_trace.hh.
Referenced by regEtraceListeners(), and regProbeListeners().
|
private |
Protobuf output stream for data dependency trace.
Definition at line 352 of file elastic_trace.hh.
Referenced by flushTraces(), and writeDepTrace().
|
private |
The instruction dependency trace containing TraceInfo objects.
The container implemented is sequential as dependencies obey commit order (program order). For example, if B is dependent on A then B must be committed after A. Thus records are updated with dependency information and written to the trace in commit order. This ensures that when a graph is reconstructed from the trace during replay, all the dependencies are stored in the graph before the dependent itself is added. This facilitates creating a tree data structure during replay, i.e. adding children as records are read from the trace in an efficient manner.
Definition at line 329 of file elastic_trace.hh.
Referenced by addDepTraceRecord(), flushTraces(), updateCommitOrderDep(), updateIssueOrderDep(), and writeDepTrace().
|
private |
The maximum distance for a dependency and is set by a top level level parameter.
It must be equal to or greater than the number of entries in the ROB. This variable is used as the length of the sliding window for processing the dependency trace.
Definition at line 349 of file elastic_trace.hh.
Referenced by addDepTraceRecord(), updateCommitOrderDep(), updateIssueOrderDep(), and updateRegDep().
|
private |
Used for checking the first window for processing and writing of dependency trace.
At the start of the program there can be dependency- free instructions and such cases are handled differently.
Definition at line 191 of file elastic_trace.hh.
Referenced by addDepTraceRecord(), and writeDepTrace().
|
private |
Protobuf output stream for instruction fetch trace.
Definition at line 355 of file elastic_trace.hh.
Referenced by fetchReqTrace(), and flushTraces().
|
private |
The last cleared instruction sequence number used to free up the memory allocated in the temporary store.
Definition at line 237 of file elastic_trace.hh.
Referenced by clearTempStoreUntil(), recordExecTick(), and updateRegDep().
|
private |
Map for recording the producer of a physical register to check Read After Write dependencies.
The key is the renamed physical register and the value is the instruction sequence number of its last producer.
Definition at line 244 of file elastic_trace.hh.
Referenced by removeRegDepMapEntry(), and updateRegDep().
EventFunctionWrapper gem5::o3::ElasticTrace::regEtraceListenersEvent |
Event to trigger registering this listener for all probe points.
Definition at line 183 of file elastic_trace.hh.
Referenced by regProbeListeners().
|
private |
Number of instructions after which to enable tracing.
Definition at line 358 of file elastic_trace.hh.
Referenced by regProbeListeners().
|
private |
Referenced by addDepTraceRecord(), assignRobDep(), recordExecTick(), updateCommitOrderDep(), updateIssueOrderDep(), updateRegDep(), and writeDepTrace().
|
private |
Temporary store of InstExecInfo objects.
Later on when an instruction is processed for commit or retire, if it is chosen to be written to the output trace then this information is looked up using the instruction sequence number as the key. If it is not chosen then the entry for it in the store is cleared.
Definition at line 231 of file elastic_trace.hh.
Referenced by addCommittedInst(), addSquashedInst(), clearTempStoreUntil(), recordExecTick(), recordToCommTick(), and updateRegDep().
|
private |
Map where the instruction sequence number is mapped to the pointer to the TraceInfo object.
Definition at line 335 of file elastic_trace.hh.
Referenced by addDepTraceRecord(), and writeDepTrace().
|
private |
Whether to trace virtual addresses for memory requests.
Definition at line 369 of file elastic_trace.hh.
Referenced by writeDepTrace().