RichardUSTC/RichardUSTC.github.io

`Add a New CPU Model for Gem5` meet problem

Closed this issue · 0 comments

您好,我想在gem5上添加新的CPU模型,
按照官方步骤遇到m5/src/cpu/cpu_models.py不存在的问题,然后搜到了您这篇文章。

手动添加cpu_models.py之后,building MyCPU则无法识别src/cpu/mycpu/SConsopts的all_cpu_list: NameError: name 'all_cpu_list' is not defined

重新按照博文步骤做,Building MyCPU的时候出现问题,系统认为Sconsopts参数过多:

TypeError: __init__() takes at most 3 arguments (6 given):
  File "/home/fsj/oschina/gem5-gpu/gem5/SConstruct", line 1110:
    SConscript(joinpath(root, 'SConsopts'))
  File "/usr/lib/scons/SCons/Script/SConscript.py", line 609:
    return method(*args, **kw)
  File "/usr/lib/scons/SCons/Script/SConscript.py", line 546:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/usr/lib/scons/SCons/Script/SConscript.py", line 260:
    exec _file_ in call_stack[-1].globals
  File "/home/fsj/oschina/gem5-gpu/gem5/src/cpu/mycpu/SConsopts", line 35:
    default=True)

SConsopts的内容是这样的:

Import('*')

CpuModel('MyCPU', 'my_cpu_exec.cc',
         '#include "cpu/mycpu/mycpu.hh"',
         { 'CPU_exec_context': 'MyCPU' },
         default=True)

gem5版本为11061
哪一部出问题了呢?怎样解决这个参数过多的问题?
谢谢