diff options
author | Korey Sewell <ksewell@umich.edu> | 2011-02-18 14:29:26 -0500 |
---|---|---|
committer | Korey Sewell <ksewell@umich.edu> | 2011-02-18 14:29:26 -0500 |
commit | 91c48b1c3ba6e46324b96fb76762a4d973ce6007 (patch) | |
tree | 92c691b1ebc702dc5ccdb1f43a647faaa942bc1e /src/cpu/inorder/pipeline_stage.cc | |
parent | 8b4b4a1ba50a6f422ab75ccf0fb09568f1805ce6 (diff) | |
download | gem5-91c48b1c3ba6e46324b96fb76762a4d973ce6007.tar.xz |
inorder: cleanup in destructors
cleanup hanging pointers and other cruft in the destructors
Diffstat (limited to 'src/cpu/inorder/pipeline_stage.cc')
-rw-r--r-- | src/cpu/inorder/pipeline_stage.cc | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/cpu/inorder/pipeline_stage.cc b/src/cpu/inorder/pipeline_stage.cc index 15f143251..b267ac00e 100644 --- a/src/cpu/inorder/pipeline_stage.cc +++ b/src/cpu/inorder/pipeline_stage.cc @@ -44,12 +44,17 @@ PipelineStage::PipelineStage(Params *params, unsigned stage_num) stageBufferMax(params->stageWidth), prevStageValid(false), nextStageValid(false), idle(false) { - switchedOutBuffer.resize(ThePipeline::MaxThreads); - switchedOutValid.resize(ThePipeline::MaxThreads); - init(params); } +PipelineStage::~PipelineStage() +{ + for(ThreadID tid = 0; tid < numThreads; tid++) { + skidBuffer[tid].clear(); + stalls[tid].resources.clear(); + } +} + void PipelineStage::init(Params *params) { @@ -66,6 +71,12 @@ PipelineStage::init(Params *params) else lastStallingStage[tid] = NumStages - 1; } + + if ((InOrderCPU::ThreadModel) params->threadModel == + InOrderCPU::SwitchOnCacheMiss) { + switchedOutBuffer.resize(ThePipeline::MaxThreads); + switchedOutValid.resize(ThePipeline::MaxThreads); + } } @@ -190,9 +201,6 @@ PipelineStage::takeOverFrom() stalls[tid].resources.clear(); - while (!insts[tid].empty()) - insts[tid].pop(); - skidBuffer[tid].clear(); } wroteToTimeBuffer = false; |