From: Andreas Sandberg Date: Wed, 20 Jun 2018 13:23:59 +0000 (+0100) Subject: arch-arm: Don't fail to initialise PMU if BP is missing X-Git-Tag: v19.0.0.0~1968 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4b2e28307d0a1c2b31e403e8e394261eb363a7a9;p=gem5.git 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 Reviewed-on: https://gem5-review.googlesource.com/11520 Maintainer: Giacomo Travaglini --- 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