Dynamic elaboration

In order to be able to execute program parts which contain sequential statements it is necessary to elaborate these program parts as well. This is done while the model is executed. Here are some examples in which elaboration is carried out dynamically during simulation:

Dynamic Elaboration of a FOR loop

Dynamic Elaboration of a Subprogram

As a consequence of the rules mentioned above, declarations within a subprogram body`s declarative part are elaborated every time the corresponding subprogram is called. If this is the case the elaboration of a declaration can lead to different results with different characteristics.

Thus, for example, the elaboration of one and the same subtype within a subprogram body can lead to subtypes with different characteristics being generated.

FUNCTION diff_subtypes (N : INTEGER)
RETURN INTEGER IS
 
    SUBTYPE my_int IS INTEGER RANGE 0 TO N;
    VARIABLE out_sig : my_int;
 
BEGIN
...

N here is a constant's formal parameter (default for formal parameters of mode IN). The actual-parameter which is linked to N may, however, also be a signal, for example, ⇒ subtype my_int can change with every function call depending on N!