Skip to content
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

Segfault with cyclic signal assignments #885

Closed
leksiso opened this issue May 3, 2024 · 1 comment
Closed

Segfault with cyclic signal assignments #885

leksiso opened this issue May 3, 2024 · 1 comment

Comments

@leksiso
Copy link

leksiso commented May 3, 2024

Hello again,

I ran into a segfault when I accidentally created a zero-time loop. The iteration limit check doesn't fire here for some reason.

Here's the reduced code demonstrating the problem:

library ieee;
use ieee.std_logic_1164.all;

entity first is
    port (
        a : in std_logic_vector(1 downto 0);
        b : out std_logic_vector(1 downto 0)
    );
end entity;

architecture rtl of first is
    signal c : std_logic;

begin
    b <= a;
    c <= a(0);

end architecture;
library ieee;
use ieee.std_logic_1164.all;

entity second is
    port (
        a : in std_logic_vector(1 downto 0);
        b : out std_logic_vector(1 downto 0) := "00"
    );
end entity;

architecture rtl of second is
begin
    b <= a;
end architecture;
library ieee;
use ieee.std_logic_1164.all;

entity test is
end entity test;

architecture arch of test is
    signal b : std_logic_vector(1 downto 0);
    signal a : std_logic_vector(1 downto 0);

begin
    first : entity work.first(rtl)
        port map(
            b => b,
            a => a
        );

    second : entity work.second(rtl)
        port map(
            a => b,
            b => a
        );

end architecture;
@nickg nickg closed this as completed in 2a1e9d9 May 3, 2024
@nickg
Copy link
Owner

nickg commented May 3, 2024

The crash actually happens when it's trying to print the iteration limit message. Now it reports:

** Fatal: 0ms+10000: limit of 10000 delta cycles reached
    > /home/nick/nvc/test/regress/issue885.vhd:46
    |
 12 |     signal c : std_logic;
    |            ^ driver for signal C is active
 ...
 28 |         b : out std_logic_vector(1 downto 0) := "00"
    |         ^ driver for port B is active
 ...
 46 |     signal b : std_logic_vector(1 downto 0);
    |            ^ driver for signal B is active
    |
    = Note: you can increase this limit with --stop-delta

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