From 3e1ad73d089a455a559bed6779996877b7370b50 Mon Sep 17 00:00:00 2001 From: Korey Sewell Date: Wed, 23 Feb 2011 16:35:04 -0500 Subject: inorder: dyn inst initialization remove constructors that werent being used (it just gets confusing) use initialization list for all the variables instead of relying on initVars() function --- src/cpu/inorder/inorder_dyn_inst.cc | 67 ++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 39 deletions(-) (limited to 'src/cpu/inorder/inorder_dyn_inst.cc') diff --git a/src/cpu/inorder/inorder_dyn_inst.cc b/src/cpu/inorder/inorder_dyn_inst.cc index b1751c0ae..ebd7b7cbb 100644 --- a/src/cpu/inorder/inorder_dyn_inst.cc +++ b/src/cpu/inorder/inorder_dyn_inst.cc @@ -47,49 +47,45 @@ using namespace std; using namespace TheISA; using namespace ThePipeline; -InOrderDynInst::InOrderDynInst(TheISA::ExtMachInst machInst, - const TheISA::PCState &instPC, - const TheISA::PCState &_predPC, - InstSeqNum seq_num, InOrderCPU *cpu) - : staticInst(machInst, instPC.instAddr()), traceData(NULL), cpu(cpu) -{ - seqNum = seq_num; - - pc = instPC; - predPC = _predPC; - - initVars(); -} - InOrderDynInst::InOrderDynInst(InOrderCPU *cpu, InOrderThreadState *state, InstSeqNum seq_num, ThreadID tid, unsigned _asid) - : traceData(NULL), cpu(cpu) -{ - seqNum = seq_num; - thread = state; - threadNumber = tid; - asid = _asid; - initVars(); -} + : seqNum(seq_num), bdelaySeqNum(0), threadNumber(tid), asid(_asid), + virtProcNumber(0), staticInst(NULL), traceData(NULL), cpu(cpu), + thread(state), fault(NoFault), memData(NULL), loadData(0), + storeData(0), effAddr(0), physEffAddr(0), memReqFlags(0), + readyRegs(0), pc(0), predPC(0), memAddr(0), nextStage(0), + memTime(0), splitMemData(NULL), splitMemReq(NULL), totalSize(0), + split2ndSize(0), split2ndAddr(0), split2ndAccess(false), + split2ndDataPtr(NULL), split2ndFlags(0), splitInst(false), + splitFinishCnt(0), split2ndStoreDataPtr(NULL), splitInstSked(false), + inFrontEnd(true), frontSked(NULL), backSked(NULL), + squashingStage(0), predictTaken(false), procDelaySlotOnMispred(false), + fetchMemReq(NULL), dataMemReq(NULL), instEffAddr(0), eaCalcDone(false), + lqIdx(0), sqIdx(0), instListIt(NULL) +{ + for(int i = 0; i < MaxInstSrcRegs; i++) { + instSrc[i].integer = 0; + instSrc[i].dbl = 0; + _readySrcRegIdx[i] = false; + _srcRegIdx[i] = 0; + } -InOrderDynInst::InOrderDynInst(StaticInstPtr &_staticInst) - : seqNum(0), staticInst(_staticInst), traceData(NULL) -{ - initVars(); -} + for(int j = 0; j < MaxInstDestRegs; j++) { + _destRegIdx[j] = 0; + _prevDestRegIdx[j] = 0; + } + + ++instcount; + DPRINTF(InOrderDynInst, "DynInst: [tid:%i] [sn:%lli] Instruction created." + " (active insts: %i)\n", threadNumber, seqNum, instcount); -InOrderDynInst::InOrderDynInst() - : seqNum(0), traceData(NULL), cpu(cpu) -{ - initVars(); } int InOrderDynInst::instcount = 0; - void InOrderDynInst::setMachInst(ExtMachInst machInst) { @@ -133,7 +129,6 @@ InOrderDynInst::initVars() memAddrReady = false; eaCalcDone = false; - memOpDone = false; predictTaken = false; procDelaySlotOnMispred = false; @@ -164,16 +159,10 @@ InOrderDynInst::initVars() } // Update Instruction Count for this instruction - ++instcount; if (instcount > 100) { fatal("Number of Active Instructions in CPU is too high. " "(Not Dereferencing Ptrs. Correctly?)\n"); } - - - - DPRINTF(InOrderDynInst, "DynInst: [tid:%i] [sn:%lli] Instruction created." - " (active insts: %i)\n", threadNumber, seqNum, instcount); } void -- cgit v1.2.3