Skip to content

[BUG] False warning regarding sensitivity list when using generic function for clock edge detection #378

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nselvara opened this issue Apr 25, 2025 · 2 comments

Comments

@nselvara
Copy link

nselvara commented Apr 25, 2025

Bug description:

Hi there, another day of bug reporting. 😬
I'm getting the following warning from VHDL LS regarding an incomplete sensitivity list when using a generic function (e.g., rising_edge or falling_edge) in the entity’s generic declaration:

The signal 'internal_signal' is not read in the sensitivity list vhdl ls(missing_in_sensitivity_list)

This occurs when the clock edge detection function is passed as a generic, based on user configuration. While I understand why this is flagged - the analyser likely searches for a direct call to rising_edge() or falling_edge() as a pattern (similar to what synthesis tools do) - this is technically correct VHDL.

Note

Attempting to suppress the warning using the -- vhdl_ls off pragma on the line causes other errors to be reported, so it isn't a viable workaround.

Thanks yaa!


Minimal reproducible example (MRE):

library ieee;
use ieee.std_logic_1164.all;

entity generic_clk_edge_function_warning is
    generic (
        -- Function in the generic, which triggers the warning
        function active_edge(signal s: std_ulogic) return boolean
    );
    port (
        clk: in std_ulogic; -- Dummy input clock
        data_out: out std_ulogic -- Dummy output
    );
end entity;

architecture behavioural of generic_clk_edge_function_warning is
    signal internal_signal: std_ulogic := '0';
begin
    process (clk)
    -- ^ Warning reported here: missing_in_sensitivity_list
    begin
        if active_edge(clk) then  -- Trigger: function call via generic
            internal_signal <= not internal_signal;
        end if;
    end process;

    data_out <= internal_signal;
end architecture;
@nselvara nselvara changed the title [BUG] False warning for generic function used in clock edge detection [BUG] False warning regarding sensitivity list for generic function used in clock edge detection Apr 25, 2025
@nselvara nselvara changed the title [BUG] False warning regarding sensitivity list for generic function used in clock edge detection [BUG] False warning regarding sensitivity list when using generic function for clock edge detection Apr 25, 2025
@Schottkyc137
Copy link
Contributor

Closed as part of 6def6bc

@nselvara
Copy link
Author

Damn that was quick, thx yaa for your your service 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants