ARM-software / workload-automation

A framework for automating workload execution and measurement collection on ARM devices.
Apache License 2.0
152 stars 120 forks source link

Gem5 Support #1243

Open ShvetankPrakash opened 1 year ago

ShvetankPrakash commented 1 year ago

Hello!

I was wondering if WA integration with Gem5 is still supported: http://old.gem5.org/wiki/images/b/b8/Summit2017_wa_devlib.pdf

And if so would you be able to point me to a link where it outlines how to get this setup so I can run the workloads using Gem5.

Thank you so much!

marcbonnici commented 1 year ago

Hi Shvetank,

WA and devlib technically still have support for the Gem5 platform, however as far as I'm aware this has not been exercised in a few years and therefore I do not expect this functionality to work out of the box today.

Unfortunately I think the old documentation you've found is probably still the most update to date guide we have available so depending on what your overall aim is, there are few options that we could suggest:

1) Pick up the old version of WA that is more inline with when that guidance was written, this would likely be the path of least resistance to getting "something" running, however may miss out of some later features or workloads.

2) Pick up a slightly older version of WA/Devlib so it includes more of the recent changes and other fixes that have been added but may still have some incompatibilities that could required digging into.

3) Pick up that latest versions which I suspect could require a fair bit of work to adapt the Gem5 target to some changes that have been made recently to improve the performance / flexibility of other connections (SSH/ADB) that could cause compatibility issues.

We'd be happy to try and provide some further pointers to you if you wanted to peruse any of these options so please let us know if any of these sound of interest to you.

Thanks.

Sticklyman1936 commented 1 year ago

Hi Shvetank,

Just to build on what Marc has said above:

The (old) documentation on gem5.org (http://old.gem5.org/WA-gem5.html) includes a gem5 patch to add a parameter to pass the directory to be mapped into the gem5 simulation to some of the gem5 run scripts. This directory is the one mapped into the simulation using VirtIO 9P, and it is used for transferring files into or out of the simulated system when running with WA or devlib. For example, this is used to copy workloads into the system prior to executing them.

The gem5 patch in the old documentation is no longer required if you use a modern gem5, as this function has now been merged (see https://github.com/gem5/gem5/commit/55c5b66ae48a3a20cf55bbe41048c0c2d217488c). This commit added the interface to configs/example/arm/fs_bigLITTLE.py. However, the parameter name itself has changed - the command line parameter is now --vio-9p=/path/to/folder, as opposed to --workload-automation-vio=/path/to/folder. Hence, you'll want an agenda that looks similar to the following (untested!):

config:
    device: gem5_linux
    device_config:
        gem5_args: "configs/example/arm/fs_bigLITTLE.py"
        gem5_vio_args: "--vio-9p={}"
        username: root
        temp_dir: "/tmp"
        checkpoint: True
        run_delay: 10
    reboot_policy: never
    result_processors: [~sqlite]
    instrumentation: [~cpufreq]

workloads:
  - id: dhrystone
    workload_name: dhrystone
    iterations: 1

If you try it, please let us know how it goes :)

douglas-raillard-arm commented 11 months ago

@Sticklyman1936 There has been a fair amount of change in the core of devlib over the past few years, and while I tried to keep the code working (based on eyeballing it), I think it's extremely likely that you will face some bugs (at least typos). On top of that, you might also face bugs that have been solved for all the other connection types.

Maybe that's irrelevant since I never used GEM5, but if you can make just make GEM5 run an SSH server and use a regular linux target, I would strongly advise doing so. You can setup a very minimal server, and even have the userspace built in a kernel image quite easily using buildroot (15-30 MB), as we do for some dev boards when using LISA: