Skip to content

Reading a output signal from within a procedure should be illegal even in VHDL 2008 #1212

@augustofg

Description

@augustofg

The following code passes when analysing with the --std=2008 flag, but it should produce an error instead (see ghdl/ghdl#2360):

library ieee;
use ieee.std_logic_1164.all;

package tb_utils is

end package tb_utils;

package body tb_utils is
  procedure f_gen_clk(signal   clk  : out std_logic;
                      constant freq : in  natural) is
  begin
    loop
      wait for (0.5 / real(freq)) * 1 sec;
      clk <= not clk;
    end loop;
  end procedure f_gen_clk;
end package body;
$ nvc --std=2008 -a ghdl-nvc-procedure-out.vhd # no error
$ ghdl -a --std=08 ghdl-nvc-procedure-out.vhd 
ghdl-nvc-procedure-out.vhd:14:18:error: signal interface "clk" cannot be read
      clk <= not clk;
                 ^
ghdl:error: compilation error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions