File: integer-variable-persist-across-activations.vhdl

package info (click to toggle)
ghdl 2.0.0%2Bdfsg-6.2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 72,852 kB
  • sloc: ada: 238,924; vhdl: 196,551; ansic: 24,457; python: 17,483; sh: 11,399; cpp: 2,283; makefile: 1,440; pascal: 516; exp: 40; asm: 25
file content (28 lines) | stat: -rw-r--r-- 588 bytes parent folder | download | duplicates (4)
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
entity foo is
end foo;

use std.textio.all;

architecture only of foo is
  signal clock : bit;
  signal last_x : integer := 0;
begin  -- only
  process (clock)
    variable x : integer := 0;
  begin  -- process
    last_x <= x;
    x := x + 1;
    wait for 1 fs;
    assert x > last_x report "TEST FAILED" severity FAILURE;
    assert x > 0 report "TEST FAILED" severity FAILURE;
    report "TEST PASSED" severity NOTE;
  end process;

  process
  begin  -- process
    clock <= '1' after 1 ns,
             '0' after 2 ns,
             '1' after 3 ns;
    wait;
  end process;
end only;