Configuring Uppercase and Lowercase Rules

There are several rules that enforce either uppercase or lowercase. The default for all such rules is lowercase. The decision was motivated by the fact, that the VHDL language is case insensitive. Having the same default for all case rules also results in less documentation and code to maintain. The default value for each of these case rules can be overridden using a configuration.

Overriding Default Lowercase Enforcement

The default lowercase setting can be changed using a configuration.

For example the rule constant_002 can be changed to enforce uppercase using the following configuration:

rule :
  constant_002 :
     case : 'upper'

Changing Multiple Case Rules

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'

Adding Prefix and Suffix Exceptions

Some rules allow for prefixes and suffixes to be cased differently than the rest of the identifier. This is performed by changing the prefix_exceptions and suffix_exceptions parameters. The default values for these are an empty list.

If they are set and if the prefix and/or suffix are encountered, then the exact prefix/suffix will be validated along with the case of the rest of the string.

rule :
  constant_007 :
     case : 'lower'
     prefix_exceptions :
       - 'G_'
rule :
  constant_007 :
     case : 'lower'
     suffix_exceptions :
       - '_G'
rule :
  constant_007 :
     case : 'lower'
     prefix_exceptions :
       - 'G_'
     suffix_exceptions :
       - '_G'

Rules Enforcing Case