Gabe Black has submitted this change and it was merged. ( https://gem5-review.googlesource.com/7124 )

Change subject: cpu: Use the NotAnInst flag to avoid passing an inst to fetch faults.
......................................................................

cpu: Use the NotAnInst flag to avoid passing an inst to fetch faults.

When a fault happens in fetch in O3, a dummy inst is created to carry
the fault through the pipeline to commit, but conceptually there isn't
actually any instruction since we failed to fetch one.

This change marks the dummy instruction as NotAnInst, and when any
such instruction gets to commit, the fault object associated with it
is invoked and passed a null static inst pointer instead of a pointer
to the dummy inst.

Change-Id: I18d993083406deb625402e06af4ba0d4772ca5a3
Reviewed-on: https://gem5-review.googlesource.com/7124
Reviewed-by: Jason Lowe-Power <[email protected]>
Maintainer: Gabe Black <[email protected]>
---
M src/cpu/o3/commit_impl.hh
M src/cpu/o3/fetch_impl.hh
2 files changed, 5 insertions(+), 1 deletion(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved
  Gabe Black: Looks good to me, approved



diff --git a/src/cpu/o3/commit_impl.hh b/src/cpu/o3/commit_impl.hh
index b3a97ad..d32493c 100644
--- a/src/cpu/o3/commit_impl.hh
+++ b/src/cpu/o3/commit_impl.hh
@@ -1225,7 +1225,10 @@
         // needed to update the state as soon as possible.  This
         // prevents external agents from changing any specific state
         // that the trap need.
-        cpu->trap(inst_fault, tid, head_inst->staticInst);
+        cpu->trap(inst_fault, tid,
+                  head_inst->notAnInst() ?
+                      StaticInst::nullStaticInstPtr :
+                      head_inst->staticInst);

         // Exit state update mode to avoid accidental updating.
         thread[tid]->noSquashFromTC = false;
diff --git a/src/cpu/o3/fetch_impl.hh b/src/cpu/o3/fetch_impl.hh
index 6cca77a..d879342 100644
--- a/src/cpu/o3/fetch_impl.hh
+++ b/src/cpu/o3/fetch_impl.hh
@@ -729,6 +729,7 @@
         // We will use a nop in ordier to carry the fault.
DynInstPtr instruction = buildInst(tid, StaticInst::nopStaticInstPtr,
                                            NULL, fetchPC, fetchPC, false);
+        instruction->setNotAnInst();

         instruction->setPredTarg(fetchPC);
         instruction->fault = fault;

--
To view, visit https://gem5-review.googlesource.com/7124
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I18d993083406deb625402e06af4ba0d4772ca5a3
Gerrit-Change-Number: 7124
Gerrit-PatchSet: 2
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Curtis Dunham <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to