ghdl / ghdl

VHDL 2008/93/87 simulator
GNU General Public License v2.0
2.34k stars 358 forks source link

[BUG] Bug on syntax check, selected signal assignment --std=08 #2594

Closed alphanumericnonsense closed 7 months ago

alphanumericnonsense commented 7 months ago

Description GHDL Bug occurred when running syntax check.

Expected behaviour I expected either nothing to happen or a list of syntax errors.

How to reproduce? I think the offending code is something like

with my_sel_s select
    my_signal_s <=  sig00_s when "00",
                    sig01_s when "01",
                    sig10_s when "10",
                    sig11_s when "11",
                    unaffected when others;

so it's probably an --std=08 issue with the "selected signal assignment."

Here's a minimal working example:

library ieee;
use ieee.std_logic_1164.all;

entity selsigass_tb is

end entity selsigass_tb;

architecture test of selsigass_tb is
    signal  my_signal_s, sig00_s, sig01_s, sig10_s, sig11_s : std_logic_vector(0 to 32-1) := (others => '0');
    signal my_sel_s : std_logic_vector(0 to 2-1) := (others => '0');
begin
    with my_sel_s select
        my_signal_s <=  sig00_s when "00",
                        sig01_s when "01",
                        sig10_s when "10",
                        sig11_s when "11",
                        unaffected when others;
end architecture test;

Context

The bug for the minimal working example:

******************** GHDL Bug occurred ***************************
Please report this bug on https://github.com/ghdl/ghdl/issues
GHDL release: 4.0.0-dev (3.0.0.r329.g63eee3d6b) [Dunoon edition]
Compiled with GNAT Version: 13.1.1 20230429
Target: x86_64-pc-linux-gnu
<some folder>
Command line:
ghdl syntax --std=08 selsigass_tb.vhdl
Exception ADA.ASSERTIONS.ASSERTION_ERROR raised
Exception information:
raised ADA.ASSERTIONS.ASSERTION_ERROR : no field We_Value
Call stack traceback locations:
0x6e4c51 0x525aaa 0x65029d 0x65042f 0x63fed4 0x69785b 0x697923 0x68f459 0x40d3ed 0x7e1062710cce 0x7e1062710d88 0x40d463 0xfffffffffffffffe
******************************************************************
tgingold commented 7 months ago

Yes, I can reproduce the crash.