How to preload memory with given raw bytes in gem5 from the command line in addition to the main ELF executable?

后端 未结 1 564
無奈伤痛
無奈伤痛 2021-01-27 06:10

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

相关标签:
1条回答
  • 2021-01-27 06:25

    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.

    0 讨论(0)
提交回复
热议问题