Contents Up << >>

Variable declaration

A variable is a modifiable data object that may be used in sequential portions of a design (i.e. in processes, procedures and functions). A variable is not special in the sense that it is like data objects of other programming languages. When a value is assigned to a variable object, the value of that object is changed immediately. A variable is modified by the variable assignment statement. The grammar rule for a variable declaration is: This declares variables of the subtype, one for each name in the name list. If the expression appears, it will be the initial value of the variable. If the expression does not appear, then the initial value is the left bound of its subtype.

Shared variables are declared by adding the shared keyword before the variable declaration. Shared variables are declared in entities, architectures, blocks, or packages so that they may be "shared" by more than one process.