42 #include "arch/registers.hh" 44 #include "debug/MinorScoreboard.hh" 45 #include "debug/MinorTiming.hh" 62 scoreboard_index = reg.
index();
94 panic(
"Unknown register class: %d",
117 unsigned int num_dests = staticInst->
numDestRegs();
120 for (
unsigned int dest_index = 0; dest_index < num_dests;
124 staticInst->
destRegIdx(dest_index), thread_context);
128 if (mark_unpredictable)
131 inst->flatDestRegIdx[dest_index] =
reg;
142 DPRINTF(MinorScoreboard,
"Marking up inst: %s" 143 " regIndex: %d final numResults: %d returnCycle: %d\n",
163 unsigned int num_srcs = staticInst->
numSrcRegs();
165 for (
unsigned int src_index = 0; src_index < num_srcs; src_index++) {
168 unsigned short int index;
176 DPRINTF(MinorScoreboard,
"Inst: %s depends on execSeqNum: %d\n",
189 unsigned int num_dests = staticInst->
numDestRegs();
192 for (
unsigned int dest_index = 0; dest_index < num_dests;
195 const RegId&
reg = inst->flatDestRegIdx[dest_index];
210 DPRINTF(MinorScoreboard,
"Clearing inst: %s" 211 " regIndex: %d final numResults: %d\n",
228 unsigned int num_srcs = staticInst->
numSrcRegs();
233 unsigned int num_relative_latencies = 0;
239 if (src_reg_relative_latencies &&
240 src_reg_relative_latencies->size() != 0)
242 num_relative_latencies = src_reg_relative_latencies->size();
243 default_relative_latency = (*src_reg_relative_latencies)
244 [num_relative_latencies-1];
248 unsigned int src_index = 0;
249 while (src_index < num_srcs &&
254 unsigned short int index;
258 cant_forward_from_fu_indices &&
259 index < cant_forward_from_fu_indices->size() &&
260 (*cant_forward_from_fu_indices)[
index];
263 (src_index >= num_relative_latencies ?
264 default_relative_latency :
265 (*src_reg_relative_latencies)[src_index]));
267 if (
returnCycle[index] > (now + relative_latency) ||
276 if (
DTRACE(MinorTiming)) {
277 if (ret && num_srcs > num_relative_latencies &&
278 num_relative_latencies != 0)
280 DPRINTF(MinorTiming,
"Warning, inst: %s timing extra decode has" 281 " more src. regs: %d than relative latencies: %d\n",
282 staticInst->
disassemble(0), num_srcs, num_relative_latencies);
292 std::ostringstream result_stream;
294 bool printed_element =
false;
299 unsigned short int num_unpredictable_results =
302 if (!(num_results == 0 && num_unpredictable_results ==
Cycles(0))) {
304 result_stream <<
',';
306 result_stream <<
'(' << i <<
',' 307 << num_results <<
'/' 308 << num_unpredictable_results <<
'/' 312 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.
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.
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.
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.