stdlib: Changed use of Workload to obtain_resource

- Changed files calling Workload class to call obtain_resoucre instead.

Change-Id: I41f5f0c3ccc7c08b39e7049eabef9609d6d68788
This commit is contained in:
Harshil Patel
2023-09-06 10:06:16 -07:00
parent bf06d61c35
commit bbe96d6485
11 changed files with 23 additions and 22 deletions

View File

@@ -43,7 +43,7 @@ scons build/ARM/gem5.opt -j<NUM_CPUS>
from gem5.isas import ISA
from m5.objects import ArmDefaultRelease
from gem5.utils.requires import requires
from gem5.resources.workload import Workload
from gem5.resources.resource import obtain_resource
from gem5.simulate.simulator import Simulator
from m5.objects import VExpress_GEM5_Foundation
from gem5.coherence_protocol import CoherenceProtocol
@@ -100,7 +100,7 @@ board = ArmBoard(
# Here we set a full system workload. The "arm64-ubuntu-20.04-boot" boots
# Ubuntu 20.04.
board.set_workload(Workload("arm64-ubuntu-20.04-boot"))
board.set_workload(obtain_resource("arm64-ubuntu-20.04-boot"))
# We define the system with the aforementioned system defined.

View File

@@ -51,7 +51,7 @@ from gem5.components.cachehierarchies.ruby.caches.mesi_three_level.octopi import
from gem5.isas import ISA
from gem5.coherence_protocol import CoherenceProtocol
from gem5.simulate.simulator import Simulator
from gem5.resources.workload import Workload
from gem5.resources.resource import obtain_resource
num_ccds = 1 # CCDs
num_cores_per_ccd = 8 # 8 cores/CCD
@@ -94,7 +94,7 @@ board = ArmBoard(
platform=platform,
)
board.set_workload(Workload("arm64-ubuntu-20.04-boot"))
board.set_workload(obtain_resource("arm64-ubuntu-20.04-boot"))
simulator = Simulator(board=board)
simulator.run()

View File

@@ -56,7 +56,7 @@ from gem5.components.memory.single_channel import SingleChannelDDR3_1600
from gem5.components.processors.simple_processor import SimpleProcessor
from gem5.components.processors.cpu_types import CPUTypes
from gem5.isas import ISA
from gem5.resources.workload import Workload
from gem5.resources.resource import obtain_resource
from pathlib import Path
from gem5.simulate.exit_event_generators import (
looppoint_save_checkpoint_generator,
@@ -110,7 +110,9 @@ board = SimpleBoard(
cache_hierarchy=cache_hierarchy,
)
board.set_workload(Workload("x86-matrix-multiply-omp-100-8-looppoint-csv"))
board.set_workload(
obtain_resource("x86-matrix-multiply-omp-100-8-looppoint-csv")
)
dir = Path(args.checkpoint_path)
dir.mkdir(exist_ok=True)

View File

@@ -54,7 +54,6 @@ from gem5.components.processors.simple_processor import SimpleProcessor
from gem5.components.processors.cpu_types import CPUTypes
from gem5.isas import ISA
from gem5.resources.resource import obtain_resource
from gem5.resources.workload import Workload
from m5.stats import reset, dump
requires(isa_required=ISA.X86)
@@ -113,7 +112,7 @@ board = SimpleBoard(
)
board.set_workload(
Workload(
obtain_resource(
f"x86-matrix-multiply-omp-100-8-looppoint-region-{args.checkpoint_region}"
)
)

View File

@@ -50,7 +50,7 @@ from gem5.components.processors.simple_processor import SimpleProcessor
from gem5.components.processors.cpu_types import CPUTypes
from gem5.isas import ISA
from gem5.simulate.simulator import Simulator
from gem5.resources.workload import Workload
from gem5.resources.resource import obtain_resource
# This runs a check to ensure the gem5 binary is compiled for RISCV.
@@ -88,7 +88,7 @@ board = RiscvBoard(
# 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"))
board.set_workload(obtain_resource("riscv-ubuntu-20.04-boot"))
simulator = Simulator(board=board)
simulator.run()

View File

@@ -42,7 +42,7 @@ from gem5.prebuilt.riscvmatched.riscvmatched_board import RISCVMatchedBoard
from gem5.utils.requires import requires
from gem5.isas import ISA
from gem5.simulate.simulator import Simulator
from gem5.resources.workload import Workload
from gem5.resources.resource import obtain_resource
import argparse
@@ -76,7 +76,7 @@ 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 = Workload("riscv-ubuntu-20.04-boot")
workload = obtain_resource("riscv-ubuntu-20.04-boot")
kernel_args = board.get_default_kernel_args()
if args.to_init:
kernel_args.append("init=/root/exit.sh")

View File

@@ -52,7 +52,7 @@ from gem5.isas import ISA
from gem5.coherence_protocol import CoherenceProtocol
from gem5.simulate.simulator import Simulator
from gem5.simulate.exit_event import ExitEvent
from gem5.resources.workload import Workload
from gem5.resources.resoruce import obtain_resource
# This simulation requires using KVM with gem5 compiled for X86 simulation
# and with MESI_Two_Level cache coherence protocol.
@@ -121,7 +121,7 @@ command = (
+ "m5 exit;"
)
workload = Workload("x86-ubuntu-18.04-boot")
workload = obtain_resource("x86-ubuntu-18.04-boot")
workload.set_parameter("readfile_contents", command)
board.set_workload(workload)

View File

@@ -51,7 +51,7 @@ from gem5.isas import ISA
from gem5.coherence_protocol import CoherenceProtocol
from gem5.simulate.simulator import Simulator
from gem5.simulate.exit_event import ExitEvent
from gem5.resources.workload import Workload
from gem5.resources.resource import obtain_resource
# This runs a check to ensure the gem5 binary is compiled to X86 and to the
# MESI Two Level coherence protocol.
@@ -117,7 +117,7 @@ command = (
+ "m5 exit;"
)
workload = Workload("x86-ubuntu-18.04-boot")
workload = obtain_resource("x86-ubuntu-18.04-boot")
workload.set_parameter("readfile_contents", command)
board.set_workload(workload)

View File

@@ -45,7 +45,7 @@ scons build/X86/gem5.opt
"""
from gem5.prebuilt.demo.x86_demo_board import X86DemoBoard
from gem5.resources.workload import Workload
from gem5.resources.resource import obtain_resource
from gem5.simulate.simulator import Simulator
@@ -56,7 +56,7 @@ board = X86DemoBoard()
# 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"))
board.set_workload(obtain_resource("x86-ubuntu-18.04-boot"))
simulator = Simulator(board=board)
simulator.run()