192 lines
3.1 KiB
ReStructuredText
192 lines
3.1 KiB
ReStructuredText
Instantiation Rules
|
|
-------------------
|
|
|
|
generic_map_001 (instantiation_013)
|
|
###################################
|
|
|
|
This rule checks the **generic map** keywords have proper case.
|
|
|
|
Refer to the section `Configuring Uppercase and Lowercase Rules <configuring_case.html>`_ for information on changing the default case.
|
|
|
|
**Violation**
|
|
|
|
.. code-block:: vhdl
|
|
|
|
GENERIC MAP (
|
|
|
|
**Fix**
|
|
|
|
.. code-block:: vhdl
|
|
|
|
generic map (
|
|
|
|
generic_map_002 (instantiation_016)
|
|
###################################
|
|
|
|
This rule checks generic names have proper case.
|
|
|
|
Refer to the section `Configuring Uppercase and Lowercase Rules <configuring_case.html>`_ for information on changing the default case.
|
|
|
|
**Violation**
|
|
|
|
.. code-block:: vhdl
|
|
|
|
generic map (
|
|
DEPTH => 512,
|
|
WIDTH => 32
|
|
)
|
|
|
|
**Fix**
|
|
|
|
.. code-block:: vhdl
|
|
|
|
generic map (
|
|
depth => 512,
|
|
width => 32
|
|
)
|
|
|
|
generic_map_003 (instantiation_026)
|
|
###################################
|
|
|
|
This rule checks the ( is on the same line as the **generic map** keywords.
|
|
|
|
**Violation**
|
|
|
|
.. code-block:: vhdl
|
|
|
|
generic map
|
|
(
|
|
WIDTH => 32,
|
|
DEPTH => 512
|
|
)
|
|
|
|
**Fix**
|
|
|
|
Use explicit port mapping.
|
|
|
|
.. code-block:: vhdl
|
|
|
|
generic map (
|
|
WIDTH => 32,
|
|
DEPTH => 512
|
|
)
|
|
|
|
generic_map_004 (instantiation_014)
|
|
###################################
|
|
|
|
This rule checks for the closing parenthesis *)* on generic maps are on their own line.
|
|
|
|
**Violation**
|
|
|
|
.. code-block:: vhdl
|
|
|
|
generic map (
|
|
GENERIC_1 => 0,
|
|
GENERIC_2 => TRUE,
|
|
GENERIC_3 => FALSE)
|
|
|
|
**Fix**
|
|
|
|
.. code-block:: vhdl
|
|
|
|
generic map (
|
|
GENERIC_1 => 0,
|
|
GENERIC_2 => TRUE,
|
|
GENERIC_3 => FALSE
|
|
)
|
|
|
|
|
|
generic_map_005 (instantiation_017)
|
|
###################################
|
|
|
|
This rule checks if the **generic map** keywords and a generic assignment are on the same line.
|
|
|
|
**Violation**
|
|
|
|
.. code-block:: vhdl
|
|
|
|
generic map (DEPTH => 512,
|
|
WIDTH => 32
|
|
)
|
|
|
|
**Fix**
|
|
|
|
.. code-block:: vhdl
|
|
|
|
generic map (
|
|
DEPTH => 512,
|
|
WIDTH => 32
|
|
)
|
|
|
|
generic_map_006 (instantiation_018)
|
|
###################################
|
|
|
|
This rule checks for a single space between the **map** keyword and the (.
|
|
|
|
**Violation**
|
|
|
|
.. code-block:: vhdl
|
|
|
|
generic map(
|
|
|
|
generic map (
|
|
|
|
**Fix**
|
|
|
|
.. code-block:: vhdl
|
|
|
|
generic map (
|
|
|
|
generic map (
|
|
|
|
generic_map_007 (instantiation_030)
|
|
###################################
|
|
|
|
This rule checks for a single space after the **=>** keyword in generic maps.
|
|
|
|
**Violation**
|
|
|
|
.. code-block:: vhdl
|
|
|
|
generic map
|
|
(
|
|
WIDTH => 32,
|
|
DEPTH => 512
|
|
)
|
|
|
|
**Fix**
|
|
|
|
.. code-block:: vhdl
|
|
|
|
generic map
|
|
(
|
|
WIDTH => 32,
|
|
DEPTH => 512
|
|
)
|
|
|
|
generic_map_008 (instantiation_024)
|
|
###################################
|
|
|
|
This rule checks for positional generics.
|
|
Positional ports and generics are subject to problems when the position of the underlying component changes.
|
|
|
|
**Violation**
|
|
|
|
.. code-block:: vhdl
|
|
|
|
port map (
|
|
WR_EN, RD_EN, OVERFLOW
|
|
);
|
|
|
|
**Fix**
|
|
|
|
Use explicit port mapping.
|
|
|
|
.. code-block:: vhdl
|
|
|
|
port map (
|
|
WR_EN => WR_EN,
|
|
RD_EN => RD_EN,
|
|
OVERFLOW => OVERFLOW
|
|
);
|