gem5
|
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 | InstExecInfo |
struct | TraceInfo |
Public Types | |
typedef O3CPUImpl::DynInstPtr | DynInstPtr |
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 DynInstPtr &dyn_inst) |
Populate the execute timestamp field in an InstExecInfo object for an instruction in flight. More... | |
void | recordToCommTick (const DynInstPtr &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 DynInstPtr &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 DynInstPtr &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 DynInstPtr &head_inst) |
Add an instruction that is at the head of the ROB and is committed. More... | |
void | regStats () |
Register statistics for the elastic trace. 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 | resetStats () |
Reset statistics associated with this object. More... | |
virtual void | regProbePoints () |
Register probe points for this object. More... | |
ProbeManager * | getProbeManager () |
Get the probe manager for this object. 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 | |
EventManager (EventManager &em) | |
EventManager (EventManager *em) | |
EventManager (EventQueue *eq) | |
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) |
void | setCurTick (Tick newVal) |
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 Attributes | |
EventWrapper< ElasticTrace,&ElasticTrace::regEtraceListeners > | 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 DynInstPtr &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 DynInstPtr 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... | |
Stats::Scalar | numRegDep |
Number of register dependencies recorded during tracing. More... | |
Stats::Scalar | numOrderDepStores |
Number of stores that got assigned a commit order dependency on a past load/store. More... | |
Stats::Scalar | numIssueOrderDepLoads |
Number of load insts that got assigned an issue order dependency because they were dependency-free. More... | |
Stats::Scalar | numIssueOrderDepStores |
Number of store insts that got assigned an issue order dependency because they were dependency-free. More... | |
Stats::Scalar | numIssueOrderDepOther |
Number of non load/store insts that got assigned an issue order dependency because they were dependency-free. More... | |
Stats::Scalar | numFilteredNodes |
Number of filtered nodes. More... | |
Stats::Scalar | maxNumDependents |
Maximum number of dependents on any instruction. More... | |
Stats::Scalar | maxTempStoreSize |
Maximum size of the temporary store mostly useful as a check that it is not growing. More... | |
Stats::Scalar | maxPhysRegDepMapSize |
Maximum size of the map that holds the last writer to a physical register. More... | |
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 () |
Get the fully-qualified name of the active section. More... | |
static void | serializeAll (const std::string &cpt_dir) |
static void | unserializeGlobals (CheckpointIn &cp) |
Static Public Attributes inherited from Serializable | |
static int | ckptCount = 0 |
static int | ckptMaxCount = 0 |
static int | ckptPrevCount = -1 |
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 88 of file elastic_trace.hh.
|
private |
Typedef of iterator to the instruction dependency trace.
Definition at line 343 of file elastic_trace.hh.
|
private |
Typedef of the reverse iterator to the instruction dependency trace.
Definition at line 346 of file elastic_trace.hh.
Definition at line 92 of file elastic_trace.hh.
typedef ProtoMessage::InstDepRecord ElasticTrace::Record |
Definition at line 97 of file elastic_trace.hh.
typedef ProtoMessage::InstDepRecord::RecordType ElasticTrace::RecordType |
Trace record types corresponding to instruction node types.
Definition at line 96 of file elastic_trace.hh.
Definition at line 93 of file elastic_trace.hh.
ElasticTrace::ElasticTrace | ( | const ElasticTraceParams * | params | ) |
Constructor.
Definition at line 51 of file elastic_trace.cc.
References cpu, dataTraceStream, depWindowSize, fatal_if(), flushTraces(), SimClock::Frequency, instTraceStream, name(), registerExitCallback(), OutputDirectory::resolve(), simout, and ProtoOutputStream::write().
void ElasticTrace::addCommittedInst | ( | const DynInstPtr & | 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 319 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 378 of file elastic_trace.cc.
References ElasticTrace::TraceInfo::asid, ArmISA::clear(), 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, numRegDep, ElasticTrace::TraceInfo::pc, ElasticTrace::TraceInfo::physAddr, ElasticTrace::TraceInfo::physRegDepList, ElasticTrace::InstExecInfo::physRegDepSet, ElasticTrace::TraceInfo::reqFlags, ElasticTrace::TraceInfo::robDepList, ElasticTrace::TraceInfo::size, 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 DynInstPtr & | 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 291 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 594 of file elastic_trace.cc.
References compDelayRob(), DPRINTF, ElasticTrace::TraceInfo::instNum, maxNumDependents, ElasticTrace::TraceInfo::numDepts, ElasticTrace::TraceInfo::robDepList, 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 641 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 706 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 663 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, Request::getFlags(), Request::getPaddr(), Request::getPC(), Request::getSize(), Request::getVaddr(), 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 939 of file elastic_trace.cc.
References dataTraceStream, depTrace, instTraceStream, and writeDepTrace().
Referenced by ElasticTrace().
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 634 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 625 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 617 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 610 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 933 of file elastic_trace.cc.
References SimObject::name().
Referenced by ElasticTrace(), and regStats().
void ElasticTrace::recordExecTick | ( | const DynInstPtr & | 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, maxTempStoreSize, tempStore, and Stats::ScalarBase< Derived, Stor >::value().
Referenced by regEtraceListeners().
void ElasticTrace::recordToCommTick | ( | const DynInstPtr & | 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 118 of file elastic_trace.cc.
References addCommittedInst(), addSquashedInst(), allProbesReg, cpu, curTick(), fetchReqTrace(), inform, ProbeListenerObject::listeners, BaseCPU::numSimulatedInsts(), recordExecTick(), recordToCommTick(), removeRegDepMapEntry(), and updateRegDep().
Referenced by regProbeListeners().
|
virtual |
Register the probe listeners that is the methods called on a probe point notify() call.
Reimplemented from SimObject.
Definition at line 101 of file elastic_trace.cc.
References cpu, curTick(), inform, regEtraceListeners(), regEtraceListenersEvent, EventManager::schedule(), and startTraceInst.
|
virtual |
Register statistics for the elastic trace.
Reimplemented from SimObject.
Definition at line 872 of file elastic_trace.cc.
References Stats::DataWrap< Derived, InfoProxyType >::desc(), maxNumDependents, maxPhysRegDepMapSize, maxTempStoreSize, name(), Stats::DataWrap< Derived, InfoProxyType >::name(), numFilteredNodes, numIssueOrderDepLoads, numIssueOrderDepOther, numIssueOrderDepStores, numOrderDepStores, numRegDep, and SimObject::regStats().
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 281 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 507 of file elastic_trace.cc.
References assignRobDep(), curTick(), depTrace, depWindowSize, hasLoadCompleted(), hasStoreCommitted(), ElasticTrace::TraceInfo::isStore(), and numOrderDepStores.
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 548 of file elastic_trace.cc.
References assignRobDep(), curTick(), depTrace, depWindowSize, ElasticTrace::TraceInfo::executeTick, hasCompCompleted(), hasLoadBeenSent(), hasStoreCommitted(), ElasticTrace::TraceInfo::isLoad(), ElasticTrace::TraceInfo::isStore(), numIssueOrderDepLoads, numIssueOrderDepOther, numIssueOrderDepStores, and ElasticTrace::TraceInfo::toCommitTick.
Referenced by addDepTraceRecord().
void ElasticTrace::updateRegDep | ( | const DynInstPtr & | 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 depWindowSize, DPRINTFR, lastClearedSeqNum, maxPhysRegDepMapSize, MiscRegClass, physRegDepMap, ElasticTrace::InstExecInfo::physRegDepSet, regIdxToClass(), tempStore, Stats::ScalarBase< Derived, Stor >::value(), and AlphaISA::ZeroReg.
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 765 of file elastic_trace.cc.
References ElasticTrace::TraceInfo::asid, 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, numFilteredNodes, ElasticTrace::TraceInfo::pc, ElasticTrace::TraceInfo::physAddr, ElasticTrace::TraceInfo::physRegDepList, ElasticTrace::TraceInfo::reqFlags, ElasticTrace::TraceInfo::robDepList, ElasticTrace::TraceInfo::size, 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 371 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 377 of file elastic_trace.hh.
Referenced by ElasticTrace(), regEtraceListeners(), and regProbeListeners().
|
private |
Protobuf output stream for data dependency trace.
Definition at line 357 of file elastic_trace.hh.
Referenced by ElasticTrace(), 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 334 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 354 of file elastic_trace.hh.
Referenced by addDepTraceRecord(), ElasticTrace(), 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 194 of file elastic_trace.hh.
Referenced by addDepTraceRecord(), and writeDepTrace().
|
private |
Protobuf output stream for instruction fetch trace.
Definition at line 360 of file elastic_trace.hh.
Referenced by ElasticTrace(), fetchReqTrace(), and flushTraces().
|
private |
The last cleared instruction sequence number used to free up the memory allocated in the temporary store.
Definition at line 240 of file elastic_trace.hh.
Referenced by clearTempStoreUntil(), recordExecTick(), and updateRegDep().
|
private |
Maximum number of dependents on any instruction.
Definition at line 547 of file elastic_trace.hh.
Referenced by assignRobDep(), and regStats().
|
private |
Maximum size of the map that holds the last writer to a physical register.
Definition at line 559 of file elastic_trace.hh.
Referenced by regStats(), and updateRegDep().
|
private |
Maximum size of the temporary store mostly useful as a check that it is not growing.
Definition at line 553 of file elastic_trace.hh.
Referenced by recordExecTick(), and regStats().
|
private |
Number of filtered nodes.
Definition at line 544 of file elastic_trace.hh.
Referenced by regStats(), and writeDepTrace().
|
private |
Number of load insts that got assigned an issue order dependency because they were dependency-free.
Definition at line 529 of file elastic_trace.hh.
Referenced by regStats(), and updateIssueOrderDep().
|
private |
Number of non load/store insts that got assigned an issue order dependency because they were dependency-free.
Definition at line 541 of file elastic_trace.hh.
Referenced by regStats(), and updateIssueOrderDep().
|
private |
Number of store insts that got assigned an issue order dependency because they were dependency-free.
Definition at line 535 of file elastic_trace.hh.
Referenced by regStats(), and updateIssueOrderDep().
|
private |
Number of stores that got assigned a commit order dependency on a past load/store.
Definition at line 523 of file elastic_trace.hh.
Referenced by regStats(), and updateCommitOrderDep().
|
private |
Number of register dependencies recorded during tracing.
Definition at line 517 of file elastic_trace.hh.
Referenced by addDepTraceRecord(), and regStats().
|
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 247 of file elastic_trace.hh.
Referenced by removeRegDepMapEntry(), and updateRegDep().
EventWrapper<ElasticTrace, &ElasticTrace::regEtraceListeners> ElasticTrace::regEtraceListenersEvent |
Event to trigger registering this listener for all probe points.
Definition at line 186 of file elastic_trace.hh.
Referenced by regProbeListeners().
|
private |
Number of instructions after which to enable tracing.
Definition at line 363 of file elastic_trace.hh.
Referenced by regProbeListeners().
|
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 234 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 340 of file elastic_trace.hh.
Referenced by addDepTraceRecord(), and writeDepTrace().
|
private |
Whether to trace virtual addresses for memory requests.
Definition at line 374 of file elastic_trace.hh.
Referenced by writeDepTrace().