misc: revert riscvmatched-fs.py due to a bug

- link to issue https://github.com/gem5/gem5/issues/1554

Change-Id: Ic9cf6e5166eeee2226b6022e6f7c971d4e7caaeb
This commit is contained in:
Harshil Patel
2024-09-16 09:50:44 -07:00
committed by Bobby R. Bruce
parent e221a70355
commit e51bc00dc7

View File

@@ -43,7 +43,6 @@ import argparse
from gem5.isas import ISA
from gem5.prebuilt.riscvmatched.riscvmatched_board import RISCVMatchedBoard
from gem5.resources.resource import obtain_resource
from gem5.simulate.exit_event import ExitEvent
from gem5.simulate.simulator import Simulator
from gem5.utils.requires import requires
@@ -77,33 +76,12 @@ board = RISCVMatchedBoard(
# In the case where the `-i` flag is passed, we add the kernel argument
# `init=/root/exit.sh`. This means the simulation will exit after the Linux
# Kernel has booted.
workload = obtain_resource("riscv-ubuntu-24.04-boot", resource_version="1.0.0")
workload = obtain_resource("riscv-ubuntu-20.04-boot", resource_version="3.0.0")
kernel_args = board.get_default_kernel_args()
if args.to_init:
kernel_args.append("init=/root/exit.sh")
workload.set_parameter("kernel_args", kernel_args)
board.set_workload(workload)
def exit_event_handler():
print("First exit: kernel booted")
yield False # gem5 is now executing systemd startup
print("Second exit: Started `after_boot.sh` script")
# The after_boot.sh script is executed after the kernel and systemd have
# booted.
yield False # gem5 is now executing the `after_boot.sh` script
print("Third exit: Finished `after_boot.sh` script")
# The after_boot.sh script will run a script if it is passed via
# m5 readfile. This is the last exit event before the simulation exits.
yield True
simulator = Simulator(
board=board,
on_exit_event={
# Here we want override the default behavior for the first m5 exit
# exit event.
ExitEvent.EXIT: exit_event_handler()
},
)
simulator = Simulator(board=board)
simulator.run()