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 example shows a data type expression being
defined for the Constant block. The example specifies the Output data type as an expression, and specifies a string to indicate
the data type value, in this case uint32.
You can specify the data type value as a string representing any of the
supported data types shown in the Model Composer Data Types table. Refer to Working with Data Types for supported data types. The exception to this
rule is for fixed point data types. The fixed string does
not specify these. The display format discussed in Working with Fixed-Point Data Types defines fixed-point data types (for example, x_sfix16_En8).
The benefit of defining data types as expressions 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.
You can specify variables from the MATLAB command line, or define variables within the model by selecting 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.