Go to the documentation of this file.
40 #include "arch/registers.hh"
42 #include "debug/MinorScoreboard.hh"
43 #include "debug/MinorTiming.hh"
53 if (
reg.isZeroReg()) {
57 switch (
reg.classValue())
60 scoreboard_index =
reg.index();
92 panic(
"Unknown register class: %d",
93 static_cast<int>(
reg.classValue()));
115 unsigned int num_dests = staticInst->
numDestRegs();
118 for (
unsigned int dest_index = 0; dest_index < num_dests;
122 staticInst->
destRegIdx(dest_index), thread_context);
126 if (mark_unpredictable)
129 inst->flatDestRegIdx[dest_index] =
reg;
140 DPRINTF(MinorScoreboard,
"Marking up inst: %s"
141 " regIndex: %d final numResults: %d returnCycle: %d\n",
161 unsigned int num_srcs = staticInst->
numSrcRegs();
163 for (
unsigned int src_index = 0; src_index < num_srcs; src_index++) {
166 unsigned short int index;
174 DPRINTF(MinorScoreboard,
"Inst: %s depends on execSeqNum: %d\n",
187 unsigned int num_dests = staticInst->
numDestRegs();
190 for (
unsigned int dest_index = 0; dest_index < num_dests;
193 const RegId&
reg = inst->flatDestRegIdx[dest_index];
208 DPRINTF(MinorScoreboard,
"Clearing inst: %s"
209 " regIndex: %d final numResults: %d\n",
226 unsigned int num_srcs = staticInst->
numSrcRegs();
231 unsigned int num_relative_latencies = 0;
237 if (src_reg_relative_latencies &&
238 src_reg_relative_latencies->size() != 0)
240 num_relative_latencies = src_reg_relative_latencies->size();
241 default_relative_latency = (*src_reg_relative_latencies)
242 [num_relative_latencies-1];
246 unsigned int src_index = 0;
247 while (src_index < num_srcs &&
252 unsigned short int index;
256 cant_forward_from_fu_indices &&
257 index < cant_forward_from_fu_indices->size() &&
258 (*cant_forward_from_fu_indices)[
index];
261 (src_index >= num_relative_latencies ?
262 default_relative_latency :
263 (*src_reg_relative_latencies)[src_index]));
274 if (
DTRACE(MinorTiming)) {
275 if (ret && num_srcs > num_relative_latencies &&
276 num_relative_latencies != 0)
278 DPRINTF(MinorTiming,
"Warning, inst: %s timing extra decode has"
279 " more src. regs: %d than relative latencies: %d\n",
280 staticInst->
disassemble(0), num_srcs, num_relative_latencies);
290 std::ostringstream result_stream;
292 bool printed_element =
false;
297 unsigned short int num_unpredictable_results =
300 if (!(num_results == 0 && num_unpredictable_results ==
Cycles(0))) {
302 result_stream <<
',';
304 result_stream <<
'(' <<
i <<
','
305 << num_results <<
'/'
306 << num_unpredictable_results <<
'/'
310 printed_element =
true;
const RegId & destRegIdx(int i) const
Return logical index (architectural reg num) of i'th destination reg.
@ VecElemClass
Vector Register Native Elem lane.
bool findIndex(const RegId ®, Index &scoreboard_index)
Sets scoreboard_index to the index into numResults of the given register index.
#define MINORTRACE(...)
DPRINTFN for MinorTrace reporting.
unsigned short int Index
Type to use when indexing numResults.
Register ID: describe an architectural register with its class and index.
@ FloatRegClass
Floating-point register.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
InstSeqNum execSeqNumToWaitFor(MinorDynInstPtr inst, ThreadContext *thread_context)
Returns the exec sequence number of the most recent inst on which the given inst depends.
int8_t numDestRegs() const
Number of destination registers.
virtual RegId flattenRegId(const RegId ®Id) const =0
const unsigned numRegs
The number of registers in the Scoreboard.
std::vector< Index > numUnpredictableResults
Count of the number of results which can't be predicted.
void clearInstDests(MinorDynInstPtr inst, bool clear_unpredictable)
Clear down the dependencies for this instruction.
const RegId & srcRegIdx(int i) const
Return logical index (architectural reg num) of i'th source reg.
@ IntRegClass
Integer register.
@ CCRegClass
Condition-code register.
void minorTrace() const
MinorTraceIF interface.
int8_t numSrcRegs() const
Number of source registers.
@ MiscRegClass
Control (misc) register.
@ VecRegClass
Vector Register.
std::vector< Index > numResults
Count of the number of in-flight instructions that have results for each register.
virtual const std::string & disassemble(Addr pc, const Loader::SymbolTable *symtab=nullptr) const
Return string representation of disassembled instruction.
std::vector< InstSeqNum > writingInst
The execute sequence number of the most recent inst to generate this register value.
static RegId flattenRegIndex(const RegId ®, ThreadContext *thread_context)
Flatten a RegId, irrespective of what reg type it's pointing to.
std::vector< Cycles > returnCycle
The estimated cycle number that the result will be presented.
Cycles is a wrapper class for representing cycle counts, i.e.
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.
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< int > fuIndices
Index of the FU generating this result.
#define panic(...)
This implements a cprintf based panic() function.
Generated on Wed Sep 30 2020 14:02:08 for gem5 by doxygen 1.8.17