There are several rules that enforce upper_or_lower, uppercase or lowercase.
There are several options to these rules:
Option | Values | Default Value | Description |
---|---|---|---|
case |
upper , lower , upper_or_lower , camelCase , PascalCase |
lower |
|
prefix_exceptions |
List of strings | Empty list | Enforce exception case on prefix if encountered. |
suffix_exceptions |
List of strings | Empty list | Enforce exception case on suffix if encountered. |
case_exceptions |
List of strings | Empty list | Enforce case for items in the list. |
This is an example of how to configure these options.
rule :
architecture_004:
case: 'lower'
prefix_exceptions:
- 'G_'
suffix_exceptions:
- '_G'
case_exceptions:
= 'IEEE'
The following code snippet is used in the following examples:
constant c_DATA_width : positive := 32;
constant addr_WIDTH_c : positive := 8;
Note
The following examples use rule constant_004.
constant c_data_width : positive := 32;
constant addr_width_c : positive := 8;
constant C_DATA_WIDTH : positive := 32;
constant ADDR_WIDTH_C : positive := 8;
This option will not perform any updates to the code as the case could be either upper or lower.
constant c_DATA_width : positive := 32;
constant addr_WIDTH_c : positive := 8;
constant c_DATA_WIDTH : positive := 32;
constant ADDR_WIDTH_C : positive := 8;
constant C_DATA_WIDTH : positive := 32;
constant ADDR_WIDTH_c : positive := 8;
constant C_DATA_WIDTH : positive := 32;
constant addr_WIDTH_c : positive := 8;
If there are a lot of case rules you want to change, you can use the global option to reduce the size of the configuration. For example, if you want to uppercase everything except the entity name, you could write the following configuration:
rule :
global :
case : 'upper'
entity_008 :
case : 'lower'
- alias_declaration_500
- alias_declaration_501
- alias_declaration_502
- architecture_004
- architecture_009
- architecture_011
- architecture_013
- architecture_014
- architecture_019
- architecture_020
- architecture_021
- architecture_028
- assert_500
- assert_501
- assert_502
- attribute_500
- attribute_declaration_500
- attribute_declaration_501
- attribute_declaration_502
- attribute_specification_500
- attribute_specification_501
- attribute_specification_502
- attribute_specification_503
- block_500
- block_501
- block_502
- block_503
- block_504
- block_505
- block_506
- case_014
- case_015
- case_016
- case_017
- case_018
- case_generate_alternative_500
- case_generate_alternative_501
- case_generate_statement_500
- case_generate_statement_501
- component_004
- component_006
- component_008
- component_010
- component_012
- component_014
- conditional_expressions_500
- conditional_expressions_501
- conditional_waveforms_500
- conditional_waveforms_501
- constant_002
- constant_004
- context_004
- context_012
- context_013
- context_014
- context_015
- context_016
- context_ref_003
- context_ref_500
- context_ref_501
- entity_004
- entity_006
- entity_008
- entity_010
- entity_012
- entity_014
- entity_500
- entity_specification_500
- entity_specification_501
- entity_specification_503
- exponent_500
- file_002
- for_generate_statement_500
- for_generate_statement_501
- function_004
- function_005
- function_013
- function_014
- function_017
- function_501
- function_502
- function_506
- generate_005
- generate_009
- generate_010
- generate_012
- generate_500
- generate_501
- generic_007
- generic_009
- generic_017
- generic_map_001
- generic_map_002
- ieee_500
- if_generate_statement_500
- if_generate_statement_501
- if_generate_statement_502
- if_generate_statement_503
- if_025
- if_026
- if_027
- if_028
- if_029
- if_034
- instantiation_008
- instantiation_009
- instantiation_027
- instantiation_028
- instantiation_031
- iteration_scheme_500
- iteration_scheme_501
- library_004
- library_005
- library_500
- logical_operator_500
- loop_statement_500
- loop_statement_501
- loop_statement_502
- loop_statement_503
- loop_statement_504
- package_004
- package_006
- package_008
- package_010
- package_013
- package_018
- package_body_500
- package_body_501
- package_body_502
- package_body_503
- package_body_504
- package_body_505
- package_body_506
- package_body_507
- port_010
- port_017
- port_018
- port_019
- port_map_001
- port_map_002
- procedure_008
- procedure_009
- procedure_500
- procedure_501
- procedure_502
- procedure_503
- procedure_504
- procedure_505
- procedure_506
- procedure_call_500
- procedure_call_501
- process_004
- process_005
- process_008
- process_009
- process_013
- process_017
- process_019
- range_001
- range_002
- record_type_definition_500
- record_type_definition_501
- record_type_definition_502
- report_statement_500
- report_statement_501
- return_statement_500
- selected_assignment_500
- selected_assignment_501
- selected_assignment_502
- selected_assignment_503
- signal_002
- signal_004
- subtype_500
- subtype_501
- subtype_502
- type_002
- type_004
- type_013
- type_500
- use_clause_500
- use_clause_501
- use_clause_502
- use_clause_503
- variable_002
- variable_004