-
Notifications
You must be signed in to change notification settings - Fork 0
/
TB_PISO.vhd
115 lines (82 loc) · 1.95 KB
/
TB_PISO.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
ENTITY TB_PISO IS
GENERIC (WIDTH : INTEGER :=10);
END TB_PISO;
ARCHITECTURE behavior OF TB_PISO IS
-- Component Declaration for the Unit Under Test (UUT)
COMPONENT PISO
GENERIC ( N: integer);
PORT(
CLK : IN std_logic;
RESET : IN std_logic;
LOAD : IN std_logic;
PRESET : IN std_logic;
ENABLE : IN std_logic;
XP: in std_logic_vector(0 to N-1);
Y : OUT std_logic
);
END COMPONENT;
--Inputs
signal L_CLK : std_logic;
signal L_RESET : std_logic;
signal L_LOAD : std_logic;
signal L_PRESET : std_logic;
signal L_ENABLE : std_logic;
signal L_XP: std_logic_vector(0 to WIDTH-1);
--Outputs
signal L_Y : std_logic;
-- Clock period definitions
constant CLK_period : time := 10 ns;
BEGIN
-- Instantiate the Unit Under Test (UUT)
UUT: PISO
GENERIC MAP(
N => WIDTH
)
PORT MAP(
CLK => L_CLK,
RESET => L_RESET,
LOAD => L_LOAD,
ENABLE => L_ENABLE,
PRESET => L_PRESET,
XP => L_XP,
Y => L_Y
);
-- Clock process definitions
CLK_process :process
begin
L_CLK <= '0';
wait for CLK_period/2;
L_CLK <= '1';
wait for CLK_period/2;
end process;
-- Stimulus process comportamento non sintetizzabile e in sequenza
inputs: process
begin
-- hold reset state for 100 ns.
wait for 10 ns;
L_ENABLE<='1';
L_XP<="1111100000";
L_LOAD<='1';
wait for CLK_period;
L_LOAD<='0';
wait for 10*CLK_period;
L_PRESET <= '1';
wait for CLK_period;
L_PRESET<='0';
wait for CLK_period;
L_RESET <='1';
wait for CLK_period;
L_RESET <='0';
wait for CLK_period;
L_XP<="1000000000";
L_LOAD<='1';
wait for CLK_period;
L_LOAD<='0';
wait for CLK_period;
wait for 10*CLK_period;
-- insert stimulus here
wait;
end process;
END;