aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth/issue1079/tb_test2.vhdl
blob: 27f6037b0501fea6c34c27400e4bb0785f4a7e8e (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
library ieee;
use ieee.std_logic_1164.all;

entity tb_test2 is
end;

architecture behav of tb_test2 is
  signal clk     : std_logic;
  signal rd_en   : std_logic;
  signal rd_addr : std_logic_vector(7 downto 0);
  signal rd_data : std_logic_vector(63 downto 0);
  signal wr_en   : std_logic;
  signal wr_sel  : std_logic_vector(7 downto 0);
  signal wr_addr : std_logic_vector(7 downto 0);
  signal wr_data : std_logic_vector(63 downto 0);
begin
  inst_test2: entity work.test2
    port map (
      clk     => clk,
      rd_en   => rd_en,
      rd_addr => rd_addr,
      rd_data => rd_data,
      wr_en   => wr_en,
      wr_sel  => wr_sel,
      wr_addr => wr_addr,
      wr_data => wr_data);

  process
    procedure pulse is
    begin
      clk <= '0';
      wait for 5 ns;
      clk <= '1';
      wait for 5 ns;
    end pulse;
  begin
    rd_en <= '0';
    wr_en <= '0';
    wr_sel <= x"ff";
    pulse;

    wr_en <= '1';
    wr_addr <= x"01";
    wr_data <= x"01_12_34_56_78_9a_bc_de";
    pulse;

    wr_en <= '1';
    wr_addr <= x"02";
    wr_data <= x"02_12_34_56_78_9a_bc_de";

    rd_en <= '1';
    rd_addr <= x"01";
    pulse;

    assert rd_data = x"01_12_34_56_78_9a_bc_de";
    wait;
  end process;
end behav;