blob: ef2a390024de4503af8d8b15a3dfeb3042a74e94 (
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 (
rst : std_logic;
clk : in std_logic;
counter : out natural
);
end entity;
architecture a of ent is
procedure incr(signal i : inout natural) is
begin
i <= i + 1;
end procedure;
begin
process(clk)
begin
if rising_edge(clk) then
if rst = '1' then
counter <= 0;
else
-- works:
--counter <= counter + 1;
incr(counter);
end if;
end if;
end process;
end;
|