[英]How to retrieve a value from simulator in specman
I am trying to access a simulator configuration parameter run_mode
this value is stored as a BRUN variable. 我正在尝试访问模拟器配置参数
run_mode
该值存储为BRUN变量。 I am using the following code to access the parameter in specman. 我正在使用以下代码访问specman中的参数。
simulator_command("sn $env(BRUN_RUN_MODE)") Simulator_command(“ sn $ env(BRUN_RUN_MODE)”)
However what is returned (eg: interactive_debug) is interpreted as an specman command which obviously doesn't exist. 但是,返回的内容(例如:interactive_debug)被解释为specman命令,该命令显然不存在。 Is there a way to send this parameter back to specman?
有没有办法将此参数发送回Specman?
Please try 请试试
var run_mode := get_symbol("BRUN_RUN_MODE");
var run_mode:= get_symbol(“ BRUN_RUN_MODE”);
simulator_command
attempts to interact with the CLI of the simulator. simulator_command
尝试与模拟器的CLI进行交互。 ie the verilog/vhdl simulator TCL CLI. 即verilog / vhdl模拟器TCL CLI。 What you're doing there is going into the simulator's CLI and then calling back into specman with the
sn [...]
command while using TCL's $env
to grab the environment variable. 您在这里做的是进入模拟器的CLI,然后在使用TCL的
$env
来获取环境变量的同时,使用sn [...]
命令调用specman。 Something like this call diagram: 像这样的调用图:
Assuming BRUN_MODE
is set to FOO
假设
BRUN_MODE
设置为FOO
Specman Runtime Verilog/VHDL CLI
| *
| --> simulator_command( ------>|
* |
* sn $env(BRUN_RUN_MODE)
* | (TCL interpreter string transform)
* v
* sn "FOO"
* |
|<-------- "FOO" <--------------|
| *
|------->(end of `sn` call) --->|
* |
|<--(end of simulator_command)--|
| *
You want to use get_symbol
as Thorsten answered, unless you really do want a simulator command and not an environment variable. 您希望使用Thorsten回答的
get_symbol
,除非您确实确实想要模拟器命令而不是环境变量。 In which case, calling simulator_command
and then extracting the output from your simulator may be appropriate. 在这种情况下,调用
simulator_command
然后从模拟器中提取输出可能是合适的。 However, that would require looking at your specific simulators documentation which is separate from your Specman documentation. 但是,这需要查看与Specman文档分开的特定模拟器文档。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.