gcc 无法使用RISC-V运行GEM 5:“!seWorkload发生时间:找不到适当的工作负荷对象”

0qx6xfy6  于 2022-11-30  发布在  其他
关注(0)|答案(1)|浏览(351)

我正在尝试使用RISC-V运行gem 5。我已经准备好了Linux 64位交叉编译器,并且安装并编译了gem 5。然后,我尝试使用以下教程运行gem 5:https://canvas.kth.se/courses/24933/pages/tutorial-simulating-a-cpu-with-gem5
我编写了一个简单的Hello World C程序,并使用以下命令编译了它:
riscv64-unknown-linux-gnu-gcc -c hello.c -static -Wall -O0 -o hello
但是当我尝试运行gem 5时,我得到以下错误:

build/RISCV/sim/process.cc:137: fatal: fatal condition !seWorkload occurred: Couldn't find appropriate workload object.

我尝试解决此问题,但无法解决。我将print语句添加到配置文件中,发现错误出现在下面所附配置文件的m5.instantiate()行中。有人知道如何解决此问题吗?什么是seWorkload,以及为什么gem 5认为该对象不合适?
我使用的是Ubuntu 22.04。作为参考,这是我用于gem 5的配置python文件:

import m5
from m5.objects import *
import sys

system = System()

system.clk_domain = SrcClockDomain()
system.clk_domain.clock = '1GHz'
system.clk_domain.voltage_domain = VoltageDomain()

system.mem_mode = 'timing'
system.mem_ranges = [AddrRange('512MB')]
system.cpu = TimingSimpleCPU()
system.membus = SystemXBar()
system.cpu.icache_port = system.membus.cpu_side_ports
system.cpu.dcache_port = system.membus.cpu_side_ports
system.mem_ctrl = MemCtrl()
system.mem_ctrl.dram = DDR3_1600_8x8()
system.mem_ctrl.dram.range = system.mem_ranges[0]
system.mem_ctrl.port = system.membus.mem_side_ports

# start a process
process = Process()

# read command line arguments for the path to the executable
process.cmd = [str(sys.argv[1])]

system.cpu.workload = process
system.cpu.createThreads()
root = Root(full_system = False, system = system)

m5.instantiate() # the error occurs from this line

print("Beginning simulation!")
exit_event = m5.simulate()
print('Exiting @ tick %i because %s' %(m5.curTick(), exit_event.getCause()))
wfauudbj

wfauudbj1#

  • 缺少m5.util.addToPath('../../')*。这用于将公用脚本添加到示例化模拟的目录路径中。

相关问题