AHDL

Define Statement



The Define Statement allows you to substitute a meaningful symbolic name (an evaluated function) for the value of an arithmetic expression. When you use an evaluated function in a Text Design File (.tdf), the Compiler replaces the evaluated function with the value of the arithmetic expression assigned to the evaluated function in the Define Statement. The value of the arithmetic expression is a number or text string, and is based on optional arguments for the expression.

NOTE
  1. The Compiler evaluates each arithmetic operator in the arithmetic expression for the evaluated function, and reduces the expression to a value (a number or text string). The Compiler does not generate logic for the expression.

  2. You can use evaluated functions in arithmetic expressions only; you cannot use evaluated functions in Boolean expressions.

The following example defines and uses the evaluated function EX to ensure that the Subdesign Section declares at least one port,.

DEFINE EX(a,b) = (a > b) ? a : b;

SUBDESIGN
(
   dataa[EX(WIDTH,0)..0]: INPUT;
   datab[EX(WIDTH,0)..0]: OUTPUT;
)
BEGIN
   datab[] = dataa[];
END;

 

The Define Statement has the following characteristics:

 

Define Statements must conform to the following rules:


Back to Top

- Altera -

 

Created by chm2web html help conversion utility.