Skip to content

VSG fix crashes when entity name in architecture does not match entity name in declaration #1409

@xtrollyj00

Description

@xtrollyj00

Environment
MacOS 15.3.1
Python 3.11.10, VSG v3.30.0

Describe the bug

When entity name in architecture does not match entity name in entity declaration, VSG crashes with this error:

File "/home/.../python3.11/site-packages/vsg/rules/consistent_interface_token_case.py", line 59, in analyze
    lArchitectureInterfaces = lInterfaces[oArchitecture.name]
                              ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
KeyError: 'entity_test'

To Reproduce

Run vsg --fix file.vhd with file.vhd contents (run it on any vhdl file, just change entity name in architecture):

entity TEST_ENTITY is -- <-- HERE
    generic (
         G_TEST : natural
    );
    port (
        CLK                         : in    std_logic;
        RESET                       : in    std_logic
    );
end entity;

architecture FULL of ENTITY_TEST is -- <-- HERE
    ...
begin
    ...
end architecture;

Expected behavior
VSG does not crash 😄 and informs user about a rule violation or fixes it, if possible.

Metadata

Metadata

Labels

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions