config: skip access to branchPred in ARM KVM
authorCiro Santilli <ciro.santilli@arm.com>
Mon, 23 Sep 2019 14:43:52 +0000 (15:43 +0100)
committerCiro Santilli <ciro.santilli@arm.com>
Mon, 7 Oct 2019 10:26:20 +0000 (10:26 +0000)
Prevents runtime error:

AttributeError: object 'ArmV8KvmCPU' has no attribute 'branchPred'

Change-Id: Ic5765fd560381cbacc2fa2fd2e6f79d98433c535
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21299
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
configs/example/fs.py

index e1501e674692ce46aab710d101de382654f81199..9216f704ca81b987175878f24c3ad86d2a6e55b1 100644 (file)
@@ -204,14 +204,15 @@ def build_test_system(np):
                 test_sys.cpu[i].addSimPointProbe(options.simpoint_interval)
             if options.checker:
                 test_sys.cpu[i].addCheckerCpu()
-            if options.bp_type:
-                bpClass = ObjectList.bp_list.get(options.bp_type)
-                test_sys.cpu[i].branchPred = bpClass()
-            if options.indirect_bp_type:
-                IndirectBPClass = ObjectList.indirect_bp_list.get(
-                    options.indirect_bp_type)
-                test_sys.cpu[i].branchPred.indirectBranchPred = \
-                    IndirectBPClass()
+            if not ObjectList.is_kvm_cpu(TestCPUClass):
+                if options.bp_type:
+                    bpClass = ObjectList.bp_list.get(options.bp_type)
+                    test_sys.cpu[i].branchPred = bpClass()
+                if options.indirect_bp_type:
+                    IndirectBPClass = ObjectList.indirect_bp_list.get(
+                        options.indirect_bp_type)
+                    test_sys.cpu[i].branchPred.indirectBranchPred = \
+                        IndirectBPClass()
             test_sys.cpu[i].createThreads()
 
         # If elastic tracing is enabled when not restoring from checkpoint and