Skip to content

Commit

Permalink
tests: Add enable_dvm flag to test DVM in long regressions
Browse files Browse the repository at this point in the history
We are only adding the option to the LinuxArmFSSystem and not to the
LinuxArmFSSystemUniprocessor as DVM is only supported for more than one
CPU

Change-Id: I57004b85158fb898297fb9d91c38673a5bb88268
Signed-off-by: Giacomo Travaglini <[email protected]>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/59870
Reviewed-by: Jason Lowe-Power <[email protected]>
Maintainer: Jason Lowe-Power <[email protected]>
Tested-by: kokoro <[email protected]>
  • Loading branch information
giactra authored and BobbyRBruce committed May 24, 2022
1 parent 234d616 commit a6704ff
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions tests/gem5/configs/arm_generic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2012, 2017, 2019 ARM Limited
# Copyright (c) 2012, 2017, 2019, 2022 Arm Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
Expand Down Expand Up @@ -71,18 +71,19 @@ class LinuxArmSystemBuilder(object):
ARM-specific create_system method to a class deriving from one of
the generic base systems.
"""
def __init__(self, machine_type, aarch64_kernel, **kwargs):
def __init__(self, machine_type, aarch64_kernel, enable_dvm, **kwargs):
"""
Arguments:
machine_type -- String describing the platform to simulate
num_cpus -- integer number of CPUs in the system
use_ruby -- True if ruby is used instead of the classic memory system
"""
self.machine_type = machine_type
self.aarch64_kernel = aarch64_kernel
self.enable_dvm = enable_dvm
self.num_cpus = kwargs.get('num_cpus', 1)
self.mem_size = kwargs.get('mem_size', '256MB')
self.use_ruby = kwargs.get('use_ruby', False)
self.aarch64_kernel = aarch64_kernel

def init_kvm(self, system):
"""Do KVM-specific system initialization.
Expand Down Expand Up @@ -133,6 +134,10 @@ def create_system(self):
default_kernels[self.machine_type])

self.init_system(system)
if self.enable_dvm:
for cpu in system.cpu:
for decoder in cpu.decoder:
decoder.dvm_enabled = True

system.workload.dtb_filename = \
os.path.join(m5.options.outdir, 'system.dtb')
Expand All @@ -146,6 +151,7 @@ class LinuxArmFSSystem(LinuxArmSystemBuilder,
def __init__(self,
machine_type='VExpress_GEM5_Foundation',
aarch64_kernel=True,
enable_dvm=False,
**kwargs):
"""Initialize an ARM system that supports full system simulation.
Expand All @@ -157,7 +163,7 @@ def __init__(self,
"""
BaseFSSystem.__init__(self, **kwargs)
LinuxArmSystemBuilder.__init__(
self, machine_type, aarch64_kernel, **kwargs)
self, machine_type, aarch64_kernel, enable_dvm, **kwargs)

def create_caches_private(self, cpu):
# Use the more representative cache configuration
Expand All @@ -180,7 +186,7 @@ def __init__(self,
**kwargs):
BaseFSSystemUniprocessor.__init__(self, **kwargs)
LinuxArmSystemBuilder.__init__(
self, machine_type, aarch64_kernel, **kwargs)
self, machine_type, aarch64_kernel, False, **kwargs)

class LinuxArmFSSwitcheroo(LinuxArmSystemBuilder, BaseFSSwitcheroo):
"""Uniprocessor ARM system prepared for CPU switching"""
Expand All @@ -191,4 +197,4 @@ def __init__(self,
**kwargs):
BaseFSSwitcheroo.__init__(self, **kwargs)
LinuxArmSystemBuilder.__init__(
self, machine_type, aarch64_kernel, **kwargs)
self, machine_type, aarch64_kernel, False, **kwargs)

0 comments on commit a6704ff

Please sign in to comment.