blob: f524c04692fd1a6963cc7c84860a1f44cb834688 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
library ieee;
use ieee.std_logic_1164.all;
entity ent is
port (
inputs : in std_logic;
result : out std_logic
);
end entity;
architecture synth of ent is
function local_func(A : std_logic) return std_logic is
begin
return A;
end function;
-- With this line
-- As expected, GHDL emits a good enough error message: cannot use signal value during elaboration
constant C : std_logic := inputs;
-- But with this line, which is erroneous code, because a constant cannot be computed from a non-constant
-- GHDL crashes with an assertion: raised CONSTRAINT_ERROR : netlists-builders.adb:791 access check failed
--constant C : std_logic := local_func(inputs);
begin
result <= C;
end architecture;
|