Home Open Vera Tutorial Hello World
Main Menu
Home
System Verilog
Verilog
Methodologies
Open Vera
    - Tutorial
        -- Hello World
        -- Data Types
        -- Operators
        -- Control Structures
        -- Task and Functions
        -- Arrays
        -- Associative Arrays
        -- Associative Arrays
        -- Strings
        -- Files
        -- Interfaces
        -- Virtual ports and binds
        -- Concurrency
        -- Mailboxes
        -- Regions
        -- Events
        -- Semaphores
    - Examples
    - Tools
    - Links
    - Books
    - Interview Questions
Digital Concepts
Verification Basics
Protocols
Scripting
Articles
Videos
Interview Questions
Computer Architechture
C and C++
Blog/Article
AsicGuru Blog
Tags Cloud
Ads
Usefull Sites
Know Your IP/Location
Local Information India
Buy Car/Inverter Batteries
Real Estate India
Sports Accessories India
A simple Program & program structure
Share This Articale:

Program structure in vera :

Vera is more like C++ with some concurrency constructs added on it. Lets start with a hello world example in Vera  :

// Hello world example

#include

program hello {

    printf("hello world \n");

}

To compile :

$> vcs -ntb hello.vr

And to run

$> ./simv

It will pring "hello world" on the console.

If we look at the above example following things can be extracted :

  1. Vera allows C/C++ type comments (starting with //)
  2. In every program we need to include the file vera_defines.vrh . Vera have its own preprocessor. The lines starting with # and ` are preprocessed by the vera preprocessor and they are replaced with the actual test.
  3. Vera program execution starts from the keyword program like in C it starts from main().
  4. All statements terminate with semicolon exactly like C++.
  5. Blocking is done by curly braces (start bracket { and end bracket is }. Single statement does not need to enclosed in brackets.

 

This Articles is written/submitted by puneet (Puneet Aggarwal). You can also contribute to Asicguru.com. Click here to start


Next >> Data Types

Posted By : pl - Sept. 13, 2009, 5:56 p.m.

example program should have a file associated with "#include" in the example above. typo: "pring" should be "print".

 
Login/Register
Register
Sign In
Login with :-
gmail-yahoo-twitter-facebook
| | |  
  •  
  • Bookmark
    ADS