Check if-else statement chain length
Specify whether to check if-else statement chain length
Model Configuration Pane: Global Settings / Coding standards
Description
Specify whether to check if-else statement chain length. This check corresponds to CGSL-2.G.C.1c of the Industry standard guidelines.
Dependencies
To clear the Check if-else statement chain length check box, set the HDL coding standard parameter to Industry.
Settings
on (default) | offDefault: On
onCheck if-else statement chain length.
- Length
Maximum if-else statement chain length, specified as a positive integer. The default is 7.
offDo not check if-else statement chain length.
Tips
To set this property:
Create an HDL coding standard customization object.
cso = hdlcoder.CodingStandard('Industry');Set the
IfElseChainproperty of the HDL coding standard customization object.For example, to check for if-else statement chains with length greater than 5, enter:
cso.IfElseChain.enable = true; cso.IfElseChain.length = 5;
Set the
HDLCodingStandardCustomizationsproperty to the HDL coding standard customization object, specify the coding standard, and generate code.For example, if your DUT is
sfir_fixed/symmetric_fir, enter:makehdl('sfir_fixed/symmetric_fir', 'HDLCodingStandard','Industry', ... 'HDLCodingStandardCustomizations',cso);
Recommended Settings
No recommended settings.
Programmatic Use
Parameter:
IfElseChain property of
hdlcoder.CodingStandard object |
| Type: character vector |
| Values: |
| Default: |
Version History
Introduced in R2020b