blob: eb6d24feee53bb1ff367ec3cd9f77669b8b57607 (
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
|
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity ent is
end entity;
architecture a of ent is
begin
main : process
procedure proc(constant value : unsigned) is
variable a : integer := value'length;
variable b : integer := (value'length - 1)/2;
begin
report "x = " & integer'image(a);
report "(x-1)/2 = " & integer'image(b);
assert a = 0 and b = 0 severity failure;
end procedure;
variable value : unsigned(0 downto 1);
begin
proc(unsigned'(""));
proc(value);
wait;
end process;
end architecture;
|