Hi Jasmin, I'm not sure if I totally understand what you're trying to do, but I think I can give some pointers in the right direction.
First, to "control gem5" you can use any python script that you create. There is a python API, and in fact, that's what all of the scripts in configs/examples use. This isn't exactly what you're asking, but if your program that you want to control gem5 can be written in Python, then it should work. Otherwise, there is a way to make gem5 into a library for use with SystemC, but I don't know exactly how to use this feature. It's there somewhere, though ;). Second, to get something specific to happen in gem5 FS mode you have a couple of options. Using the distributed disk images, you can just pass a runscript via the System object (or the command line using fs.py). This script is then executed after the system boots up. If you need more control than this, you can probably use the m5 magic instructions (e.g., readfile) to read a script in from the host into the guest even from a guest-executing program. The readfile magic instruction is how the runscript I mentioned above is implemented. You can see sample runscipts in configs/boot. The hackback.rcS is a good example of the complex things you can do with runscripts and magic instructions. Cheers, Jason On Fri, Sep 23, 2016 at 9:54 AM Jasmin Jahic <[email protected]> wrote: > Hello, > > I am working with gem5 and I have encountered one interesting challenge. > There is a program which should control gem5. A control program should > start gem5. The gem5 should run in the Full system mode, as a library. The > control program can call some functions from gem5, e.g. initialize(), > simulate(), etc. This starts gem5. > > When starting from the terminal line, gem5 in FS can take binaries as > arguments. I was wondering, where are these binaries handled? While gem5 is > running, would it be possible to execute some binary by calling some call > some function from gem5 and to either pass a binary from a host or have > gem5 execute binary from the full system image (I assume this would be not > so easy, as gem5 sees only instructions, correct?)? > > Best regards, > Jasmin > _______________________________________________ > gem5-users mailing list > [email protected] > http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
_______________________________________________ gem5-users mailing list [email protected] http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
