문제
I need to call a Perl script from an E test that I wrote. I need to create an ini file-invoke C script that will create a config file which I need for the test I'm writing. I want the test to invoke the Perl which will handle the ini->C->config process, and then proceed with the test. any ideas?
해결책
You can do system calls or shell commands with functions system
or output_from
. This can be used to execute arbitrary commands, including invocations of Perl. The system
function returns the return value of the shell call, whereas output_from
returns the standard out ( and maybe standard error... check your docs..).
Examples:
var ret := system("echo hello world");
prints to Specman screen/log file
hello world
Whereas output_from
is used like:
var std_out := output_from("echo hello world");
print std_out;
and prints:
std_out = "hello world"
The functions take a string, so you can build up the arguments using the append()
and appendf()
functions.
Small aside: You can talk directly to the simulator command line interface using simulator_command(cmd_str)
. I've used this one before for talking with Synopsys' VCS
simulator_command("quit");