diff options
author | Korey Sewell <ksewell@umich.edu> | 2011-06-19 21:43:36 -0400 |
---|---|---|
committer | Korey Sewell <ksewell@umich.edu> | 2011-06-19 21:43:36 -0400 |
commit | 7dea79535c87b68b5fc6143190d09b8fc364f2aa (patch) | |
tree | 3f30f0716de709f86b9adaa746f0b3e312203cef /src/cpu/inorder/inorder_dyn_inst.cc | |
parent | 061b369d288ba4e3fdb145c025fb4d80378cb851 (diff) | |
download | gem5-7dea79535c87b68b5fc6143190d09b8fc364f2aa.tar.xz |
inorder: implement trap handling
Diffstat (limited to 'src/cpu/inorder/inorder_dyn_inst.cc')
-rw-r--r-- | src/cpu/inorder/inorder_dyn_inst.cc | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/cpu/inorder/inorder_dyn_inst.cc b/src/cpu/inorder/inorder_dyn_inst.cc index d8bfbacc7..d42e84016 100644 --- a/src/cpu/inorder/inorder_dyn_inst.cc +++ b/src/cpu/inorder/inorder_dyn_inst.cc @@ -54,7 +54,7 @@ InOrderDynInst::InOrderDynInst(InOrderCPU *cpu, InstSeqNum seq_num, ThreadID tid, unsigned _asid) - : seqNum(seq_num), bdelaySeqNum(0), threadNumber(tid), asid(_asid), + : seqNum(seq_num), squashSeqNum(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), @@ -319,7 +319,15 @@ void InOrderDynInst::setSquashInfo(unsigned stage_num) { squashingStage = stage_num; - bdelaySeqNum = seqNum; + + // If it's a fault, then we need to squash + // the faulting instruction too. Squash + // functions squash above a seqNum, so we + // decrement here for that case + if (fault != NoFault) + squashSeqNum = seqNum - 1; + else + squashSeqNum = seqNum; #if ISA_HAS_DELAY_SLOT if (isControl()) { @@ -329,10 +337,9 @@ InOrderDynInst::setSquashInfo(unsigned stage_num) // Check to see if we should squash after the // branch or after a branch delay slot. if (pc.nextInstAddr() == pc.instAddr() + sizeof(MachInst)) - bdelaySeqNum = seqNum + 1; + squashSeqNum = seqNum + 1; else - bdelaySeqNum = seqNum; - + squashSeqNum = seqNum; } #endif } |