python,configs: Add Resource class to gem5 components
The `Resource` class can be used to obtain a gem5 resource. The `Resource` class, via the `downloader` package, parses the gem5 resources `resources.json` file: https://gem5.googlesource.com/public/gem5-resources/+/refs/heads/develop/resources.json From this it can determine the available resources and where to download them. This allows for automatic retrieval of resources. The `CustomResource` can be used to specify a local resource not part of gem5 resources. The board's `set_workload` function has been updated to use the resources. The components library example scripts have been updated to demonstrate the `Resource`/`CustomResource` class usage. Issue-on: https://gem5.atlassian.net/browse/GEM5-1022 Change-Id: I59cfe81d5ec9c64576c0dab55af52aede96976fb Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49304 Reviewed-by: Austin Harris <austin.dane.harris@gmail.com> Maintainer: Jason Lowe-Power <power.jg@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -48,6 +48,7 @@ sys.path.append(
|
||||
)
|
||||
)
|
||||
|
||||
from components_library.resources.resource import CustomResource
|
||||
from components_library.boards.simple_board import SimpleBoard
|
||||
from components_library.cachehierarchies.classic.no_cache import NoCache
|
||||
from components_library.memory.single_channel import SingleChannelDDR3_1600
|
||||
@@ -76,9 +77,10 @@ motherboard.connect_things()
|
||||
|
||||
# Set the workload
|
||||
thispath = os.path.dirname(os.path.realpath(__file__))
|
||||
binary = os.path.join(
|
||||
thispath, "../../../tests/test-progs/hello/bin/x86/linux/hello"
|
||||
)
|
||||
binary = CustomResource(os.path.join(
|
||||
thispath,
|
||||
"../../../tests/test-progs/hello/bin/x86/linux/hello"
|
||||
))
|
||||
motherboard.set_workload(binary)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user