ghdl icon indicating copy to clipboard operation
ghdl copied to clipboard

GHDL simulation crashes with exception TYPES.INTERNAL_ERROR on design using external names

Open pacalet opened this issue 4 years ago • 1 comments

Description A design using external names compiles without errors but the simulation crashes with exception TYPES.INTERNAL_ERROR.

Expected behaviour An error message stating that external names are not supported yet or a syntax error.

How to reproduce?

package pkg is
  type state_t is (idle, run);
end package pkg;

use work.pkg.all;

entity bar is
  port(
    clk:  in bit;
    rst:  in bit
  );
end entity bar;

architecture rtl of bar is
  signal state: state_t;
begin
  process(clk)
  begin
    if rising_edge(clk) then
      if rst = '1' then
        state <= idle;
      else
        case state is
          when idle => state <= run;
          when run  => state <= idle;
        end case;
      end if;
    end if;
  end process;

end architecture rtl;

use std.env.all;
use work.pkg.all;

entity bar_sim is
end entity bar_sim;

architecture sim of bar_sim is
  signal clk, rst: bit;
begin
  dut: entity work.bar
  port map(
    clk => clk,
    rst => rst
  );

  process
  begin
    clk <= '0';
    wait for 1 ns;
    clk <= '1';
    wait for 1 ns;
  end process;

  process
  begin
    rst <= '1';
    wait until rising_edge(clk);
    rst <= '0';
    for i in 1 to 10 loop
      wait until rising_edge(clk);
    end loop;
    finish;
  end process;

  process
    alias state is <<signal dut.state: state_t>>;
  begin
    wait until rising_edge(clk);
    if state = run then
      report "RUN!";
    else
      report "IDLE";
    end if;
  end process;
end architecture sim;
$ ghdl -a --std=08 bar.vhd
$ ghdl -r --std=08 bar_sim
translate_name: cannot handle IIR_KIND_EXTERNAL_SIGNAL_NAME (bar.vhd:68:20)

******************** GHDL Bug occurred ***************************
Please report this bug on https://github.com/ghdl/ghdl/issues
GHDL release: 2.0.0-dev (1.0.0.r983.g29289cbb) [Dunoon edition]
Compiled with GNAT Version: 11.2.0
Target: x86_64-apple-darwin15
/Users/pacalet/tmp/
Command line:
ghdl -r --std=08 bar_sim
Exception TYPES.INTERNAL_ERROR raised
Exception information:
raised TYPES.INTERNAL_ERROR : vhdl-errors.adb:30
Load address: 0x10d356000
Call stack traceback locations:
0x10d539c7c 0x10d6f4ac3 0x10d74ef23 0x10d752eb8 0x10d778056 0x10d77d8b3 0x10d736ddc 0x10d729921 0x10d73b5f6 0x10d73554c 0x10d77faab 0x10d6b049c 0x10d5dc821 0x10d78368d 0x10d35c4cf
******************************************************************

Context Please, provide the following information:

  • OS: macOS 12.1 (Monterey)
  • Origin:
    • [ ] Package manager: version
    • [ ] Released binaries: tarball_url
    • [X] Built from sources: 29289cbb4fb0bf5c8424519bf97220205f892151

If a GHDL Bug occurred block is shown in the log, please paste it here:

******************** GHDL Bug occurred ***************************
Please report this bug on https://github.com/ghdl/ghdl/issues
GHDL release: 2.0.0-dev (1.0.0.r983.g29289cbb) [Dunoon edition]
Compiled with GNAT Version: 11.2.0
Target: x86_64-apple-darwin15
/Users/pacalet/tmp/
Command line:
ghdl -r --std=08 bar_sim
Exception TYPES.INTERNAL_ERROR raised
Exception information:
raised TYPES.INTERNAL_ERROR : vhdl-errors.adb:30
Load address: 0x10d356000
Call stack traceback locations:
0x10d539c7c 0x10d6f4ac3 0x10d74ef23 0x10d752eb8 0x10d778056 0x10d77d8b3 0x10d736ddc 0x10d729921 0x10d73b5f6 0x10d73554c 0x10d77faab 0x10d6b049c 0x10d5dc821 0x10d78368d 0x10d35c4cf
******************************************************************

pacalet avatar Feb 09 '22 16:02 pacalet

This is a known missing feature and at some point it will be implemented.

tgingold avatar Feb 09 '22 19:02 tgingold