Go to the documentation of this file.
41 #include "debug/MinorScoreboard.hh"
42 #include "debug/MinorTiming.hh"
56 switch (
reg.classValue()) {
58 scoreboard_index =
reg.index();
86 panic(
"Unknown register class: %d",
reg.classValue());
107 unsigned int num_dests = staticInst->
numDestRegs();
110 for (
unsigned int dest_index = 0; dest_index < num_dests;
114 staticInst->
destRegIdx(dest_index), thread_context);
118 if (mark_unpredictable)
121 inst->flatDestRegIdx[dest_index] =
reg;
132 DPRINTF(MinorScoreboard,
"Marking up inst: %s"
133 " regIndex: %d final numResults: %d returnCycle: %d\n",
137 inst->flatDestRegIdx[dest_index] =
RegId();
152 unsigned int num_srcs = staticInst->
numSrcRegs();
154 for (
unsigned int src_index = 0; src_index < num_srcs; src_index++) {
157 unsigned short int index;
165 DPRINTF(MinorScoreboard,
"Inst: %s depends on execSeqNum: %d\n",
178 unsigned int num_dests = staticInst->
numDestRegs();
181 for (
unsigned int dest_index = 0; dest_index < num_dests;
184 const RegId&
reg = inst->flatDestRegIdx[dest_index];
199 DPRINTF(MinorScoreboard,
"Clearing inst: %s"
200 " regIndex: %d final numResults: %d\n",
217 unsigned int num_srcs = staticInst->
numSrcRegs();
222 unsigned int num_relative_latencies = 0;
228 if (src_reg_relative_latencies &&
229 src_reg_relative_latencies->size() != 0)
231 num_relative_latencies = src_reg_relative_latencies->size();
232 default_relative_latency = (*src_reg_relative_latencies)
233 [num_relative_latencies-1];
237 unsigned int src_index = 0;
238 while (src_index < num_srcs &&
243 unsigned short int index;
248 cant_forward_from_fu_indices &&
249 src_reg_fu < cant_forward_from_fu_indices->size() &&
250 (*cant_forward_from_fu_indices)[src_reg_fu];
253 (src_index >= num_relative_latencies ?
254 default_relative_latency :
255 (*src_reg_relative_latencies)[src_index]));
266 if (debug::MinorTiming) {
267 if (ret && num_srcs > num_relative_latencies &&
268 num_relative_latencies != 0)
270 DPRINTF(MinorTiming,
"Warning, inst: %s timing extra decode has"
271 " more src. regs: %d than relative latencies: %d\n",
272 staticInst->
disassemble(0), num_srcs, num_relative_latencies);
282 std::ostringstream result_stream;
284 bool printed_element =
false;
289 unsigned short int num_unpredictable_results =
292 if (!(num_results == 0 && num_unpredictable_results ==
Cycles(0))) {
294 result_stream <<
',';
296 result_stream <<
'(' <<
i <<
','
297 << num_results <<
'/'
298 << num_unpredictable_results <<
'/'
302 printed_element =
true;
const unsigned vecRegOffset
@ VecElemClass
Vector Register Native Elem lane.
@ CCRegClass
Condition-code register.
void markupInstDests(MinorDynInstPtr inst, Cycles retire_time, ThreadContext *thread_context, bool mark_unpredictable)
Mark up an instruction's effects by incrementing numResults counts.
std::vector< Index > numUnpredictableResults
Count of the number of results which can't be predicted.
const unsigned numRegs
The number of registers in the Scoreboard.
bool canInstIssue(MinorDynInstPtr inst, const std::vector< Cycles > *src_reg_relative_latencies, const std::vector< bool > *cant_forward_from_fu_indices, Cycles now, ThreadContext *thread_context)
Can this instruction be issued.
std::vector< Index > numResults
Count of the number of in-flight instructions that have results for each register.
const RegId & destRegIdx(int i) const
Return logical index (architectural reg num) of i'th destination reg.
Cycles is a wrapper class for representing cycle counts, i.e.
@ FloatRegClass
Floating-point register.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
virtual RegId flattenRegId(const RegId ®_id) const =0
const RegId & srcRegIdx(int i) const
Return logical index (architectural reg num) of i'th source reg.
static RegId flattenRegIndex(const RegId ®, ThreadContext *thread_context)
Flatten a RegId, irrespective of what reg type it's pointing to.
void minorTrace() const
MinorTraceIF interface.
std::vector< int > fuIndices
Index of the FU generating this result.
void clearInstDests(MinorDynInstPtr inst, bool clear_unpredictable)
Clear down the dependencies for this instruction.
bool findIndex(const RegId ®, Index &scoreboard_index)
Sets scoreboard_index to the index into numResults of the given register index.
std::vector< InstSeqNum > writingInst
The execute sequence number of the most recent inst to generate this register value.
GEM5_DEPRECATED_NAMESPACE(GuestABI, guest_abi)
void minorTrace(const char *fmt, Args ...args)
DPRINTFN for MinorTrace reporting.
unsigned short int Index
Type to use when indexing numResults.
const unsigned ccRegOffset
@ IntRegClass
Integer register.
std::vector< Cycles > returnCycle
The estimated cycle number that the result will be presented.
virtual const std::string & disassemble(Addr pc, const loader::SymbolTable *symtab=nullptr) const
Return string representation of disassembled instruction.
@ MiscRegClass
Control (misc) register.
InstSeqNum execSeqNumToWaitFor(MinorDynInstPtr inst, ThreadContext *thread_context)
Returns the exec sequence number of the most recent inst on which the given inst depends.
static constexpr int invalidFUIndex
uint8_t numDestRegs() const
Number of destination registers.
uint8_t numSrcRegs() const
Number of source registers.
@ VecRegClass
Vector Register.
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
const unsigned vecPredRegOffset
const unsigned floatRegOffset
Register ID: describe an architectural register with its class and index.
#define panic(...)
This implements a cprintf based panic() function.
Generated on Wed Jul 13 2022 10:39:16 for gem5 by doxygen 1.8.17