|
The If Generate Statement lists a series of behavioral statements that are activated after the positive evaluation of an arithmetic expression.
The following example shows an If Generate Statement:
IF DEVICE_FAMILY == "FLEX®6000" GENERATE c[] = 6kadder(a[], b[], cin); ELSE GENERATE c[] = otheradder(a[], b[], cin); END GENERATE;
This example uses the predefined Altera® parameter DEVICE_FAMILY , which represents the target device family that you specified for the current design with the Device page of the Settings dialog box (Assignments menu). |
The If Generate Statement has the following characteristics:
The keywords IF
and GENERATE
enclose the arithmetic expression to be evaluated and are followed by one
or more behavioral statements, each of which ends with a semicolon (;
).
These statements are activated if the expression is true.
The keywords ELSE GENERATE
are followed by one or more behavioral
statements, each of which ends with a semicolon. These statements are activated
if the arithmetic expression is false.
The keywords END GENERATE
and a semicolon (;
)
end the If Generate Statement.
The If Generate Statement can be used in the Logic Section or in the Variable Section.
- PLDWorld - |
|
Created by chm2web html help conversion utility. |