Renode 常规命令和实例命令

Renode 常规命令和实例命令

Renode 有两种类型的命令,一种是常规命令,另一种是通过 C# 实例导出的命令。常规命令使用 help 命令查看帮助,实例导出命令直接输入实例名称就可以查看帮助,关键得知道有哪些实例被导出了。

如果在 Renode 窗口输入无法识别的命令,那么 Renode 会输出 No such command or device: xxx。言外之意就是 Renode 支持两种输入,一是command;二是device。这里所说的常规命令对应 command,实例命令对应 device

https://blog.csdn.net/zoomdy/article/details/95591280
zoomdy at 163 dot com

常规命令

在 Renode Monitor 窗口输入 help 就可以获取常规命令列表。

(monitor) help
Available commands:
Name              | Description
================================================================================
allowPrivates     : allow private fields and properties manipulation.
analyzers         : shows available analyzers for peripheral.
commandFromHistory: executes command from history.
createPlatform    : creates a platform.
execute           : executes a command or the content of a variable.
help              : prints this help message or info about specified command.
history           : prints command history.
include           : loads a monitor script, python code or a plugin class.
log               : logs messages.
logFile           : sets the output file for logger.
logLevel          : sets logging level for backends.
mach              : list and manipulate machines available in the environment.
macro             : sets a macro.
numbersMode       : sets the way numbers are displayed.
path              : allows modification of internal 'PATH' variable.
pause             : pauses the emulation.
peripherals       : prints list of registered and named peripherals.
python            : executes the provided python command.
quit              : quits the emulator.
require           : verifies the existence of a variable.
runMacro          : executes a command or the content of a macro.
set               : sets a variable.
showAnalyzer      : opens a peripheral backend analyzer.
start             : starts the emulation.
string            : treat given arguments as a single string.
using             : expose a prefix to avoid typing full object names.
verboseMode       : controls the verbosity of the Monitor.
version           : shows version information.
watch             : executes a command periodically, showing output in monitor

help 后跟随命令名称,就可以查看命令的使用说明。例如要查看 include 命令的使用说明,在 monitor 窗口输入 help include

(monitor) help include
include [ i ]
loads a monitor script, python code or a plugin class.
To load a script you have to provide an existing file name.
Supported file formats:
*.cs  - plugin file
*.py  - python script
other - monitor script

常规命令在 Monitor.InitCommands 中初始化。命令定义在 renode/src/Infrastructure/src/Emulator/Extensions/UserInterface/Commands 目录下。

C# 实例导出的命令

有部分命令是使用 C# 实例的方式导出的。包括以下命令:

  • machine
  • connector
  • emulation
  • plugins
  • EmulationManager
  • host

还有就是定义在 machine 内的所有外设,创建 machine 后输入 peripherals 就可以看到所有外设,创建 machine 时会自动创建 sysbus 总线外设,因此即使没有添加任何外设,也会有一个 sysbus 外设。其他外设是挂在 sysbus 下的。

输入实例命令名,不带任何参数,就可以查看实例命令的帮助。查看 sysbus 下的外设的帮助,在外设名前加入 sysbus. ,例如查看 uart1 的帮助,输入 sysbus.uart1

注意:machine 命令只有在创建了 machine 后(执行 mach create 命令后)才有效。

实例命令在 Monitor.InitCommands 中导出,外设实例命令则是在创建外设时导出的。

Bind(Machine.MachineKeyword, () => Machine); // MachineKeyword = "machine"
BindStatic("connector", () => emulationManager.CurrentEmulation.Connector);
BindStatic("emulation", () => Emulation);
BindStatic("plugins", () => TypeManager.Instance.PluginManager);
BindStatic("EmulationManager", () => emulationManager);
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
解释下面代码功能#include<iostream> #include<cstring> #include<cmath> using namespace std; int Node[50]; int number; int Calculate(char x)//计算偏移 { if(x>=97&&x<=122) return 0; switch(x) { case '!': case '^': case '(': case ')': return 1; case '|': case '-': return 2; case '<': return 3; default: return 1; } } int CalculateOut(string &Word,int n,int m)//输出||、->、<->,等等 { int i; if(m!=0) { for(i=1; i<m; i++)cout<<Word[n+i]; if(Word[i+n]!='\0') cout<<" "; } } int Input(string &Word)//输出数据 { int m,i,tag,q; number=0; for(i=0; Word[i]!='\0'; ) { q=i; if(Word[i]==' ') { i++; continue; } cout<<Word[i]; tag=Calculate(Word[i]); CalculateOut(Word,i,tag); i+=tag;//偏移 if(!tag)//数字计数 { Node[Word[q]-97]++; number++; if(Word[i+1]!='\0') cout<<" "; i++; } } cout<<endl; return number; } int Bin(int n,int m) { int bin[10000]; int a,b,i=0; do { a=n%2; n/=2; bin[i++]=a; } while(n>0); for(n=0; n<m-i; n++) { cout<<"0 "; } for(n=i-1; n>=0; n--) { cout<<bin[n]; if(n) cout<<" "; } } int Outnumber(int n) { int i,m=1; for(i=1; i<n; i++) { m=m*2+1; } for(i=m; i>=0; i--) { Bin(i,n); cout<<endl; } } void CoutNode() { int i,temp=0; for(i=0; i<50; i++) { if(temp==0&&Node[i]!=0) { cout.put(97+i); temp++; } else if(Node[i]!=0) { cout<<" "; cout.put(97+i); temp++; } } number=temp; cout<<endl; } int ReNode()//初始化 { for(int i=0; i<110; i++) Node[i]=0; } int Turn(char Map[400],string &Word) { int n,i; for(i=0,n=0;i<=strlen(Map);i++) { if(Map[i]!=' ') { Word[n]=Map[i]; n++; } } Word[n]='\0'; } int main() { int n,i; string Word; char Map[400]; while(gets(Map)!=NULL)//输入 { ReNode(); Turn(Map,Word); Input(Word); CoutNode(); Outnumber(number); } // Bin(2); }
06-07
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值