Intel® Quartus® Prime Standard Edition User Guide: Design Compilation

ID 683283
Date 9/24/2018
Public
Document Table of Contents

3.2.7.1. Setting Default Parameter Values and BDF Instance Parameter Values

Default parameter values and BDF instance parameter values do not have an explicitly declared type. Usually, the Intel® Quartus® Prime software can correctly infer the type from the value without ambiguity. For example, the Intel® Quartus® Prime software interprets “ABC” as a string, 123 as an integer, and 15.4 as a floating-point value. In other cases, such as when the instantiated subdesign language is VHDL, the Intel® Quartus® Prime software uses the type of the parameter, generic, or both in the instantiated entity to determine how to interpret the value, so that the Intel® Quartus® Prime software interprets a value of 123 as a string if the VHDL parameter is of a type string. In addition, you can set the parameter value in a format that is legal in the language of the instantiated entity. For example, to pass an unsized bit literal value from .bdf to Verilog HDL, you can use '1 as the parameter value, and to pass a 4-bit binary vector from .bdf to Verilog HDL, you can use 4'b1111 as the parameter value.

In a few cases, the Intel® Quartus® Prime software cannot infer the correct type of parameter value. To avoid ambiguity, specify the parameter value in a type-encoded format in which the first or first and second characters of the parameter indicate the type of the parameter, and the rest of the string indicates the value in a quoted sub-string. For example, to pass a binary string 1001 from .bdf to Verilog HDL, you cannot use the value 1001, because the Intel® Quartus® Prime software interprets it as a decimal value. You also cannot use the string "1001" because the Intel® Quartus® Prime software interprets it as an ASCII string. You must use the type-encoded string B"1001" for the Intel® Quartus® Prime software to correctly interpret the parameter value.

This table lists valid parameter strings and how the Intel® Quartus® Prime software interprets the parameter strings. Use the type-encoded format only when necessary to resolve ambiguity.

Table 10.  Valid Parameter Strings and Interpretations
Parameter String Intel® Quartus® Prime Parameter Type, Format, and Value
S"abc", s"abc" String value abc
"abc123", "123abc" String value abc123 or 123abc
F"12.3", f"12.3" Floating point number 12.3
-5.4 Floating point number -5.4
D"123", d"123" Decimal number 123
123, -123 Decimal number 123, -123
X"ff", H"ff" Hexadecimal value FF
Q"77", O"77" Octal value 77
B"1010", b"1010" Unsigned binary value 1010
SB"1010", sb"1010" Signed binary value 1010
R"1", R"0", R"X", R"Z", r"1", r"0", r"X", r"Z" Unsized bit literal
E"apple", e"apple" Enumeration type, value name is apple
P"1 unit" Physical literal, the value is (1, unit)
A(...), a(...) Array type or record type. The string (...) determines the array type or record type content

You can select the parameter type for global parameters or global constants with the pull-down list in the Parameter tab of the Symbol Properties dialog box. If you do not specify the parameter type, the Intel® Quartus® Prime software interprets the parameter value and defines the parameter type. You must specify parameter type with the pull-down list to avoid ambiguity.

Note: If you open a .bdf in the Intel® Quartus® Prime software, the software automatically updates the parameter types of old symbol blocks by interpreting the parameter value based on the language-independent format. If the Intel® Quartus® Prime software does not recognize the parameter value type, the software sets the parameter type as untyped.

The Intel® Quartus® Prime software supports the following parameter types:

  • Unsigned Integer
  • Signed Integer
  • Unsigned Binary
  • Signed Binary
  • Octal
  • Hexadecimal
  • Float
  • Enum
  • String
  • Boolean
  • Char
  • Untyped/Auto