Hallo Leute, ich habe dass Problem, dass ich in der Simulation nur
Undefined 'U' für meine Eingänge EN und S ausgegeben bekomme.
Mein Code :
1 | library IEEE;
|
2 | use IEEE.STD_LOGIC_1164.ALL;
|
3 |
|
4 | -- Uncomment the following library declaration if using
|
5 | -- arithmetic functions with Signed or Unsigned values
|
6 | --use IEEE.NUMERIC_STD.ALL;
|
7 |
|
8 | -- Uncomment the following library declaration if instantiating
|
9 | -- any Xilinx leaf cells in this code.
|
10 | --library UNISIM;
|
11 | --use UNISIM.VComponents.all;
|
12 |
|
13 | entity Praktikum1 is
|
14 | Port (EN , S : in std_logic;
|
15 | Out1 : out std_logic
|
16 | );
|
17 | end Praktikum1;
|
18 |
|
19 | architecture Behavioral of Praktikum1 is
|
20 |
|
21 | begin
|
22 |
|
23 | XOR1_proc : process (EN, S)
|
24 |
|
25 | begin
|
26 |
|
27 | if (EN = '1' and S = '0') then
|
28 | Out1 <= '1';
|
29 | elsif (EN = '0' and S = '1') then
|
30 | Out1 <= '1';
|
31 | else
|
32 | Out1 <= '0';
|
33 | end if;
|
34 | end process;
|
35 |
|
36 | end Behavioral;
|
37 |
|
38 | Testbench:
|
39 |
|
40 | entity XOR_TB is
|
41 | -- Port ( );
|
42 | end XOR_TB;
|
43 |
|
44 | architecture Behavioral of XOR_TB is
|
45 |
|
46 | COMPONENT Praktikum1
|
47 | port (EN, S : in std_logic := '0';
|
48 | Out1 : out std_logic
|
49 | );
|
50 | END COMPONENT;
|
51 | -- input
|
52 | signal EN_TB : std_logic;
|
53 | signal S_TB : std_logic;
|
54 | -- output
|
55 | signal Out1_TB : std_logic;
|
56 |
|
57 | begin
|
58 |
|
59 | uut : Praktikum1
|
60 | port map ( EN => EN_TB,
|
61 | S => S_TB,
|
62 | Out1 => Out1_TB);
|
63 |
|
64 | test : PROCESS
|
65 | BEGIN
|
66 |
|
67 | EN_TB <= '0';
|
68 | S_TB <= '0';
|
69 | wait for 100 ns;
|
70 | EN_TB <= '1';
|
71 | wait for 100 ns;
|
72 | EN_TB <= '0';
|
73 | S_TB <= '1';
|
74 | wait for 100 ns;
|
75 | S_TB <= '1';
|
76 | wait for 100 ns;
|
77 | wait;
|
78 |
|
79 | END PROCESS;
|
80 | end Behavioral;
|
Ich hoffe mir kann jemadn Helfen, Danke im Vorraus!