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/mult_div_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/mult_div_unit.cc')
-rw-r--r-- | src/cpu/inorder/resources/mult_div_unit.cc | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/cpu/inorder/resources/mult_div_unit.cc b/src/cpu/inorder/resources/mult_div_unit.cc index 55df1cc43..5aa0b0aa1 100644 --- a/src/cpu/inorder/resources/mult_div_unit.cc +++ b/src/cpu/inorder/resources/mult_div_unit.cc @@ -204,11 +204,7 @@ MultDivUnit::execute(int slot_num) { ResourceRequest* mult_div_req = reqMap[slot_num]; DynInstPtr inst = reqMap[slot_num]->inst; - Fault fault = reqMap[slot_num]->fault; - //ThreadID tid = inst->readTid(); - //int seq_num = inst->seqNum; - switch (mult_div_req->cmd) { case StartMultDiv: @@ -281,11 +277,8 @@ MultDivUnit::exeMulDiv(int slot_num) { ResourceRequest* mult_div_req = reqMap[slot_num]; DynInstPtr inst = reqMap[slot_num]->inst; - Fault fault = reqMap[slot_num]->fault; - ThreadID tid = inst->readTid(); - int seq_num = inst->seqNum; - fault = inst->execute(); + inst->fault = inst->execute(); if (inst->opClass() == IntMultOp) { multiplies++; @@ -293,15 +286,15 @@ MultDivUnit::exeMulDiv(int slot_num) divides++; } - if (fault == NoFault) { + if (inst->fault == NoFault) { inst->setExecuted(); mult_div_req->setCompleted(); - DPRINTF(Resource, "[tid:%i]: The result of execution is 0x%x.\n", + DPRINTF(InOrderMDU, "[tid:%i]: The result of execution is 0x%x.\n", inst->readTid(), inst->readIntResult(0)); } else { - warn("inst [sn:%i] had a %s fault", seq_num, fault->name()); - cpu->trap(fault, tid, inst); + DPRINTF(InOrderMDU, "[tid:%i]: [sn:%i]: had a %s " + "fault.\n", inst->readTid(), inst->seqNum, inst->fault->name()); } } |