vurfctl.v
6.36 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
/*
*************************************************************************
* *
* 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: vurfctl.v,v 1.1 2002/03/28 00:26:14 berndt Exp $
/*
*************************************************************************
* *
* Project Reality *
* *
* Module: vurfctl *
* Description: Control for new 32 word by 128 "custom" 5 port *
* register file. *
* *
* This version is for the standard cell *
* implementation of the datapath. *
* *
* Designer: Brian Ferguson *
* Date: 4/6/95 *
* *
*************************************************************************
*/
// vurfctl.v: RSP vector unit top level - instantiation of datapath and control
`timescale 1ns / 10ps
module vurfctl (
clk,
reset_l,
su_instelem_rd,
su_bwe_ac,
su_vd_addr_ac,
su_ld_rnum_ac,
su_xposeop_rdac,
vct_instvld_ac,
su_wbv_wr_en_ac,
vct_dvtypop_ac,
vct_vs_addr_ac,
su_sclrdatasl_rd,
su_qrtdatasl_rd,
su_hlfdatasl_rd,
su_whldatasl_rd,
su_vd_addr_wb,
su_ld_rnum_wb,
vct_wbv_wr_en_wb,
su_bwe_wb
) ;
input clk; /* vu clock */
input reset_l; /* vu active low reset */
input [3:0] su_instelem_rd; /* element field of instruction */
input [15:0] su_bwe_ac; /* load port byte write enable */
input [4:0] su_vd_addr_ac; /* register number for datapath writeback */
input [4:0] su_ld_rnum_ac; /* register number for load */
input su_xposeop_rdac; /* transpose op for rd stage (store) */
input vct_instvld_ac; /* valid CP2 instruction for vu */
input su_wbv_wr_en_ac; /* write enable for datapath results */
input vct_dvtypop_ac; /* divide op in ac stage from VU */
input [2:0] vct_vs_addr_ac; /* vs address in ac stage from VU */
output [3:0] su_sclrdatasl_rd; /* selcts for vector, quarter, half or whole scalar data */
output [1:0] su_qrtdatasl_rd; /* selects for scalar quarter data */
output [3:0] su_hlfdatasl_rd; /* selects for scalar half data */
output [7:0] su_whldatasl_rd; /* selects for scalar whole data */
output [4:0] su_vd_addr_wb; /* register number for datapath writeback */
output [4:0] su_ld_rnum_wb; /* register number for load */
output [7:0] vct_wbv_wr_en_wb; /* short word write enable for datapath results */
output [15:0] su_bwe_wb; /* load port byte write enable */
/*
* Decode the element field to produce selects for quarter tristate buffers
* selecting between even and odd slices.
*/
assign su_qrtdatasl_rd[0] = !su_instelem_rd[0] ;
assign su_qrtdatasl_rd[1] = su_instelem_rd[0] ;
/*
* Decode the element field to produce selects for half tristate buffers
* selecting between even and odd slices.
*/
assign su_hlfdatasl_rd[0] = ( su_instelem_rd[1:0] == 2'b00 ) ;
assign su_hlfdatasl_rd[1] = ( su_instelem_rd[1:0] == 2'b01 ) ;
assign su_hlfdatasl_rd[2] = ( su_instelem_rd[1:0] == 2'b10 ) ;
assign su_hlfdatasl_rd[3] = ( su_instelem_rd[1:0] == 2'b11 ) ;
/*
* Decode the element field to produce selects for whole tristate buffers
* selecting between even and odd slices.
*/
assign su_whldatasl_rd[0] = ( su_instelem_rd[2:0] == 3'b000 ) ;
assign su_whldatasl_rd[1] = ( su_instelem_rd[2:0] == 3'b001 ) ;
assign su_whldatasl_rd[2] = ( su_instelem_rd[2:0] == 3'b010 ) ;
assign su_whldatasl_rd[3] = ( su_instelem_rd[2:0] == 3'b011 ) ;
assign su_whldatasl_rd[4] = ( su_instelem_rd[2:0] == 3'b100 ) ;
assign su_whldatasl_rd[5] = ( su_instelem_rd[2:0] == 3'b101 ) ;
assign su_whldatasl_rd[6] = ( su_instelem_rd[2:0] == 3'b110 ) ;
assign su_whldatasl_rd[7] = ( su_instelem_rd[2:0] == 3'b111 ) ;
/*
* Decode the element field to produce selects for mux selecting between vector,
* quarter, half and whole data within register file block.
*/
assign su_sclrdatasl_rd[0] = ( su_instelem_rd[3:1] == 3'b000 ) ; // vector operand
assign su_sclrdatasl_rd[1] = ( su_instelem_rd[3:1] == 3'b001 ) ; // quarter scalar
assign su_sclrdatasl_rd[2] = ( su_instelem_rd[3:2] == 2'b01 ) ; // half scalar
assign su_sclrdatasl_rd[3] = ( su_instelem_rd[3] == 1'b1 ) ; // whole scalar
/*
* Register vd port write address
*/
asdffen #(5, 0) vctvdaddrrgwb (su_vd_addr_wb, su_vd_addr_ac, vct_instvld_ac, clk, reset_l );
/*
* Register load port write address
*/
asdff #(5,0) suldrnumrgwb (su_ld_rnum_wb, su_ld_rnum_ac, clk, 1'b1);
/*
* Decode the element field to produce selects for whole tristate buffers
* selecting between even and odd slices.
*/
wire su_wbvwrenff_wb; /* write enable for datapath results */
wire vct_dvtypop_wb; /* divide op in ac stage from VU */
wire [2:0] vct_vs_addr_wb; /* vs address in ac stage from VU */
asdff #(1, 0) vctwbvwrenffwb (su_wbvwrenff_wb, su_wbv_wr_en_ac, clk, reset_l );
asdffen #(1, 0) vctdvtypopwb (vct_dvtypop_wb, vct_dvtypop_ac, vct_instvld_ac, clk, reset_l );
asdffen #(3, 0) vctvsaddrffwb (vct_vs_addr_wb, vct_vs_addr_ac, vct_instvld_ac, clk, reset_l );
assign vct_wbv_wr_en_wb[7] = su_wbvwrenff_wb &&
( !vct_dvtypop_wb || (vct_vs_addr_wb == 3'b000)
) ;
assign vct_wbv_wr_en_wb[6] = su_wbvwrenff_wb &&
( !vct_dvtypop_wb || (vct_vs_addr_wb == 3'b001)
) ;
assign vct_wbv_wr_en_wb[5] = su_wbvwrenff_wb &&
( !vct_dvtypop_wb || (vct_vs_addr_wb == 3'b010)
) ;
assign vct_wbv_wr_en_wb[4] = su_wbvwrenff_wb &&
( !vct_dvtypop_wb || (vct_vs_addr_wb == 3'b011)
) ;
assign vct_wbv_wr_en_wb[3] = su_wbvwrenff_wb &&
( !vct_dvtypop_wb || (vct_vs_addr_wb == 3'b100)
) ;
assign vct_wbv_wr_en_wb[2] = su_wbvwrenff_wb &&
( !vct_dvtypop_wb || (vct_vs_addr_wb == 3'b101)
) ;
assign vct_wbv_wr_en_wb[1] = su_wbvwrenff_wb &&
( !vct_dvtypop_wb || (vct_vs_addr_wb == 3'b110)
) ;
assign vct_wbv_wr_en_wb[0] = su_wbvwrenff_wb &&
( !vct_dvtypop_wb || (vct_vs_addr_wb == 3'b111)
) ;
/*
* Register byte write enables for loads.
*/
asdff #(16, 0) vctbwergwb (su_bwe_wb, su_bwe_ac, clk, reset_l );
endmodule // vurfctl