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>
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