Documentation

Fixed-Point Run-Time Library Functions

HDL code generation support for fixed-point run-time library functions from the Fixed-Point Designer™ is summarized in the following table. See Fixed-Point Function Limitations for general limitations of fixed-point run-time library functions for code generation.

FunctionRestrictions

abs

Double data type not supported.

add

None

all

Double data type not supported.

any

Double data type not supported.

bitand

None

bitandreduce

None

bitcmp

None

bitconcat

None

bitget

None

bitor

None

bitorreduce

None

bitreplicate

None

bitrol

None

bitror

None

bitset

None

bitshift

None

bitsliceget

None

bitsll

None

bitsra

None

bitsrl

None

bitxor

None

bitxorreduce

None

ceil

None

complex

None

conj

None

convergent

None

ctranspose

None

divide

  • For HDL Code generation, the divisor must be a constant and a power of two.

  • Non-fi inputs must be constant; that is, their values must be known at compile time so that they can be cast to fi objects.

  • Complex and imaginary divisors are not supported.

  • Code generation in MATLAB® does not support the syntax T.divide(a,b).

end

None

eps

  • Supported for scalar fixed-point signals only.

  • Supported for scalar, vector, and matrix, fi single and fi double signals.

eq

None

fi

None

fimath

None

fix

None

floor

None

ge

None

getlsb

None

getmsb

None

gt

None

horzcat

None

imag

None

int8int16int32

None

iscolumn

None

isempty

None

isequal

None

isfi

None

isfimath

None

isfimathlocal

None

isfinite

None

isinf

None

isnan

None

isnumeric

None

isnumerictype

None

isreal

None

isrow

None

isscalar

None

issigned

None

isvector

None

le

None

length

None

logical

None

lowerbound

None

lsb

None

lt

None

max

None

min

None

minus

None

mpower

Both inputs must be scalar, and the exponent input, k, must be a constant integer.

mtimes

None

ndims

None

ne

None

nearest

None

numberofelements

None

numerictype

None

plus

Inputs cannot be data type logical.

power

Both inputs must be scalar, and the exponent input, k, must be a constant integer.

range

None

real

None

realmax

None

realmin

None

reinterpretcast

None

repmat

None

rescale

None

reshape

None

round

None

sfi

None

sign

None

size

None

sqrt

None

sub

None

subsasgn

Supported data types for HDL code generation are listed in Supported Data Types

subsref

Supported data types for HDL code generation are listed in Supported Data Types

sum

None

times

Inputs cannot be data type logical.

transpose

None

ufi

None

uint8uint16uint32

None

uminus

None

uplus

Inputs cannot be data type logical.

upperbound

None

vertcat

None

Fixed-Point Function Limitations

In addition to function-specific limitations listed in the table, the following general limitations apply to the use of Fixed-Point Designer functions in generated HDL code:

  • fipref and quantizer objects are not supported.

  • Slope and bias scaling are not supported.

  • Dot notation is only supported for getting the values of fimath and numerictype properties. Dot notation is not supported for fi objects, and it is not supported for setting properties.

  • Word lengths greater than 128 bits are not supported.

  • You cannot change the fimath or numerictype of a given variable after that variable has been created.

  • The boolean and ScaledDouble values of the DataTypeMode and DataType properties are not supported.

  • For all SumMode property settings other than FullPrecision, the CastBeforeSum property must be set to true.

  • The numel function returns the number of elements of fi objects in the generated code.

  • General limitations of C/C++ code generated from MATLAB apply. See MATLAB Language Features Not Supported for C/C++ Code Generation for more information.

Was this topic helpful?