How to enable ARM semihosting in gem5?

浪尽此生 提交于 2019-12-11 22:15:29

问题


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

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

but gem5 seemed to not process it properly and crashed.


回答1:


As of 7bfb7f3a43f382eb49853f47b140bfd6caad0fb8 (Sep 2018) for fs.py 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)

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



来源:https://stackoverflow.com/questions/52475268/how-to-enable-arm-semihosting-in-gem5

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!