aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/issue1588/libs12.vhdl
blob: 5dd9967a7bf72801b64c45af8cfee7bd0b39f6d4 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
library ieee;
use ieee.std_logic_1164.all;
use work.all;

entity libs12 is
end entity;

architecture tb of libs12 is

  component tent
    port(
      rst_n : in std_logic;
      clk   : in std_logic;
      period : in integer;
      clk_o : out std_logic;
      op1 : out integer;
      op2 : out integer
      );
  end component;

  signal tclk : std_logic := '0';
  signal trst : std_logic := '0';
  signal tper : integer := 1;
  signal oclk : std_logic;
  signal oop1 : integer;
  signal oop2 : integer;
  signal oclk1 : std_logic;
  signal oop11 : integer;
  signal oop21 : integer;
  
begin

  process
    variable v_cnt : integer := 0;
  begin
    trst  <= '0';
    wait for 1 ns;
    trst  <= '1';
    wait for 1 ns;
    while v_cnt < 50 loop
      --report "clk";
      tclk <= not tclk;
      wait for 1 ns;
      v_cnt := v_cnt + 1;
    end loop;
  end process;


u1: entity tent(rtl)
  port map(
    rst_n  => trst,
    clk    => tclk,
    period => tper,
    clk_o  => oclk,
    op1    => oop1,
    op2    => oop2
    );

u2: entity tent(bhv)
  port map(
    rst_n  => trst,
    clk    => tclk,
    period => tper,
    clk_o  => oclk1,
    op1    => oop11,
    op2    => oop21
    );

  mon: process(oclk)
  begin
    if oclk'event and oclk = '1' then
      report "Rising edge oclk with oop1: " & integer'image(oop1) &
      " and oop2: " & integer'image(oop2);
      report "Rising edge oclk with oop11: " & integer'image(oop11) &
      " and oop12: " & integer'image(oop21);
    end if;
  end process mon;

end tb;