46 #ifndef __ARCH_ARM_TRACERS_TARMAC_PARSER_HH__ 47 #define __ARCH_ARM_TRACERS_TARMAC_PARSER_HH__ 50 #include <unordered_map> 58 #include "params/TarmacParser.hh" 98 bool _mismatch_on_pc_or_opcode) :
99 parent(_parent), thread(_thread), inst(_inst), pc(_pc),
101 mismatchOnPcOrOpcode(_mismatch_on_pc_or_opcode)
138 void dump()
override;
179 using MiscRegMap = std::unordered_map<std::string, RegIndex>;
220 exitOnDiff(p->exit_on_diff),
221 exitOnInsnDiff(p->exit_on_insn_diff),
222 memWrCheck(p->mem_wr_check),
223 ignoredAddrRange(p->ignore_mem_addr),
225 macroopInProgress(false)
227 assert(!(exitOnDiff && exitOnInsnDiff));
229 trace.open(p->path_to_trace.c_str());
230 if (startPc == 0x0) {
233 advanceTraceToStartPc();
248 if (!started && pc.pc() == startPc)
260 void advanceTraceToStartPc();
300 #endif // __ARCH_ARM_TRACERS_TARMAC_PARSER_HH__ TarmacParser(const Params *p)
std::ifstream trace
TARMAC trace file.
bool started
True if tracing has started.
ISetState
ARM instruction set state.
void dump() const
Dump the current event data.
Event triggered to check the value of the destination registers.
static TarmacRecordType currRecordType
Type of last parsed record.
static ParserRegEntry regRecord
Buffer for register trace records.
Declaration of a request, the overall memory request consisting of the parts of the request that are ...
union Trace::InstRecord::@115 data
Tick _when
timestamp when event should be processed
bool exitOnInsnDiff
If true, the simulation is stopped as the first mismatch is detected on PC or opcode.
std::shared_ptr< Request > RequestPtr
const char * iSetStateToStr(ISetState isetstate) const
Returns the string representation of an instruction set state.
bool parsingStarted
True if a TARMAC instruction record has already been parsed for this instruction. ...
Addr size
The size of the memory request.
RequestPtr memReq
Request for memory write checks.
bool mismatch
True if a mismatch has been detected for this instruction.
TarmacParserParams Params
ThreadContext is the external interface to all thread state for anything outside of the CPU...
bool cpuId
If true, the trace format includes the CPU id.
ArmISA::PCState pc
PC of the current instruction.
static std::list< ParserRegEntry > destRegRecords
List of records of destination registers.
bool mismatch
True if a mismatch has been detected for this instruction.
TarmacParser & parent
Reference to the TARMAC trace object to which this record belongs.
Tarmac Parser: this tracer parses an existing Tarmac trace and it diffs it with gem5 simulation statu...
The AddrRange class encapsulates an address range, and supports a number of tests to check if two ran...
const char * description() const
Return a C string describing the event.
bool mismatchOnPcOrOpcode
True if a mismatch has been detected for this instruction on PC or opcode.
bool readMemNoEffect(Addr addr, uint8_t *data, unsigned size, unsigned flags)
Performs a memory access to read the value written by a previous write.
static MiscRegMap miscRegMap
static ParserInstEntry instRecord
Buffer for instruction trace records.
InstRecord * getInstRecord(Tick when, ThreadContext *tc, const StaticInstPtr staticInst, ArmISA::PCState pc, const StaticInstPtr macroStaticInst=NULL)
uint64_t Tick
Tick count type.
static int8_t maxVectorLength
Max.
Addr startPc
Tracing starts when the PC gets this value for the first time (ignored if 0x0).
TarmacRecordType
TARMAC trace record type.
static ParserMemEntry memRecord
Buffer for memory access trace records (stores only).
std::unordered_map< std::string, RegIndex > MiscRegMap
Map from misc.
StaticInstPtr macroStaticInst
ThreadContext * thread
Current thread context.
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
virtual void trace(const char *action)
This function isn't really useful if TRACING_ON is not defined.
static void printMismatchHeader(const StaticInstPtr inst, ArmISA::PCState pc)
Print a mismatch header containing the instruction fields as reported by gem5.
bool mismatchOnPcOrOpcode
True if a mismatch has been detected for this instruction on PC or opcode.
TarmacParserRecord(Tick _when, ThreadContext *_thread, const StaticInstPtr _staticInst, ArmISA::PCState _pc, TarmacParser &_parent, const StaticInstPtr _macroStaticInst=NULL)
AddrRange ignoredAddrRange
Ignored addresses (ignored if empty).
bool macroopInProgress
True if a macroop is currently in progress.
bool advanceTrace()
Advances the TARMAC trace up to the next instruction, register, or memory access record.
static char buf[MaxLineLength]
Buffer used for trace file parsing.
bool memWrCheck
If true, memory write accesses are checked.
TarmacParserRecordEvent(TarmacParser &_parent, ThreadContext *_thread, const StaticInstPtr _inst, ArmISA::PCState _pc, bool _mismatch, bool _mismatch_on_pc_or_opcode)
bool exitOnDiff
If true, the simulation is stopped as the first mismatch is detected.
GenericISA::DelaySlotPCState< MachInst > PCState
static const int MaxLineLength
Tick when() const
Get the time that the event is scheduled.
Addr addr
The address that was accessed.
const StaticInstPtr inst
Current instruction.