[gem5-users] Re: does gem5 have a C++ API?
Hi Jason, Thanks for the reply! I was hoping for something light-weight, similar to Unicorn, but based on gem5 instead of QEMU... I tried running build/X86/gem5.opt configs/example/se.py -c ./tests/test-progs/hello/bin/x86/linux/hello and it takes 0.3 second -- too slow. The profile shows: 14.55% gem5.opt libpython3.9.so.1.0[.] _PyEval_EvalFrameDefault 2.31% gem5.opt libpython3.9.so.1.0[.] _PyType_Lookup 2.01% gem5.opt libpython3.9.so.1.0[.] _PyObject_GenericGetAttrWithDict 1.09% gem5.opt libpython3.9.so.1.0[.] _Py_CheckFunctionResult 1.06% gem5.opt libpython3.9.so.1.0[.] 0x002000b0 ... I.e. all the time for simulating a tiny test is spent in python. I'd like to be able to simulate tiny programs, like "hello" from the examples, but hopefully at least 100x faster than this. What's the best supported mechanism for running many tiny simulations w/o having to pay for the large python overhead? Any examples? --kcc On Thu, Jul 1, 2021 at 5:00 PM Jason Lowe-Power wrote: > Hello, > > It's somewhat possible. You can compile gem5 as a library (e.g., scons > build//libgem5-opt.so). However, gem5 *is a python > interpreter* and is configured via python scripts. Getting that to work > with an external program is "exciting". It's possible to get python > working, and there are other workarounds like using the CXXConfig > interface, but it's not straightforward or easy to understand. > > Unless you're trying to integrate gem5 into another simulator, it's > unlikely that invoking gem5 from another program is the best option. Even > in this case, I would advise going the other way and using gem5 as the > driver simulator. That said, there are many simulators that integrate with > gem5. You can easily hook in things like DRAMSim, at one point I integrated > it with GPGPU-Sim (this is now incredibly out of date), and there is an > SST-gem5 bridge that we are actively working on. Finally, there are many > efforts to integrate gem5 with SystemC including implementing the entire > SystemC spec in gem5. > > Hopefully this helps. I'd be happy to provide more specific help with some > more information :). > > Cheers, > Jason > > On Thu, Jul 1, 2021 at 4:49 PM Konstantin Serebryany via gem5-users < > gem5-users@gem5.org> wrote: > >> Hi, >> >> [gem5 newbie here... ] >> >> Does gem5 have a C++ API? >> >> I am interested in using gem5 as a library, i.e. invoking >> the system call emulation mode from within my process, >> without fork/exec or python. >> Is that at all possible? >> Any pointers? >> >> thanks! >> >> --kcc >> >> ___ >> gem5-users mailing list -- gem5-users@gem5.org >> To unsubscribe send an email to gem5-users-le...@gem5.org >> %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s > > ___ gem5-users mailing list -- gem5-users@gem5.org To unsubscribe send an email to gem5-users-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-users] Re: does gem5 have a C++ API?
Hello, It's somewhat possible. You can compile gem5 as a library (e.g., scons build//libgem5-opt.so). However, gem5 *is a python interpreter* and is configured via python scripts. Getting that to work with an external program is "exciting". It's possible to get python working, and there are other workarounds like using the CXXConfig interface, but it's not straightforward or easy to understand. Unless you're trying to integrate gem5 into another simulator, it's unlikely that invoking gem5 from another program is the best option. Even in this case, I would advise going the other way and using gem5 as the driver simulator. That said, there are many simulators that integrate with gem5. You can easily hook in things like DRAMSim, at one point I integrated it with GPGPU-Sim (this is now incredibly out of date), and there is an SST-gem5 bridge that we are actively working on. Finally, there are many efforts to integrate gem5 with SystemC including implementing the entire SystemC spec in gem5. Hopefully this helps. I'd be happy to provide more specific help with some more information :). Cheers, Jason On Thu, Jul 1, 2021 at 4:49 PM Konstantin Serebryany via gem5-users < gem5-users@gem5.org> wrote: > Hi, > > [gem5 newbie here... ] > > Does gem5 have a C++ API? > > I am interested in using gem5 as a library, i.e. invoking > the system call emulation mode from within my process, > without fork/exec or python. > Is that at all possible? > Any pointers? > > thanks! > > --kcc > > ___ > gem5-users mailing list -- gem5-users@gem5.org > To unsubscribe send an email to gem5-users-le...@gem5.org > %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s ___ gem5-users mailing list -- gem5-users@gem5.org To unsubscribe send an email to gem5-users-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-users] does gem5 have a C++ API?
Hi, [gem5 newbie here... ] Does gem5 have a C++ API? I am interested in using gem5 as a library, i.e. invoking the system call emulation mode from within my process, without fork/exec or python. Is that at all possible? Any pointers? thanks! --kcc ___ gem5-users mailing list -- gem5-users@gem5.org To unsubscribe send an email to gem5-users-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-users] init-file parser has trouble with comments
Comments (lines beginning with '#') at the beginning seem fine, but further down in the file they cause a line to be printed "Can't parse .ini line [...]", and the run is aborted. Thanks, Jeff -- Jeff Inman High-Performance Computing (HPC-ENV) Ultrascale Systems Research Center Los Alamos National Laboratory ___ gem5-users mailing list -- gem5-users@gem5.org To unsubscribe send an email to gem5-users-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-users] Heterogeneous memory channels
Hi, I'm using gem5 for few month ago, and now I want to experiment with heterogeneous memory channels like 7 channels HBM + 1 channels DDR4 in the same system. I tried to modify de Ruby.py file in order to create 1 ddr4 controller and 7 hbm controllers. The system boot, but when i run a stream benchmark the resulting bandwidth is exactly the same as if I used 8 DDR4 channels. so my question is the following one : is gem5 allow using heterogeneous memory channels ? if yes how ? Thanks for you help, Mokrane.H ___ gem5-users mailing list -- gem5-users@gem5.org To unsubscribe send an email to gem5-users-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
[gem5-users] instrutions statistics
Hi Jason: Previously, I have seen examples about the increase of kernel-mode instructions and user-mode instructions on the GEM5 official website. However, I cannot find them on the official website. The web page has been updated. If yes, where can I refer to these examples? ___ gem5-users mailing list -- gem5-users@gem5.org To unsubscribe send an email to gem5-users-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s