문제

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");
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top