forked from AndrewMcClelland/RISC_Computer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathencoder_32_to_5_tb.vhd
More file actions
296 lines (268 loc) · 5.67 KB
/
Copy pathencoder_32_to_5_tb.vhd
File metadata and controls
296 lines (268 loc) · 5.67 KB
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY encoder_32_to_5_tb IS
END;
ARCHITECTURE encoder_32_to_5_tb_arch OF encoder_32_to_5_tb IS
SIGNAL R0out_tb : std_logic;
SIGNAL R1out_tb : std_logic;
SIGNAL R2out_tb : std_logic;
SIGNAL R3out_tb : std_logic;
SIGNAL R4out_tb : std_logic;
SIGNAL R5out_tb : std_logic;
SIGNAL R6out_tb : std_logic;
SIGNAL R7out_tb : std_logic;
SIGNAL R8out_tb : std_logic;
SIGNAL R9out_tb : std_logic;
SIGNAL R10out_tb : std_logic;
SIGNAL R11out_tb : std_logic;
SIGNAL R12out_tb : std_logic;
SIGNAL R13out_tb : std_logic;
SIGNAL R14out_tb : std_logic;
SIGNAL R15out_tb : std_logic;
SIGNAL HIout_tb : std_logic;
SIGNAL LOout_tb : std_logic;
SIGNAL Zlowout_tb : std_logic;
SIGNAL Zhighout_tb : std_logic;
SIGNAL PCout_tb : std_logic;
SIGNAL MDRout_tb : std_logic;
SIGNAL In_portout_tb : std_logic;
SIGNAL Cout_tb : std_logic;
SIGNAL S_tb : std_logic_vector(4 downto 0);
COMPONENT encoder_32_to_5
PORT (
R0out : IN std_logic;
R1out : IN std_logic;
R2out : IN std_logic;
R3out : IN std_logic;
R4out : IN std_logic;
R5out : IN std_logic;
R6out : IN std_logic;
R7out : IN std_logic;
R8out : IN std_logic;
R9out : IN std_logic;
R10out : IN std_logic;
R11out : IN std_logic;
R12out : IN std_logic;
R13out : IN std_logic;
R14out : IN std_logic;
R15out : IN std_logic;
HIout : IN std_logic;
LOout : IN std_logic;
Zlowout : IN std_logic;
Zhighout : IN std_logic;
PCout : IN std_logic;
MDRout : IN std_logic;
In_portout : IN std_logic;
Cout : IN std_logic;
S : OUT std_logic_vector(4 downto 0)
);
END COMPONENT encoder_32_to_5;
BEGIN
DUT1 : encoder_32_to_5
PORT MAP (
R0out => R0out_tb,
R1out => R1out_tb,
R2out => R2out_tb,
R3out => R3out_tb,
R4out => R4out_tb,
R5out => R5out_tb,
R6out => R6out_tb,
R7out => R7out_tb,
R8out => R8out_tb,
R9out => R9out_tb,
R10out => R10out_tb,
R11out => R11out_tb,
R12out => R12out_tb,
R13out => R13out_tb,
R14out => R14out_tb,
R15out => R15out_tb,
HIout => HIout_tb,
LOout => LOout_tb,
Zlowout => Zlowout_tb,
Zhighout => Zhighout_tb,
PCout => PCout_tb,
MDRout => MDRout_tb,
In_portout => In_portout_tb,
Cout => Cout_tb,
S => S_tb
);
sim_process: process
begin
wait for 20 ns;
R0out_tb <= '1';
R1out_tb <= '0';
R2out_tb <= '0';
R3out_tb <= '0';
R4out_tb <= '0';
R5out_tb <= '0';
R6out_tb <= '0';
R7out_tb <= '0';
R8out_tb <= '0';
R9out_tb <= '0';
R10out_tb <= '0';
R11out_tb <= '0';
R12out_tb <= '0';
R13out_tb <= '0';
R14out_tb <= '0';
R15out_tb <= '0';
HIout_tb <= '0';
LOout_tb <= '0';
Zlowout_tb <= '0';
Zhighout_tb <= '0';
PCout_tb <= '0';
MDRout_tb <= '0';
In_portout_tb <= '0';
Cout_tb <= '0';
wait for 20 ns;
R0out_tb <= '0';
R1out_tb <= '1';
R2out_tb <= '0';
R3out_tb <= '0';
R4out_tb <= '0';
R5out_tb <= '0';
R6out_tb <= '0';
R7out_tb <= '0';
R8out_tb <= '0';
R9out_tb <= '0';
R10out_tb <= '0';
R11out_tb <= '0';
R12out_tb <= '0';
R13out_tb <= '0';
R14out_tb <= '0';
R15out_tb <= '0';
HIout_tb <= '0';
LOout_tb <= '0';
Zlowout_tb <= '0';
Zhighout_tb <= '0';
PCout_tb <= '0';
MDRout_tb <= '0';
In_portout_tb <= '0';
Cout_tb <= '0';
wait for 20 ns;
R0out_tb <= '0';
R1out_tb <= '0';
R2out_tb <= '1';
R3out_tb <= '0';
R4out_tb <= '0';
R5out_tb <= '0';
R6out_tb <= '0';
R7out_tb <= '0';
R8out_tb <= '0';
R9out_tb <= '0';
R10out_tb <= '0';
R11out_tb <= '0';
R12out_tb <= '0';
R13out_tb <= '0';
R14out_tb <= '0';
R15out_tb <= '0';
HIout_tb <= '0';
LOout_tb <= '0';
Zlowout_tb <= '0';
Zhighout_tb <= '0';
PCout_tb <= '0';
MDRout_tb <= '0';
In_portout_tb <= '0';
Cout_tb <= '0';
wait for 20 ns;
R0out_tb <= '0';
R1out_tb <= '0';
R2out_tb <= '0';
R3out_tb <= '1';
R4out_tb <= '0';
R5out_tb <= '0';
R6out_tb <= '0';
R7out_tb <= '0';
R8out_tb <= '0';
R9out_tb <= '0';
R10out_tb <= '0';
R11out_tb <= '0';
R12out_tb <= '0';
R13out_tb <= '0';
R14out_tb <= '0';
R15out_tb <= '0';
HIout_tb <= '0';
LOout_tb <= '0';
Zlowout_tb <= '0';
Zhighout_tb <= '0';
PCout_tb <= '0';
MDRout_tb <= '0';
In_portout_tb <= '0';
Cout_tb <= '0';
wait for 20 ns;
R0out_tb <= '0';
R1out_tb <= '0';
R2out_tb <= '0';
R3out_tb <= '0';
R4out_tb <= '1';
R5out_tb <= '0';
R6out_tb <= '0';
R7out_tb <= '0';
R8out_tb <= '0';
R9out_tb <= '0';
R10out_tb <= '0';
R11out_tb <= '0';
R12out_tb <= '0';
R13out_tb <= '0';
R14out_tb <= '0';
R15out_tb <= '0';
HIout_tb <= '0';
LOout_tb <= '0';
Zlowout_tb <= '0';
Zhighout_tb <= '0';
PCout_tb <= '0';
MDRout_tb <= '0';
In_portout_tb <= '0';
Cout_tb <= '0';
wait for 20 ns;
R0out_tb <= '0';
R1out_tb <= '0';
R2out_tb <= '0';
R3out_tb <= '0';
R4out_tb <= '0';
R5out_tb <= '1';
R6out_tb <= '0';
R7out_tb <= '0';
R8out_tb <= '0';
R9out_tb <= '0';
R10out_tb <= '0';
R11out_tb <= '0';
R12out_tb <= '0';
R13out_tb <= '0';
R14out_tb <= '0';
R15out_tb <= '0';
HIout_tb <= '0';
LOout_tb <= '0';
Zlowout_tb <= '0';
Zhighout_tb <= '0';
PCout_tb <= '0';
MDRout_tb <= '0';
In_portout_tb <= '0';
Cout_tb <= '0';
wait for 20 ns;
R0out_tb <= '0';
R1out_tb <= '0';
R2out_tb <= '0';
R3out_tb <= '0';
R4out_tb <= '0';
R5out_tb <= '0';
R6out_tb <= '1';
R7out_tb <= '0';
R8out_tb <= '0';
R9out_tb <= '0';
R10out_tb <= '0';
R11out_tb <= '0';
R12out_tb <= '0';
R13out_tb <= '0';
R14out_tb <= '0';
R15out_tb <= '0';
HIout_tb <= '0';
LOout_tb <= '0';
Zlowout_tb <= '0';
Zhighout_tb <= '0';
PCout_tb <= '0';
MDRout_tb <= '0';
In_portout_tb <= '0';
Cout_tb <= '0';
wait;
end process sim_process;
end;