Skip to content

"declaration of <inst> hides component instance <inst>" Warning Shouldn't(?) Apply #3250

@Elkniwt

Description

@Elkniwt

Description
Naming a component instance inside a generate clause with the same name as an instance outside the clause causes a warning, even though the generate label should be part of the hierarchical path of the instance(?), making the names distinct.

Expected behaviour
Silent compilation

How to reproduce?
A simple ghdl -a gen_bug.vhd should show the issue. For example:

library IEEE;
use IEEE.std_logic_1164.all;

entity naming is
        generic (
                do_sub : boolean := FALSE
        );
        port (
                din  : in    std_logic;
                clk  : in    std_logic;
                dout :   out std_logic
        );
end entity;

architecture bug of naming is
        component ff is
                port (
                        din  : in    std_logic;
                        clk  : in    std_logic;
                        dout :   out std_logic
                );
        end component;

        signal sub : std_logic := '0';
        signal res : std_logic := '0';

begin

        g_sub: if do_sub generate

                inst : ff
                        port map (
                                din => din,
                                clk => clk,
                                dout => sub
                        );

        end generate;

        inst : ff
                port map (
                        din => din,
                        clk => clk,
                        dout => res
                );

        dout <= res xor sub;

end architecture;
ghdl -a gen_bug.vhd

Context
Please, provide the following information:

  • OS: Ubuntu 24.04.4 LTS
  • Origin:
    • Package manager: version
    • Released binaries: tarball_url
    • Built from sources: e9cfc54

Additional context
none.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions