User guide

21-8
OpenVera Native Testbench
Testbench starts execution
Any variable defined in a task or function has local scope.
"Hello World!"
The following simple program prints “Hello World!” to standard
output.
//hello.vr file
program hello_world
{
string str;
str = "Hello World!";
printf("%s \n", str); // printf() sends information
// to stdout
}
//hello.vr file, is a comment line. A single-line comment starts
with the two slashes, //. This comment provides the name of the
testbench file containing the program.
program is a keyword and indicates that this is where execution of
the testbench begins.
hello_world is an identifier. Here, "hello_world" is the name of
the program.
The left curly brace, { , must follow the program name. The right
curly brace, } , indicates the end of the program.
string str; is the first statement in the program. string
indicates the data type of the variable.
The variable, str, is a global string variable.