|
The optional Variable Section is used to declare and/or generate any variables used in the Logic Section. AHDL variables are similar to variables in a high-level programming language; they are used to define buried (internal) logic.
The following example shows a Variable Section:
VARIABLE a, b, c [WIDTHAD-1..0] : NODE; ts_node : TRI_STATE_NODE; temp : DFFE; IF DEVICE_FAMILY == "APEX20K" GENERATE 20kcounter : lpm_counter WITH (LPM_WIDTH=WITHAD-1); END GENERATE;
This example uses the predefined Altera® parameter DEVICE_FAMILY , which represents the current device family that you specified for compilation with the Device page of the Settings dialog box (Assignments menu). |
The Variable Section can include the following statements or constructs:
The Variable Section can also contain If Generate Statements which can be used to generate Instance, Node, Register, and State Machine Declarations. |
The Variable Section has the following characteristics:
The keyword VARIABLE
begins
the Variable Section.
User-defined, symbolic variable names
are separated from each other by commas (,
) and from the variable
type by a colon (:
). In the example shown above, the variables are a
, b
, c
, ts_node
, and temp
.
The variable type to the right of the colon can be NODE
,
TRI_STATE_NODE
, <primitive>,
<megafunction>, <macrofunction>,
or <state machine name>. In the example shown above, the variables a
, b
, and c
are instances of type NODE
, the variable ts_node
is an instance of type TRI_STATE_NODE
, and the variable temp
is an instance of the primitive DFFE.
When you specify a variable type that is a megafunction or macrofunction, you can use the name substitution feature to specify a text string for the variable type that is replaced by a different text string when the design is compiled. Before you can use the name substitution feature, you must turn on the NAME_SUBSTITUTION
option in the TDF's Options Statement and specify the replacement string for the variable type in the TDF's Parameters Statement. You can then specify the text string to be replaced in the Variable Section using the format @
<text string>. Example
Each entry in the list of variables ends with a semicolon (;
).
Compiler-generated names that contain the tilde (~ ) character may appear in the compilation database for a project. If you back-annotate the assignments in the database, these names will then appear in the project's Compiler Settings File (.csf). The tilde character is reserved for Compiler-generated names only; you cannot use it in your own pin, node, and group names. |
- PLDWorld - |
|
Created by chm2web html help conversion utility. |