Working with Data Type Expression - 2023.2 English

Vitis Model Composer User Guide (UG1483)

Document ID
UG1483
Release Date
2023-11-15
Version
2023.2 English

Vitis Model Composer lets you specify data types as an expression. Currently the following HLS library blocks support data type expression:

  • Constant
  • Data Type Conversion
  • Gain
  • Look-Up Table
  • Reinterpret

To specify a data type expression open one of the block types that support it, and edit the data type and value. The following shows a data type expression being defined for the Constant block. The Output data type is specified as an expression, and a string is specified to indicate the data type value, in this case 'uint32'.

Figure 1. Data Type Expression

The data type value can be specified as a string representing any of the supported data types shown in the Model Composer Data Types table in the Working with Data Types section. The exception to this rule is for fixed point data types, which are not specified with the fixed string, but are defined according to the display format discussed under Working with Fixed-Point Data Types (for example, 'x_sfix16_En8').

The real benefit of defining a data type as an expression is the ability to programmatically determine the data type value using a variable from the model. For instance, if you define a variable from the MATLABĀ® command line:
>> InputDataType = 'x_ufix8_En7';

You can use the variable in defining the data type expression.

Figure 2. Variable Data Type

You can specify variables from the MATLAB command line, or define variables within the model using the Tools > Model Explorer menu command, or simply pressing Ctrl+H. From the Model Explorer you can create, edit, and manage variables that the model or a block uses.

Tip: You can also enable the View > Property Inspector command to display the variables for currently selected objects.