I need memory to be setup in a given way immediately when simulation starts before any instructions are executed.
I understand that this is essentially what the ELF load
Tested in gem5 f5f9ca46258ac2ded8f3402e5d271a18f8400183 (April 2020) I can achieve this with:
configs/example/fs.py \
--param 'system.workload.extras = "mydata.raw"' \
--param 'system.workload.extras_addrs = 0x83000000' \
where mydata.raw
contains the raw data to be loaded, and 0x83000000
is the base physical address to load to.
Both of those parameters are arrays, so you can load multiple raw binaries for example with:
configs/example/fs.py \
--param 'system.workload.extras = ["mydata.raw", "mydata2.raw"]' \
--param 'system.workload.extras_addrs = [0x83000000, 0x84000000]' \
This can be used for example to pass information to baremetal executables. For example, this could be used to implement baremetal command line arguments of a C program.