Hello kokoro,
I'd like you to do a code review.
Please visit
https://gem5-review.googlesource.com/c/public/gem5/+/65974?usp=email
to review the following change.
Change subject: configs,stdlib,tests: Update riscvmatched-fs.py to-init
......................................................................
configs,stdlib,tests: Update riscvmatched-fs.py to-init
The "test-gem5-library-example-riscvmatched-fs" test, which runs
"configs/example/gem5_library/riscvmatched-fs.py", was running the
script in full. This takes a very long time. Given we already have boot
tests for RISCV, it's better to just run this configuration to just the
end of the Linux boot (significantly faster than a full OS boot). This
patch adds this feature to the config script and modifies the test to
utilize it.
Change-Id: I1e37a26aab5e9a127ebd64590be79fbc16fe53aa
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/65853
Reviewed-by: Bobby Bruce <bbr...@ucdavis.edu>
Maintainer: Bobby Bruce <bbr...@ucdavis.edu>
Tested-by: kokoro <noreply+kok...@google.com>
---
M configs/example/gem5_library/riscvmatched-fs.py
M tests/gem5/gem5_library_example_tests/test_gem5_library_examples.py
2 files changed, 47 insertions(+), 2 deletions(-)
diff --git a/configs/example/gem5_library/riscvmatched-fs.py
b/configs/example/gem5_library/riscvmatched-fs.py
index 8cf20d9..3e84b8c 100644
--- a/configs/example/gem5_library/riscvmatched-fs.py
+++ b/configs/example/gem5_library/riscvmatched-fs.py
@@ -44,8 +44,23 @@
from gem5.simulate.simulator import Simulator
from gem5.resources.workload import Workload
+import argparse
+
requires(isa_required=ISA.RISCV)
+parser = argparse.ArgumentParser(
+ description="A script which uses the RISCVMatchedBoard in FS mode."
+)
+
+parser.add_argument(
+ "-i",
+ "--to-init",
+ action="store_true",
+ help="Exit the simulation after the Linux Kernel boot.",
+)
+
+args = parser.parse_args()
+
# instantiate the riscv matched board with default parameters
board = RISCVMatchedBoard(
clk_freq="1.2GHz",
@@ -57,7 +72,16 @@
# Ubuntu 20.04. Once the system successfully boots it encounters an
`m5_exit`
# instruction which stops the simulation. When the simulation has ended
you may
# inspect `m5out/system.pc.com_1.device` to see the stdout.
-board.set_workload(Workload("riscv-ubuntu-20.04-boot"))
+#
+# 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 = Workload("riscv-ubuntu-20.04-boot")
+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)
simulator = Simulator(board=board)
simulator.run()
diff --git
a/tests/gem5/gem5_library_example_tests/test_gem5_library_examples.py
b/tests/gem5/gem5_library_example_tests/test_gem5_library_examples.py
index 28a10b5..254b15c 100644
--- a/tests/gem5/gem5_library_example_tests/test_gem5_library_examples.py
+++ b/tests/gem5/gem5_library_example_tests/test_gem5_library_examples.py
@@ -319,7 +319,7 @@
"gem5_library",
"riscvmatched-fs.py",
),
- config_args=[],
+ config_args=["--to-init"],
valid_isas=(constants.riscv_tag,),
valid_hosts=constants.supported_hosts,
length=constants.very_long_tag,
--
To view, visit
https://gem5-review.googlesource.com/c/public/gem5/+/65974?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: release-staging-v22-1
Gerrit-Change-Id: I1e37a26aab5e9a127ebd64590be79fbc16fe53aa
Gerrit-Change-Number: 65974
Gerrit-PatchSet: 1
Gerrit-Owner: Bobby Bruce <bbr...@ucdavis.edu>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org