-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAutoCarPark_tb.vhd
80 lines (70 loc) · 2.02 KB
/
AutoCarPark_tb.vhd
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
library ieee;
use ieee.std_logic_1164.all;
use ieee.Numeric_std.all;
use work.Parking_Package.all;
entity AutoCarPark_tb is
end AutoCarPark_tb;
architecture test of AutoCarPark_tb is
component AutoCarPark is
port(
clk :in std_logic;
rst : in std_logic;
car_in : in std_logic;
Car_out : in std_logic;
Ent_car_type : car_type;
Ext_car_type : car_type;
Status : out level
);
end component;
signal clk_tb : std_logic;
signal rst_tb : std_logic;
signal car_in_tb : std_logic;
signal car_out_tb : std_logic;
signal Ent_car_type_tb: car_type;
signal Ext_car_type_tb : car_type;
signal Status_tb : level;
begin
tb_1:entity work.AutoCarPark port map( clk => clk_tb, rst => rst_tb, car_in => car_in_tb, car_out => car_out_tb,
Ent_car_type => Ent_car_type_tb, Ext_car_type => Ext_car_type_tb, Status => Status_tb);
clock: process
begin
clk_tb <= '1';
wait for 5 ns;
clk_tb <= '0';
wait for 5 ns;
end process clock;
Reset: process
begin
Rst_tb <= '1';
wait for 10 ns ;
Rst_tb <='0';
wait ;
end process Reset;
Input: process
begin
car_in_tb <= '1';
wait for 10 ns;
car_out_tb<='0';
wait for 10 ns ;
Ent_car_type_tb<= Visitor;
wait for 10 ns;
car_in_tb <= '1';
wait for 10 ns;
Ent_car_type_tb <= Visitor;
wait for 10 ns;
car_out_tb <= '1';
wait for 10 ns;
Ext_car_type_tb <= Visitor;
wait for 10 ns;
Ent_car_type_tb <= Admin;
wait for 10 ns;
car_in_tb <= '1';
wait for 10 ns;
Ent_car_type_tb <= Admin;
wait for 10 ns;
car_out_tb <= '1';
wait for 10 ns;
Ext_car_type_tb <= Admin;
wait for 10 ns;
end process;
end test;