问题描述
如果您在src/python
下修改文件,则必须进行重建,这与对configs/
If you modify a file under src/python
, then a rebuild is necessary, unlike modifications to configs/
这使得在该目录下进行更改非常痛苦,因为即使是干净的重建也要花费几秒钟.
That makes making changes under that directory very painful, since even the clean rebuild takes several seconds.
是否有避免重建的方法?
Is there a way to avoid the rebuild?
推荐答案
M5_OVERRIDE_PY_SOURCE=true
M5_OVERRIDE_PY_SOURCE=true
如果导出该环境变量以进行运行,并且gem5直接使用Python源代码.
If you export that environment variable for the run, and gem5 uses the Python source code directly.
这可能存在,因为默认情况下,gem5将Python目标文件打包在gem5.opt
二进制文件内,因此允许用户在不更改其PYTHON_PATH
的情况下运行它.
This likely exists because by default, gem5 packs up Python object files inside the gem5.opt
binary so allows users to run it without changing their PYTHON_PATH
.
M5_OVERRIDE_PY_SOURCE
的工作方式此处在252dd80中进行了描述.
经过以下测试: https://gem5.googlesource.com/public/gem5/+/91295ff980c17efb3ad013b9636017b58e49c071
这篇关于如何在src/python下修改文件并运行而不在gem5中重建?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!