gem5  v20.1.0.0
Classes | Public Types | Public Member Functions | Public Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
ElasticTrace Class Reference

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>

Inheritance diagram for ElasticTrace:
ProbeListenerObject SimObject EventManager Serializable Drainable Stats::Group

Classes

struct  ElasticTraceStats
 
struct  InstExecInfo
 
struct  TraceInfo
 

Public Types

typedef O3CPUImpl::DynInstPtr DynInstPtr
 
typedef O3CPUImpl::DynInstConstPtr DynInstConstPtr
 
typedef std::pair< InstSeqNum, PhysRegIndexSeqNumRegPair
 
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 ()
 
ProbeManagergetProbeManager ()
 
- Public Member Functions inherited from SimObject
const Paramsparams () 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...
 
ProbeManagergetProbeManager ()
 Get the probe manager for this object. More...
 
virtual PortgetPort (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
EventQueueeventQueue () 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 InforesolveStat (std::string name) const
 Resolve a stat by its name within this group. More...
 
 Group ()=delete
 
 Group (const Group &)=delete
 
Groupoperator= (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< depTraceItrdepTraceRevItr
 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, InstSeqNumphysRegDepMap
 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...
 
ProtoOutputStreamdataTraceStream
 Protobuf output stream for data dependency trace. More...
 
ProtoOutputStreaminstTraceStream
 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 SimObjectfind (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
ProbeManagermanager
 
std::vector< ProbeListener * > listeners
 
- Protected Attributes inherited from SimObject
const SimObjectParams * _params
 Cached copy of the object parameters. More...
 
- Protected Attributes inherited from EventManager
EventQueueeventq
 A pointer to this object's event queue. More...
 

Detailed Description

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.

Member Typedef Documentation

◆ depTraceItr

typedef std::vector<TraceInfo*>::iterator ElasticTrace::depTraceItr
private

Typedef of iterator to the instruction dependency trace.

Definition at line 334 of file elastic_trace.hh.

◆ depTraceRevItr

typedef std::reverse_iterator<depTraceItr> ElasticTrace::depTraceRevItr
private

Typedef of the reverse iterator to the instruction dependency trace.

Definition at line 337 of file elastic_trace.hh.

◆ DynInstConstPtr

Definition at line 89 of file elastic_trace.hh.

◆ DynInstPtr

Definition at line 88 of file elastic_trace.hh.

◆ Record

typedef ProtoMessage::InstDepRecord ElasticTrace::Record

Definition at line 94 of file elastic_trace.hh.

◆ RecordType

typedef ProtoMessage::InstDepRecord::RecordType ElasticTrace::RecordType

Trace record types corresponding to instruction node types.

Definition at line 93 of file elastic_trace.hh.

◆ SeqNumRegPair

Definition at line 90 of file elastic_trace.hh.

Constructor & Destructor Documentation

◆ ElasticTrace()

ElasticTrace::ElasticTrace ( const ElasticTraceParams *  params)

Constructor.

Definition at line 47 of file elastic_trace.cc.

References regEtraceListeners().

Member Function Documentation

◆ addCommittedInst()

void ElasticTrace::addCommittedInst ( const DynInstConstPtr head_inst)

Add an instruction that is at the head of the ROB and is committed.

Parameters
head_instpointer 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().

◆ addDepTraceRecord()

void ElasticTrace::addDepTraceRecord ( const DynInstConstPtr head_inst,
InstExecInfo exec_info_ptr,
bool  commit 
)
private

◆ 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.

Parameters
head_instpointer 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().

◆ assignRobDep()

void ElasticTrace::assignRobDep ( TraceInfo past_record,
TraceInfo new_record 
)
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.

Parameters
new_recordpointer to new record
past_recordpointer 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().

◆ clearTempStoreUntil()

void ElasticTrace::clearTempStoreUntil ( const DynInstConstPtr head_inst)
private

Clear entries in the temporary store of execution info objects to free allocated memory until the present instruction being added to the trace.

Parameters
head_instpointer to dynamic instruction

Definition at line 650 of file elastic_trace.cc.

References lastClearedSeqNum, and tempStore.

Referenced by addCommittedInst(), and addSquashedInst().

◆ compDelayPhysRegDep()

void ElasticTrace::compDelayPhysRegDep ( TraceInfo past_record,
TraceInfo new_record 
)
private

Calculate the computational delay between an instruction and a subsequent instruction that has a Physical Register (data) dependency on it.

Parameters
past_recordPointer to instruction
new_recordPointer 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().

◆ compDelayRob()

void ElasticTrace::compDelayRob ( TraceInfo past_record,
TraceInfo new_record 
)
private

Calculate the computational delay between an instruction and a subsequent instruction that has an ROB (order) dependency on it.

Parameters
past_recordPointer to instruction
new_recordPointer 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().

◆ fetchReqTrace()

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.

Parameters
reqpointer 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().

◆ flushTraces()

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().

◆ hasCompCompleted()

bool ElasticTrace::hasCompCompleted ( TraceInfo past_record,
Tick  execute_tick 
) const
private

Check if past record is a comp node that completed earlier than the execute tick.

Parameters
past_recordpointer to past comp node
execute_ticktick with which to compare past comp node's completion tick
Returns
true if past record is comp completed earlier

Definition at line 643 of file elastic_trace.cc.

References ElasticTrace::TraceInfo::isComp(), and ElasticTrace::TraceInfo::toCommitTick.

Referenced by updateIssueOrderDep().

◆ hasLoadBeenSent()

bool ElasticTrace::hasLoadBeenSent ( TraceInfo past_record,
Tick  execute_tick 
) const
private

Check if past record is a load sent earlier than the execute tick.

Parameters
past_recordpointer to past load
execute_ticktick with which to compare past load's send tick
Returns
true if past record is load sent earlier

Definition at line 634 of file elastic_trace.cc.

References ElasticTrace::TraceInfo::commit, ElasticTrace::TraceInfo::executeTick, and ElasticTrace::TraceInfo::isLoad().

Referenced by updateIssueOrderDep().

◆ hasLoadCompleted()

bool ElasticTrace::hasLoadCompleted ( TraceInfo past_record,
Tick  execute_tick 
) const
private

Check if past record is a load that completed earlier than the execute tick.

Parameters
past_recordpointer to past load
execute_ticktick with which to compare past load's complete tick
Returns
true if past record is load completed earlier

Definition at line 626 of file elastic_trace.cc.

References ElasticTrace::TraceInfo::commit, ElasticTrace::TraceInfo::isLoad(), and ElasticTrace::TraceInfo::toCommitTick.

Referenced by updateCommitOrderDep().

◆ hasStoreCommitted()

bool ElasticTrace::hasStoreCommitted ( TraceInfo past_record,
Tick  execute_tick 
) const
private

Check if past record is a store sent earlier than the execute tick.

Parameters
past_recordpointer to past store
execute_ticktick with which to compare past store's commit tick
Returns
true if past record is store sent earlier

Definition at line 619 of file elastic_trace.cc.

References ElasticTrace::TraceInfo::commitTick, and ElasticTrace::TraceInfo::isStore().

Referenced by updateCommitOrderDep(), and updateIssueOrderDep().

◆ name()

const std::string ElasticTrace::name ( ) const
virtual

Returns the name of the trace probe listener.

Reimplemented from SimObject.

Definition at line 908 of file elastic_trace.cc.

References SimObject::name().

◆ recordExecTick()

void ElasticTrace::recordExecTick ( const DynInstConstPtr dyn_inst)

Populate the execute timestamp field in an InstExecInfo object for an instruction in flight.

Parameters
dyn_instpointer 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().

◆ recordToCommTick()

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.

Parameters
dyn_instpointer 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().

◆ regEtraceListeners()

void ElasticTrace::regEtraceListeners ( )

◆ regProbeListeners()

void ElasticTrace::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.

◆ removeRegDepMapEntry()

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.

Parameters
inst_reg_pairpair of inst. sequence no. and the register

Definition at line 291 of file elastic_trace.cc.

References DPRINTFR, and physRegDepMap.

Referenced by regEtraceListeners().

◆ updateCommitOrderDep()

void ElasticTrace::updateCommitOrderDep ( TraceInfo new_record,
bool  find_load_not_store 
)
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.

Parameters
new_recordpointer to new store record
find_load_not_storetrue 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().

◆ updateIssueOrderDep()

void ElasticTrace::updateIssueOrderDep ( TraceInfo new_record)
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.

Parameters
new_recordpointer 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().

◆ updateRegDep()

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.

Parameters
dyn_instpointer 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().

◆ writeDepTrace()

void ElasticTrace::writeDepTrace ( uint32_t  num_to_write)
private

Member Data Documentation

◆ allProbesReg

bool ElasticTrace::allProbesReg
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().

◆ cpu

FullO3CPU<O3CPUImpl>* ElasticTrace::cpu
private

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().

◆ dataTraceStream

ProtoOutputStream* ElasticTrace::dataTraceStream
private

Protobuf output stream for data dependency trace.

Definition at line 348 of file elastic_trace.hh.

Referenced by flushTraces(), and writeDepTrace().

◆ depTrace

std::vector<TraceInfo*> ElasticTrace::depTrace
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().

◆ depWindowSize

uint32_t ElasticTrace::depWindowSize
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().

◆ firstWin

bool ElasticTrace::firstWin
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().

◆ instTraceStream

ProtoOutputStream* ElasticTrace::instTraceStream
private

Protobuf output stream for instruction fetch trace.

Definition at line 351 of file elastic_trace.hh.

Referenced by fetchReqTrace(), and flushTraces().

◆ lastClearedSeqNum

InstSeqNum ElasticTrace::lastClearedSeqNum
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().

◆ physRegDepMap

std::unordered_map<PhysRegIndex, InstSeqNum> ElasticTrace::physRegDepMap
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().

◆ regEtraceListenersEvent

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().

◆ startTraceInst

const InstSeqNum ElasticTrace::startTraceInst
private

Number of instructions after which to enable tracing.

Definition at line 354 of file elastic_trace.hh.

Referenced by regProbeListeners().

◆ stats

ElasticTrace::ElasticTraceStats ElasticTrace::stats
private

◆ tempStore

std::unordered_map<InstSeqNum, InstExecInfo*> ElasticTrace::tempStore
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().

◆ traceInfoMap

std::unordered_map<InstSeqNum, TraceInfo*> ElasticTrace::traceInfoMap
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().

◆ traceVirtAddr

const bool ElasticTrace::traceVirtAddr
private

Whether to trace virtual addresses for memory requests.

Definition at line 365 of file elastic_trace.hh.

Referenced by writeDepTrace().


The documentation for this class was generated from the following files:

Generated on Wed Sep 30 2020 14:02:23 for gem5 by doxygen 1.8.17