diff options
author | Korey Sewell <ksewell@umich.edu> | 2011-02-04 00:09:20 -0500 |
---|---|---|
committer | Korey Sewell <ksewell@umich.edu> | 2011-02-04 00:09:20 -0500 |
commit | e396a34b0155d5054a099c67a91baa66c095d3d8 (patch) | |
tree | 9372731b0110d067b4377ab73b1d62bbabf5efe3 /src/cpu/inorder/resources/execution_unit.cc | |
parent | e57613588b15f25b5b912ae98134b6f1007988fd (diff) | |
download | gem5-e396a34b0155d5054a099c67a91baa66c095d3d8.tar.xz |
inorder: fault handling
Maintain all information about an instruction's fault in the DynInst object rather
than any cpu-request object. Also, if there is a fault during the execution stage
then just save the fault inside the instruction and trap once the instruction
tries to graduate
Diffstat (limited to 'src/cpu/inorder/resources/execution_unit.cc')
-rw-r--r-- | src/cpu/inorder/resources/execution_unit.cc | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/cpu/inorder/resources/execution_unit.cc b/src/cpu/inorder/resources/execution_unit.cc index cae007deb..36bf2a4dc 100644 --- a/src/cpu/inorder/resources/execution_unit.cc +++ b/src/cpu/inorder/resources/execution_unit.cc @@ -84,14 +84,11 @@ ExecutionUnit::execute(int slot_num) { ResourceRequest* exec_req = reqMap[slot_num]; DynInstPtr inst = reqMap[slot_num]->inst; - Fault fault = reqMap[slot_num]->fault; - ThreadID tid = inst->readTid(); + Fault fault = NoFault; int seq_num = inst->seqNum; - exec_req->fault = NoFault; - DPRINTF(InOrderExecute, "[tid:%i] Executing [sn:%i] [PC:%s] %s.\n", - tid, seq_num, inst->pcState(), inst->instName()); + inst->readTid(), seq_num, inst->pcState(), inst->instName()); switch (exec_req->cmd) { @@ -126,7 +123,6 @@ ExecutionUnit::execute(int slot_num) if (inst->mispredicted()) { int stage_num = exec_req->getStageNum(); ThreadID tid = inst->readTid(); - // If it's a branch ... if (inst->isDirectCtrl()) { assert(!inst->isIndirectCtrl()); @@ -247,13 +243,13 @@ ExecutionUnit::execute(int slot_num) seq_num, (inst->resultType(0) == InOrderDynInst::Float) ? inst->readFloatResult(0) : inst->readIntResult(0)); - - exec_req->done(); } else { - warn("inst [sn:%i] had a %s fault", - seq_num, fault->name()); - cpu->trap(fault, tid, inst); + DPRINTF(InOrderExecute, "[tid:%i]: [sn:%i]: had a %s " + "fault.\n", inst->readTid(), seq_num, fault->name()); + inst->fault = fault; } + + exec_req->done(); } } break; |