class InOrderCPU(BaseCPU):
type = 'InOrderCPU'
activity = Param.Unsigned(0, "Initial count")
- numThreads = Param.Unsigned(1, "number of HW thread contexts")
- cachePorts = Param.Unsigned("Cache Ports")
+ cachePorts = Param.Unsigned(2, "Cache Ports")
stageWidth = Param.Unsigned(1, "Stage width")
fetchMemPort = Param.String("icache_port" , "Name of Memory Port to get instructions from")
functionTraceStart = Param.Tick(0, "Cycle to start function trace")
stageTracing = Param.Bool(False, "Enable tracing of each stage in CPU")
- memBlockSize = Param.Unsigned("Memory Block Size")
+ memBlockSize = Param.Unsigned(64, "Memory Block Size")
multLatency = Param.Unsigned(1, "Latency for Multiply Operations")
multRepeatRate = Param.Unsigned(1, "Repeat Rate for Multiply Operations")
uint64_t nextPC;
InstSeqNum squashedSeqNum;
bool includeSquashInst;
+
+ InterStageStruct()
+ :size(0), squash(false),
+ branchMispredict(false), branchTaken(false),
+ mispredPC(0), nextPC(0),
+ squashedSeqNum(0), includeSquashInst(false)
+ { }
+
};
/** Turn This into a Class */
InOrderDynInst::InOrderDynInst()
: traceData(NULL), cpu(cpu)
-{ initVars(); }
+{
+ seqNum = 0;
+ initVars();
+}
int InOrderDynInst::instcount = 0;
using namespace ThePipeline;
PipelineStage::PipelineStage(Params *params, unsigned stage_num)
- : numThreads(ThePipeline::MaxThreads)
{
- stageNum = stage_num;
- stageWidth = ThePipeline::StageWidth;
-
- _status = Inactive;
-
- prevStageValid = false;
- nextStageValid = false;
-
- // Init. structures
- for(int tid=0; tid < numThreads; tid++) {
- stageStatus[tid] = Idle;
-
- for (int stNum = 0; stNum < NumStages; stNum++) {
- stalls[tid].stage[stNum] = false;
- }
- stalls[tid].resources.clear();
-
- if (stageNum < BackEndStartStage)
- lastStallingStage[tid] = BackEndStartStage - 1;
- else
- lastStallingStage[tid] = NumStages - 1;
- }
-
- stageBufferMax = ThePipeline::interStageBuffSize[stage_num];
+ init(params, stage_num);
}
-
void
PipelineStage::init(Params *params, unsigned stage_num)
{
// Setup wire to write information to proper place in stage queue.
nextStage = nextStageQueue->getWire(0);
-
+ nextStage->size = 0;
nextStageValid = true;
}
bool status_change = false;
+ if (nextStageValid)
+ nextStage->size = 0;
+
toNextStageIndex = 0;
sortInsts();
div32RepeatRate = params->div32RepeatRate;
div32Latency = params->div32Latency;
+
+ lastMDUCycle = 0;
}
void
rval);
if (rval != -1) {
+ lastMDUCycle = curTick;
+ lastOpType = inst->opClass();
+ lastInstName = inst->staticInst->getName();
}
return rval;