diff options
author | Korey Sewell <ksewell@umich.edu> | 2009-03-04 22:37:45 -0500 |
---|---|---|
committer | Korey Sewell <ksewell@umich.edu> | 2009-03-04 22:37:45 -0500 |
commit | 9e1dc7f20549e9590c5b1450be17ff03057e346f (patch) | |
tree | 29e8dd06790c50fa35ae1feba632bba0be72ce0d /src/cpu/inorder/resources | |
parent | 7c8d54421665ccbc204487cb6a9faa31c1b3c243 (diff) | |
download | gem5-9e1dc7f20549e9590c5b1450be17ff03057e346f.tar.xz |
InOrderCPU: Clean up Constructors to initialize variables correctly (i.e. in a way for the compiler to play *nice*)
Diffstat (limited to 'src/cpu/inorder/resources')
-rw-r--r-- | src/cpu/inorder/resources/cache_unit.cc | 7 | ||||
-rw-r--r-- | src/cpu/inorder/resources/fetch_seq_unit.cc | 5 | ||||
-rw-r--r-- | src/cpu/inorder/resources/graduation_unit.cc | 7 | ||||
-rw-r--r-- | src/cpu/inorder/resources/mult_div_unit.cc | 27 | ||||
-rw-r--r-- | src/cpu/inorder/resources/mult_div_unit.hh | 10 |
5 files changed, 19 insertions, 37 deletions
diff --git a/src/cpu/inorder/resources/cache_unit.cc b/src/cpu/inorder/resources/cache_unit.cc index 6fd7ae36c..57bcb10ef 100644 --- a/src/cpu/inorder/resources/cache_unit.cc +++ b/src/cpu/inorder/resources/cache_unit.cc @@ -81,14 +81,9 @@ CacheUnit::CachePort::recvRetry() 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 * diff --git a/src/cpu/inorder/resources/fetch_seq_unit.cc b/src/cpu/inorder/resources/fetch_seq_unit.cc index 36cf714c9..444252e1b 100644 --- a/src/cpu/inorder/resources/fetch_seq_unit.cc +++ b/src/cpu/inorder/resources/fetch_seq_unit.cc @@ -38,10 +38,9 @@ using namespace ThePipeline; 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; diff --git a/src/cpu/inorder/resources/graduation_unit.cc b/src/cpu/inorder/resources/graduation_unit.cc index 701da5996..569401e4f 100644 --- a/src/cpu/inorder/resources/graduation_unit.cc +++ b/src/cpu/inorder/resources/graduation_unit.cc @@ -35,11 +35,10 @@ using namespace ThePipeline; 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]; diff --git a/src/cpu/inorder/resources/mult_div_unit.cc b/src/cpu/inorder/resources/mult_div_unit.cc index e98e97be7..b31d60ad5 100644 --- a/src/cpu/inorder/resources/mult_div_unit.cc +++ b/src/cpu/inorder/resources/mult_div_unit.cc @@ -41,25 +41,14 @@ using namespace ThePipeline; 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() diff --git a/src/cpu/inorder/resources/mult_div_unit.hh b/src/cpu/inorder/resources/mult_div_unit.hh index 762442c4b..003f6fbb1 100644 --- a/src/cpu/inorder/resources/mult_div_unit.hh +++ b/src/cpu/inorder/resources/mult_div_unit.hh @@ -84,24 +84,24 @@ class MultDivUnit : public Resource { 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; |