1 | // ========== Copyright Header Begin ========================================== |
---|
2 | // |
---|
3 | // OpenSPARC T1 Processor File: spu_lsurpt1.v |
---|
4 | // Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved. |
---|
5 | // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES. |
---|
6 | // |
---|
7 | // The above named program is free software; you can redistribute it and/or |
---|
8 | // modify it under the terms of the GNU General Public |
---|
9 | // License version 2 as published by the Free Software Foundation. |
---|
10 | // |
---|
11 | // The above named program is distributed in the hope that it will be |
---|
12 | // useful, but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
14 | // General Public License for more details. |
---|
15 | // |
---|
16 | // You should have received a copy of the GNU General Public |
---|
17 | // License along with this work; if not, write to the Free Software |
---|
18 | // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
19 | // |
---|
20 | // ========== Copyright Header End ============================================ |
---|
21 | |
---|
22 | |
---|
23 | module spu_lsurpt1 ( |
---|
24 | |
---|
25 | |
---|
26 | /*outputs*/ |
---|
27 | so, |
---|
28 | |
---|
29 | spu_lsu_ldxa_data_w2, |
---|
30 | spu_lsu_ldxa_data_vld_w2, |
---|
31 | spu_lsu_ldxa_tid_w2, |
---|
32 | |
---|
33 | spu_lsu_ldst_pckt, |
---|
34 | |
---|
35 | |
---|
36 | spu_lsurpt1_rs3_data_g2, |
---|
37 | |
---|
38 | |
---|
39 | spu_lsu_ldxa_illgl_va_w2, |
---|
40 | |
---|
41 | spu_lsurpt1_stb_empty, |
---|
42 | |
---|
43 | spu_lsurpt_cpx_data_out, |
---|
44 | |
---|
45 | spu_ifu_ttype_tid_w2, |
---|
46 | |
---|
47 | spu_lsu_unc_error_w2, |
---|
48 | |
---|
49 | spu_ifu_err_addr_w2, |
---|
50 | |
---|
51 | spu_lsu_stxa_ack_tid, |
---|
52 | |
---|
53 | /*inputs*/ |
---|
54 | |
---|
55 | spu_ctl_ldxa_illgl_va_w, |
---|
56 | |
---|
57 | spu_madp_ldxa_data, |
---|
58 | |
---|
59 | spu_ldstreq_pcx, |
---|
60 | |
---|
61 | spu_ctl_ldxa_data_vld_w2, |
---|
62 | spu_ctl_ldxa_tid_w2, |
---|
63 | |
---|
64 | |
---|
65 | exu_lsu_rs3_data_e, |
---|
66 | |
---|
67 | lsu_spu_stb_empty, |
---|
68 | |
---|
69 | spu_lsurpt_cpx_data_in, |
---|
70 | |
---|
71 | spu_wen_pcx_wen, |
---|
72 | spu_wen_pcx_7170_sel, |
---|
73 | |
---|
74 | spu_ifu_ttype_tid_w, |
---|
75 | |
---|
76 | spu_lsu_unc_error_w, |
---|
77 | |
---|
78 | spu_lsu_stxa_ack_tid_ctl, |
---|
79 | |
---|
80 | |
---|
81 | |
---|
82 | si,se, |
---|
83 | //tmb_l, |
---|
84 | |
---|
85 | reset_l, |
---|
86 | rclk); |
---|
87 | |
---|
88 | // --------------------------------------------------------------------- |
---|
89 | input rclk; |
---|
90 | input reset_l; |
---|
91 | input se; |
---|
92 | input si; |
---|
93 | //input tmb_l; |
---|
94 | |
---|
95 | input [63:0] spu_madp_ldxa_data; |
---|
96 | |
---|
97 | input [122:0] spu_ldstreq_pcx; |
---|
98 | |
---|
99 | input spu_ctl_ldxa_data_vld_w2; |
---|
100 | input [1:0] spu_ctl_ldxa_tid_w2; |
---|
101 | |
---|
102 | |
---|
103 | input [63:0] exu_lsu_rs3_data_e; |
---|
104 | |
---|
105 | input spu_ctl_ldxa_illgl_va_w; |
---|
106 | |
---|
107 | input [3:0] lsu_spu_stb_empty; |
---|
108 | |
---|
109 | input [134:0] spu_lsurpt_cpx_data_in; |
---|
110 | |
---|
111 | input spu_wen_pcx_wen; |
---|
112 | input spu_wen_pcx_7170_sel; |
---|
113 | |
---|
114 | input [1:0] spu_ifu_ttype_tid_w; |
---|
115 | |
---|
116 | input spu_lsu_unc_error_w; |
---|
117 | |
---|
118 | input [1:0] spu_lsu_stxa_ack_tid_ctl; |
---|
119 | // --------------------------------------------------------------------- |
---|
120 | output [122:0] spu_lsu_ldst_pckt; |
---|
121 | |
---|
122 | output [63:0] spu_lsu_ldxa_data_w2; |
---|
123 | output spu_lsu_ldxa_data_vld_w2; |
---|
124 | output [1:0] spu_lsu_ldxa_tid_w2; |
---|
125 | |
---|
126 | |
---|
127 | output [63:0] spu_lsurpt1_rs3_data_g2; |
---|
128 | |
---|
129 | |
---|
130 | output spu_lsu_ldxa_illgl_va_w2; |
---|
131 | |
---|
132 | output [3:0] spu_lsurpt1_stb_empty; |
---|
133 | |
---|
134 | output [134:0] spu_lsurpt_cpx_data_out; |
---|
135 | |
---|
136 | output [1:0] spu_ifu_ttype_tid_w2; |
---|
137 | |
---|
138 | output spu_lsu_unc_error_w2; |
---|
139 | |
---|
140 | output [39:4] spu_ifu_err_addr_w2; |
---|
141 | |
---|
142 | output [1:0] spu_lsu_stxa_ack_tid; |
---|
143 | |
---|
144 | |
---|
145 | output so; |
---|
146 | // --------------------------------------------------------------------- |
---|
147 | |
---|
148 | |
---|
149 | dffe_s #(121) pcx_ff ( |
---|
150 | .din({spu_ldstreq_pcx[122:72],spu_ldstreq_pcx[69:0]}) , |
---|
151 | .q({spu_lsu_ldst_pckt[122:72],spu_lsu_ldst_pckt[69:0]}), |
---|
152 | .en(spu_wen_pcx_wen), .clk (rclk), .se(1'b0),.si (),.so () |
---|
153 | ); |
---|
154 | |
---|
155 | |
---|
156 | // bank select needs to be fast. |
---|
157 | //assign spu_lsu_ldst_pckt[71:70] = spu_ldstreq_pcx[71:70]; |
---|
158 | |
---|
159 | wire [71:70] spu_ldstreq_pcx_q; |
---|
160 | dffe_s #(2) pcx_7170_ff ( |
---|
161 | .din(spu_ldstreq_pcx[71:70]) , |
---|
162 | .q(spu_ldstreq_pcx_q[71:70]), |
---|
163 | .en(spu_wen_pcx_wen), .clk (rclk), .se(1'b0),.si (),.so () |
---|
164 | ); |
---|
165 | |
---|
166 | dp_mux2es #(2) pcx_7170_mx ( |
---|
167 | .in0 (spu_ldstreq_pcx_q[71:70]), |
---|
168 | .in1 (spu_ldstreq_pcx[71:70]), |
---|
169 | .sel (spu_wen_pcx_7170_sel), |
---|
170 | .dout (spu_lsu_ldst_pckt[71:70])); |
---|
171 | |
---|
172 | |
---|
173 | assign spu_ifu_err_addr_w2[39:8] = spu_ldstreq_pcx[103:72]; // buf_10x |
---|
174 | assign spu_ifu_err_addr_w2[7:6] = spu_ldstreq_pcx[71:70]; // very critical to not overload double |
---|
175 | // buffer(buf_2x+buf10x) |
---|
176 | assign spu_ifu_err_addr_w2[5:4] = spu_ldstreq_pcx[69:68]; // buf_10x |
---|
177 | |
---|
178 | // --------------------------------------------------------------------- |
---|
179 | |
---|
180 | |
---|
181 | dff_s #(64) ldxa_data_ff ( |
---|
182 | .din(spu_madp_ldxa_data[63:0]) , |
---|
183 | .q(spu_lsu_ldxa_data_w2[63:0]), |
---|
184 | .clk (rclk), .se(1'b0),.si (),.so () |
---|
185 | ); |
---|
186 | |
---|
187 | dff_s #(2) ldxa_tid_ff ( |
---|
188 | .din(spu_ctl_ldxa_tid_w2[1:0]) , |
---|
189 | .q(spu_lsu_ldxa_tid_w2[1:0]), |
---|
190 | .clk (rclk), .se(1'b0),.si (),.so () |
---|
191 | ); |
---|
192 | |
---|
193 | |
---|
194 | wire reset = ~reset_l; |
---|
195 | |
---|
196 | dffr_s #(1) ldxa_vld_ff ( |
---|
197 | .din(spu_ctl_ldxa_data_vld_w2) , |
---|
198 | .q(spu_lsu_ldxa_data_vld_w2), |
---|
199 | .rst(reset), |
---|
200 | .clk (rclk), .se(1'b0),.si (),.so () |
---|
201 | ); |
---|
202 | |
---|
203 | dffr_s #(1) illgl_va_ff ( |
---|
204 | .din(spu_ctl_ldxa_illgl_va_w) , |
---|
205 | .q(spu_lsu_ldxa_illgl_va_w2), |
---|
206 | .rst(reset), |
---|
207 | .clk (rclk), .se(1'b0),.si (),.so () |
---|
208 | ); |
---|
209 | |
---|
210 | //--------------------------------------------- |
---|
211 | |
---|
212 | wire [63:0] spu_lsurpt1_rs3_data_m, spu_lsurpt1_rs3_data_g; |
---|
213 | |
---|
214 | dff_s #(64) exu_rs3_data_e_ff ( |
---|
215 | .din(exu_lsu_rs3_data_e[63:0]) , |
---|
216 | .q(spu_lsurpt1_rs3_data_m[63:0]), |
---|
217 | .clk (rclk), .se(1'b0),.si (),.so () |
---|
218 | ); |
---|
219 | |
---|
220 | dff_s #(64) spu_rs3_data_m_ff ( |
---|
221 | .din(spu_lsurpt1_rs3_data_m[63:0]) , |
---|
222 | .q(spu_lsurpt1_rs3_data_g[63:0]), |
---|
223 | .clk (rclk), .se(1'b0),.si (),.so () |
---|
224 | ); |
---|
225 | |
---|
226 | dff_s #(64) spu_rs3_data_g_ff ( |
---|
227 | .din(spu_lsurpt1_rs3_data_g[63:0]) , |
---|
228 | .q(spu_lsurpt1_rs3_data_g2[63:0]), |
---|
229 | .clk (rclk), .se(1'b0),.si (),.so () |
---|
230 | ); |
---|
231 | |
---|
232 | |
---|
233 | //--------------------------------------------- |
---|
234 | //--------------------------------------------- |
---|
235 | |
---|
236 | // port postion should be: input on the BOTTOM and output on TOP. |
---|
237 | |
---|
238 | dff_s #(4) lsu_spu_stb_empty_ff ( |
---|
239 | .din(lsu_spu_stb_empty[3:0]) , |
---|
240 | .q(spu_lsurpt1_stb_empty[3:0]), |
---|
241 | .clk (rclk), .se(1'b0), .si(), .so()); |
---|
242 | |
---|
243 | |
---|
244 | //--------------------------------------------- |
---|
245 | //--------------------------------------------- |
---|
246 | |
---|
247 | // port postion should be: input on the BOTTOM and output on TOP. |
---|
248 | |
---|
249 | assign spu_lsurpt_cpx_data_out[134:0] = spu_lsurpt_cpx_data_in[134:0]; |
---|
250 | |
---|
251 | |
---|
252 | //--------------------------------------------- |
---|
253 | //--------------------------------------------- |
---|
254 | |
---|
255 | // place all the following flops on the right hand side. inputs located on the top |
---|
256 | // and outputs located on the bottom. |
---|
257 | |
---|
258 | |
---|
259 | dff_s #(2) spu_ifu_ttype_tid_w2_ff ( |
---|
260 | .din(spu_ifu_ttype_tid_w[1:0]) , |
---|
261 | .q(spu_ifu_ttype_tid_w2[1:0]), |
---|
262 | .clk (rclk), .se(se), .si(), .so()); |
---|
263 | |
---|
264 | |
---|
265 | dff_s #(1) spu_lsu_unc_error_w2_ff ( |
---|
266 | .din(spu_lsu_unc_error_w) , |
---|
267 | .q(spu_lsu_unc_error_w2), |
---|
268 | .clk (rclk), .se(se), .si(), .so()); |
---|
269 | |
---|
270 | dff_s #(2) spu_lsu_stxa_ack_tid_ff ( |
---|
271 | .din(spu_lsu_stxa_ack_tid_ctl[1:0]) , |
---|
272 | .q(spu_lsu_stxa_ack_tid[1:0]), |
---|
273 | .clk (rclk), .se(se), .si(), .so()); |
---|
274 | |
---|
275 | endmodule |
---|