aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/issue2198/moon.vhdl
blob: c1a435f82eb947aede94476dae8663a13cb4eb68 (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
entity good is
    port(
        a,b,c : in bit;
        d1,d2,d3 : out bit
    );
end good;
    
architecture night of good is
    begin
        d1 <= (a and b) or c;
        d2 <= (a or b) and c;
        d3 <= (a and b and c) or (a and b) or c;
    end;
        
entity moon is
end moon;

architecture night of moon is
    component good
    port(
        a,b,c : in bit;
        d1,d2,d3 : out bit
        );  
    end component;

    signal a0,b0,c0 : bit;
    signal d0 : bit;
    
    begin
        cow : night port map(a0, b0, c0, d0);
        
        process (a,b,c,d) is
            begin
                a <= '0'; b <= '0'; c <= '0';
                wait for 25 ns;
                a <= '0'; b <= '0'; c <= '1';
                wait for 25 ns;
                a <= '0'; b <= '1'; c <= '0';
                wait for 25 ns;
                a <= '0'; b <= '1'; c <= '1';
                wait for 25 ns;
                a <= '1'; b <= '0'; c <= '0';
                wait for 25 ns;
                a <= '1'; b <= '0'; c <= '1';
                wait for 25 ns;
                a <= '1'; b <= '1'; c <= '0';
                wait for 25 ns;
                a <= '1'; b <= '1'; c <= '1';
                wait for 25 ns;
        end process;
    end;