40 #include "arch/registers.hh" 42 #include "debug/MinorScoreboard.hh" 43 #include "debug/MinorTiming.hh" 60 scoreboard_index = reg.
index();
92 panic(
"Unknown register class: %d",
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]));
265 if (
returnCycle[index] > (now + relative_latency) ||
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;
std::vector< Index > numUnpredictableResults
Count of the number of results which can't be predicted.
#define panic(...)
This implements a cprintf based panic() function.
virtual const std::string & disassemble(Addr pc, const Loader::SymbolTable *symtab=nullptr) const
Return string representation of disassembled instruction.
int8_t numSrcRegs() const
Number of source registers.
Cycles is a wrapper class for representing cycle counts, i.e.
unsigned short int Index
Type to use when indexing numResults.
int8_t numDestRegs() const
Number of destination registers.
const RegId & srcRegIdx(int i) const
Return logical index (architectural reg num) of i'th source reg.
Minor contains all the definitions within the MinorCPU apart from the CPU class itself.
ThreadContext is the external interface to all thread state for anything outside of the CPU...
std::vector< int > fuIndices
Index of the FU generating this result.
Vector Register Native Elem lane.
std::vector< InstSeqNum > writingInst
The execute sequence number of the most recent inst to generate this register value.
void clearInstDests(MinorDynInstPtr inst, bool clear_unpredictable)
Clear down the dependencies for this instruction.
void markupInstDests(MinorDynInstPtr inst, Cycles retire_time, ThreadContext *thread_context, bool mark_unpredictable)
Mark up an instruction's effects by incrementing numResults counts.
void minorTrace() const
MinorTraceIF interface.
A simple instruction scoreboard for tracking dependencies in Execute.
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.
InstSeqNum execSeqNumToWaitFor(MinorDynInstPtr inst, ThreadContext *thread_context)
Returns the exec sequence number of the most recent inst on which the given inst depends.
std::vector< Index > numResults
Count of the number of in-flight instructions that have results for each register.
const RegClass & classValue() const
Class accessor.
RegIndex flatIndex() const
Index flattening.
#define MINORTRACE(...)
DPRINTFN for MinorTrace reporting.
const RegIndex & index() const
Index accessors.
virtual RegId flattenRegId(const RegId ®Id) const =0
static RegId flattenRegIndex(const RegId ®, ThreadContext *thread_context)
Flatten a RegId, irrespective of what reg type it's pointing to.
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.
bool findIndex(const RegId ®, Index &scoreboard_index)
Sets scoreboard_index to the index into numResults of the given register index.
std::vector< Cycles > returnCycle
The estimated cycle number that the result will be presented.
bool isZeroReg() const
Check if this is the zero register.
const unsigned numRegs
The number of registers in the Scoreboard.