From 215d5e4096cb4b06aa7fd5e9936440b28d8fe034 Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Tue, 28 Aug 2018 11:56:55 +0100 Subject: config: Move KVM CPU checking to CpuConfig helper module Both se.py and fs.py need to check if a CPU is a KVM CPU. This is somewhat involved since CPUs can be disabled at compile time. Enable better code reuse by moving it to the CpuConfig module. Change-Id: I47b1512ecb62e757399a407a0e41be83b9f83be3 Signed-off-by: Andreas Sandberg Reviewed-on: https://gem5-review.googlesource.com/12418 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power --- configs/example/fs.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'configs/example/fs.py') diff --git a/configs/example/fs.py b/configs/example/fs.py index 4031fd05e..f299d761c 100644 --- a/configs/example/fs.py +++ b/configs/example/fs.py @@ -66,14 +66,6 @@ from common import CpuConfig from common.Caches import * from common import Options - -# Check if KVM support has been enabled, we might need to do VM -# configuration if that's the case. -have_kvm_support = 'BaseKvmCPU' in globals() -def is_kvm_cpu(cpu_class): - return have_kvm_support and cpu_class != None and \ - issubclass(cpu_class, BaseKvmCPU) - def cmd_line_template(): if options.command_line and options.command_line_file: print("Error: --command-line and --command-line-file are " @@ -148,7 +140,7 @@ def build_test_system(np): test_sys.cpu = [TestCPUClass(clk_domain=test_sys.cpu_clk_domain, cpu_id=i) for i in xrange(np)] - if is_kvm_cpu(TestCPUClass) or is_kvm_cpu(FutureClass): + if CpuConfig.is_kvm_cpu(TestCPUClass) or CpuConfig.is_kvm_cpu(FutureClass): test_sys.kvm_vm = KvmVM() if options.ruby: @@ -282,7 +274,7 @@ def build_drive_system(np): if options.kernel is not None: drive_sys.kernel = binary(options.kernel) - if is_kvm_cpu(DriveCPUClass): + if CpuConfig.is_kvm_cpu(DriveCPUClass): drive_sys.kvm_vm = KvmVM() drive_sys.iobridge = Bridge(delay='50ns', -- cgit v1.2.3