-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMoore_Feli_tb.vhdl
60 lines (49 loc) · 1.58 KB
/
Moore_Feli_tb.vhdl
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
59
60
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.numeric_std.all;
entity Moore_Feli_tb is
end entity;
architecture verhalten_tb of Moore_Feli_tb is
-- Abschnitt 1: Deklaration der Signale
constant clkPeriod : time := 20 ns;
signal eintb : std_logic;
signal austb : std_logic_vector(1 downto 0);
signal zustand : std_logic_vector(3 downto 0);
signal clk : std_logic := '1';
signal nRst : std_logic :='0';
-- Abschnitt 2: Zuordnung der Signale zu den Modellsignalen mit Generic Map und Port Map
begin
UUT: entity work.Moore_Feli(verhalten)
generic map
(
clkPeriod => clkPeriod
)
port map(
ein => eintb,
aus => austb,
zustand => zustand,
clk => clk,
nRst => nRst
);
-- Abschnitt 3: Stimuli
clk <= not clk after clkPeriod / 2 ;
process
begin
wait until rising_edge(clk);
nRst <= '1';
wait;
end process;
process(clk)
variable counter : integer := 1;
begin
if rising_edge(clk) then
if counter = 1 or counter = 3 or counter = 4 or counter = 5 or counter = 7 or counter = 8 or counter = 9 or counter = 10 or counter = 12 or counter = 17 or counter = 19 or counter = 22 or counter = 25 or counter = 26 or counter = 28 then
eintb <= '1';
counter := counter + 1;
elsif counter = 2 or counter = 6 or counter = 11 or counter = 1 or counter = 4 or counter = 13 or counter = 14 or counter = 15 or counter = 16 or counter = 18 or counter = 20 or counter = 21 or counter = 23 or counter = 24 or counter = 27 then
eintb <= '0';
counter := counter + 1;
end if;
end if;
end process;
end architecture;