Generate

LRM §9.7.

A mechanism for iterative or conditional elaboration of a portion of a description.

Syntax:

label: for parameter in range generate 
  [ generate_declarations
begin ]  
   concurrent_statements 
end generate [ label ]; 

label: if condition generate 
  [ generate_declarations 
begin ] 
   concurrent_statements 
end generate [ label ]; 

Description:

The generate statement simplifies the description of regular design structures. Usually it is used to specify a group of identical components using just one component specification and repeating it using the generate mechanism.

A generate statement consists of three main parts:

The generation scheme specifies how the concurrent structure statement should be generated. There are two generation schemes available: for scheme and if scheme.

The for generation scheme is used to describe regular structures in the design. In such a case, the generation parameter and its scope of values are generated in similar way as in the sequential loop statement.

The if generation scheme is used when the regular structure contains some irregularities.

Example:

G1: for I in 1 to N-1 generate 
  L: Blk port map (A(I), B(I+1)); 
end generate G1;

G2: if I = 3 generate 
  L: Blk port map (A(I+1), B(I+2)); 
end generate; 

Notes:

See also:

Concurrent statement, For loop, If, Process, Range