sim: Rework the Linux Kernel exit events (#639)

This patch reworks the Linux Kernel panic and oops events. The code has
been re-factored to provide re-usable events that can be applied to all
ISAs from the base `KernelWorkload` `SimObject`. At the moment they are
installed for the Arm workloads.

This update also provides more configuration options that can be
specified using the new `KernelPanicOopsBehaviour` enum. The options are
applied to the Kernel Workload parameters `on_panic` and `on_oops` which
are available to all subclasses of `KernelWorkload`.

The main rationale for this reworking is to add the option to cleanly
exit the simulation after dumping the Dmesg buffer. Without this option,
the simulation would continue running after a Kernel panic. If system
components (e.g. a system timer) keep the event queue alive, this causes
the simulation to run slowly to the maximum allowed tick.
This commit is contained in:
Richard Cooper
2023-12-02 01:33:59 +00:00
committed by GitHub
parent ecb72b74f8
commit d9c870f641
5 changed files with 89 additions and 61 deletions

View File

@@ -1,5 +1,16 @@
# -*- mode:python -*-
# Copyright (c) 2023 Arm Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality of the software
# licensed hereunder. You may use the software subject to the license
# terms below provided that you ensure that this notice is replicated
# unmodified and in its entirety in all distributions of the software,
# modified or unmodified, in source code or in binary form.
#
# Copyright (c) 2006 The Regents of The University of Michigan
# All rights reserved.
#
@@ -31,7 +42,8 @@ Import('*')
SimObject('ClockedObject.py', sim_objects=['ClockedObject'])
SimObject('TickedObject.py', sim_objects=['TickedObject'])
SimObject('Workload.py', sim_objects=[
'Workload', 'StubWorkload', 'KernelWorkload', 'SEWorkload'])
'Workload', 'StubWorkload', 'KernelWorkload', 'SEWorkload'],
enums=['KernelPanicOopsBehaviour'])
SimObject('Root.py', sim_objects=['Root'])
SimObject('ClockDomain.py', sim_objects=[
'ClockDomain', 'SrcClockDomain', 'DerivedClockDomain'])