Main Content

RTL Description Rules for Conditional Parameters

These parameters belong to the RTL description rules section of the Coding standards tab of the HDL Code Generation > Global Settings pane of the Configuration Parameters dialog box. Use these parameters to customize RTL description rules for conditional and if-else statements that are specified by the Industry standard guidelines.

Check for conditional statements in processes

Specify whether to check for length of conditional statements that are described separately within a process. This check corresponds to CGSL-2.F.B.1 of the Industry standard guidelines.

Settings

Default: On

On

Check for length of conditional statements in a process. The default length is 1.

Off

Do not check for length of conditional statements in a process.

Dependency

To clear the Check for conditional statements in processes check box, set the HDL coding standard parameter to Industry.

Command-Line Information

To set this property:

  1. Create an HDL coding standard customization object.

    cso = hdlcoder.CodingStandard('Industry');

  2. Set the ConditionalRegionCheck property of the HDL coding standard customization object.

    For example, to check for four conditional statements in a process, enter:

    cso.ConditionalRegionCheck.enable = true;
    cso.ConditionalRegionCheck.length = 4;

  3. Set the HDLCodingStandardCustomizations property 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);

See Also

Check for assignments to the same variable in multiple cascaded control regions

Specify whether to check if there are assignments to the same variable in multiple cascaded control regions within the same process block. This check corresponds to CGSL-2.F.B.1.a of the industry standard guidelines.

Settings

Default: Off

On

Check for assignments to the same variable in multiple cascaded control regions.

Off

Do not check for assignments to the same variable in multiple cascaded control regions.

Command-Line Information

To set this property:

  1. Create an HDL coding standard customization object.

    cso = hdlcoder.CodingStandard('Industry');

  2. Set the CascadedConditionalAssignmentCheck property of the HDL coding standard customization object.

    cso.CascadedConditionalAssignmentCheck.enable = true;
    

  3. Set the HDLCodingStandardCustomizations property 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);

See Also

Check if-else statement chain length

Specify whether to check if-else statement chain length. This check corresponds to CGSL-2.G.C.1c of the Industry standard guidelines.

Settings

Default: On

On

Check if-else statement chain length.

Length

Maximum if-else statement chain length, specified as a positive integer. The default is 7.

Off

Do not check if-else statement chain length.

Dependency

To clear the Check if-else statement chain length check box, set the HDL coding standard parameter to Industry.

Command-Line Information

To set this property:

  1. Create an HDL coding standard customization object.

    cso = hdlcoder.CodingStandard('Industry');

  2. Set the IfElseChain property 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;

  3. Set the HDLCodingStandardCustomizations property 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);

See Also

Check if-else statement nesting depth

Specify whether to check if-else statement nesting depth. This check corresponds to CGSL-2.G.C.1a of the Industry standard guidelines.

Settings

Default: On

On

Check if-else statement nesting depth.

Depth

Maximum if-else statement nesting depth, specified as a positive integer. The default is 3.

Off

Do not check if-else statement nesting depth.

Dependency

To clear the Check if-else statement nesting depth check box, set the HDL coding standard parameter to Industry.

Command-Line Information

To set this property:

  1. Create an HDL coding standard customization object.

    cso = hdlcoder.CodingStandard('Industry');

  2. Set the IfElseNesting property of the HDL coding standard customization object.

    For example, to enable the check for if-else statement nesting depth with a maximum depth of 5, enter:

    cso.IfElseNesting.enable = true;
    cso.IfElseNesting.depth = 5;

  3. Set the HDLCodingStandardCustomizations property 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);

See Also