Lookup Table Blocks
hisl_0033: Usage of Lookup Table blocks
ID: Title | hisl_0033: Usage of Lookup Table blocks | |
---|---|---|
Description | To support robustness of generated code, when using the 1-D Lookup Table, 2-D Lookup Table, n-D Lookup Table, Prelookup, and Interpolation Using Prelookup blocks: | |
A | Clear block parameter Remove protection against out-of-range input in generated code in each 1-D Lookup Table, 2-D Lookup Table, n-D Lookup Table, or Prelookup block. | |
B | Clear block parameter Remove protection against out-of-range index in generated code in each Interpolation Using Prelookup block. | |
Note | If the lookup table inputs are not guaranteed to fall within the range of valid breakpoint values, exclusion of range-checking code may produce unexpected results. | |
Rationale | A,B | Protect against out-of-range inputs or indices. |
Model Advisor Checks | Check usage of lookup table blocks (Simulink Check) | |
References |
| |
See Also | ||
Last Changed | R2021a |
hisl_0016: Usage of blocks that compute relational operators
ID: Title | hisl_0016: Usage of blocks that compute relational operators | ||
---|---|---|---|
Description | To support the robustness of the operations, avoid using the equality and inequality operators on floating-point data types. | ||
Notes | Due to floating-point precision issues, do not test floating-point expressions for equality (==) or inequality (~=, !=). | ||
Rationale | Improve model robustness and prevent unexpected results. | ||
Model Advisor Checks | Check relational comparisons on floating-point signals (Simulink Check) | ||
References |
| ||
See Also | Relational Operations | ||
Last Changed | R2021b | ||
Examples | Ex: 1 Example — Correct
Example — Incorrect
Ex: 2 Example — Correct Equality comparison operators are not used in floating-point operands. Example — Incorrect Equality comparison operator == is used in floating-point operands. Example — Correct To test whether two floating-point variables or expressions are equal, compare the difference of the two variables against a threshold that takes into account the floating-point relative accuracy (eps) and the magnitude of the numbers. The following pattern shows how to test two double-precision input signals, In1 and In2, for equality. Example — InCorrect Equality comparison operator == is used in floating-point operands |
hisl_0072: Usage of tunable parameters for referenced models
ID: Title | hisl_0072: Usage of tunable parameters for referenced models | ||
---|---|---|---|
Description | Use the
| ||
Notes | Simulink® ignores the storage class settings of parameters that are configured by using the Model Parameter Configuration dialog box for referenced models. This guideline is applicable only when configuration
parameter Default parameter behavior is set to
| ||
Rationale | Prevent unintended loss of parameter tunability. | ||
Model Advisor Checks | Check for parameter tunability information ignored for referenced models | ||
References |
| ||
See Also | Create Tunable Calibration Parameter in the Generated Code (Simulink Coder) | ||
Last Changed | R2021b |
hisl_0073: Usage of bit-shift operations
ID: Title | hisl_0073: Usage of bit-shift operations | ||
---|---|---|---|
Description | For bit-shifting operations (e.g. a >> b or a << b), do not perform: Shift operations that are greater than or equal to the bit-width (b must not be equal or greater than the bit width of a). | ||
Rationale | Generation of code with shift operations can result in violation of coding standards | ||
Model Advisor Checks | Check usage of bit-shift operations (Simulink Check) | ||
References |
| ||
See Also | Create Tunable Calibration Parameter in the Generated Code (Simulink Coder) | ||
Last Changed | R2021b |