vu.v
11.4 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
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
/*
*************************************************************************
* *
* Copyright (C) 1994, Silicon Graphics, Inc. *
* *
* These coded instructions, statements, and computer programs contain *
* unpublished proprietary information of Silicon Graphics, Inc., and *
* are protected by Federal copyright law. They may not be disclosed *
* to third parties or copied or duplicated in any form, in whole or *
* in part, without the prior written consent of Silicon Graphics, Inc. *
* *
*************************************************************************
*/
// $Id: vu.v,v 1.1 2002/03/28 00:26:14 berndt Exp $
/*
*************************************************************************
* *
* Project Reality *
* *
* Module: vu *
* Description: Top level vector unit which incorporates 4 *
* vector unit slice and one divide unit. *
* Each vector unit slice includes two vector *
* unit datapaths, the unique control for each *
* *
* *
* Designer: Brian Ferguson *
* Date: 4/6/95 *
* *
*************************************************************************
*/
// vu.v: RSP vector unit top level - instantiation of datapath and control
`timescale 1ns / 10ps
module vu ( clk, reset_l,
su_instvld_rd, su_instvldk_rd,
su_storeinst_rd,
su_vseqone_rd, su_instelem_rd, su_instfunc_rd,
su_rdcmpcd_rd, su_rdcryout_rd, su_rdcmpcdad_rd,
su_wrcmpcd_wb, su_wrcryout_wb, su_wrcmpcdad_wb,
su_st_rnum_rd,
su_xp_rnum_rd,
su_ld_rnum_ac,
su_vs_addr_rd,
su_vt_addr_rd,
su_vd_addr_ac,
su_wbv_wr_en_ac,
su_bwe_ac,
su_st_xposeop_rd,
su_ld_xposeop_wb,
su_data_to_from
) ;
input clk; /* vu clock */
input reset_l; /* vu active low reset */
input su_instvld_rd; /* valid CP2 instruction for vu without kill */
input su_instvldk_rd; /* valid CP2 instruction for vu with kill */
input su_storeinst_rd; /* store from VU */
input su_vseqone_rd; /* vs field of instruction equal to 1 */
input [3:0] su_instelem_rd; /* element field of instruction */
input [5:0] su_instfunc_rd; /* function field of instruction */
input su_rdcmpcd_rd; /* read vector compare code register */
input su_rdcryout_rd; /* read vector carry out register */
input su_rdcmpcdad_rd; /* read vector compare add register */
input su_wrcmpcd_wb; /* write vector compare code register */
input su_wrcryout_wb; /* write vector carry out register */
input su_wrcmpcdad_wb; /* write vector compare add register */
/*
* The following input signals are for register file address decoding
* only.
*/
input [4:0] su_st_rnum_rd; /* register number for stores */
input [4:0] su_xp_rnum_rd; /* register number for xpose stores */
input [4:0] su_ld_rnum_ac; /* register number for load */
input [4:0] su_vs_addr_rd; /* register number for vs read */
input [4:0] su_vt_addr_rd; /* decoded register number for vt read */
input [4:0] su_vd_addr_ac; /* register number for datapath writeback */
input su_wbv_wr_en_ac; /* write enable for datapath results */
input [15:0] su_bwe_ac; /* load port byte write enable */
input su_st_xposeop_rd; /* store transpose op in rd */
input su_ld_xposeop_wb; /* load transpose op in wb */
inout [127:0] su_data_to_from; /* data field to/from vu */
/*
* The following signals are the input signals to the
* vector unit control block.
*
* The first group are input signals to the control block
* which provide general control such as clocks, reset
* hold and instruction decoding.
*
*/
/*
* The following are wires for connecting between vector unit datapath slice
* modules.
*/
wire vct_instvld01_ac; /* valid CP2 instruction in AC */
wire vct_instvld23_ac; /* valid CP2 instruction in AC */
wire vct_instvld45_ac; /* valid CP2 instruction in AC */
wire vct_instvld67_ac; /* valid CP2 instruction in AC */
wire vct_dvtypop01_ac; /* divide op in ac stage from VU slice 01 */
wire vct_dvtypop23_ac; /* divide op in ac stage from VU slice 23 */
wire vct_dvtypop45_ac; /* divide op in ac stage from VU slice 45 */
wire vct_dvtypop67_ac; /* divide op in ac stage from VU slice 67 */
wire [2:0] vct_vs_addr01_ac; /* vs address in ac stage from VU slice 01 */
wire [2:0] vct_vs_addr23_ac; /* vs address in ac stage from VU slice 23 */
wire [2:0] vct_vs_addr45_ac; /* vs address in ac stage from VU slice 45 */
wire [2:0] vct_vs_addr67_ac; /* vs address in ac stage from VU slice 67 */
wire [127:0] vrf_vs_data_mu; // vs port read data from register file
wire [127:0] vrf_vt_data_mu; // vt port read data from register file
wire [127:0] vdp_rslt_data_wb; // vd port write data from register file
wire [15:0] vrf_div_input_rd; /* data for divide unit */
wire [15:0] vdi_divrslt_wb; /* result from divide unit */
wire [3:0] su_sclrdatasl_rd; /* selcts for vector, quarter, half or whole scalar data */
wire [1:0] su_qrtdatasl_rd; /* selects for scalar quarter data */
wire [3:0] su_hlfdatasl_rd; /* selects for scalar half data */
wire [7:0] su_whldatasl_rd; /* selects for scalar whole data */
wire [4:0] su_vd_addr_wb; /* register number for datapath writeback */
wire [4:0] su_ld_rnum_wb; /* register number for load */
wire [7:0] vct_wbv_wr_en_wb; /* short word write enable for datapath results */
wire [15:0] su_bwe_wb; /* load port byte write enable */
vusl vusl01 (
.clk (clk),
.reset_l (reset_l),
.vrf_vsdata0_mu (vrf_vs_data_mu[127:112]),
.vrf_vtdata0_mu (vrf_vt_data_mu[127:112]),
.vrf_vsdata1_mu (vrf_vs_data_mu[111:96]),
.vrf_vtdata1_mu (vrf_vt_data_mu[111:96]),
.su_instvld_rd (su_instvld_rd),
.su_instvldk_rd (su_instvldk_rd),
.su_vseqone_rd (su_vseqone_rd),
.su_instelem_rd (su_instelem_rd),
.su_instfunc_rd (su_instfunc_rd),
.su_rdcmpcd_rd (su_rdcmpcd_rd),
.su_rdcryout_rd (su_rdcryout_rd),
.su_rdcmpcdad_rd (su_rdcmpcdad_rd),
.su_wrcmpcd_wb (su_wrcmpcd_wb),
.su_wrcryout_wb (su_wrcryout_wb),
.su_wrcmpcdad_wb (su_wrcmpcdad_wb),
.su_vs_addr_rd (su_vs_addr_rd),
.su_vd_addr_ac (su_vd_addr_ac),
.vdi_divrslt0_wb (vdi_divrslt_wb),
.vdi_divrslt1_wb (vdi_divrslt_wb),
.vdp_rslt_data0_wb (vdp_rslt_data_wb[127:112]),
.vdp_rslt_data1_wb (vdp_rslt_data_wb[111:96]),
.vct_instvld_ac (vct_instvld01_ac),
.vct_dvtypop_ac (vct_dvtypop01_ac),
.vct_vs_addr_ac (vct_vs_addr01_ac),
.su_cont_to_from ({su_data_to_from[105:104],su_data_to_from[97:96]})
) ;
vusl vusl23 (
.clk (clk),
.reset_l (reset_l),
.vrf_vsdata0_mu (vrf_vs_data_mu[95:80]),
.vrf_vtdata0_mu (vrf_vt_data_mu[95:80]),
.vrf_vsdata1_mu (vrf_vs_data_mu[79:64]),
.vrf_vtdata1_mu (vrf_vt_data_mu[79:64]),
.su_instvld_rd (su_instvld_rd),
.su_instvldk_rd (su_instvldk_rd),
.su_vseqone_rd (su_vseqone_rd),
.su_instelem_rd (su_instelem_rd),
.su_instfunc_rd (su_instfunc_rd),
.su_rdcmpcd_rd (su_rdcmpcd_rd),
.su_rdcryout_rd (su_rdcryout_rd),
.su_rdcmpcdad_rd (su_rdcmpcdad_rd),
.su_wrcmpcd_wb (su_wrcmpcd_wb),
.su_wrcryout_wb (su_wrcryout_wb),
.su_wrcmpcdad_wb (su_wrcmpcdad_wb),
.su_vs_addr_rd (su_vs_addr_rd),
.su_vd_addr_ac (su_vd_addr_ac),
.vdi_divrslt0_wb (vdi_divrslt_wb),
.vdi_divrslt1_wb (vdi_divrslt_wb),
.vdp_rslt_data0_wb (vdp_rslt_data_wb[95:80]),
.vdp_rslt_data1_wb (vdp_rslt_data_wb[79:64]),
.vct_instvld_ac (vct_instvld23_ac),
.vct_dvtypop_ac (vct_dvtypop23_ac),
.vct_vs_addr_ac (vct_vs_addr23_ac),
.su_cont_to_from ({su_data_to_from[107:106],su_data_to_from[99:98]})
) ;
vusl vusl45 (
.clk (clk),
.reset_l (reset_l),
.vrf_vsdata0_mu (vrf_vs_data_mu[63:48]),
.vrf_vtdata0_mu (vrf_vt_data_mu[63:48]),
.vrf_vsdata1_mu (vrf_vs_data_mu[47:32]),
.vrf_vtdata1_mu (vrf_vt_data_mu[47:32]),
.su_instvld_rd (su_instvld_rd),
.su_instvldk_rd (su_instvldk_rd),
.su_vseqone_rd (su_vseqone_rd),
.su_instelem_rd (su_instelem_rd),
.su_instfunc_rd (su_instfunc_rd),
.su_rdcmpcd_rd (su_rdcmpcd_rd),
.su_rdcryout_rd (su_rdcryout_rd),
.su_rdcmpcdad_rd (su_rdcmpcdad_rd),
.su_wrcmpcd_wb (su_wrcmpcd_wb),
.su_wrcryout_wb (su_wrcryout_wb),
.su_wrcmpcdad_wb (su_wrcmpcdad_wb),
.su_vs_addr_rd (su_vs_addr_rd),
.su_vd_addr_ac (su_vd_addr_ac),
.vdi_divrslt0_wb (vdi_divrslt_wb),
.vdi_divrslt1_wb (vdi_divrslt_wb),
.vdp_rslt_data0_wb (vdp_rslt_data_wb[63:48]),
.vdp_rslt_data1_wb (vdp_rslt_data_wb[47:32]),
.vct_instvld_ac (vct_instvld45_ac),
.vct_dvtypop_ac (vct_dvtypop45_ac),
.vct_vs_addr_ac (vct_vs_addr45_ac),
.su_cont_to_from ({su_data_to_from[109:108],su_data_to_from[101:100]})
) ;
vusl vusl67 (
.clk (clk),
.reset_l (reset_l),
.vrf_vsdata0_mu (vrf_vs_data_mu[31:16]),
.vrf_vtdata0_mu (vrf_vt_data_mu[31:16]),
.vrf_vsdata1_mu (vrf_vs_data_mu[15:0]),
.vrf_vtdata1_mu (vrf_vt_data_mu[15:0]),
.su_instvld_rd (su_instvld_rd),
.su_instvldk_rd (su_instvldk_rd),
.su_vseqone_rd (su_vseqone_rd),
.su_instelem_rd (su_instelem_rd),
.su_instfunc_rd (su_instfunc_rd),
.su_rdcmpcd_rd (su_rdcmpcd_rd),
.su_rdcryout_rd (su_rdcryout_rd),
.su_rdcmpcdad_rd (su_rdcmpcdad_rd),
.su_wrcmpcd_wb (su_wrcmpcd_wb),
.su_wrcryout_wb (su_wrcryout_wb),
.su_wrcmpcdad_wb (su_wrcmpcdad_wb),
.su_vs_addr_rd (su_vs_addr_rd),
.su_vd_addr_ac (su_vd_addr_ac),
.vdi_divrslt0_wb (vdi_divrslt_wb),
.vdi_divrslt1_wb (vdi_divrslt_wb),
.vdp_rslt_data0_wb (vdp_rslt_data_wb[31:16]),
.vdp_rslt_data1_wb (vdp_rslt_data_wb[15:0]),
.vct_instvld_ac (vct_instvld67_ac),
.vct_dvtypop_ac (vct_dvtypop67_ac),
.vct_vs_addr_ac (vct_vs_addr67_ac),
.su_cont_to_from ({su_data_to_from[111:110],su_data_to_from[103:102]})
) ;
vurfctl vurfctl1 (
.clk (clk),
.reset_l (reset_l),
.su_instelem_rd (su_instelem_rd),
.su_bwe_ac (su_bwe_ac),
.su_vd_addr_ac (su_vd_addr_ac),
.su_ld_rnum_ac (su_ld_rnum_ac),
.su_xposeop_rdac (su_st_xposeop_rd),
.vct_instvld_ac (vct_instvld67_ac),
.su_wbv_wr_en_ac (su_wbv_wr_en_ac),
.vct_dvtypop_ac (vct_dvtypop67_ac),
.vct_vs_addr_ac (vct_vs_addr67_ac),
.su_sclrdatasl_rd (su_sclrdatasl_rd),
.su_qrtdatasl_rd (su_qrtdatasl_rd),
.su_hlfdatasl_rd (su_hlfdatasl_rd),
.su_whldatasl_rd (su_whldatasl_rd),
.su_vd_addr_wb (su_vd_addr_wb),
.su_ld_rnum_wb (su_ld_rnum_wb),
.vct_wbv_wr_en_wb (vct_wbv_wr_en_wb),
.su_bwe_wb (su_bwe_wb)
) ;
vurf vdpregfile_i (
.preclk_in0 (clk),
.preclk_in1 (clk),
.reset_l (reset_l),
.su_instvld_rd (su_instvld_rd),
.su_vs_addr_rd (su_vs_addr_rd),
.su_vt_addr_rd (su_vt_addr_rd),
.su_vd_addr_wb (su_vd_addr_wb),
.su_st_rnum_rd (su_st_rnum_rd),
.su_xp_rnum_rd (su_xp_rnum_rd),
.su_ld_rnum_wb (su_ld_rnum_wb),
.su_sclrdatasl_rd (su_sclrdatasl_rd),
.su_qrtdatasl_rd (su_qrtdatasl_rd),
.su_hlfdatasl_rd (su_hlfdatasl_rd),
.su_whldatasl_rd (su_whldatasl_rd),
.vct_wbv_wr_en_wb (vct_wbv_wr_en_wb),
.su_bwe_wb (su_bwe_wb),
.su_xposeop_rd (su_st_xposeop_rd),
.su_xposeop_wb (su_ld_xposeop_wb),
.vdp_datatristen_rd (su_storeinst_rd),
.vdp_rslt_data_wb (vdp_rslt_data_wb),
.vrf_div_input_rd (vrf_div_input_rd),
.vrf_vs_data_mu (vrf_vs_data_mu),
.vrf_vt_data_mu (vrf_vt_data_mu),
.su_data_to_from (su_data_to_from)
) ;
div div1 (
.CLK (clk),
.Reset_l (reset_l),
.OpCode (su_instfunc_rd),
.OpCodeValid (su_instvldk_rd),
.VT (vrf_div_input_rd),
.DivOut (vdi_divrslt_wb)
) ;
endmodule