aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth/issue1140/tb_ent.vhdl
blob: 85d370e2ea5942d8a9fe0f7952520bfbf9fdaa28 (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
entity tb_ent is
end tb_ent;

library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

architecture behav of tb_ent is
	-- Interrupt mapping register:
	signal iar	 : unsigned(15 downto 0) := "0000000010010000";
	signal ipend : unsigned(3 downto 0) := (others => '0');
	signal irq : unsigned(3 downto 0);
	signal clk : std_logic := '0';
begin
	dut: entity work.ent
	generic map (NUM_CHANNELS => 4)
		port map (iar => iar, ipend => ipend, irq => irq, clk => clk);

	process
	begin
		clk <= not clk;
		wait for 1 ns;
	end process;

stim:
	process
	begin
		wait for 10 ns;
		ipend(0) <= '1';
		wait for 10 ns;
		ipend(1) <= '1';
		wait for 10 ns;
		ipend(2) <= '1';
		wait for 10 ns;
		ipend <= (others => '0');

		wait for 10 ns;
		ipend(3) <= '1';
		wait for 10 ns;
		ipend(2) <= '1';
		wait for 10 ns;
		ipend(1) <= '1';
		wait for 10 ns;
		ipend <= (others => '0');

		wait;
	end process;

end behav;