如何在gem5中启用ARM半主机? [英] How to enable ARM semihosting in gem5?

查看:208
本文介绍了如何在gem5中启用ARM半主机?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试运行对QEMU起作用的半主机退出指令:

I tried to run a semihosting exit instruction that worked on QEMU:

mov r0, #0x18
ldr r1, =#0x20026
svc 0x00123456

但是gem5似乎无法正确处理它并崩溃了.

but gem5 seemed to not process it properly and crashed.

推荐答案

以下修补程序将其添加到裸金属.py中,而不是fs.py中(2020年3月): .com/c/public/gem5/+/26993/4"rel =" nofollow noreferrer> https://gem5-review.googlesource.com/c/public/gem5/+/26993/4

The following patch adds it to baremetal.py but not fs.py (March 2020): https://gem5-review.googlesource.com/c/public/gem5/+/26993/4

对于fs.py的7bfb7f3a43f382eb49853f47b140bfd6caad0fb8(截至2018年9月),您可以应用补丁:

As of 7bfb7f3a43f382eb49853f47b140bfd6caad0fb8 (Sep 2018) for fs.py you could apply the patch:

diff --git a/configs/example/fs.py b/configs/example/fs.py
index 3997ed76c..43bebcd66 100644
--- a/configs/example/fs.py
+++ b/configs/example/fs.py
@@ -376,5 +376,7 @@ if buildEnv['TARGET_ISA'] == "arm" and options.generate_dtb:
             sys = getattr(root, sysname)
             sys.dtb_filename = create_dtb_for_system(sys, '%s.dtb' % sysname)

+from m5.objects import ArmSemihosting
+test_sys.semihosting = ArmSemihosting()
 Simulation.setWorkCountOptions(test_sys, options)
 Simulation.run(options, root, test_sys, FutureClass)

应该与任何其他脚本类似,只需连接此新的SimObject.

Should be analogous for any other script, you just have to connect this new SimObject.

这篇关于如何在gem5中启用ARM半主机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