tests,configs: Update x86 boot tests/examples with Workload

As of this commit:
https://gem5-review.googlesource.com/c/public/gem5-resources/+/62658
there is an x86-ubuntu-18.04-boot workload.

Where appropriate tests and example scripts have been updated to use
this workload.

Change-Id: I7c9dc8e0e53b1d3f4c365f0382b5f5d4224436f7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/62663
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
This commit is contained in:
Bobby R. Bruce
2022-08-24 14:07:45 -07:00
committed by Bobby Bruce
parent bfcf5f0b91
commit af4fd2f2c6
3 changed files with 19 additions and 29 deletions

View File

@@ -49,9 +49,9 @@ from gem5.components.processors.simple_switchable_processor import (
from gem5.components.processors.cpu_types import CPUTypes
from gem5.isas import ISA
from gem5.coherence_protocol import CoherenceProtocol
from gem5.resources.resource import Resource
from gem5.simulate.simulator import Simulator
from gem5.simulate.exit_event import ExitEvent
from gem5.resources.workload import Workload
# This runs a check to ensure the gem5 binary is compiled to X86 and to the
# MESI Two Level coherence protocol.
@@ -117,15 +117,9 @@ command = (
+ "m5 exit;"
)
board.set_kernel_disk_workload(
# The x86 linux kernel will be automatically downloaded to the if not
# already present.
kernel=Resource("x86-linux-kernel-5.4.49"),
# The x86 ubuntu image will be automatically downloaded to the if not
# already present.
disk_image=Resource("x86-ubuntu-18.04-img"),
readfile_contents=command,
)
workload = Workload("x86-ubuntu-18.04-boot")
workload.set_parameter("readfile_contents", command)
board.set_workload(workload)
simulator = Simulator(
board=board,

View File

@@ -45,7 +45,7 @@ scons build/X86/gem5.opt
"""
from gem5.prebuilt.demo.x86_demo_board import X86DemoBoard
from gem5.resources.resource import Resource
from gem5.resources.workload import Workload
from gem5.simulate.simulator import Simulator
@@ -53,13 +53,10 @@ from gem5.simulate.simulator import Simulator
# simulation.
board = X86DemoBoard()
# We then set the workload. Here we use the 5.4.49 Linux kernel with an X86
# Ubuntu OS. If these cannot be found locally they will be automatically
# downloaded.
board.set_kernel_disk_workload(
kernel=Resource("x86-linux-kernel-5.4.49"),
disk_image=Resource("x86-ubuntu-18.04-img"),
)
# We then set the workload. Here we use the "x86-ubuntu-18.04-boot" workload.
# This boots Ubuntu 18.04 with Linux 5.4.49. If the required resources are not
# found locally, they will be downloaded.
board.set_workload(Workload("x86-ubuntu-18.04-boot"))
simulator = Simulator(board=board)
simulator.run()

View File

@@ -33,7 +33,6 @@ import m5
from gem5.runtime import get_runtime_coherence_protocol
from gem5.isas import ISA
from gem5.utils.requires import requires
from gem5.resources.resource import Resource
from gem5.coherence_protocol import CoherenceProtocol
from gem5.components.boards.x86_board import X86Board
from gem5.components.processors.cpu_types import (
@@ -42,10 +41,15 @@ from gem5.components.processors.cpu_types import (
)
from gem5.components.processors.simple_processor import SimpleProcessor
from gem5.simulate.simulator import Simulator
from gem5.resources.workload import Workload
import argparse
import importlib
from python.gem5.components.boards.kernel_disk_workload import (
KernelDiskWorkload,
)
parser = argparse.ArgumentParser(
description="A script to run the gem5 boot test. This test boots the "
"linux kernel."
@@ -184,17 +188,12 @@ kernal_args = motherboard.get_default_kernel_args()
if args.boot_type == "init":
kernal_args.append("init=/root/exit.sh")
# Set the Full System workload.
motherboard.set_kernel_disk_workload(
kernel=Resource(
"x86-linux-kernel-5.4.49", resource_directory=args.resource_directory
),
disk_image=Resource(
"x86-ubuntu-18.04-img", resource_directory=args.resource_directory
),
kernel_args=kernal_args,
# Set the workload.
workload = Workload(
"x86-ubuntu-18.04-boot", resource_directory=args.resource_directory
)
workload.set_parameter("kernel_args", kernal_args)
motherboard.set_workload(workload)
# Begin running of the simulation. This will exit once the Linux system boot
# is complete.