User guide
21-9
OpenVera Native Testbench
Statements are indicated with a semi-colon, ; .
The str variable is initialized on the next line (str = "Hello
World!";).
A variable can be declared and initialized on the same line, that is,
you can modify the example as follows:
string str = "Hello World!";
The printf() system task sends information to standard output during
the simulation.
printf("%s \n", str);
%s is a string format specifier. \n indicates a line break. The str
variable is passed to the task. The value of the str variable is
printed out.
To see the output of this program, compile and run the hello.vr file as
follows:
% vcs -ntb hello.vr
% simv
The output is, as expected:
Hello World!
The Template Generator
The typical flow for developing a testbench using the NTB template
generator to start the process is as follows: