gem5
v20.1.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 O3CPUImpl::DynInstPtr | DynInstPtr |
typedef O3CPUImpl::DynInstConstPtr | DynInstConstPtr |
typedef std::pair< InstSeqNum, PhysRegIndex > | SeqNumRegPair |
typedef ProtoMessage::InstDepRecord::RecordType | RecordType |
Trace record types corresponding to instruction node types. More... | |
typedef ProtoMessage::InstDepRecord | Record |
Public Types inherited from SimObject | |
typedef SimObjectParams | Params |
Public Member Functions | |
ElasticTrace (const ElasticTraceParams *params) | |
Constructor. More... | |
void | regProbeListeners () |
Register the probe listeners that is the methods called on a probe point notify() call. More... | |
void | regEtraceListeners () |
Register all listeners. More... | |
const std::string | name () const |
Returns the name of the trace probe listener. More... | |
void | flushTraces () |
Process any outstanding trace records, flush them out to the protobuf output streams and delete the streams at simulation exit. More... | |
void | fetchReqTrace (const RequestPtr &req) |
Take the fields of the request class object that are relevant to create an instruction fetch request. More... | |
void | recordExecTick (const DynInstConstPtr &dyn_inst) |
Populate the execute timestamp field in an InstExecInfo object for an instruction in flight. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
void | addCommittedInst (const DynInstConstPtr &head_inst) |
Add an instruction that is at the head of the ROB and is committed. More... | |
Public Member Functions inherited from ProbeListenerObject | |
ProbeListenerObject (const ProbeListenerObjectParams *params) | |
virtual | ~ProbeListenerObject () |
ProbeManager * | getProbeManager () |
Public Member Functions inherited from SimObject | |
const Params * | params () const |
SimObject (const Params *_params) | |
virtual | ~SimObject () |
virtual void | init () |
init() is called after all C++ SimObjects have been created and all ports are connected. More... | |
virtual void | loadState (CheckpointIn &cp) |
loadState() is called on each SimObject when restoring from a checkpoint. More... | |
virtual void | initState () |
initState() is called on each SimObject when not restoring from a checkpoint. More... | |
virtual void | regProbePoints () |
Register probe points for this object. More... | |
ProbeManager * | getProbeManager () |
Get the probe manager for this object. More... | |
virtual Port & | getPort (const std::string &if_name, PortID idx=InvalidPortID) |
Get a port with a given name and index. More... | |
virtual void | startup () |
startup() is the final initialization call before simulation. More... | |
DrainState | drain () override |
Provide a default implementation of the drain interface for objects that don't need draining. More... | |
virtual void | memWriteback () |
Write back dirty buffers to memory using functional writes. More... | |
virtual void | memInvalidate () |
Invalidate the contents of memory buffers. More... | |
void | serialize (CheckpointOut &cp) const override |
Serialize an object. More... | |
void | unserialize (CheckpointIn &cp) override |
Unserialize an object. More... | |
Public Member Functions inherited from 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. More... | |
void | setCurTick (Tick newVal) |
EventManager (EventManager &em) | |
Event manger manages events in the event queue. More... | |
EventManager (EventManager *em) | |
EventManager (EventQueue *eq) | |
Public Member Functions inherited from Serializable | |
Serializable () | |
virtual | ~Serializable () |
void | serializeSection (CheckpointOut &cp, const char *name) const |
Serialize an object into a new section. More... | |
void | serializeSection (CheckpointOut &cp, const std::string &name) const |
void | unserializeSection (CheckpointIn &cp, const char *name) |
Unserialize an a child object. More... | |
void | unserializeSection (CheckpointIn &cp, const std::string &name) |
Public Member Functions inherited from Drainable | |
DrainState | drainState () const |
Return the current drain state of an object. More... | |
virtual void | notifyFork () |
Notify a child process of a fork. More... | |
Public Member Functions inherited from Stats::Group | |
Group (Group *parent, const char *name=nullptr) | |
Construct a new statistics group. More... | |
virtual | ~Group () |
virtual void | regStats () |
Callback to set stat parameters. More... | |
virtual void | resetStats () |
Callback to reset stats. More... | |
virtual void | preDumpStats () |
Callback before stats are dumped. More... | |
void | addStat (Stats::Info *info) |
Register a stat with this group. More... | |
const std::map< std::string, Group * > & | getStatGroups () const |
Get all child groups associated with this object. More... | |
const std::vector< Info * > & | getStats () const |
Get all stats associated with this object. More... | |
void | addStatGroup (const char *name, Group *block) |
Add a stat block as a child of this block. More... | |
const Info * | resolveStat (std::string name) const |
Resolve a stat by its name within this group. More... | |
Group ()=delete | |
Group (const Group &)=delete | |
Group & | operator= (const Group &)=delete |
Public Attributes | |
EventFunctionWrapper | regEtraceListenersEvent |
Event to trigger registering this listener for all probe points. More... | |
Private Types | |
typedef std::vector< TraceInfo * >::iterator | depTraceItr |
Typedef of iterator to the instruction dependency trace. More... | |
typedef std::reverse_iterator< depTraceItr > | depTraceRevItr |
Typedef of the reverse iterator to the instruction dependency trace. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
bool | hasStoreCommitted (TraceInfo *past_record, Tick execute_tick) const |
Check if past record is a store sent earlier than the execute tick. More... | |
bool | hasLoadCompleted (TraceInfo *past_record, Tick execute_tick) const |
Check if past record is a load that completed earlier than the execute tick. More... | |
bool | hasLoadBeenSent (TraceInfo *past_record, Tick execute_tick) const |
Check if past record is a load sent earlier than the execute tick. More... | |
bool | hasCompCompleted (TraceInfo *past_record, Tick execute_tick) const |
Check if past record is a comp node that completed earlier than the execute tick. More... | |
Private Attributes | |
bool | firstWin |
Used for checking the first window for processing and writing of dependency trace. More... | |
std::unordered_map< InstSeqNum, InstExecInfo * > | tempStore |
Temporary store of InstExecInfo objects. More... | |
InstSeqNum | lastClearedSeqNum |
The last cleared instruction sequence number used to free up the memory allocated in the temporary store. More... | |
std::unordered_map< PhysRegIndex, InstSeqNum > | physRegDepMap |
Map for recording the producer of a physical register to check Read After Write dependencies. More... | |
std::vector< TraceInfo * > | depTrace |
The instruction dependency trace containing TraceInfo objects. More... | |
std::unordered_map< InstSeqNum, TraceInfo * > | traceInfoMap |
Map where the instruction sequence number is mapped to the pointer to the TraceInfo object. More... | |
uint32_t | depWindowSize |
The maximum distance for a dependency and is set by a top level level parameter. More... | |
ProtoOutputStream * | dataTraceStream |
Protobuf output stream for data dependency trace. More... | |
ProtoOutputStream * | instTraceStream |
Protobuf output stream for instruction fetch trace. More... | |
const InstSeqNum | startTraceInst |
Number of instructions after which to enable tracing. More... | |
bool | allProbesReg |
Whther the elastic trace listener has been registered for all probes. More... | |
const bool | traceVirtAddr |
Whether to trace virtual addresses for memory requests. More... | |
FullO3CPU< O3CPUImpl > * | cpu |
Pointer to the O3CPU that is this listener's parent a.k.a. More... | |
ElasticTrace::ElasticTraceStats | stats |
Additional Inherited Members | |
Static Public Member Functions inherited from SimObject | |
static void | serializeAll (CheckpointOut &cp) |
Serialize all SimObjects in the system. More... | |
static SimObject * | find (const char *name) |
Find the SimObject with the given name and return a pointer to it. More... | |
Static Public Member Functions inherited from Serializable | |
static const std::string & | currentSection () |
Gets the fully-qualified name of the active section. More... | |
static void | serializeAll (const std::string &cpt_dir) |
Serializes all the SimObjects. More... | |
static void | unserializeGlobals (CheckpointIn &cp) |
Protected Member Functions inherited from Drainable | |
Drainable () | |
virtual | ~Drainable () |
virtual void | drainResume () |
Resume execution after a successful drain. More... | |
void | signalDrainDone () const |
Signal that an object is drained. More... | |
Protected Attributes inherited from ProbeListenerObject | |
ProbeManager * | manager |
std::vector< ProbeListener * > | listeners |
Protected Attributes inherited from SimObject | |
const SimObjectParams * | _params |
Cached copy of the object parameters. More... | |
Protected Attributes inherited from EventManager | |
EventQueue * | eventq |
A pointer to this object's event queue. More... | |
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 84 of file elastic_trace.hh.
|
private |
Typedef of iterator to the instruction dependency trace.
Definition at line 334 of file elastic_trace.hh.
|
private |
Typedef of the reverse iterator to the instruction dependency trace.
Definition at line 337 of file elastic_trace.hh.
Definition at line 89 of file elastic_trace.hh.
Definition at line 88 of file elastic_trace.hh.
typedef ProtoMessage::InstDepRecord ElasticTrace::Record |
Definition at line 94 of file elastic_trace.hh.
typedef ProtoMessage::InstDepRecord::RecordType ElasticTrace::RecordType |
Trace record types corresponding to instruction node types.
Definition at line 93 of file elastic_trace.hh.
Definition at line 90 of file elastic_trace.hh.
ElasticTrace::ElasticTrace | ( | const ElasticTraceParams * | params | ) |
void 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 329 of file elastic_trace.cc.
References addDepTraceRecord(), clearTempStoreUntil(), DPRINTF, DPRINTFR, ElasticTrace::InstExecInfo::executeTick, MaxTick, NoFault, tempStore, and 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 388 of file elastic_trace.cc.
References ElasticTrace::TraceInfo::commit, ElasticTrace::TraceInfo::commitTick, ElasticTrace::TraceInfo::compDelay, compDelayPhysRegDep(), curTick(), depTrace, depWindowSize, DPRINTF, ElasticTrace::InstExecInfo::executeTick, ElasticTrace::TraceInfo::executeTick, firstWin, ElasticTrace::TraceInfo::instNum, ElasticTrace::TraceInfo::numDepts, ElasticTrace::ElasticTraceStats::numRegDep, ElasticTrace::TraceInfo::pc, ElasticTrace::TraceInfo::physAddr, ElasticTrace::TraceInfo::physRegDepList, ElasticTrace::InstExecInfo::physRegDepSet, ElasticTrace::TraceInfo::reqFlags, ElasticTrace::TraceInfo::robDepList, ElasticTrace::TraceInfo::size, stats, ElasticTrace::InstExecInfo::toCommitTick, ElasticTrace::TraceInfo::toCommitTick, traceInfoMap, ElasticTrace::TraceInfo::type, updateCommitOrderDep(), updateIssueOrderDep(), ElasticTrace::TraceInfo::virtAddr, and writeDepTrace().
Referenced by addCommittedInst(), and addSquashedInst().
void 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 301 of file elastic_trace.cc.
References addDepTraceRecord(), clearTempStoreUntil(), DPRINTFR, ElasticTrace::InstExecInfo::executeTick, MaxTick, NoFault, tempStore, and ElasticTrace::InstExecInfo::toCommitTick.
Referenced by regEtraceListeners().
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 603 of file elastic_trace.cc.
References compDelayRob(), DPRINTF, ElasticTrace::TraceInfo::instNum, ElasticTrace::ElasticTraceStats::maxNumDependents, ElasticTrace::TraceInfo::numDepts, ElasticTrace::TraceInfo::robDepList, stats, ElasticTrace::TraceInfo::typeToStr(), and Stats::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 650 of file elastic_trace.cc.
References lastClearedSeqNum, and tempStore.
Referenced by addCommittedInst(), and addSquashedInst().
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 715 of file elastic_trace.cc.
References ElasticTrace::TraceInfo::commitTick, ElasticTrace::TraceInfo::compDelay, DPRINTF, ElasticTrace::TraceInfo::getExecuteTick(), ElasticTrace::TraceInfo::instNum, ElasticTrace::TraceInfo::isStore(), and ElasticTrace::TraceInfo::toCommitTick.
Referenced by addDepTraceRecord().
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 672 of file elastic_trace.cc.
References ElasticTrace::TraceInfo::commitTick, ElasticTrace::TraceInfo::compDelay, DPRINTF, ElasticTrace::TraceInfo::executeTick, ElasticTrace::TraceInfo::getExecuteTick(), ElasticTrace::TraceInfo::instNum, ElasticTrace::TraceInfo::isComp(), ElasticTrace::TraceInfo::isLoad(), ElasticTrace::TraceInfo::isStore(), and ElasticTrace::TraceInfo::toCommitTick.
Referenced by assignRobDep().
void 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 143 of file elastic_trace.cc.
References curTick(), DPRINTFR, instTraceStream, MemCmd::ReadReq, and ProtoOutputStream::write().
Referenced by regEtraceListeners().
void 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 914 of file elastic_trace.cc.
References dataTraceStream, depTrace, instTraceStream, and writeDepTrace().
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 643 of file elastic_trace.cc.
References ElasticTrace::TraceInfo::isComp(), and ElasticTrace::TraceInfo::toCommitTick.
Referenced by updateIssueOrderDep().
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 634 of file elastic_trace.cc.
References ElasticTrace::TraceInfo::commit, ElasticTrace::TraceInfo::executeTick, and ElasticTrace::TraceInfo::isLoad().
Referenced by updateIssueOrderDep().
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 626 of file elastic_trace.cc.
References ElasticTrace::TraceInfo::commit, ElasticTrace::TraceInfo::isLoad(), and ElasticTrace::TraceInfo::toCommitTick.
Referenced by updateCommitOrderDep().
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 619 of file elastic_trace.cc.
References ElasticTrace::TraceInfo::commitTick, and ElasticTrace::TraceInfo::isStore().
Referenced by updateCommitOrderDep(), and updateIssueOrderDep().
|
virtual |
Returns the name of the trace probe listener.
Reimplemented from SimObject.
Definition at line 908 of file elastic_trace.cc.
References SimObject::name().
void 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 165 of file elastic_trace.cc.
References curTick(), DPRINTFR, ElasticTrace::InstExecInfo::executeTick, lastClearedSeqNum, ElasticTrace::ElasticTraceStats::maxTempStoreSize, stats, tempStore, and Stats::ScalarBase< Derived, Stor >::value().
Referenced by regEtraceListeners().
void 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 202 of file elastic_trace.cc.
References curTick(), DPRINTFR, tempStore, and ElasticTrace::InstExecInfo::toCommitTick.
Referenced by regEtraceListeners().
void ElasticTrace::regEtraceListeners | ( | ) |
Register all listeners.
Definition at line 113 of file elastic_trace.cc.
References addCommittedInst(), addSquashedInst(), allProbesReg, cpu, curTick(), fetchReqTrace(), inform, ProbeListenerObject::listeners, 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 SimObject.
Definition at line 96 of file elastic_trace.cc.
References cpu, curTick(), BaseCPU::getContext(), inform, regEtraceListeners(), regEtraceListenersEvent, ThreadContext::scheduleInstCountEvent(), and startTraceInst.
void 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 291 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 516 of file elastic_trace.cc.
References assignRobDep(), curTick(), depTrace, depWindowSize, hasLoadCompleted(), hasStoreCommitted(), ElasticTrace::TraceInfo::isStore(), 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 557 of file elastic_trace.cc.
References assignRobDep(), curTick(), depTrace, depWindowSize, ElasticTrace::TraceInfo::executeTick, hasCompCompleted(), hasLoadBeenSent(), hasStoreCommitted(), ElasticTrace::TraceInfo::isLoad(), ElasticTrace::TraceInfo::isStore(), ElasticTrace::ElasticTraceStats::numIssueOrderDepLoads, ElasticTrace::ElasticTraceStats::numIssueOrderDepOther, ElasticTrace::ElasticTraceStats::numIssueOrderDepStores, stats, and ElasticTrace::TraceInfo::toCommitTick.
Referenced by addDepTraceRecord().
void 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 223 of file elastic_trace.cc.
References RegId::className(), PhysRegId::className(), depWindowSize, DPRINTFR, PhysRegId::flatIndex(), RegId::isMiscReg(), RegId::isZeroReg(), lastClearedSeqNum, ElasticTrace::ElasticTraceStats::maxPhysRegDepMapSize, physRegDepMap, ElasticTrace::InstExecInfo::physRegDepSet, stats, tempStore, and Stats::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 774 of file elastic_trace.cc.
References ElasticTrace::TraceInfo::commitTick, ElasticTrace::TraceInfo::compDelay, dataTraceStream, depTrace, DPRINTFR, ElasticTrace::TraceInfo::executeTick, firstWin, ElasticTrace::TraceInfo::instNum, ElasticTrace::TraceInfo::isComp(), ElasticTrace::TraceInfo::isLoad(), ElasticTrace::TraceInfo::isStore(), ElasticTrace::TraceInfo::numDepts, ElasticTrace::ElasticTraceStats::numFilteredNodes, ElasticTrace::TraceInfo::pc, ElasticTrace::TraceInfo::physAddr, ElasticTrace::TraceInfo::physRegDepList, ElasticTrace::TraceInfo::reqFlags, ElasticTrace::TraceInfo::robDepList, ElasticTrace::TraceInfo::size, stats, ElasticTrace::TraceInfo::toCommitTick, traceInfoMap, traceVirtAddr, ElasticTrace::TraceInfo::type, ElasticTrace::TraceInfo::typeToStr(), 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 362 of file elastic_trace.hh.
Referenced by regEtraceListeners().
Pointer to the O3CPU that is this listener's parent a.k.a.
manager
Definition at line 368 of file elastic_trace.hh.
Referenced by regEtraceListeners(), and regProbeListeners().
|
private |
Protobuf output stream for data dependency trace.
Definition at line 348 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 325 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 345 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 187 of file elastic_trace.hh.
Referenced by addDepTraceRecord(), and writeDepTrace().
|
private |
Protobuf output stream for instruction fetch trace.
Definition at line 351 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 233 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 240 of file elastic_trace.hh.
Referenced by removeRegDepMapEntry(), and updateRegDep().
EventFunctionWrapper ElasticTrace::regEtraceListenersEvent |
Event to trigger registering this listener for all probe points.
Definition at line 179 of file elastic_trace.hh.
Referenced by regProbeListeners().
|
private |
Number of instructions after which to enable tracing.
Definition at line 354 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 227 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 331 of file elastic_trace.hh.
Referenced by addDepTraceRecord(), and writeDepTrace().
|
private |
Whether to trace virtual addresses for memory requests.
Definition at line 365 of file elastic_trace.hh.
Referenced by writeDepTrace().