Hello,

It's somewhat possible. You can compile gem5 as a library (e.g., scons
build/<Default build opts>/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

Reply via email to