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
relaxedCamelCase
PascalCase
RelaxedPascalCase
Pascal_Snake_Case
regex |
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. |
regex |
String | Empty String | Enforce case based on regex string |
This is an example of how to configure these options.
rule :
architecture_004:
case: 'lower'
prefix_exceptions:
- 'G_'
suffix_exceptions:
- '_G'
case_exceptions:
- 'IEEE'
regex: ''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;The following constant identifiers would pass with the defined regular expression.
constant SPIAccess : std_logic;
constant ADCRegisters : std_logic;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'- after_500
- 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
- array_constraint_500
- 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
- bit_string_literal_500
- bit_string_literal_501
- 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_statement_500
- case_generate_statement_501
- choice_500
- 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
- constrained_array_definition_500
- constrained_array_definition_501
- context_004
- context_012
- context_013
- context_014
- context_015
- context_016
- context_ref_003
- context_ref_500
- context_ref_501
- delay_mechanism_500
- delay_mechanism_501
- delay_mechanism_502
- entity_004
- entity_006
- entity_008
- entity_010
- entity_012
- entity_014
- entity_500
- entity_specification_500
- entity_specification_501
- entity_specification_503
- exit_statement_500
- exit_statement_501
- exponent_500
- external_constant_name_500
- external_signal_name_500
- external_variable_name_500
- file_open_information_500
- file_open_information_501
- file_open_information_502
- file_002
- file_500
- file_type_definition_500
- file_type_definition_501
- for_generate_statement_500
- for_generate_statement_501
- function_004
- function_005
- function_013
- function_017
- function_501
- function_502
- function_506
- function_507
- function_509
- function_510
- function_511
- function_512
- generate_005
- generate_009
- generate_010
- generate_012
- generate_500
- generate_501
- generic_007
- generic_009
- generic_map_001
- generic_map_002
- 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
- index_subtype_definition_500
- instantiation_008
- instantiation_009
- instantiation_027
- instantiation_028
- instantiation_031
- instantiation_500
- interface_incomplete_type_declaration_500
- interface_incomplete_type_declaration_501
- 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
- next_statement_500
- next_statement_501
- null_statement_500
- 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
- package_instantiation_500
- package_instantiation_501
- package_instantiation_502
- package_instantiation_503
- package_instantiation_504
- parameter_specification_500
- parameter_specification_501
- port_010
- port_017
- port_019
- port_map_001
- port_map_002
- procedure_008
- procedure_500
- procedure_501
- procedure_502
- procedure_503
- procedure_504
- procedure_506
- procedure_508
- procedure_510
- procedure_511
- procedure_call_500
- procedure_call_501
- procedure_call_502
- process_004
- process_005
- process_008
- process_009
- process_013
- process_017
- process_019
- protected_type_500
- protected_type_501
- protected_type_502
- protected_type_body_500
- protected_type_body_501
- protected_type_body_502
- protected_type_body_503
- protected_type_body_504
- range_constraint_500
- 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
- shift_operator_500
- signal_002
- signal_004
- subprogram_instantiation_500
- subprogram_instantiation_501
- subprogram_instantiation_502
- subprogram_instantiation_503
- subprogram_kind_500
- subprogram_kind_501
- subtype_500
- subtype_501
- subtype_502
- type_002
- type_004
- type_013
- type_500
- type_mark_500
- unbounded_array_definition_500
- unbounded_array_definition_501
- use_clause_500
- use_clause_501
- use_clause_502
- use_clause_503
- variable_002
- variable_004
- wait_500
- wait_501
- wait_502
- wait_503