InOrderCPU::InOrderCPU(Params *params)
: BaseCPU(params),
cpu_id(params->cpu_id),
+ coreType("default"),
+ _status(Idle),
tickEvent(this),
miscRegFile(this),
timeBuffer(2 , 2),
resPool = new ResourcePool(this, params);
- coreType = "default"; // eventually get this from params
-
- _status = Idle;
-
// Resize for Multithreading CPUs
thread.resize(numThreads);
using namespace ThePipeline;
FirstStage::FirstStage(Params *params, unsigned stage_num)
- : PipelineStage(params, stage_num)
+ : PipelineStage(params, stage_num), numFetchingThreads(1),
+ fetchPolicy(FirstStage::RoundRobin)
{
for(int tid=0; tid < this->numThreads; tid++) {
stageStatus[tid] = Running;
}
-
- numFetchingThreads = 1;
-
- fetchPolicy = RoundRobin;
}
void
}
InOrderDynInst::InOrderDynInst(StaticInstPtr &_staticInst)
- : staticInst(_staticInst), traceData(NULL)
+ : seqNum(0), staticInst(_staticInst), traceData(NULL)
{
- seqNum = 0;
initVars();
}
InOrderDynInst::InOrderDynInst()
- : traceData(NULL), cpu(cpu)
+ : seqNum(0), traceData(NULL), cpu(cpu)
{
- seqNum = 0;
initVars();
}
using namespace ThePipeline;
PipelineStage::PipelineStage(Params *params, unsigned stage_num)
+ : stageNum(stage_num), stageWidth(ThePipeline::StageWidth),
+ numThreads(ThePipeline::MaxThreads), _status(Inactive),
+ stageBufferMax(ThePipeline::interStageBuffSize[stage_num]),
+ prevStageValid(false), nextStageValid(false)
{
- init(params, stage_num);
+ init(params);
}
void
-PipelineStage::init(Params *params, unsigned stage_num)
+PipelineStage::init(Params *params)
{
- stageNum = stage_num;
- stageWidth = ThePipeline::StageWidth;
-
- _status = Inactive;
-
- numThreads = ThePipeline::MaxThreads;
-
- prevStageValid = false;
- nextStageValid = false;
-
- // Init. structures
for(int tid=0; tid < numThreads; tid++) {
stageStatus[tid] = Idle;
else
lastStallingStage[tid] = NumStages - 1;
}
-
- stageBufferMax = ThePipeline::interStageBuffSize[stage_num];
}
virtual ~PipelineStage() { }
/** PipelineStage initialization. */
- void init(Params *params, unsigned stage_num);
+ void init(Params *params);
/** Returns the name of stage. */
std::string name() const;
CacheUnit::CacheUnit(string res_name, int res_id, int res_width,
int res_latency, InOrderCPU *_cpu, ThePipeline::Params *params)
: Resource(res_name, res_id, res_width, res_latency, _cpu),
- retryPkt(NULL), retrySlot(-1)
+ retryPkt(NULL), retrySlot(-1), cacheBlocked(false)
{
- //cacheData.resize(res_width);
- //slotStatus = new CachePortStatus[width];
- //fetchPC = new Addr[width];
cachePort = new CachePort(this);
-
- cacheBlocked = false;
}
Port *
FetchSeqUnit::FetchSeqUnit(std::string res_name, int res_id, int res_width,
int res_latency, InOrderCPU *_cpu, ThePipeline::Params *params)
- : Resource(res_name, res_id, res_width, res_latency, _cpu)
+ : Resource(res_name, res_id, res_width, res_latency, _cpu),
+ instSize(sizeof(MachInst))
{
- instSize = sizeof(MachInst);
-
for (int tid = 0; tid < ThePipeline::MaxThreads; tid++) {
delaySlotInfo[tid].numInsts = 0;
delaySlotInfo[tid].targetReady = false;
GraduationUnit::GraduationUnit(std::string res_name, int res_id, int res_width,
int res_latency, InOrderCPU *_cpu, ThePipeline::Params *params)
- : Resource(res_name, res_id, res_width, res_latency, _cpu)
+ : Resource(res_name, res_id, res_width, res_latency, _cpu),
+ lastCycleGrad(0), numCycleGrad(0)
+
{
- lastCycleGrad = 0;
- numCycleGrad = 0;
-
for (int tid = 0; tid < ThePipeline::MaxThreads; tid++) {
nonSpecInstActive[tid] = &cpu->nonSpecInstActive[tid];
nonSpecSeqNum[tid] = &cpu->nonSpecSeqNum[tid];
MultDivUnit::MultDivUnit(string res_name, int res_id, int res_width,
int res_latency, InOrderCPU *_cpu, ThePipeline::Params *params)
- : Resource(res_name, res_id, res_width, res_latency, _cpu)
-{
- multRepeatRate = params->multRepeatRate;
- multLatency = params->multLatency;
-
- div8RepeatRate = params->div8RepeatRate;
- div8Latency = params->div8Latency;
-
- div16RepeatRate = params->div16RepeatRate;
- div16Latency = params->div16Latency;
-
- div24RepeatRate = params->div24RepeatRate;
- div24Latency = params->div24Latency;
-
- div32RepeatRate = params->div32RepeatRate;
- div32Latency = params->div32Latency;
-
- lastMDUCycle = 0;
-}
+ : Resource(res_name, res_id, res_width, res_latency, _cpu),
+ multRepeatRate(params->multRepeatRate), multLatency(params->multLatency),
+ div8RepeatRate(params->div8RepeatRate), div8Latency(params->div8Latency),
+ div16RepeatRate(params->div16RepeatRate), div16Latency(params->div16Latency),
+ div24RepeatRate(params->div24RepeatRate), div24Latency(params->div24Latency),
+ div32RepeatRate(params->div32RepeatRate), div32Latency(params->div32Latency),
+ lastMDUCycle(0)
+{ }
void
MultDivUnit::regStats()
protected:
/** Latency & Repeat Rate for Multiply Insts */
- unsigned multLatency;
unsigned multRepeatRate;
+ unsigned multLatency;
/** Latency & Repeat Rate for 8-bit Divide Insts */
- unsigned div8Latency;
unsigned div8RepeatRate;
+ unsigned div8Latency;
/** Latency & Repeat Rate for 16-bit Divide Insts */
- unsigned div16Latency;
unsigned div16RepeatRate;
+ unsigned div16Latency;
/** Latency & Repeat Rate for 24-bit Divide Insts */
- unsigned div24Latency;
unsigned div24RepeatRate;
+ unsigned div24Latency;
/** Latency & Repeat Rate for 32-bit Divide Insts */
- unsigned div32Latency;
unsigned div32RepeatRate;
+ unsigned div32Latency;
/** Last cycle that MDU was used */
Tick lastMDUCycle;
/** Serializes state. */
virtual void serialize(std::ostream &os);
+
/** Unserializes state. */
virtual void unserialize(Checkpoint *cp, const std::string §ion);