0

I am trying to access a simulator configuration parameter run_mode this value is stored as a BRUN variable. I am using the following code to access the parameter in specman.

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. Is there a way to send this parameter back to specman?

2 Answers2

1

Please try

var run_mode := get_symbol("BRUN_RUN_MODE");

Thorsten
  • 710
  • 8
  • 17
0

simulator_command attempts to interact with the CLI of the simulator. i.e. the verilog/vhdl simulator 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. Something like this call diagram:

Assuming BRUN_MODE is set to 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. In which case, calling simulator_command and then extracting the output from your simulator may be appropriate. However, that would require looking at your specific simulators documentation which is separate from your Specman documentation.

Ross Rogers
  • 23,523
  • 27
  • 108
  • 164