source: XOpenSparcT1/trunk/T1-CPU/spu/spu_lsurpt1.v @ 6

Revision 6, 6.4 KB checked in by pntsvt00, 14 years ago (diff)

versione iniziale opensparc

Line 
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
23module spu_lsurpt1 (
24
25
26/*outputs*/
27so,
28
29spu_lsu_ldxa_data_w2,
30spu_lsu_ldxa_data_vld_w2,
31spu_lsu_ldxa_tid_w2,
32
33spu_lsu_ldst_pckt,
34
35
36spu_lsurpt1_rs3_data_g2,
37
38
39spu_lsu_ldxa_illgl_va_w2,
40
41spu_lsurpt1_stb_empty,
42
43spu_lsurpt_cpx_data_out,
44
45spu_ifu_ttype_tid_w2,
46
47spu_lsu_unc_error_w2,
48
49spu_ifu_err_addr_w2,
50
51spu_lsu_stxa_ack_tid,
52
53/*inputs*/
54
55spu_ctl_ldxa_illgl_va_w,
56
57spu_madp_ldxa_data,
58
59spu_ldstreq_pcx,
60
61spu_ctl_ldxa_data_vld_w2,
62spu_ctl_ldxa_tid_w2,
63
64
65exu_lsu_rs3_data_e,
66
67lsu_spu_stb_empty,
68
69spu_lsurpt_cpx_data_in,
70
71spu_wen_pcx_wen,
72spu_wen_pcx_7170_sel,
73
74spu_ifu_ttype_tid_w,
75
76spu_lsu_unc_error_w,
77
78spu_lsu_stxa_ack_tid_ctl,
79
80
81
82si,se,
83//tmb_l,
84
85reset_l,
86rclk);
87
88// ---------------------------------------------------------------------
89input rclk;
90input reset_l;
91input se;
92input si;
93//input tmb_l;
94
95input [63:0] spu_madp_ldxa_data;
96
97input [122:0] spu_ldstreq_pcx;
98
99input spu_ctl_ldxa_data_vld_w2;
100input [1:0] spu_ctl_ldxa_tid_w2;
101
102
103input [63:0] exu_lsu_rs3_data_e;
104
105input spu_ctl_ldxa_illgl_va_w;
106
107input [3:0] lsu_spu_stb_empty;
108
109input [134:0] spu_lsurpt_cpx_data_in;
110
111input spu_wen_pcx_wen;
112input spu_wen_pcx_7170_sel;
113
114input [1:0] spu_ifu_ttype_tid_w;
115
116input spu_lsu_unc_error_w;
117
118input [1:0] spu_lsu_stxa_ack_tid_ctl;
119// ---------------------------------------------------------------------
120output [122:0] spu_lsu_ldst_pckt;
121
122output [63:0] spu_lsu_ldxa_data_w2;
123output spu_lsu_ldxa_data_vld_w2;
124output [1:0] spu_lsu_ldxa_tid_w2;
125
126
127output [63:0] spu_lsurpt1_rs3_data_g2;
128
129
130output  spu_lsu_ldxa_illgl_va_w2;
131
132output [3:0] spu_lsurpt1_stb_empty;
133
134output [134:0] spu_lsurpt_cpx_data_out;
135
136output [1:0] spu_ifu_ttype_tid_w2;
137
138output spu_lsu_unc_error_w2;
139
140output [39:4] spu_ifu_err_addr_w2;
141
142output [1:0] spu_lsu_stxa_ack_tid;
143
144
145output so;
146// ---------------------------------------------------------------------
147
148
149dffe_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
159wire [71:70] spu_ldstreq_pcx_q;
160dffe_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
166dp_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
173assign spu_ifu_err_addr_w2[39:8] = spu_ldstreq_pcx[103:72]; // buf_10x
174assign spu_ifu_err_addr_w2[7:6] = spu_ldstreq_pcx[71:70]; // very critical to not overload double
175                                                          // buffer(buf_2x+buf10x)
176assign spu_ifu_err_addr_w2[5:4] = spu_ldstreq_pcx[69:68]; // buf_10x
177
178// ---------------------------------------------------------------------
179
180
181dff_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
187dff_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
194wire reset = ~reset_l;
195
196dffr_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
203dffr_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
212wire [63:0] spu_lsurpt1_rs3_data_m, spu_lsurpt1_rs3_data_g;
213
214dff_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
220dff_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
226dff_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
238dff_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
249assign 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
259dff_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
265dff_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
270dff_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
275endmodule
Note: See TracBrowser for help on using the repository browser.