45 #include "arch/isa.hh" 46 #include "arch/registers.hh" 50 #include "debug/MinorExecute.hh" 51 #include "enums/OpClass.hh" 65 os <<
id.threadId <<
'/' <<
id.streamSeqNum <<
'.' 66 <<
id.predictionSeqNum <<
'/' <<
id.lineSeqNum;
69 if (
id.fetchSeqNum != 0) {
70 os <<
'/' <<
id.fetchSeqNum;
71 if (
id.execSeqNum != 0)
72 os <<
'.' <<
id.execSeqNum;
120 os << inst.
id <<
" pc: 0x" 121 << std::hex << inst.
pc.instAddr() << std::dec <<
" (";
124 os <<
"fault: \"" << inst.
fault->name() <<
'"';
149 #if THE_ISA == ARM_ISA 153 os <<
'n' << misc_reg;
158 os << 'f' << static_cast<unsigned int>(reg.
index());
161 os << 'v' << static_cast<unsigned int>(reg.
index());
164 os << 'v' << static_cast<unsigned int>(reg.
index()) <<
'[' <<
165 static_cast<unsigned int>(reg.
elemIndex()) <<
']';
171 os << 'r' << static_cast<unsigned int>(reg.
index());
175 os << 'c' << static_cast<unsigned int>(reg.
index());
186 MINORINST(&named_object,
"id=F;%s addr=0x%x fault=\"%s\"\n",
187 id,
pc.instAddr(),
fault->name());
192 std::ostringstream regs_str;
197 regs_str <<
" srcRegs=";
199 unsigned int src_reg = 0;
200 while (src_reg < num_src_regs) {
204 if (src_reg != num_src_regs)
208 regs_str <<
" destRegs=";
210 unsigned int dest_reg = 0;
211 while (dest_reg < num_dest_regs) {
215 if (dest_reg != num_dest_regs)
219 #if THE_ISA == ARM_ISA 220 regs_str <<
" extMachInst=" << std::hex << std::setw(16)
225 std::ostringstream flags;
228 MINORINST(&named_object,
"id=%s addr=0x%x inst=\"%s\" class=%s" 229 " flags=\"%s\"%s%s\n",
#define panic(...)
This implements a cprintf based panic() function.
std::ostream & operator<<(std::ostream &os, const InstId &id)
Print this id in the usual slash-separated format expected by MinorTrace.
int8_t numSrcRegs() const
Number of source registers.
decltype(nullptr) constexpr NoFault
static const InstSeqNum firstPredictionSeqNum
Fault fault
This is actually a fault masquerading as an instruction.
virtual const std::string & disassemble(Addr pc, const SymbolTable *symtab=0) const
Return string representation of disassembled instruction.
int8_t numDestRegs() const
Number of destination registers.
void reportData(std::ostream &os) const
ReportIF interface.
Id for lines and instructions.
const RegId & srcRegIdx(int i) const
Return logical index (architectural reg num) of i'th source reg.
std::string getName()
Return name of machine instruction.
const char *const miscRegName[]
Minor contains all the definitions within the MinorCPU apart from the CPU class itself.
MinorDynInst(InstId id_=InstId(), Fault fault_=NoFault)
Fault translationFault
Translation fault in case of a mem ref.
This file contains miscellaneous classes and functions for formatting general trace information and a...
bool predictedTaken
This instruction was predicted to change control flow and the following instructions will have a newe...
bool isFault() const
Is this a fault rather than instruction.
const RegIndex & elemIndex() const
Elem accessor.
static const InstSeqNum firstExecSeqNum
Vector Register Native Elem lane.
const ExtMachInst machInst
The binary machine instruction.
static const InstSeqNum firstFetchSeqNum
static void printRegName(std::ostream &os, const RegId ®)
Print a register in the form r<n>, f<n>, m<n>(<name>), z for integer, float, misc and zero registers ...
static void init()
Initialise the class.
static MinorDynInstPtr bubbleInst
A prototypical bubble instruction.
OpClass opClass() const
Operation class. Used to select appropriate function unit in issue.
bool isNoCostInst() const
Is this an instruction that can be executed `for free' and needn't spend time in an FU...
#define MINORINST(sim_object,...)
DPRINTFN for MinorTrace MinorInst line reporting.
Dynamic instruction for Minor.
void printFlags(std::ostream &outs, const std::string &separator) const
Print a separator separated list of this instruction's set flag names on the given stream...
TheISA::PCState pc
The fetch address of this instruction.
bool isInst() const
Is this a real instruction.
const RegClass & classValue() const
Class accessor.
The dynamic instruction and instruction/line id (sequence numbers) definition for Minor...
void minorTraceInst(const Named &named_object) const
Print (possibly verbose) instruction information for MinorTrace using the given Named object's name...
const RegIndex & index() const
Index accessors.
const RegId & destRegIdx(int i) const
Return logical index (architectural reg num) of i'th destination reg.
Register ID: describe an architectural register with its class and index.
static const InstSeqNum firstLineSeqNum
bool isBubble() const
The BubbleIF interface.
bool isZeroReg() const
Check if this is the zero register.
bool isLastOpInInst() const
Assuming this is not a fault, is this instruction either a whole instruction or the last microop from...
bool isLastMicroop() const
Trace::InstRecord * traceData
Trace information for this instruction's execution.
static const InstSeqNum firstStreamSeqNum
First sequence numbers to use in initialisation of the pipeline and to be expected on the first line/...