今天在GemFI中试图解决m5term退出模拟系统问题。
参考官方Running gem5中:
./m5term <host> <port>
<host>
is the host that is running gem5
<port>
is the console port to connect to. gem5 defaults to using
port 3456, but if the port is used, it will try the next higher port
until it finds one available.
If there are multiple systems running within one simulation, there
will be a console for each one. (The first system’s console will be
on 3456 and the second on 3457 for example)
m5term uses ‘~’ as an escape character. If you enter the escape
character followed by a ‘.’, the m5term program will exit.
按说明,在模拟系统中输入~.
可以退出m5term,然而尝试该方法没有成功。
随后我打开gem5运行全系统模式,试图在m5term命令连接的模拟系统中尝试,然后悲剧发生了!
没有反应,只在fs.py命令行下显示:
47256339000: system.remote_gdb: remote gdb attached
在运行m5term的终端下,什么都不出现了!!!
中间可能我还做了什么别的操作,从此悲剧一发不可收拾。
我关了gem5,打开GemFI,然后!然后GemFI也没反应了!!!
重新build一遍,还是没反应。
关掉m5term所在的终端,fs.py所在的终端就开始死循环弹:
warn: could not read byte from debugger
warn: could not read byte from debugger
warn: could not read byte from debugger
warn: could not read byte from debugger
……
在google搜索这个问题,在gem5-users@gem5.org 有一个人遇到了这个问题。但是他是运行脚本的,没有开终端拿m5term连接模拟系统的啊!
有一个Nate回答了这个问题,这可能是有恶意软件在攻击端口。好吧,这个和我的问题不一样,不是很懂。
Nate建议:
Well, the remote debugger just sits there listening on port 7000 which
anyone could probe. You can turn it off by calling
m5.debug.setRemoteGDBPort(0) at the top of your script. You could
also call m5.disableAllListeners() to disable all ports including the
terminal ports. (Generally a good idea if you’re not debugging.)
如果直接调用m5.disableAllListeners()
,那就和在之前GemFI安装中遇到的问题冲突了。于是我添了一行m5.debug.setRemoteGDBPort(3456)
在之前的fs.py里面# m5.disableAllListeners()
一行的后面。
然后gdb的连接端口从7000+变回了此前正常运行时候的3456+,可惜依然没用!
==================&