|
| 1 | + |
| 2 | +.. _configuring-library-and-package-name-restriction-rules: |
| 3 | + |
| 4 | +Configuring Library and Package Name Restriction Rules |
| 5 | +------------------------------------------------------ |
| 6 | + |
| 7 | +There are rules which will check for invalid package names in library and use clauses. |
| 8 | +These rules are disabled by default and must be enabled before they will perform any checks. |
| 9 | + |
| 10 | +There is one option for these rules: |
| 11 | + |
| 12 | +.. |names| replace:: |
| 13 | + :code:`names` |
| 14 | + |
| 15 | +.. |default| replace:: |
| 16 | + :code:`std_logic_arith` for **use_clause_001**. None for **library_012** |
| 17 | + |
| 18 | +.. |values__names| replace:: |
| 19 | + List of strings |
| 20 | + |
| 21 | +.. |action__names| replace:: |
| 22 | + Search for libraries and packages with the user defined names |
| 23 | + |
| 24 | ++--------------------------------------+-----------------+-----------+------------------------------------------------+ |
| 25 | +| Option | Values | Default | Description | |
| 26 | ++======================================+=================+===========+================================================+ |
| 27 | +| |names| | |values__names| | |default| | * |action__names| | |
| 28 | ++--------------------------------------+-----------------+-----------+------------------------------------------------+ |
| 29 | + |
| 30 | +This is an example of how to configure the option. |
| 31 | + |
| 32 | +.. code-block:: yaml |
| 33 | +
|
| 34 | + rule : |
| 35 | + library_012: |
| 36 | + names: |
| 37 | + - "work" |
| 38 | + - "std_logic_arith" |
| 39 | +
|
| 40 | +.. NOTE:: All examples below are using the rule **use_clause_001**. |
| 41 | + |
| 42 | +Example: |names| set to list ["std_logic_arith"] |
| 43 | +################################################ |
| 44 | + |
| 45 | +The following code would fail with this option: |
| 46 | + |
| 47 | +.. code-Block:: vhdl |
| 48 | +
|
| 49 | + library ieee; |
| 50 | + use ieee.std_logic_arith.all; |
| 51 | +
|
| 52 | +Example: |names| set to ["std_logic_arith", "my_package"] |
| 53 | +############################################## |
| 54 | + |
| 55 | +The following code would fail three times with this option: |
| 56 | + |
| 57 | +.. code-block:: vhdl |
| 58 | +
|
| 59 | + library ieee; |
| 60 | + use ieee.std_logic_arith.all; |
| 61 | +
|
| 62 | + library work; |
| 63 | + use work.my_package.all; |
| 64 | +
|
| 65 | +
|
| 66 | +Rules Enforcing Valid Names |
| 67 | +########################### |
| 68 | + |
| 69 | +* `library_012 <library_rules.html#library-012>`_ |
| 70 | +* `use_clause_001 <use_clause_rules.html#use-clause-001>`_ |
0 commit comments