gem5  v20.1.0.0
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Trace::TarmacTracerRecord Class Reference

TarmacTracer Record: Record generated by the TarmacTracer for every executed instruction. More...

#include <tarmac_record.hh>

Inheritance diagram for Trace::TarmacTracerRecord:
Trace::TarmacBaseRecord Trace::InstRecord Trace::TarmacTracerRecordV8

Classes

struct  TraceInstEntry
 Instruction Entry. More...
 
struct  TraceMemEntry
 Memory Entry. More...
 
struct  TraceRegEntry
 Register Entry. More...
 

Public Types

using InstPtr = std::unique_ptr< TraceInstEntry >
 
using MemPtr = std::unique_ptr< TraceMemEntry >
 
using RegPtr = std::unique_ptr< TraceRegEntry >
 
- Public Types inherited from Trace::TarmacBaseRecord
enum  TarmacRecordType { TARMAC_INST, TARMAC_REG, TARMAC_MEM, TARMAC_UNSUPPORTED }
 TARMAC trace record type. More...
 
enum  ISetState { ISET_ARM, ISET_THUMB, ISET_A64, ISET_UNSUPPORTED }
 ARM instruction set state. More...
 
enum  RegType {
  REG_R, REG_X, REG_S, REG_D,
  REG_P, REG_Q, REG_Z, REG_MISC
}
 ARM register type. More...
 

Public Member Functions

 TarmacTracerRecord (Tick _when, ThreadContext *_thread, const StaticInstPtr _staticInst, ArmISA::PCState _pc, TarmacTracer &_tracer, const StaticInstPtr _macroStaticInst=NULL)
 
virtual void dump () override
 
- Public Member Functions inherited from Trace::TarmacBaseRecord
 TarmacBaseRecord (Tick _when, ThreadContext *_thread, const StaticInstPtr _staticInst, ArmISA::PCState _pc, const StaticInstPtr _macroStaticInst=NULL)
 
- Public Member Functions inherited from Trace::InstRecord
 InstRecord (Tick _when, ThreadContext *_thread, const StaticInstPtr _staticInst, TheISA::PCState _pc, const StaticInstPtr _macroStaticInst=NULL)
 
virtual ~InstRecord ()
 
void setWhen (Tick new_when)
 
void setMem (Addr a, Addr s, unsigned f)
 
template<typename T , size_t N>
void setData (std::array< T, N > d)
 
void setData (uint64_t d)
 
void setData (uint32_t d)
 
void setData (uint16_t d)
 
void setData (uint8_t d)
 
void setData (int64_t d)
 
void setData (int32_t d)
 
void setData (int16_t d)
 
void setData (int8_t d)
 
void setData (double d)
 
void setData (::VecRegContainer< TheISA::VecRegSizeBytes > &d)
 
void setData (::VecPredRegContainer< TheISA::VecPredRegSizeBits, TheISA::VecPredRegHasPackedRepr > &d)
 
void setFetchSeq (InstSeqNum seq)
 
void setCPSeq (InstSeqNum seq)
 
void setPredicate (bool val)
 
void setFaulting (bool val)
 
Tick getWhen () const
 
ThreadContextgetThread () const
 
StaticInstPtr getStaticInst () const
 
TheISA::PCState getPCState () const
 
StaticInstPtr getMacroStaticInst () const
 
Addr getAddr () const
 
Addr getSize () const
 
unsigned getFlags () const
 
bool getMemValid () const
 
uint64_t getIntData () const
 
double getFloatData () const
 
int getDataStatus () const
 
InstSeqNum getFetchSeq () const
 
bool getFetchSeqValid () const
 
InstSeqNum getCpSeq () const
 
bool getCpSeqValid () const
 
bool getFaulting () const
 

Protected Member Functions

virtual void addInstEntry (std::vector< InstPtr > &queue, const TarmacContext &ptr)
 Generates an Entry for the executed instruction. More...
 
virtual void addMemEntry (std::vector< MemPtr > &queue, const TarmacContext &ptr)
 Generates an Entry for every triggered memory access. More...
 
virtual void addRegEntry (std::vector< RegPtr > &queue, const TarmacContext &ptr)
 Generate an Entry for every register being written. More...
 
template<typename RegEntry >
RegEntry genRegister (const TarmacContext &tarmCtx, const RegId &reg)
 Generate and update a register entry. More...
 
template<typename RegEntry >
void mergeCCEntry (std::vector< RegPtr > &queue, const TarmacContext &tarmCtx)
 
template<typename Queue >
void flushQueues (Queue &queue)
 Flush queues to the trace output. More...
 
template<typename Queue , typename... Args>
void flushQueues (Queue &queue, Args &... args)
 

Protected Attributes

TarmacTracertracer
 Reference to tracer. More...
 
- Protected Attributes inherited from Trace::InstRecord
Tick when
 
ThreadContextthread
 
StaticInstPtr staticInst
 
TheISA::PCState pc
 
StaticInstPtr macroStaticInst
 
Addr addr
 The address that was accessed. More...
 
Addr size
 The size of the memory request. More...
 
