Running Java programs in gem5(or any language which is not C)

后端 未结 2 1297
感动是毒
感动是毒 2021-01-24 02:01

This may be a silly question, but i\'m learning about gem5 recently and i\'m being able to simulate my C programs using this software, in syscall emulation and in full system si

2条回答
  •  攒了一身酷
    2021-01-24 02:18

    Similar post: Is it possible to run java -jar on gem5 simulator with ISA x86?

    A full system Ubuntu image will almost certainly work (pre-install Java with QEMU user mode before running gem5).

    X86 syscall emulation could in theory just work, the command line would be something like:

    build/X86/gem5.opt \
      configs/example/se.py \
      --cmd /usr/bin/java \
      --options HelloWorld \
      --param 'system.cpu[0].workload[:].release = "5.2.1"' \
    

    where /usr/bin/java is the Java interpreter ELF executable just like your C program, and HelloWorld.class is the compiled Java class passed as an argument to java.

    However, I tried this on Ubuntu 18.04 and gem5 61005bb9ef455b2ac851f8a992f2cec5686e520f and it failed with:

    /usr/bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory

    I'm not sure why that was the case, it would require further investigation.

    Analogous for Python: Is it possible to run Python code in Gem5 syscall emulation mode?

提交回复
热议问题