48using namespace ArmISA;
107 return "Unsupported";
118 _pc, _macroStaticInst),
126 :
InstEntry(tarmCtx.thread, *tarmCtx.
pc, tarmCtx.staticInst, predicate),
127 disassemble(tarmCtx.tracer.disassemble(tarmCtx.staticInst, *tarmCtx.
pc))
137 instSize = (arm_inst->instSize() << 3);
147 [](
char&
c) { c = toupper(c); });
156 uint8_t _size,
Addr _addr, uint64_t _data)
176 switch (regId.classValue()) {
181 updateFloat(tarmCtx);
240 regName =
"f" + std::to_string(regId.index());
241 panic(
"ARM doesn't support float registers.");
255 std::string reg_suffix;
261 switch (regId.index()) {
266 regName =
"sp" + reg_suffix ;
269 regName =
"fp" + reg_suffix;
272 regName =
"lr" + reg_suffix;
275 regName =
"r" + std::to_string(regId.index());
288 std::make_unique<TraceInstEntry>(tarmCtx,
predicate)
301 std::make_unique<TraceMemEntry>(tarmCtx,
302 static_cast<uint8_t
>(
getSize()),
323 queue.push_back(std::make_unique<TraceRegEntry>(single_reg));
380template<
typename Queue>
386 for (
const auto &single_entry : queue) {
387 single_entry->print(outs);
393template<
typename Queue,
typename... Args>
405 const std::string &prefix)
const
412 ccprintf(outs,
"%s clk %s (%u) %08x %s %s %s_%s : %s\n",
420 secureMode?
"s" :
"ns",
428 const std::string &prefix)
const
432 ccprintf(outs,
"%s clk M%s%d %08x %0*x\n",
434 loadAccess?
"R" :
"W",
445 const std::string &prefix)
const
450 ccprintf(outs,
"%s clk R %s %08x\n",
MachInst encoding() const
Returns the real encoding of the instruction: the machInst field is in fact always 64 bit wide and co...
A high-level queue interface, to be used by both the MSHR queue and the write buffer.
T * get() const
Directly access the pointer itself without taking a reference.
Register ID: describe an architectural register with its class and index.
bool isFirstMicroop() const
uint8_t numDestRegs() const
Number of destination registers.
const RegId & destRegIdx(int i) const
Return logical index (architectural reg num) of i'th destination reg.
bool isLastMicroop() const
ThreadContext is the external interface to all thread state for anything outside of the CPU.
virtual RegVal getReg(const RegId ®) const
virtual RegVal readMiscRegNoEffect(RegIndex misc_reg) const =0
Addr addr
The address that was accessed.
StaticInstPtr macroStaticInst
std::unique_ptr< PCStateBase > pc
uint64_t getIntData() const
bool predicate
is the predicate for execution this inst true or false (not execed)?
union gem5::trace::InstRecord::Data data
Addr size
The size of the memory request.
ISetState
ARM instruction set state.
This object type is encapsulating the informations needed by a Tarmac record to generate it's own ent...
const StaticInstPtr staticInst
virtual void addInstEntry(std::vector< InstPtr > &queue, const TarmacContext &ptr)
Generates an Entry for the executed instruction.
void mergeCCEntry(std::vector< RegPtr > &queue, const TarmacContext &tarmCtx)
RegEntry genRegister(const TarmacContext &tarmCtx, const RegId ®)
Generate and update a register entry.
virtual void addRegEntry(std::vector< RegPtr > &queue, const TarmacContext &ptr)
Generate an Entry for every register being written.
virtual void dump() override
TarmacTracerRecord(Tick _when, ThreadContext *_thread, const StaticInstPtr _staticInst, const PCStateBase &_pc, TarmacTracer &_tracer, const StaticInstPtr _macroStaticInst=NULL)
void flushQueues(Queue &queue)
Flush queues to the trace output.
virtual void addMemEntry(std::vector< MemPtr > &queue, const TarmacContext &ptr)
Generates an Entry for every triggered memory access.
TarmacTracer & tracer
Reference to tracer.
Tarmac Tracer: this tracer generates a new Tarmac Record for every instruction being executed in gem5...
std::vector< InstPtr > instQueue
Collection of heterogeneous printable entries: could be representing either instructions,...
std::vector< RegPtr > regQueue
std::vector< MemPtr > memQueue
#define panic(...)
This implements a cprintf based panic() function.
const char *const RegName[NumRegs]
bool isSecure(ThreadContext *tc)
constexpr auto & StackPointerReg
constexpr auto & ReturnAddressReg
Bitfield< 24, 21 > opcode
const char *const miscRegName[]
constexpr auto & FramePointerReg
std::string iSetStateToStr(TarmacBaseRecord::ISetState isetstate)
Returns the string representation of the instruction set being currently run according to the Tarmac ...
std::string opModeToStr(OperatingMode opMode)
Returns the string representation of the ARM Operating Mode (CPSR.M[3:0] field) according to the Tarm...
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Tick curTick()
The universal simulation clock.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
uint64_t Tick
Tick count type.
std::string csprintf(const char *format, const Args &...args)
@ FloatRegClass
Floating-point register.
@ CCRegClass
Condition-code register.
@ VecRegClass
Vector Register.
@ IntRegClass
Integer register.
@ MiscRegClass
Control (misc) register.
void ccprintf(cp::Print &print)
TARMAC instruction trace record.
TARMAC memory access trace record (stores only).
TARMAC register trace record.
bool secureMode
True if instruction is executed in secure mode.
virtual void print(std::ostream &outs, int verbosity=0, const std::string &prefix="") const override
std::string disassemble
Instruction disassembly.
static uint64_t instCount
Number of instructions being traced.
uint8_t instSize
Instruction size: 16 for 16-bit Thumb Instruction 32 otherwise (ARM and BigThumb)
TraceInstEntry(const TarmacContext &tarmCtx, bool predicate)
TraceMemEntry(const TarmacContext &tarmCtx, uint8_t _size, Addr _addr, uint64_t _data)
virtual void print(std::ostream &outs, int verbosity=0, const std::string &prefix="") const override
void update(const TarmacContext &tarmCtx)
This updates the register entry using the update table.
virtual void updateCC(const TarmacContext &tarmCtx)
virtual void updateFloat(const TarmacContext &tarmCtx)
virtual void print(std::ostream &outs, int verbosity=0, const std::string &prefix="") const override
virtual void updateMisc(const TarmacContext &tarmCtx)
Register update functions.
TraceRegEntry(const TarmacContext &tarmCtx, const RegId ®)
virtual void updateInt(const TarmacContext &tarmCtx)