unsigned flags
 The flags that were assigned to the request. More...
 
union {
   uint64_t   as_int
 
   double   as_double
 
   ::VecRegContainer< TheISA::VecRegSizeBytes > *   as_vec
 
   ::VecPredRegContainer< TheISA::VecPredRegSizeBits, TheISA::VecPredRegHasPackedRepr > *   as_pred
 
data
 
InstSeqNum fetch_seq
 
InstSeqNum cp_seq
 
enum Trace::InstRecord::DataStatus data_status
 
bool mem_valid
 
bool fetch_seq_valid
 
bool cp_seq_valid
 
bool predicate
 is the predicate for execution this inst true or false (not execed)? More...
 
bool faulting
 Did the execution of this instruction fault? (requires ExecFaulting to be enabled) More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Trace::TarmacBaseRecord
static ISetState pcToISetState (ArmISA::PCState pc)
 Returns the Instruction Set State according to the current PCState. More...
 
- Protected Types inherited from Trace::InstRecord
enum  DataStatus {
  DataInvalid = 0, DataInt8 = 1, DataInt16 = 2, DataInt32 = 4,
  DataInt64 = 8, DataDouble = 3, DataVec = 5, DataVecPred = 6
}
 

Detailed Description

TarmacTracer Record: Record generated by the TarmacTracer for every executed instruction.

The record is composed by a set of entries, matching the tracing capabilities provided by the Tarmac specifications:

Definition at line 89 of file tarmac_record.hh.

Member Typedef Documentation

◆ InstPtr

Definition at line 191 of file tarmac_record.hh.

◆ MemPtr

Definition at line 192 of file tarmac_record.hh.

◆ RegPtr

Definition at line 193 of file tarmac_record.hh.

Constructor & Destructor Documentation

◆ TarmacTracerRecord()

Trace::TarmacTracerRecord::TarmacTracerRecord ( Tick  _when,
ThreadContext _thread,
const StaticInstPtr  _staticInst,
ArmISA::PCState  _pc,
TarmacTracer _tracer,
const StaticInstPtr  _macroStaticInst = NULL 
)

Definition at line 107 of file tarmac_record.cc.

Member Function Documentation

◆ addInstEntry()

void Trace::TarmacTracerRecord::addInstEntry ( std::vector< InstPtr > &  queue,
const TarmacContext ptr 
)
protectedvirtual

Generates an Entry for the executed instruction.

Reimplemented in Trace::TarmacTracerRecordV8.

Definition at line 288 of file tarmac_record.cc.

References Trace::InstRecord::predicate.

Referenced by dump().

◆ addMemEntry()

void Trace::TarmacTracerRecord::addMemEntry ( std::vector< MemPtr > &  queue,
const TarmacContext ptr 
)
protectedvirtual

Generates an Entry for every triggered memory access.

Reimplemented in Trace::TarmacTracerRecordV8.

Definition at line 299 of file tarmac_record.cc.

References Trace::InstRecord::getAddr(), Trace::InstRecord::getIntData(), Trace::InstRecord::getMemValid(), and Trace::InstRecord::getSize().

Referenced by dump().

◆ addRegEntry()

void Trace::TarmacTracerRecord::addRegEntry ( std::vector< RegPtr > &  queue,
const TarmacContext ptr 
)
protectedvirtual

Generate an Entry for every register being written.

Reimplemented in Trace::TarmacTracerRecordV8.

Definition at line 315 of file tarmac_record.cc.

References StaticInst::destRegIdx(), StaticInst::numDestRegs(), X86ISA::reg, and Trace::InstRecord::staticInst.

Referenced by dump().

◆ dump()

void Trace::TarmacTracerRecord::dump ( )
overridevirtual

◆ flushQueues() [1/2]

template<typename Queue >
void Trace::TarmacTracerRecord::flushQueues ( Queue queue)
protected

Flush queues to the trace output.

Definition at line 389 of file tarmac_record.cc.

References Trace::output().

Referenced by dump(), and flushQueues().

◆ flushQueues() [2/2]

template<typename Queue , typename... Args>
void Trace::TarmacTracerRecord::flushQueues ( Queue queue,
Args &...  args 
)
protected

Definition at line 402 of file tarmac_record.cc.

References flushQueues().

◆ genRegister()

template<typename RegEntry >
RegEntry Trace::TarmacTracerRecord::genRegister ( const TarmacContext tarmCtx,
const RegId reg 
)
inlineprotected

Generate and update a register entry.

Definition at line 212 of file tarmac_record.hh.

References X86ISA::reg.

◆ mergeCCEntry()

template<typename RegEntry >
void Trace::TarmacTracerRecord::mergeCCEntry ( std::vector< RegPtr > &  queue,
const TarmacContext tarmCtx 
)
inlineprotected

Definition at line 222 of file tarmac_record.hh.

References ArmISA::MISCREG_CPSR, MiscRegClass, and X86ISA::reg.

Member Data Documentation

◆ tracer

TarmacTracer& Trace::TarmacTracerRecord::tracer
protected

Reference to tracer.

Definition at line 264 of file tarmac_record.hh.

Referenced by dump().


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

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