47#include "debug/MinorExecute.hh"
48#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;
80 assert(inst->isBubble());
116 os << inst.
id <<
" pc: 0x???????? (bubble)";
120 os << inst.
id <<
" pc: 0x"
121 << std::hex << inst.
pc->instAddr() << std::dec <<
" (";
124 os <<
"fault: \"" << inst.
fault->name() <<
'"';
142 switch (
reg.classValue()) {
149 os <<
'm' << misc_reg <<
'(' <<
reg <<
')';
153 os <<
'f' <<
reg.index();
156 os <<
'v' <<
reg.index();
162 os <<
'r' <<
reg.index();
165 os <<
'c' <<
reg.index();
168 panic(
"Unknown register class: %d", (
int)
reg.classValue());
176 minorInst(named_object,
"id=F;%s addr=0x%x fault=\"%s\"\n",
177 id,
pc ?
pc->instAddr() : 0,
fault->name());
182 std::ostringstream regs_str;
187 regs_str <<
" srcRegs=";
189 unsigned int src_reg = 0;
190 while (src_reg < num_src_regs) {
194 if (src_reg != num_src_regs)
198 regs_str <<
" destRegs=";
200 unsigned int dest_reg = 0;
201 while (dest_reg < num_dest_regs) {
205 if (dest_reg != num_dest_regs)
212 std::ostringstream
flags;
215 minorInst(named_object,
"id=%s addr=0x%x inst=\"%s\" class=%s"
216 " flags=\"%s\"%s%s\n",
217 id,
pc ?
pc->instAddr() : 0,
Interface for things with names.
Register ID: describe an architectural register with its class and index.
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.
virtual const std::string & disassemble(Addr pc, const loader::SymbolTable *symtab=nullptr) const
Return string representation of disassembled instruction.
virtual uint64_t getEMI() const
uint8_t numSrcRegs() const
Number of source registers.
OpClass opClass() const
Operation class. Used to select appropriate function unit in issue.
uint8_t numDestRegs() const
Number of destination registers.
std::string getName()
Return name of machine instruction.
const RegId & destRegIdx(int i) const
Return logical index (architectural reg num) of i'th destination reg.
bool isLastMicroop() const
const RegId & srcRegIdx(int i) const
Return logical index (architectural reg num) of i'th source reg.
Id for lines and instructions.
static const InstSeqNum firstFetchSeqNum
static const InstSeqNum firstExecSeqNum
static const InstSeqNum firstLineSeqNum
static const InstSeqNum firstStreamSeqNum
First sequence numbers to use in initialisation of the pipeline and to be expected on the first line/...
static const InstSeqNum firstPredictionSeqNum
Dynamic instruction for Minor.
bool isFault() const
Is this a fault rather than instruction.
bool isNoCostInst() const
Is this an instruction that can be executed ‘for free’ and needn't spend time in an FU.
bool isInst() const
Is this a real instruction.
Fault translationFault
Translation fault in case of a mem ref.
trace::InstRecord * traceData
Trace information for this instruction's execution.
std::unique_ptr< PCStateBase > pc
The fetch address of this instruction.
void minorTraceInst(const Named &named_object) const
Print (possibly verbose) instruction information for MinorTrace using the given Named object's name.
const StaticInstPtr staticInst
bool isLastOpInInst() const
Assuming this is not a fault, is this instruction either a whole instruction or the last microop from...
void reportData(std::ostream &os) const
ReportIF interface.
static MinorDynInstPtr bubbleInst
A prototypical bubble instruction.
bool predictedTaken
This instruction was predicted to change control flow and the following instructions will have a newe...
Fault fault
This is actually a fault masquerading as an instruction.
bool isBubble() const
The BubbleIF interface.
This file contains miscellaneous classes and functions for formatting general trace information and a...
#define panic(...)
This implements a cprintf based panic() function.
The dynamic instruction and instruction/line id (sequence numbers) definition for Minor.
static void printRegName(std::ostream &os, const RegId ®)
Print a register in the form r<n>, f<n>, m<n>(<name>) for integer, float, and misc given an 'architec...
RefCountingPtr< MinorDynInst > MinorDynInstPtr
MinorDynInsts are currently reference counted.
std::ostream & operator<<(std::ostream &os, const InstId &id)
Print this id in the usual slash-separated format expected by MinorTrace.
void minorInst(const Named &named, const char *fmt, Args ...args)
DPRINTFN for MinorTrace MinorInst line reporting.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
const StaticInstPtr nullStaticInstPtr
Statically allocated null StaticInstPtr.
constexpr decltype(nullptr) NoFault
@ FloatRegClass
Floating-point register.
@ CCRegClass
Condition-code register.
@ VecRegClass
Vector Register.
@ IntRegClass
Integer register.
@ MiscRegClass
Control (misc) register.
@ VecElemClass
Vector Register Native Elem lane.
void ccprintf(cp::Print &print)
Minor contains all the definitions within the MinorCPU apart from the CPU class itself.