1/* 2 * Copyright (c) 2013-2014 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 34 unchanged lines hidden (view full) --- 43#include "cpu/reg_class.hh" 44#include "debug/MinorScoreboard.hh" 45#include "debug/MinorTiming.hh" 46 47namespace Minor 48{ 49 50bool |
51Scoreboard::findIndex(const RegId& reg, Index &scoreboard_index) |
52{ 53 bool ret = false; 54 55 if (reg.isZeroReg()) { 56 /* Don't bother with the zero register */ 57 ret = false; 58 } else { |
59 switch (reg.classValue()) |
60 { 61 case IntRegClass: |
62 scoreboard_index = reg.index(); |
63 ret = true; 64 break; 65 case FloatRegClass: 66 scoreboard_index = TheISA::NumIntRegs + TheISA::NumCCRegs + |
67 reg.index(); |
68 ret = true; 69 break; 70 case CCRegClass: |
71 scoreboard_index = TheISA::NumIntRegs + reg.index(); |
72 ret = true; 73 break; 74 case MiscRegClass: 75 /* Don't bother with Misc registers */ 76 ret = false; 77 break; 78 } 79 } 80 81 return ret; 82} 83 84/** Flatten a RegId, irrespective of what reg type it's pointing to */ 85static RegId |
86flattenRegIndex(const RegId& reg, ThreadContext *thread_context) |
87{ |
88 return thread_context->flattenRegId(reg); |
89} 90 91void 92Scoreboard::markupInstDests(MinorDynInstPtr inst, Cycles retire_time, 93 ThreadContext *thread_context, bool mark_unpredictable) 94{ 95 if (inst->isFault()) 96 return; --- 24 unchanged lines hidden (view full) --- 121 fuIndices[index] = inst->fuIndex; 122 } 123 124 DPRINTF(MinorScoreboard, "Marking up inst: %s" 125 " regIndex: %d final numResults: %d returnCycle: %d\n", 126 *inst, index, numResults[index], returnCycle[index]); 127 } else { 128 /* Use ZeroReg to mark invalid/untracked dests */ |
129 inst->flatDestRegIdx[dest_index] = RegId(IntRegClass, 130 TheISA::ZeroReg); |
131 } 132 } 133} 134 135InstSeqNum 136Scoreboard::execSeqNumToWaitFor(MinorDynInstPtr inst, 137 ThreadContext *thread_context) 138{ --- 30 unchanged lines hidden (view full) --- 169 170 StaticInstPtr staticInst = inst->staticInst; 171 unsigned int num_dests = staticInst->numDestRegs(); 172 173 /** Mark each destination register */ 174 for (unsigned int dest_index = 0; dest_index < num_dests; 175 dest_index++) 176 { |
177 const RegId& reg = inst->flatDestRegIdx[dest_index]; |
178 Index index; 179 180 if (findIndex(reg, index)) { 181 if (clear_unpredictable && numUnpredictableResults[index] != 0) 182 numUnpredictableResults[index] --; 183 184 numResults[index] --; 185 --- 118 unchanged lines hidden --- |