summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas.sandberg@arm.com>2018-06-20 14:23:59 +0100
committerAndreas Sandberg <andreas.sandberg@arm.com>2018-08-02 08:29:57 +0000
commit4b2e28307d0a1c2b31e403e8e394261eb363a7a9 (patch)
treee9ceb499c3a4d6af3517aa853ecec60eedf72a8d /src/arch
parenta27ce59a39ec8fa20a3c4e9fa53e9b3db1199e91 (diff)
downloadgem5-4b2e28307d0a1c2b31e403e8e394261eb363a7a9.tar.xz
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 <giacomo.travaglini@arm.com> Reviewed-on: https://gem5-review.googlesource.com/11520 Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/arm/ArmPMU.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/arch/arm/ArmPMU.py b/src/arch/arm/ArmPMU.py
index a87c20b4a..9da3de28a 100644
--- a/src/arch/arm/ArmPMU.py
+++ b/src/arch/arm/ArmPMU.py
@@ -115,8 +115,9 @@ class ArmPMU(SimObject):
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