IF-Scheme Example
ARCHITECTURE test_generate OF test_entity
SIGNAL S1, S2, S3: BIT_VECTOR(7 DOWNTO 0);
G1 : FOR N IN 7 DOWNTO 0 GENERATE
PORT MAP (S1(N), S2(N), S3(N));
PORT MAP (S1(N), S2(N), S3(N));
Notes:
The example here uses the IF-scheme GENERATE statement to make a modification to the and_gate array such that the seventh gate of the array will be an or_gate.
Another example use of the IF-scheme GENERATE is in the conditional execution of timing checks. Timing checks can be incorporated inside a GENERATE IF-scheme. For example, the following statement can be used:
Check_time : IF TimingChecksOn GENERATE
This allows the boolean variable TimingChecksOn to enable timing checks by generating the appropriate concurrent VHDL statements in the description. This parameter can be set in a package or passed as a generic and can improve simulation speed by shutting off this computational section.