Model Composer lets you specify data types as an expression. Currently the following HLS library blocks support data type expression:
- Data Type Conversion
- Look-Up Table
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'.
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 (e.g. 'x_sfix16_En8').
>> 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 using the menu command, or simply pressing
the Model Explorer you can create, edit, and manage variables that the model or a block uses.