aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/issue225/tb.vhdl
blob: 362533a792ca3f132981e0de1f350ff8d097b0db (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
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

entity foo is
  port (
    a0 : in unsigned(1 downto 0)
    );
end entity;

architecture bar of foo is
begin
  assert a0 = "01";
end architecture;

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

entity foo_tb is
  generic
  ( DEFAULT_X : unsigned(1 downto 0) := (others => '0')
  );
end entity;

architecture tb of foo_tb is

  function compute_stuff_with_x(x : unsigned) return unsigned is
  begin
    return x + 1;
  end compute_stuff_with_x;

begin

  foo_inst:
    entity work.foo
    port map
    ( a0 => compute_stuff_with_x(DEFAULT_X)
    );

end architecture;