blob: 79ccfd54f8b509ef1270e8d1655aaafd651acf1e (
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
31
32
33
|
package SortListGenericPkg is
generic (
type ElementType;
function "<"(L : ElementType; R : ElementType) return boolean;
function "<="(L : ElementType; R : ElementType) return boolean
);
function f (a, b : ElementType) return boolean;
end package;
package body SortListGenericPkg is
function f (a, b : ElementType) return boolean is
begin
return a <= b;
end f;
end;
package mysort is new work.SortListGenericPkg generic map (natural, "<", "<=");
entity repro is
end repro;
use work.mysort.all;
architecture behav of repro
is
begin
process
variable ok : boolean;
begin
ok := f (3, 12);
assert ok report "bad comparaison" severity failure;
wait;
end process;
end behav;
|