Hello Giacomo Travaglini,

I'd like you to do a code review. Please visit

    https://gem5-review.googlesource.com/11520

to review the following change.


Change subject: arch-arm: Don't fail to initialise PMU if BP is missing
......................................................................

arch-arm: Don't fail to initialise PMU if BP is missing

The branch predictor currently assumes that each CPU has a branch
predictor. This isn't true in some cases (e.g., KVM, Atomic).

Change-Id: I61e80dca940c2dadba1b812449691c9dba1c06d9
Reviewed-by: Giacomo Travaglini <[email protected]>
---
M src/arch/arm/ArmPMU.py
1 file changed, 3 insertions(+), 2 deletions(-)



diff --git a/src/arch/arm/ArmPMU.py b/src/arch/arm/ArmPMU.py
index a87c20b..9da3de2 100644
--- a/src/arch/arm/ArmPMU.py
+++ b/src/arch/arm/ArmPMU.py
@@ -115,8 +115,9 @@
         sharing the PMU (e.g., when switching between CPU models).
         """

- bpred = cpu.branchPred if cpu and not isNullPointer(cpu.branchPred) \
-            else None
+        bpred = getattr(cpu, "branchPred", None) if cpu else None
+        if bpred is not None and isNullPointer(bpred):
+            bpred = None

         self.addEvent(SoftwareIncrement(self,0x00))
         # 0x01: L1I_CACHE_REFILL

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

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I61e80dca940c2dadba1b812449691c9dba1c06d9
Gerrit-Change-Number: 11520
Gerrit-PatchSet: 1
Gerrit-Owner: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to