我需要在Gem5中运行一些Python代码。作为测试,我创建了一个名为hello.py
的Python程序,它打印"Hello World from Python“。我使用Pyinstaller创建了hello.py
文件的二进制文件。二进制文件名为hello
。接下来,我尝试使用以下命令./build/X86/gem5.opt --debug-flags=DRAM --debug-file=gem5-helloworld.out ./configs/example/se.py -c ./tests/test-progs/myFile/hello
运行Gem5。但是,我收到以下消息,fatal: syscall fchmod (#91) unimplemented.
和Gem5没有打印"Hello World from Python“。消息。如何解决上述问题?可以在Gem5中运行Python代码吗?Gem5在终端中打印以下内容。
./build/X86/gem5.opt --debug-flags=DRAM --debug-file=gem5-helloworld.out ./configs/example/se.py -c ./tests/test-progs/myFile/hello
warn: CheckedInt already exists in allParams. This may be caused by the Python 2.7 compatibility layer.
warn: Enum already exists in allParams. This may be caused by the Python 2.7 compatibility layer.
warn: ScopedEnum already exists in allParams. This may be caused by the Python 2.7 compatibility layer.
gem5 Simulator System. http://gem5.org
gem5 is copyrighted software; use the --copyright option for details.
gem5 version 20.0.0.3
gem5 compiled Aug 5 2020 12:06:57
gem5 started Sep 21 2020 16:31:18
gem5 executing on LAPWF05588, pid 248502
command line: ./build/X86/gem5.opt --debug-flags=DRAM --debug-file=gem5-helloworld.out ./configs/example/se.py -c ./tests/test-progs/myFile/hello
Global frequency set at 1000000000000 ticks per second
warn: No dot file generated. Please install pydot to generate the dot file and pdf.
warn: DRAM device capacity (8192 Mbytes) does not match the address range assigned (512 Mbytes)
0: system.remote_gdb: listening for remote gdb on port 7000
**** REAL SIMULATION ****
info: Entering event queue @ 0. Starting simulation...
warn: ignoring syscall access(...)
info: Increasing stack size by one page.
warn: ignoring syscall mprotect(...)
warn: ignoring syscall mprotect(...)
warn: ignoring syscall mprotect(...)
warn: ignoring syscall mprotect(...)
warn: ignoring syscall mprotect(...)
warn: ignoring syscall mprotect(...)
info: Increasing stack size by one page.
info: Increasing stack size by one page.
info: Increasing stack size by one page.
info: Increasing stack size by one page.
info: Increasing stack size by one page.
info: Increasing stack size by one page.
info: Increasing stack size by one page.
warn: MOVNTDQ: Ignoring non-temporal hint, modeling as cacheable!
fatal: syscall fchmod (#91) unimplemented.
Memory Usage: 688628 KBytes
发布于 2020-09-22 05:53:51
您必须在命中时逐个实现所有缺少的必需syscall。
但是,它们中的一些不是基本的,它们将与未实现的存根一起工作,只需快速查看系统调用描述并尝试猜测它是否是基本的,例如https://github.com/gem5/gem5/blob/fa70478413e4650d0058cbfe81fd5ce362101994/src/arch/arm/linux/process.cc#L179
我想这不会太难。不尝试就不可能确定,这完全取决于丢失了多少不可忽略的syscall以及它们的实现有多复杂。
这种情况与Java类似:Running Java programs in gem5(or any language which is not C)
相关信息:
https://stackoverflow.com/questions/63999944
复制相似问题