HDL Coding Standard Customization Properties
Customize HDL coding standard
HDL coding standard customization properties control how HDL Coder™ generates and checks code according to a specified coding standard. By changing property values, you can customize the rules and the appearance of the coding standard report.
To refer to a particular object and property, use dot notation:
cso = hdlcoder.CodingStandard('Industry'); len = cso.SignalPortParamNameLength.length; cso.ShowPassingRules.enable = false;
The generated code follows the customized coding standard rules as much as possible. If following a coding standard rule causes the HDL code to be uncompilable or unsynthesizable, the coder does not follow the rule.
Coding Standard Report
ShowPassingRules
— Show passing rules in coding standard report
structure
Show or do not show passing rules in coding standard report, specified as a structure with this field.
Field | Description |
---|---|
enable | Set to Set to The default is |
Basic Coding Rules
HDLKeywords
— Check for HDL keywords in design names
structure
Check for HDL keywords in design names (rule CGSL-1.A.A.3), specified as a structure with this field.
Field | Description |
---|---|
enable | Set to Set to The default is
|
DetectDuplicateNamesCheck
— Check for duplicate names
structure
Check for duplicate names in the design (rule CGSL-1.A.A.5), specified as a structure with this field.
Field | Description |
---|---|
enable | Set to Set to The default is
|
ModuleInstanceEntityNameLength
— Check module, instance, and entity name length
structure
Check for module, instance and entity name lengths (rule CGSL-1.A.B.1), specified as a structure with the following fields.
Field | Description |
---|---|
enable | Set to Set to The default is
|
length | Minimum and maximum length of module, instance, and entity name names, specified as a 2-element array of positive integers. The first element is the minimum length, and the second element is the maximum length. The default is [2 32]. |
SignalPortParamNameLength
— Check signal, port, and parameter name length
structure
Check for signal, port, and parameter name lengths (rule CGSL-1.A.C.3), specified as a structure with the following fields.
Field | Description |
---|---|
enable | Set to Set to The default is
|
length | Minimum and maximum length of signal, port, and parameter names, specified as a 2-element array of positive integers. The first element is the minimum length. The second element is the maximum length. The default is [2 40]. |
RTL Description Rules
MinimizeClockEnableCheck
— Check for clock enable signals
structure
Check for clock enable signals in the generated code (rule CGSL-2.C.C.4), specified as a structure with this field.
Field | Description |
---|---|
enable | Set to Set to
The default is |
RemoveResetCheck
— Check for reset signals
structure
Check for reset signals in the design (rule CGSL-2.C.C.5), specified as a structure with this field.
Field | Description |
---|---|
enable | Set to Set to
The default is |
AsynchronousResetCheck
— Check for asynchronous reset signals in the generated code
structure
Check for asynchronous reset signals in the generated code (CGSL-2.C.C.6), specified as a structure with this field.
Field | Description |
---|---|
enable | Set to Set to The default is
|
MinimizeVariableUsage
— Minimize use of variables
structure
Minimize use of variables (rule CGSL-2.G), specified as a structure with this field.
Field | Description |
---|---|
enable | Set to Set
to The default is |
ConditionalRegionCheck
— Check for length of conditional statements in a process or always block
structure
Check for length of conditional statements (if-else, case, and loops) that are described separately in a process block or an always block (rule CGSL-2.F.B.1), specified as a structure with the following fields.
Field | Description |
---|---|
enable | Set to Set to The default is
|
length | Number of conditional statements that are described separately within a
process block ( The default is 1. |
CascadedConditionalAssignmentCheck
— Check if there are assignments to the same variable in multiple cascaded control regions
structure
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, specified as a structure with this field.
Field | Description |
---|---|
enable | Set to Set to The default is |
IfElseNesting
— Check if-else statement nesting depth
structure
Check for if-else statement nesting depth (rule CGSL-2.G.C.1a), specified as a structure with the following fields.
Field | Description |
---|---|
enable | Set to Set to The default is
|
depth | Maximum if-else statement nesting depth, specified as a positive integer. The default is 3. |
IfElseChain
— Check if-else statement chain length
structure
Check for if-else statement chain length (rule CGSL-2.G.C.1c), specified as a structure with the following fields.
Field | Description |
---|---|
enable | Set to Set to The default is
|
length | Maximum length of if-else statement chain, specified as a positive integer. The default is 7. |
MultiplierBitWidth
— Check multiplier bit width
structure
Check for multiplier bit width (rule CGSL-2.J.F.5), specified as a structure with the following fields.
Field | Description |
---|---|
enable | Set to Set
to The default is |
width | Maximum multiplier bit width, specified as a positive integer. The default is 16. |
RTL Design Rules
LineLength
— Check generated code line length
structure
Check for generated code line length (rule CGSL-3.A.D.5), specified as a structure with the following fields.
Field | Description |
---|---|
enable | Set to Set to The default is
|
length | Maximum number of characters per line in generated code, specified as a positive integer. The default is 110. |
NonIntegerTypes
— Check for non-integer constants
structure
Check for non-integer constants (rule CGSL-3.B.D.1), specified as a structure with the following field.
Field | Description |
---|---|
enable | Set to Set to The default is
|
Version History
Introduced in R2014b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)