1 |
95 |
fafa1971 |
// ========== Copyright Header Begin ==========================================
|
2 |
|
|
//
|
3 |
|
|
// OpenSPARC T1 Processor File: lsu_dcdp.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 |
113 |
albert.wat |
`ifdef SIMPLY_RISC_TWEAKS
|
22 |
|
|
`define SIMPLY_RISC_SCANIN .si(0)
|
23 |
|
|
`else
|
24 |
|
|
`define SIMPLY_RISC_SCANIN .si()
|
25 |
|
|
`endif
|
26 |
95 |
fafa1971 |
////////////////////////////////////////////////////////////////////////
|
27 |
|
|
/*
|
28 |
|
|
// Description: LSU Data Cache Data Path
|
29 |
|
|
// - Final Way-Select Mux.
|
30 |
|
|
// - Alignment, Sign-Extension, Endianness.
|
31 |
|
|
*/
|
32 |
|
|
////////////////////////////////////////////////////////////////////////
|
33 |
|
|
// Global header file includes
|
34 |
|
|
////////////////////////////////////////////////////////////////////////
|
35 |
113 |
albert.wat |
`include "sys.h" // system level definition file which contains the
|
36 |
95 |
fafa1971 |
// time scale definition
|
37 |
|
|
|
38 |
|
|
////////////////////////////////////////////////////////////////////////
|
39 |
|
|
// Local header file includes / local defines
|
40 |
|
|
////////////////////////////////////////////////////////////////////////
|
41 |
|
|
|
42 |
|
|
module lsu_dcdp ( /*AUTOARG*/
|
43 |
|
|
// Outputs
|
44 |
|
|
so, dcache_rdata_wb_buf, mbist_dcache_data_in,
|
45 |
|
|
lsu_exu_dfill_data_w2, lsu_ffu_ld_data, stb_rdata_ramc_buf,
|
46 |
|
|
// Inputs
|
47 |
|
|
rclk, si, se, rst_tri_en, dcache_rdata_wb, dcache_rparity_wb,
|
48 |
|
|
dcache_rdata_msb_w0_m, dcache_rdata_msb_w1_m,
|
49 |
|
|
dcache_rdata_msb_w2_m, dcache_rdata_msb_w3_m, lsu_bist_rsel_way_e,
|
50 |
|
|
dcache_alt_mx_sel_e, cache_way_hit_buf2, morphed_addr_m,
|
51 |
|
|
signed_ldst_byte_m, signed_ldst_hw_m, signed_ldst_w_m,
|
52 |
|
|
merge7_sel_byte0_m, merge7_sel_byte7_m, merge6_sel_byte1_m,
|
53 |
|
|
merge6_sel_byte6_m, merge5_sel_byte2_m, merge5_sel_byte5_m,
|
54 |
|
|
merge4_sel_byte3_m, merge4_sel_byte4_m, merge3_sel_byte0_m,
|
55 |
|
|
merge3_sel_byte3_m, merge3_sel_byte4_m,
|
56 |
|
|
merge3_sel_byte7_default_m, merge3_sel_byte_m, merge2_sel_byte1_m,
|
57 |
|
|
merge2_sel_byte2_m, merge2_sel_byte5_m,
|
58 |
|
|
merge2_sel_byte6_default_m, merge2_sel_byte_m, merge0_sel_byte0_m,
|
59 |
|
|
merge0_sel_byte1_m, merge0_sel_byte2_m,
|
60 |
|
|
merge0_sel_byte3_default_m, merge0_sel_byte4_m,
|
61 |
|
|
merge0_sel_byte5_m, merge0_sel_byte6_m,
|
62 |
|
|
merge0_sel_byte7_default_m, merge1_sel_byte0_m,
|
63 |
|
|
merge1_sel_byte1_m, merge1_sel_byte2_m,
|
64 |
|
|
merge1_sel_byte3_default_m, merge1_sel_byte4_m,
|
65 |
|
|
merge1_sel_byte5_m, merge1_sel_byte6_m,
|
66 |
|
|
merge1_sel_byte7_default_m, merge0_sel_byte_1h_m,
|
67 |
|
|
merge1_sel_byte_1h_m, merge1_sel_byte_2h_m, stb_rdata_ramc
|
68 |
|
|
) ;
|
69 |
|
|
|
70 |
|
|
input rclk;
|
71 |
|
|
input si;
|
72 |
|
|
input se;
|
73 |
|
|
output so;
|
74 |
|
|
input rst_tri_en;
|
75 |
|
|
|
76 |
|
|
input [63:0] dcache_rdata_wb;
|
77 |
|
|
output [63:0] dcache_rdata_wb_buf;
|
78 |
|
|
|
79 |
|
|
input [7:0] dcache_rparity_wb;
|
80 |
|
|
output [71:0] mbist_dcache_data_in;
|
81 |
|
|
|
82 |
|
|
output [63:0] lsu_exu_dfill_data_w2; // bypass data - d$ fill or hit
|
83 |
|
|
output [63:0] lsu_ffu_ld_data ; // ld data to frf
|
84 |
|
|
|
85 |
|
|
|
86 |
|
|
//=========================================
|
87 |
|
|
//dc_fill CP
|
88 |
|
|
//=========================================
|
89 |
|
|
input [7:0] dcache_rdata_msb_w0_m; //from D$
|
90 |
|
|
input [7:0] dcache_rdata_msb_w1_m; //from D$
|
91 |
|
|
input [7:0] dcache_rdata_msb_w2_m; //from D$
|
92 |
|
|
input [7:0] dcache_rdata_msb_w3_m; //from D$
|
93 |
|
|
|
94 |
|
|
input [3:0] lsu_bist_rsel_way_e; //from qdp2
|
95 |
|
|
|
96 |
|
|
input dcache_alt_mx_sel_e;
|
97 |
|
|
input [3:0] cache_way_hit_buf2; //from dtlb
|
98 |
|
|
|
99 |
|
|
input [7:0] morphed_addr_m; //from dctl
|
100 |
|
|
|
101 |
|
|
input signed_ldst_byte_m; //from dctl
|
102 |
|
|
// input unsigned_ldst_byte_m; //from dctl
|
103 |
|
|
input signed_ldst_hw_m; //from dctl
|
104 |
|
|
// input unsigned_ldst_hw_m; //from dctl
|
105 |
|
|
input signed_ldst_w_m; //from dctl
|
106 |
|
|
// input unsigned_ldst_w_m; //from dctl
|
107 |
|
|
|
108 |
|
|
input merge7_sel_byte0_m;
|
109 |
|
|
input merge7_sel_byte7_m;
|
110 |
|
|
|
111 |
|
|
input merge6_sel_byte1_m;
|
112 |
|
|
input merge6_sel_byte6_m;
|
113 |
|
|
|
114 |
|
|
input merge5_sel_byte2_m;
|
115 |
|
|
input merge5_sel_byte5_m;
|
116 |
|
|
|
117 |
|
|
input merge4_sel_byte3_m;
|
118 |
|
|
input merge4_sel_byte4_m;
|
119 |
|
|
|
120 |
|
|
input merge3_sel_byte0_m;
|
121 |
|
|
input merge3_sel_byte3_m;
|
122 |
|
|
input merge3_sel_byte4_m;
|
123 |
|
|
input merge3_sel_byte7_default_m;
|
124 |
|
|
input merge3_sel_byte_m ;
|
125 |
|
|
|
126 |
|
|
input merge2_sel_byte1_m;
|
127 |
|
|
input merge2_sel_byte2_m;
|
128 |
|
|
input merge2_sel_byte5_m;
|
129 |
|
|
input merge2_sel_byte6_default_m;
|
130 |
|
|
input merge2_sel_byte_m ;
|
131 |
|
|
|
132 |
|
|
input merge0_sel_byte0_m, merge0_sel_byte1_m;
|
133 |
|
|
input merge0_sel_byte2_m, merge0_sel_byte3_default_m;
|
134 |
|
|
|
135 |
|
|
input merge0_sel_byte4_m, merge0_sel_byte5_m;
|
136 |
|
|
input merge0_sel_byte6_m, merge0_sel_byte7_default_m;
|
137 |
|
|
|
138 |
|
|
input merge1_sel_byte0_m, merge1_sel_byte1_m;
|
139 |
|
|
input merge1_sel_byte2_m, merge1_sel_byte3_default_m;
|
140 |
|
|
input merge1_sel_byte4_m, merge1_sel_byte5_m;
|
141 |
|
|
input merge1_sel_byte6_m, merge1_sel_byte7_default_m;
|
142 |
|
|
|
143 |
|
|
input merge0_sel_byte_1h_m ;
|
144 |
|
|
|
145 |
|
|
input merge1_sel_byte_1h_m, merge1_sel_byte_2h_m ;
|
146 |
|
|
|
147 |
|
|
input [14:9] stb_rdata_ramc;
|
148 |
|
|
output [14:9] stb_rdata_ramc_buf;
|
149 |
|
|
|
150 |
|
|
//wire [3:1] lsu_byp_byte_zero_extend ; // zero-extend for bypass bytes 7-1
|
151 |
|
|
wire [7:1] lsu_byp_byte_sign_extend ; // sign-extend by 1 for byp bytes 7-1
|
152 |
|
|
|
153 |
|
|
wire [7:0] byte0,byte1,byte2,byte3;
|
154 |
|
|
wire [7:0] byte4,byte5,byte6,byte7;
|
155 |
|
|
//wire [3:1] zero_extend_g;
|
156 |
|
|
wire [7:1] sign_extend_g;
|
157 |
|
|
|
158 |
|
|
wire [7:0] align_byte3 ;
|
159 |
|
|
wire [7:0] align_byte2 ;
|
160 |
|
|
wire [7:0] align_byte1_1h,align_byte1_2h;
|
161 |
|
|
wire [7:0] align_byte0_1h,align_byte0_2h ;
|
162 |
|
|
wire [63:0] align_byte ;
|
163 |
|
|
|
164 |
|
|
|
165 |
|
|
wire merge7_sel_byte0;
|
166 |
|
|
wire merge7_sel_byte7;
|
167 |
|
|
|
168 |
|
|
wire merge6_sel_byte1;
|
169 |
|
|
wire merge6_sel_byte6;
|
170 |
|
|
|
171 |
|
|
wire merge5_sel_byte2;
|
172 |
|
|
wire merge5_sel_byte5;
|
173 |
|
|
|
174 |
|
|
wire merge4_sel_byte3;
|
175 |
|
|
wire merge4_sel_byte4;
|
176 |
|
|
|
177 |
|
|
wire merge3_sel_byte0;
|
178 |
|
|
wire merge3_sel_byte3;
|
179 |
|
|
wire merge3_sel_byte4;
|
180 |
|
|
wire merge3_sel_byte7;
|
181 |
|
|
wire merge3_sel_byte ;
|
182 |
|
|
|
183 |
|
|
wire merge2_sel_byte1;
|
184 |
|
|
wire merge2_sel_byte2;
|
185 |
|
|
wire merge2_sel_byte5;
|
186 |
|
|
wire merge2_sel_byte6;
|
187 |
|
|
wire merge2_sel_byte ;
|
188 |
|
|
|
189 |
|
|
wire merge0_sel_byte0, merge0_sel_byte1;
|
190 |
|
|
wire merge0_sel_byte2, merge0_sel_byte3;
|
191 |
|
|
wire merge0_sel_byte4, merge0_sel_byte5;
|
192 |
|
|
wire merge0_sel_byte6, merge0_sel_byte7;
|
193 |
|
|
wire merge1_sel_byte0, merge1_sel_byte1;
|
194 |
|
|
wire merge1_sel_byte2, merge1_sel_byte3;
|
195 |
|
|
wire merge1_sel_byte4, merge1_sel_byte5;
|
196 |
|
|
wire merge1_sel_byte6, merge1_sel_byte7;
|
197 |
|
|
|
198 |
|
|
wire merge0_sel_byte_1h ;
|
199 |
|
|
wire merge1_sel_byte_1h, merge1_sel_byte_2h ;
|
200 |
|
|
|
201 |
|
|
wire clk;
|
202 |
|
|
assign clk = rclk;
|
203 |
|
|
|
204 |
|
|
assign stb_rdata_ramc_buf[14:9] = stb_rdata_ramc[14:9];
|
205 |
|
|
|
206 |
|
|
//=========================================================================================
|
207 |
|
|
// Alignment of Fill Data
|
208 |
|
|
//=========================================================================================
|
209 |
|
|
|
210 |
|
|
// Alignment needs to be done for following reasons :
|
211 |
|
|
// - Write of data to irf on ld hit in l1.
|
212 |
|
|
// - Write of data to irf on ld fill to l1 after miss in l1.
|
213 |
|
|
// - Store of irf data to memory.
|
214 |
|
|
// - Data must be aligned before write to stb.
|
215 |
|
|
// - If data is bypassed from stb by ld then it will
|
216 |
|
|
// need realignment thru dfq i.e., it looks like a fill.
|
217 |
|
|
// This applies to data either read from the dcache (hit) or dfq(fill on miss).
|
218 |
|
|
|
219 |
|
|
|
220 |
|
|
assign byte7[7:0] = dcache_rdata_wb[63:56];
|
221 |
|
|
assign byte6[7:0] = dcache_rdata_wb[55:48];
|
222 |
|
|
assign byte5[7:0] = dcache_rdata_wb[47:40];
|
223 |
|
|
assign byte4[7:0] = dcache_rdata_wb[39:32];
|
224 |
|
|
assign byte3[7:0] = dcache_rdata_wb[31:24];
|
225 |
|
|
assign byte2[7:0] = dcache_rdata_wb[23:16];
|
226 |
|
|
assign byte1[7:0] = dcache_rdata_wb[15:8];
|
227 |
|
|
assign byte0[7:0] = dcache_rdata_wb[7:0];
|
228 |
|
|
|
229 |
|
|
//assign zero_extend_g[3:1] = lsu_byp_byte_zero_extend[3:1] ;
|
230 |
|
|
assign sign_extend_g[7:1] = lsu_byp_byte_sign_extend[7:1] ;
|
231 |
|
|
|
232 |
|
|
//buffer
|
233 |
|
|
assign dcache_rdata_wb_buf[63:0] = dcache_rdata_wb[63:0];
|
234 |
|
|
assign mbist_dcache_data_in[71:0] = {dcache_rdata_wb_buf[63:0], dcache_rparity_wb[7:0]};
|
235 |
|
|
|
236 |
|
|
// Final endian/justified/sign-extend Byte 0.
|
237 |
|
|
//assign align_byte0_1h[7:0]
|
238 |
|
|
// = merge0_sel_byte0 ? byte0[7:0] :
|
239 |
|
|
// merge0_sel_byte1 ? byte1[7:0] :
|
240 |
|
|
// merge0_sel_byte2 ? byte2[7:0] :
|
241 |
|
|
// merge0_sel_byte3 ? byte3[7:0] :
|
242 |
|
|
// 8'hxx ;
|
243 |
|
|
|
244 |
|
|
wire merge0_sel_byte0_mxsel0, merge0_sel_byte1_mxsel1, merge0_sel_byte2_mxsel2, merge0_sel_byte3_mxsel3;
|
245 |
|
|
assign merge0_sel_byte0_mxsel0 = merge0_sel_byte0 & ~rst_tri_en;
|
246 |
|
|
assign merge0_sel_byte1_mxsel1 = merge0_sel_byte1 & ~rst_tri_en;
|
247 |
|
|
assign merge0_sel_byte2_mxsel2 = merge0_sel_byte2 & ~rst_tri_en;
|
248 |
|
|
assign merge0_sel_byte3_mxsel3 = merge0_sel_byte3 | rst_tri_en;
|
249 |
|
|
|
250 |
|
|
mux4ds #(8) align_byte0_1h_mx (
|
251 |
|
|
.in0 (byte0[7:0]),
|
252 |
|
|
.in1 (byte1[7:0]),
|
253 |
|
|
.in2 (byte2[7:0]),
|
254 |
|
|
.in3 (byte3[7:0]),
|
255 |
|
|
.sel0(merge0_sel_byte0_mxsel0),
|
256 |
|
|
.sel1(merge0_sel_byte1_mxsel1),
|
257 |
|
|
.sel2(merge0_sel_byte2_mxsel2),
|
258 |
|
|
.sel3(merge0_sel_byte3_mxsel3),
|
259 |
|
|
.dout(align_byte0_1h[7:0])
|
260 |
|
|
);
|
261 |
|
|
|
262 |
|
|
//assign align_byte0_2h[7:0]
|
263 |
|
|
// = merge0_sel_byte4 ? byte4[7:0] :
|
264 |
|
|
// merge0_sel_byte5 ? byte5[7:0] :
|
265 |
|
|
// merge0_sel_byte6 ? byte6[7:0] :
|
266 |
|
|
// merge0_sel_byte7 ? byte7[7:0] :
|
267 |
|
|
// 8'hxx ;
|
268 |
|
|
|
269 |
|
|
wire merge0_sel_byte4_mxsel0, merge0_sel_byte5_mxsel1, merge0_sel_byte6_mxsel2, merge0_sel_byte7_mxsel3;
|
270 |
|
|
assign merge0_sel_byte4_mxsel0 = merge0_sel_byte4 & ~rst_tri_en;
|
271 |
|
|
assign merge0_sel_byte5_mxsel1 = merge0_sel_byte5 & ~rst_tri_en;
|
272 |
|
|
assign merge0_sel_byte6_mxsel2 = merge0_sel_byte6 & ~rst_tri_en;
|
273 |
|
|
assign merge0_sel_byte7_mxsel3 = merge0_sel_byte7 | rst_tri_en;
|
274 |
|
|
|
275 |
|
|
mux4ds #(8) align_byte0_2h_mx (
|
276 |
|
|
.in0 (byte4[7:0]),
|
277 |
|
|
.in1 (byte5[7:0]),
|
278 |
|
|
.in2 (byte6[7:0]),
|
279 |
|
|
.in3 (byte7[7:0]),
|
280 |
|
|
.sel0(merge0_sel_byte4_mxsel0),
|
281 |
|
|
.sel1(merge0_sel_byte5_mxsel1),
|
282 |
|
|
.sel2(merge0_sel_byte6_mxsel2),
|
283 |
|
|
.sel3(merge0_sel_byte7_mxsel3),
|
284 |
|
|
.dout(align_byte0_2h[7:0])
|
285 |
|
|
);
|
286 |
|
|
|
287 |
|
|
// No sign-extension or zero-extension for byte0
|
288 |
|
|
//assign align_byte[7:0]
|
289 |
|
|
// = merge0_sel_byte_1h ? align_byte0_1h[7:0] :
|
290 |
|
|
// align_byte0_2h[7:0] ;
|
291 |
|
|
|
292 |
|
|
assign align_byte[7:0] = merge0_sel_byte_1h ? align_byte0_1h[7:0] :
|
293 |
|
|
align_byte0_2h[7:0];
|
294 |
|
|
|
295 |
|
|
|
296 |
|
|
// Final endian/justified/sign-extend Byte 1.
|
297 |
|
|
// *** The path thru byte1 is the most critical ***
|
298 |
|
|
//assign align_byte1_1h[7:0]
|
299 |
|
|
// = merge1_sel_byte0 ? byte0[7:0] :
|
300 |
|
|
// merge1_sel_byte1 ? byte1[7:0] :
|
301 |
|
|
// merge1_sel_byte2 ? byte2[7:0] :
|
302 |
|
|
// merge1_sel_byte3 ? byte3[7:0] :
|
303 |
|
|
// 8'hxx ;
|
304 |
|
|
|
305 |
|
|
wire merge1_sel_byte0_mxsel0, merge1_sel_byte1_mxsel1, merge1_sel_byte2_mxsel2, merge1_sel_byte3_mxsel3;
|
306 |
|
|
assign merge1_sel_byte0_mxsel0 = merge1_sel_byte0 & ~rst_tri_en;
|
307 |
|
|
assign merge1_sel_byte1_mxsel1 = merge1_sel_byte1 & ~rst_tri_en;
|
308 |
|
|
assign merge1_sel_byte2_mxsel2 = merge1_sel_byte2 & ~rst_tri_en;
|
309 |
|
|
assign merge1_sel_byte3_mxsel3 = merge1_sel_byte3 | rst_tri_en;
|
310 |
|
|
|
311 |
|
|
mux4ds #(8) align_byte1_1h_mx (
|
312 |
|
|
.in0 (byte0[7:0]),
|
313 |
|
|
.in1 (byte1[7:0]),
|
314 |
|
|
.in2 (byte2[7:0]),
|
315 |
|
|
.in3 (byte3[7:0]),
|
316 |
|
|
.sel0(merge1_sel_byte0_mxsel0),
|
317 |
|
|
.sel1(merge1_sel_byte1_mxsel1),
|
318 |
|
|
.sel2(merge1_sel_byte2_mxsel2),
|
319 |
|
|
.sel3(merge1_sel_byte3_mxsel3),
|
320 |
|
|
.dout(align_byte1_1h[7:0])
|
321 |
|
|
);
|
322 |
|
|
|
323 |
|
|
//assign align_byte1_2h[7:0]
|
324 |
|
|
// = merge1_sel_byte4 ? byte4[7:0] :
|
325 |
|
|
// merge1_sel_byte5 ? byte5[7:0] :
|
326 |
|
|
// merge1_sel_byte6 ? byte6[7:0] :
|
327 |
|
|
// merge1_sel_byte7 ? byte7[7:0] :
|
328 |
|
|
// 8'hxx ;
|
329 |
|
|
|
330 |
|
|
wire merge1_sel_byte4_mxsel0, merge1_sel_byte5_mxsel1, merge1_sel_byte6_mxsel2, merge1_sel_byte7_mxsel3;
|
331 |
|
|
assign merge1_sel_byte4_mxsel0 = merge1_sel_byte4 & ~rst_tri_en;
|
332 |
|
|
assign merge1_sel_byte5_mxsel1 = merge1_sel_byte5 & ~rst_tri_en;
|
333 |
|
|
assign merge1_sel_byte6_mxsel2 = merge1_sel_byte6 & ~rst_tri_en;
|
334 |
|
|
assign merge1_sel_byte7_mxsel3 = merge1_sel_byte7 | rst_tri_en;
|
335 |
|
|
|
336 |
|
|
mux4ds #(8) align_byte1_2h_mx (
|
337 |
|
|
.in0 (byte4[7:0]),
|
338 |
|
|
.in1 (byte5[7:0]),
|
339 |
|
|
.in2 (byte6[7:0]),
|
340 |
|
|
.in3 (byte7[7:0]),
|
341 |
|
|
.sel0(merge1_sel_byte4_mxsel0),
|
342 |
|
|
.sel1(merge1_sel_byte5_mxsel1),
|
343 |
|
|
.sel2(merge1_sel_byte6_mxsel2),
|
344 |
|
|
.sel3(merge1_sel_byte7_mxsel3),
|
345 |
|
|
.dout(align_byte1_2h[7:0])
|
346 |
|
|
);
|
347 |
|
|
|
348 |
|
|
//assign align_byte[15:8] =
|
349 |
|
|
// zero_extend_g[1] ? 8'h00 :
|
350 |
|
|
// sign_extend_g[1] ? 8'hff :
|
351 |
|
|
// merge1_sel_byte_1h ? align_byte1_1h[7:0] :
|
352 |
|
|
// merge1_sel_byte_2h ? align_byte1_2h[7:0] :
|
353 |
|
|
// 8'hxx ;
|
354 |
|
|
|
355 |
|
|
//mux4ds #(8) align_byte1_mx (
|
356 |
|
|
// .in0 (8'h00),
|
357 |
|
|
// .in1 (8'hff),
|
358 |
|
|
// .in2 (align_byte1_1h[7:0]),
|
359 |
|
|
// .in3 (align_byte1_2h[7:0]),
|
360 |
|
|
// .sel0(zero_extend_g[1]),
|
361 |
|
|
// .sel1(sign_extend_g[1]),
|
362 |
|
|
// .sel2(merge1_sel_byte_1h),
|
363 |
|
|
// .sel3(merge1_sel_byte_2h),
|
364 |
|
|
// .dout(align_byte[15:8])
|
365 |
|
|
//);
|
366 |
|
|
|
367 |
|
|
//change to aoi from pass gate
|
368 |
|
|
//don't need zero_extend
|
369 |
|
|
|
370 |
|
|
assign align_byte[15:8] =
|
371 |
|
|
(sign_extend_g[1] ? 8'hff : 8'h00) |
|
372 |
|
|
(merge1_sel_byte_1h ? align_byte1_1h[7:0] : 8'h00) |
|
373 |
|
|
(merge1_sel_byte_2h ? align_byte1_2h[7:0] : 8'h00);
|
374 |
|
|
|
375 |
|
|
// Final endian/justified/sign-extend Byte 2.
|
376 |
|
|
//assign align_byte2[7:0]
|
377 |
|
|
// = merge2_sel_byte1 ? byte1[7:0] :
|
378 |
|
|
// merge2_sel_byte2 ? byte2[7:0] :
|
379 |
|
|
// merge2_sel_byte5 ? byte5[7:0] :
|
380 |
|
|
// merge2_sel_byte6 ? byte6[7:0] :
|
381 |
|
|
// 8'hxx ;
|
382 |
|
|
|
383 |
|
|
wire merge2_sel_byte1_mxsel0, merge2_sel_byte2_mxsel1, merge2_sel_byte5_mxsel2, merge2_sel_byte6_mxsel3;
|
384 |
|
|
assign merge2_sel_byte1_mxsel0 = merge2_sel_byte1 & ~rst_tri_en;
|
385 |
|
|
assign merge2_sel_byte2_mxsel1 = merge2_sel_byte2 & ~rst_tri_en;
|
386 |
|
|
assign merge2_sel_byte5_mxsel2 = merge2_sel_byte5 & ~rst_tri_en;
|
387 |
|
|
assign merge2_sel_byte6_mxsel3 = merge2_sel_byte6 | rst_tri_en;
|
388 |
|
|
|
389 |
|
|
mux4ds #(8) align_byte2_1st_mx (
|
390 |
|
|
.in0 (byte1[7:0]),
|
391 |
|
|
.in1 (byte2[7:0]),
|
392 |
|
|
.in2 (byte5[7:0]),
|
393 |
|
|
.in3 (byte6[7:0]),
|
394 |
|
|
.sel0(merge2_sel_byte1_mxsel0),
|
395 |
|
|
.sel1(merge2_sel_byte2_mxsel1),
|
396 |
|
|
.sel2(merge2_sel_byte5_mxsel2),
|
397 |
|
|
.sel3(merge2_sel_byte6_mxsel3),
|
398 |
|
|
.dout(align_byte2[7:0])
|
399 |
|
|
);
|
400 |
|
|
|
401 |
|
|
//assign align_byte[23:16] =
|
402 |
|
|
// zero_extend_g[2] ? 8'h00 :
|
403 |
|
|
// sign_extend_g[2] ? 8'hff :
|
404 |
|
|
// merge2_sel_byte ? align_byte2[7:0] :
|
405 |
|
|
// 8'hxx ;
|
406 |
|
|
|
407 |
|
|
//mux3ds #(8) align_byte2_2nd_mx (
|
408 |
|
|
// .in0 (8'h00),
|
409 |
|
|
// .in1 (8'hff),
|
410 |
|
|
// .in2 (align_byte2[7:0]),
|
411 |
|
|
// .sel0(zero_extend_g[2]),
|
412 |
|
|
// .sel1(sign_extend_g[2]),
|
413 |
|
|
// .sel2(merge2_sel_byte),
|
414 |
|
|
// .dout(align_byte[23:16])
|
415 |
|
|
// );
|
416 |
|
|
|
417 |
|
|
assign align_byte[23:16] =
|
418 |
|
|
( sign_extend_g[2] ? 8'hff : 8'h00) |
|
419 |
|
|
( merge2_sel_byte ? align_byte2[7:0] : 8'h00);
|
420 |
|
|
|
421 |
|
|
// Final endian/justified/sign-extend Byte 3.
|
422 |
|
|
//assign align_byte3[7:0]
|
423 |
|
|
// = merge3_sel_byte0 ? byte0[7:0] :
|
424 |
|
|
// merge3_sel_byte3 ? byte3[7:0] :
|
425 |
|
|
// merge3_sel_byte4 ? byte4[7:0] :
|
426 |
|
|
// merge3_sel_byte7 ? byte7[7:0] :
|
427 |
|
|
// 8'hxx ;
|
428 |
|
|
|
429 |
|
|
wire merge3_sel_byte0_mxsel0, merge3_sel_byte3_mxsel1, merge3_sel_byte4_mxsel2, merge3_sel_byte7_mxsel3;
|
430 |
|
|
assign merge3_sel_byte0_mxsel0 = merge3_sel_byte0 & ~rst_tri_en;
|
431 |
|
|
assign merge3_sel_byte3_mxsel1 = merge3_sel_byte3 & ~rst_tri_en;
|
432 |
|
|
assign merge3_sel_byte4_mxsel2 = merge3_sel_byte4 & ~rst_tri_en;
|
433 |
|
|
assign merge3_sel_byte7_mxsel3 = merge3_sel_byte7 | rst_tri_en;
|
434 |
|
|
|
435 |
|
|
mux4ds #(8) align_byte3_1st_mx (
|
436 |
|
|
.in0 (byte0[7:0]),
|
437 |
|
|
.in1 (byte3[7:0]),
|
438 |
|
|
.in2 (byte4[7:0]),
|
439 |
|
|
.in3 (byte7[7:0]),
|
440 |
|
|
.sel0(merge3_sel_byte0_mxsel0),
|
441 |
|
|
.sel1(merge3_sel_byte3_mxsel1),
|
442 |
|
|
.sel2(merge3_sel_byte4_mxsel2),
|
443 |
|
|
.sel3(merge3_sel_byte7_mxsel3),
|
444 |
|
|
.dout(align_byte3[7:0])
|
445 |
|
|
);
|
446 |
|
|
|
447 |
|
|
//assign align_byte[31:24] =
|
448 |
|
|
// zero_extend_g[3] ? 8'h00 :
|
449 |
|
|
// sign_extend_g[3] ? 8'hff :
|
450 |
|
|
// merge3_sel_byte ? align_byte3[7:0] :
|
451 |
|
|
// 8'hxx ;
|
452 |
|
|
|
453 |
|
|
//mux3ds #(8) align_byte3_2nd_mx (
|
454 |
|
|
// .in0 (8'h00),
|
455 |
|
|
// .in1 (8'hff),
|
456 |
|
|
// .in2 (align_byte3[7:0]),
|
457 |
|
|
// .sel0(zero_extend_g[3]),
|
458 |
|
|
// .sel1(sign_extend_g[3]),
|
459 |
|
|
// .sel2(merge3_sel_byte),
|
460 |
|
|
// .dout(align_byte[31:24])
|
461 |
|
|
// );
|
462 |
|
|
|
463 |
|
|
assign align_byte[31:24] =
|
464 |
|
|
(sign_extend_g[3] ? 8'hff : 8'h00 ) |
|
465 |
|
|
(merge3_sel_byte ? align_byte3[7:0] : 8'h00);
|
466 |
|
|
|
467 |
|
|
// Final endian/justified/sign-extend Byte 4.
|
468 |
|
|
//assign align_byte[39:32]
|
469 |
|
|
// = zero_extend_g[4] ? 8'h00 :
|
470 |
|
|
// sign_extend_g[4] ? 8'hff :
|
471 |
|
|
// merge4_sel_byte3 ? byte3[7:0] :
|
472 |
|
|
// merge4_sel_byte4 ? byte4[7:0] :
|
473 |
|
|
// 8'hxx;
|
474 |
|
|
|
475 |
|
|
//mux4ds #(8) align_byte4_mx (
|
476 |
|
|
// .in0 (8'h00),
|
477 |
|
|
// .in1 (8'hff),
|
478 |
|
|
// .in2 (byte3[7:0]),
|
479 |
|
|
// .in3 (byte4[7:0]),
|
480 |
|
|
// .sel0(zero_extend_g[4]),
|
481 |
|
|
// .sel1(sign_extend_g[4]),
|
482 |
|
|
// .sel2(merge4_sel_byte3),
|
483 |
|
|
// .sel3(merge4_sel_byte4),
|
484 |
|
|
// .dout(align_byte[39:32])
|
485 |
|
|
// );
|
486 |
|
|
|
487 |
|
|
assign align_byte[39:32] =
|
488 |
|
|
(sign_extend_g[4] ? 8'hff : 8'h00) |
|
489 |
|
|
(merge4_sel_byte3 ? byte3[7:0] : 8'h00) |
|
490 |
|
|
(merge4_sel_byte4 ? byte4[7:0] : 8'h00);
|
491 |
|
|
|
492 |
|
|
// Final endian/justified/sign-extend Byte 5.
|
493 |
|
|
//assign align_byte[47:40]
|
494 |
|
|
// = zero_extend_g[5] ? 8'h00 :
|
495 |
|
|
// sign_extend_g[5] ? 8'hff :
|
496 |
|
|
// merge5_sel_byte2 ? byte2[7:0] :
|
497 |
|
|
// merge5_sel_byte5 ? byte5[7:0] :
|
498 |
|
|
// 8'hxx ;
|
499 |
|
|
|
500 |
|
|
//mux4ds #(8) align_byte5_mx (
|
501 |
|
|
// .in0 (8'h00),
|
502 |
|
|
// .in1 (8'hff),
|
503 |
|
|
// .in2 (byte2[7:0]),
|
504 |
|
|
// .in3 (byte5[7:0]),
|
505 |
|
|
// .sel0(zero_extend_g[5]),
|
506 |
|
|
// .sel1(sign_extend_g[5]),
|
507 |
|
|
// .sel2(merge5_sel_byte2),
|
508 |
|
|
// .sel3(merge5_sel_byte5),
|
509 |
|
|
// .dout(align_byte[47:40])
|
510 |
|
|
// );
|
511 |
|
|
|
512 |
|
|
assign align_byte[47:40] =
|
513 |
|
|
(sign_extend_g[5] ? 8'hff : 8'h00) |
|
514 |
|
|
(merge5_sel_byte2 ? byte2[7:0] : 8'h00) |
|
515 |
|
|
(merge5_sel_byte5 ? byte5[7:0] : 8'h00);
|
516 |
|
|
|
517 |
|
|
|
518 |
|
|
// Final endian/justified/sign-extend Byte 6.
|
519 |
|
|
//assign align_byte[55:48]
|
520 |
|
|
// = zero_extend_g[6] ? 8'h00 :
|
521 |
|
|
// sign_extend_g[6] ? 8'hff :
|
522 |
|
|
// merge6_sel_byte1 ? byte1[7:0] :
|
523 |
|
|
// merge6_sel_byte6 ? byte6[7:0] :
|
524 |
|
|
// 8'hxx ;
|
525 |
|
|
|
526 |
|
|
//mux4ds #(8) align_byte6_mx (
|
527 |
|
|
// .in0 (8'h00),
|
528 |
|
|
// .in1 (8'hff),
|
529 |
|
|
// .in2 (byte1[7:0]),
|
530 |
|
|
// .in3 (byte6[7:0]),
|
531 |
|
|
// .sel0(zero_extend_g[6]),
|
532 |
|
|
// .sel1(sign_extend_g[6]),
|
533 |
|
|
// .sel2(merge6_sel_byte1),
|
534 |
|
|
// .sel3(merge6_sel_byte6),
|
535 |
|
|
// .dout(align_byte[55:48])
|
536 |
|
|
// );
|
537 |
|
|
|
538 |
|
|
assign align_byte[55:48] =
|
539 |
|
|
(sign_extend_g[6] ? 8'hff : 8'h00) |
|
540 |
|
|
(merge6_sel_byte1 ? byte1[7:0] : 8'h00) |
|
541 |
|
|
(merge6_sel_byte6 ? byte6[7:0] : 8'h00);
|
542 |
|
|
|
543 |
|
|
|
544 |
|
|
// Final endian/justified/sign-extend Byte 7.
|
545 |
|
|
//assign align_byte[63:56] =
|
546 |
|
|
// zero_extend_g[7] ? 8'h00 :
|
547 |
|
|
// sign_extend_g[7] ? 8'hff :
|
548 |
|
|
// merge7_sel_byte0 ? byte0[7:0] :
|
549 |
|
|
// merge7_sel_byte7 ? byte7[7:0] :
|
550 |
|
|
// 8'hxx ;
|
551 |
|
|
|
552 |
|
|
//mux4ds #(8) align_byte7_mx (
|
553 |
|
|
// .in0 (8'h00),
|
554 |
|
|
// .in1 (8'hff),
|
555 |
|
|
// .in2 (byte0[7:0]),
|
556 |
|
|
// .in3 (byte7[7:0]),
|
557 |
|
|
// .sel0(zero_extend_g[7]),
|
558 |
|
|
// .sel1(sign_extend_g[7]),
|
559 |
|
|
// .sel2(merge7_sel_byte0),
|
560 |
|
|
// .sel3(merge7_sel_byte7),
|
561 |
|
|
// .dout(align_byte[63:56])
|
562 |
|
|
// );
|
563 |
|
|
|
564 |
|
|
assign align_byte[63:56] =
|
565 |
|
|
(sign_extend_g[7] ? 8'hff : 8'h00 ) |
|
566 |
|
|
(merge7_sel_byte0 ? byte0[7:0] : 8'h00) |
|
567 |
|
|
(merge7_sel_byte7 ? byte7[7:0] : 8'h00);
|
568 |
|
|
|
569 |
|
|
//====================================================
|
570 |
|
|
//dc_fill CP sign/zero control signals
|
571 |
|
|
//====================================================
|
572 |
|
|
wire [7:0] ld_data_msb_w0_m;
|
573 |
|
|
wire [7:0] ld_data_msb_w1_m;
|
574 |
|
|
wire [7:0] ld_data_msb_w2_m;
|
575 |
|
|
wire [7:0] ld_data_msb_w3_m;
|
576 |
|
|
|
577 |
|
|
wire [7:0] ld_data_msb_w0_g;
|
578 |
|
|
wire [7:0] ld_data_msb_w1_g;
|
579 |
|
|
wire [7:0] ld_data_msb_w2_g;
|
580 |
|
|
wire [7:0] ld_data_msb_w3_g;
|
581 |
|
|
|
582 |
|
|
assign ld_data_msb_w0_m[7:0] = dcache_rdata_msb_w0_m[7:0];
|
583 |
|
|
assign ld_data_msb_w1_m[7:0] = dcache_rdata_msb_w1_m[7:0];
|
584 |
|
|
assign ld_data_msb_w2_m[7:0] = dcache_rdata_msb_w2_m[7:0];
|
585 |
|
|
assign ld_data_msb_w3_m[7:0] = dcache_rdata_msb_w3_m[7:0];
|
586 |
|
|
|
587 |
113 |
albert.wat |
dff_s #(32) ld_data_msb_stgg (
|
588 |
95 |
fafa1971 |
.din ({ld_data_msb_w0_m[7:0], ld_data_msb_w1_m[7:0], ld_data_msb_w2_m[7:0], ld_data_msb_w3_m[7:0]}),
|
589 |
|
|
.q ({ld_data_msb_w0_g[7:0], ld_data_msb_w1_g[7:0], ld_data_msb_w2_g[7:0], ld_data_msb_w3_g[7:0]}),
|
590 |
|
|
.clk (clk),
|
591 |
113 |
albert.wat |
.se (se), `SIMPLY_RISC_SCANIN, .so ()
|
592 |
95 |
fafa1971 |
);
|
593 |
|
|
|
594 |
|
|
wire [3:0] dcache_alt_rsel_way_m;
|
595 |
|
|
wire dcache_alt_mx_sel_m;
|
596 |
|
|
|
597 |
113 |
albert.wat |
dff_s #(5) dcache_alt_stgm (
|
598 |
95 |
fafa1971 |
.din ({lsu_bist_rsel_way_e[3:0], dcache_alt_mx_sel_e}),
|
599 |
|
|
.q ({dcache_alt_rsel_way_m[3:0], dcache_alt_mx_sel_m}),
|
600 |
|
|
.clk (clk),
|
601 |
113 |
albert.wat |
.se (se), `SIMPLY_RISC_SCANIN, .so ()
|
602 |
95 |
fafa1971 |
);
|
603 |
|
|
|
604 |
|
|
wire [3:0] dcache_alt_rsel_way_g;
|
605 |
|
|
wire dcache_alt_mx_sel_g;
|
606 |
|
|
|
607 |
113 |
albert.wat |
dff_s #(5) dcache_alt_stgg (
|
608 |
95 |
fafa1971 |
.din ({dcache_alt_rsel_way_m[3:0], dcache_alt_mx_sel_m}),
|
609 |
|
|
.q ({dcache_alt_rsel_way_g[3:0], dcache_alt_mx_sel_g}),
|
610 |
|
|
.clk (clk),
|
611 |
113 |
albert.wat |
.se (se), `SIMPLY_RISC_SCANIN, .so ()
|
612 |
95 |
fafa1971 |
);
|
613 |
|
|
wire [3:0] cache_way_mx_sel;
|
614 |
|
|
|
615 |
|
|
assign cache_way_mx_sel [3:0] = dcache_alt_mx_sel_g ? dcache_alt_rsel_way_g[3:0] : cache_way_hit_buf2[3:0];
|
616 |
|
|
|
617 |
|
|
// wire [7:0] align_bytes_msb;
|
618 |
|
|
|
619 |
|
|
//mux4ds #(8) align_bytes_msb_mux (
|
620 |
|
|
// .in0 (ld_data_msb_w0_g[7:0]),
|
621 |
|
|
// .in1 (ld_data_msb_w1_g[7:0]),
|
622 |
|
|
// .in2 (ld_data_msb_w2_g[7:0]),
|
623 |
|
|
// .in3 (ld_data_msb_w3_g[7:0]),
|
624 |
|
|
// .sel0 (cache_way_mx_sel[0]),
|
625 |
|
|
// .sel1 (cache_way_mx_sel[1]),
|
626 |
|
|
// .sel2 (cache_way_mx_sel[2]),
|
627 |
|
|
// .sel3 (cache_way_mx_sel[3]),
|
628 |
|
|
// .dout (align_bytes_msb[7:0])
|
629 |
|
|
//);
|
630 |
|
|
|
631 |
|
|
wire signed_ldst_byte_g;
|
632 |
|
|
wire signed_ldst_hw_g;
|
633 |
|
|
wire signed_ldst_w_g;
|
634 |
|
|
|
635 |
113 |
albert.wat |
dff_s #(3) ldst_size_stgg(
|
636 |
95 |
fafa1971 |
.din ({signed_ldst_byte_m, signed_ldst_hw_m, signed_ldst_w_m}),
|
637 |
|
|
.q ({signed_ldst_byte_g, signed_ldst_hw_g, signed_ldst_w_g}),
|
638 |
|
|
.clk (clk),
|
639 |
113 |
albert.wat |
.se (se), `SIMPLY_RISC_SCANIN, .so ()
|
640 |
95 |
fafa1971 |
);
|
641 |
|
|
|
642 |
|
|
wire [7:0] morphed_addr_g;
|
643 |
|
|
|
644 |
113 |
albert.wat |
dff_s #(8) stgg_morphadd(
|
645 |
95 |
fafa1971 |
.din (morphed_addr_m[7:0]),
|
646 |
|
|
.q (morphed_addr_g[7:0]),
|
647 |
|
|
.clk (clk),
|
648 |
113 |
albert.wat |
.se (se), `SIMPLY_RISC_SCANIN, .so ()
|
649 |
95 |
fafa1971 |
);
|
650 |
|
|
|
651 |
|
|
wire sign_bit_w0_g, sign_bit_w1_g, sign_bit_w2_g, sign_bit_w3_g;
|
652 |
|
|
|
653 |
|
|
assign sign_bit_w0_g =
|
654 |
|
|
(morphed_addr_g[0] & ld_data_msb_w0_g[7]) |
|
655 |
|
|
(morphed_addr_g[1] & ld_data_msb_w0_g[6]) |
|
656 |
|
|
(morphed_addr_g[2] & ld_data_msb_w0_g[5]) |
|
657 |
|
|
(morphed_addr_g[3] & ld_data_msb_w0_g[4]) |
|
658 |
|
|
(morphed_addr_g[4] & ld_data_msb_w0_g[3]) |
|
659 |
|
|
(morphed_addr_g[5] & ld_data_msb_w0_g[2]) |
|
660 |
|
|
(morphed_addr_g[6] & ld_data_msb_w0_g[1]) |
|
661 |
|
|
(morphed_addr_g[7] & ld_data_msb_w0_g[0]) ;
|
662 |
|
|
|
663 |
|
|
assign sign_bit_w1_g =
|
664 |
|
|
(morphed_addr_g[0] & ld_data_msb_w1_g[7]) |
|
665 |
|
|
(morphed_addr_g[1] & ld_data_msb_w1_g[6]) |
|
666 |
|
|
(morphed_addr_g[2] & ld_data_msb_w1_g[5]) |
|
667 |
|
|
(morphed_addr_g[3] & ld_data_msb_w1_g[4]) |
|
668 |
|
|
(morphed_addr_g[4] & ld_data_msb_w1_g[3]) |
|
669 |
|
|
(morphed_addr_g[5] & ld_data_msb_w1_g[2]) |
|
670 |
|
|
(morphed_addr_g[6] & ld_data_msb_w1_g[1]) |
|
671 |
|
|
(morphed_addr_g[7] & ld_data_msb_w1_g[0]) ;
|
672 |
|
|
|
673 |
|
|
assign sign_bit_w2_g =
|
674 |
|
|
(morphed_addr_g[0] & ld_data_msb_w2_g[7]) |
|
675 |
|
|
(morphed_addr_g[1] & ld_data_msb_w2_g[6]) |
|
676 |
|
|
(morphed_addr_g[2] & ld_data_msb_w2_g[5]) |
|
677 |
|
|
(morphed_addr_g[3] & ld_data_msb_w2_g[4]) |
|
678 |
|
|
(morphed_addr_g[4] & ld_data_msb_w2_g[3]) |
|
679 |
|
|
(morphed_addr_g[5] & ld_data_msb_w2_g[2]) |
|
680 |
|
|
(morphed_addr_g[6] & ld_data_msb_w2_g[1]) |
|
681 |
|
|
(morphed_addr_g[7] & ld_data_msb_w2_g[0]) ;
|
682 |
|
|
|
683 |
|
|
assign sign_bit_w3_g =
|
684 |
|
|
(morphed_addr_g[0] & ld_data_msb_w3_g[7]) |
|
685 |
|
|
(morphed_addr_g[1] & ld_data_msb_w3_g[6]) |
|
686 |
|
|
(morphed_addr_g[2] & ld_data_msb_w3_g[5]) |
|
687 |
|
|
(morphed_addr_g[3] & ld_data_msb_w3_g[4]) |
|
688 |
|
|
(morphed_addr_g[4] & ld_data_msb_w3_g[3]) |
|
689 |
|
|
(morphed_addr_g[5] & ld_data_msb_w3_g[2]) |
|
690 |
|
|
(morphed_addr_g[6] & ld_data_msb_w3_g[1]) |
|
691 |
|
|
(morphed_addr_g[7] & ld_data_msb_w3_g[0]) ;
|
692 |
|
|
|
693 |
|
|
//assign sign_bit_g =
|
694 |
|
|
// (morphed_addr_g[0] & align_bytes_msb[7]) |
|
695 |
|
|
// (morphed_addr_g[1] & align_bytes_msb[6]) |
|
696 |
|
|
// (morphed_addr_g[2] & align_bytes_msb[5]) |
|
697 |
|
|
// (morphed_addr_g[3] & align_bytes_msb[4]) |
|
698 |
|
|
// (morphed_addr_g[4] & align_bytes_msb[3]) |
|
699 |
|
|
// (morphed_addr_g[5] & align_bytes_msb[2]) |
|
700 |
|
|
// (morphed_addr_g[6] & align_bytes_msb[1]) |
|
701 |
|
|
// (morphed_addr_g[7] & align_bytes_msb[0]) ;
|
702 |
|
|
|
703 |
|
|
|
704 |
|
|
//dff #(4) ssign_bit_stgg (
|
705 |
|
|
// .din ({sign_bit_w0_m, sign_bit_w1_m, sign_bit_w2_m, sign_bit_w3_m}),
|
706 |
|
|
// .q ({sign_bit_w0_g, sign_bit_w1_g, sign_bit_w2_g, sign_bit_w3_g}),
|
707 |
|
|
// .clk (clk),
|
708 |
113 |
albert.wat |
// .se (se), `SIMPLY_RISC_SCANIN, .so ()
|
709 |
95 |
fafa1971 |
// );
|
710 |
|
|
|
711 |
|
|
// byte0 never requires sign or zero extension.
|
712 |
|
|
//w0
|
713 |
|
|
// wire [3:1] lsu_byp_byte_zero_extend_w0;
|
714 |
|
|
wire [7:1] lsu_byp_byte_sign_extend_w0;
|
715 |
|
|
|
716 |
|
|
//assign lsu_byp_byte_zero_extend_w0[1] =
|
717 |
|
|
// unsigned_ldst_byte_g | (signed_ldst_byte_g & ~sign_bit_w0_g);
|
718 |
|
|
|
719 |
|
|
assign lsu_byp_byte_sign_extend_w0[1] =
|
720 |
|
|
signed_ldst_byte_g & sign_bit_w0_g;
|
721 |
|
|
|
722 |
|
|
//assign lsu_byp_byte_zero_extend_w0[2] =
|
723 |
|
|
// unsigned_ldst_hw_g | (signed_ldst_hw_g & ~sign_bit_w0_g);
|
724 |
|
|
|
725 |
|
|
assign lsu_byp_byte_sign_extend_w0[2] =
|
726 |
|
|
signed_ldst_hw_g & sign_bit_w0_g;
|
727 |
|
|
|
728 |
|
|
//assign lsu_byp_byte_zero_extend_w0[3] =
|
729 |
|
|
// lsu_byp_byte_zero_extend_w0[2] ;
|
730 |
|
|
|
731 |
|
|
assign lsu_byp_byte_sign_extend_w0[3] =
|
732 |
|
|
lsu_byp_byte_sign_extend_w0[2] ;
|
733 |
|
|
|
734 |
|
|
//assign lsu_byp_byte_zero_extend_w0[4] =
|
735 |
|
|
// unsigned_ldst_w_g | (signed_ldst_w_g & ~sign_bit_w0_g);
|
736 |
|
|
|
737 |
|
|
assign lsu_byp_byte_sign_extend_w0[4] =
|
738 |
|
|
signed_ldst_w_g & sign_bit_w0_g;
|
739 |
|
|
|
740 |
|
|
//assign lsu_byp_byte_zero_extend_w0[5] =
|
741 |
|
|
// lsu_byp_byte_zero_extend_w0[4] ;
|
742 |
|
|
assign lsu_byp_byte_sign_extend_w0[5] =
|
743 |
|
|
lsu_byp_byte_sign_extend_w0[4] ;
|
744 |
|
|
//assign lsu_byp_byte_zero_extend_w0[6] =
|
745 |
|
|
// lsu_byp_byte_zero_extend_w0[4] ;
|
746 |
|
|
assign lsu_byp_byte_sign_extend_w0[6] =
|
747 |
|
|
lsu_byp_byte_sign_extend_w0[4] ;
|
748 |
|
|
//assign lsu_byp_byte_zero_extend_w0[7] =
|
749 |
|
|
// lsu_byp_byte_zero_extend_w0[4] ;
|
750 |
|
|
assign lsu_byp_byte_sign_extend_w0[7] =
|
751 |
|
|
lsu_byp_byte_sign_extend_w0[4] ;
|
752 |
|
|
|
753 |
|
|
//w1
|
754 |
|
|
// wire [3:1] lsu_byp_byte_zero_extend_w1;
|
755 |
|
|
wire [7:1] lsu_byp_byte_sign_extend_w1;
|
756 |
|
|
|
757 |
|
|
//assign lsu_byp_byte_zero_extend_w1[1] =
|
758 |
|
|
// unsigned_ldst_byte_g | (signed_ldst_byte_g & ~sign_bit_w1_g);
|
759 |
|
|
|
760 |
|
|
assign lsu_byp_byte_sign_extend_w1[1] =
|
761 |
|
|
signed_ldst_byte_g & sign_bit_w1_g;
|
762 |
|
|
|
763 |
|
|
//assign lsu_byp_byte_zero_extend_w1[2] =
|
764 |
|
|
// unsigned_ldst_hw_g | (signed_ldst_hw_g & ~sign_bit_w1_g);
|
765 |
|
|
|
766 |
|
|
assign lsu_byp_byte_sign_extend_w1[2] =
|
767 |
|
|
signed_ldst_hw_g & sign_bit_w1_g;
|
768 |
|
|
|
769 |
|
|
//assign lsu_byp_byte_zero_extend_w1[3] =
|
770 |
|
|
// lsu_byp_byte_zero_extend_w1[2] ;
|
771 |
|
|
|
772 |
|
|
assign lsu_byp_byte_sign_extend_w1[3] =
|
773 |
|
|
lsu_byp_byte_sign_extend_w1[2] ;
|
774 |
|
|
|
775 |
|
|
//assign lsu_byp_byte_zero_extend_w1[4] =
|
776 |
|
|
// unsigned_ldst_w_g | (signed_ldst_w_g & ~sign_bit_w1_g);
|
777 |
|
|
|
778 |
|
|
assign lsu_byp_byte_sign_extend_w1[4] =
|
779 |
|
|
signed_ldst_w_g & sign_bit_w1_g;
|
780 |
|
|
|
781 |
|
|
//assign lsu_byp_byte_zero_extend_w1[5] =
|
782 |
|
|
// lsu_byp_byte_zero_extend_w1[4] ;
|
783 |
|
|
assign lsu_byp_byte_sign_extend_w1[5] =
|
784 |
|
|
lsu_byp_byte_sign_extend_w1[4] ;
|
785 |
|
|
//assign lsu_byp_byte_zero_extend_w1[6] =
|
786 |
|
|
// lsu_byp_byte_zero_extend_w1[4] ;
|
787 |
|
|
assign lsu_byp_byte_sign_extend_w1[6] =
|
788 |
|
|
lsu_byp_byte_sign_extend_w1[4] ;
|
789 |
|
|
//assign lsu_byp_byte_zero_extend_w1[7] =
|
790 |
|
|
// lsu_byp_byte_zero_extend_w1[4] ;
|
791 |
|
|
assign lsu_byp_byte_sign_extend_w1[7] =
|
792 |
|
|
lsu_byp_byte_sign_extend_w1[4] ;
|
793 |
|
|
|
794 |
|
|
//w2
|
795 |
|
|
// wire [3:1] lsu_byp_byte_zero_extend_w2;
|
796 |
|
|
wire [7:1] lsu_byp_byte_sign_extend_w2;
|
797 |
|
|
|
798 |
|
|
//assign lsu_byp_byte_zero_extend_w2[1] =
|
799 |
|
|
// unsigned_ldst_byte_g | (signed_ldst_byte_g & ~sign_bit_w2_g);
|
800 |
|
|
|
801 |
|
|
assign lsu_byp_byte_sign_extend_w2[1] =
|
802 |
|
|
signed_ldst_byte_g & sign_bit_w2_g;
|
803 |
|
|
|
804 |
|
|
//assign lsu_byp_byte_zero_extend_w2[2] =
|
805 |
|
|
// unsigned_ldst_hw_g | (signed_ldst_hw_g & ~sign_bit_w2_g);
|
806 |
|
|
|
807 |
|
|
assign lsu_byp_byte_sign_extend_w2[2] =
|
808 |
|
|
signed_ldst_hw_g & sign_bit_w2_g;
|
809 |
|
|
|
810 |
|
|
//assign lsu_byp_byte_zero_extend_w2[3] =
|
811 |
|
|
// lsu_byp_byte_zero_extend_w2[2] ;
|
812 |
|
|
|
813 |
|
|
assign lsu_byp_byte_sign_extend_w2[3] =
|
814 |
|
|
lsu_byp_byte_sign_extend_w2[2] ;
|
815 |
|
|
|
816 |
|
|
//assign lsu_byp_byte_zero_extend_w2[4] =
|
817 |
|
|
// unsigned_ldst_w_g | (signed_ldst_w_g & ~sign_bit_w2_g);
|
818 |
|
|
|
819 |
|
|
assign lsu_byp_byte_sign_extend_w2[4] =
|
820 |
|
|
signed_ldst_w_g & sign_bit_w2_g;
|
821 |
|
|
|
822 |
|
|
//assign lsu_byp_byte_zero_extend_w2[5] =
|
823 |
|
|
// lsu_byp_byte_zero_extend_w2[4] ;
|
824 |
|
|
assign lsu_byp_byte_sign_extend_w2[5] =
|
825 |
|
|
lsu_byp_byte_sign_extend_w2[4] ;
|
826 |
|
|
//assign lsu_byp_byte_zero_extend_w2[6] =
|
827 |
|
|
// lsu_byp_byte_zero_extend_w2[4] ;
|
828 |
|
|
assign lsu_byp_byte_sign_extend_w2[6] =
|
829 |
|
|
lsu_byp_byte_sign_extend_w2[4] ;
|
830 |
|
|
//assign lsu_byp_byte_zero_extend_w2[7] =
|
831 |
|
|
// lsu_byp_byte_zero_extend_w2[4] ;
|
832 |
|
|
assign lsu_byp_byte_sign_extend_w2[7] =
|
833 |
|
|
lsu_byp_byte_sign_extend_w2[4] ;
|
834 |
|
|
|
835 |
|
|
//w3
|
836 |
|
|
// wire [3:1] lsu_byp_byte_zero_extend_w3;
|
837 |
|
|
wire [7:1] lsu_byp_byte_sign_extend_w3;
|
838 |
|
|
|
839 |
|
|
//assign lsu_byp_byte_zero_extend_w3[1] =
|
840 |
|
|
// unsigned_ldst_byte_g | (signed_ldst_byte_g & ~sign_bit_w3_g);
|
841 |
|
|
|
842 |
|
|
assign lsu_byp_byte_sign_extend_w3[1] =
|
843 |
|
|
signed_ldst_byte_g & sign_bit_w3_g;
|
844 |
|
|
|
845 |
|
|
//assign lsu_byp_byte_zero_extend_w3[2] =
|
846 |
|
|
// unsigned_ldst_hw_g | (signed_ldst_hw_g & ~sign_bit_w3_g);
|
847 |
|
|
|
848 |
|
|
assign lsu_byp_byte_sign_extend_w3[2] =
|
849 |
|
|
signed_ldst_hw_g & sign_bit_w3_g;
|
850 |
|
|
|
851 |
|
|
//assign lsu_byp_byte_zero_extend_w3[3] =
|
852 |
|
|
// lsu_byp_byte_zero_extend_w3[2] ;
|
853 |
|
|
|
854 |
|
|
assign lsu_byp_byte_sign_extend_w3[3] =
|
855 |
|
|
lsu_byp_byte_sign_extend_w3[2] ;
|
856 |
|
|
|
857 |
|
|
//assign lsu_byp_byte_zero_extend_w3[4] =
|
858 |
|
|
// unsigned_ldst_w_g | (signed_ldst_w_g & ~sign_bit_w3_g);
|
859 |
|
|
|
860 |
|
|
assign lsu_byp_byte_sign_extend_w3[4] =
|
861 |
|
|
signed_ldst_w_g & sign_bit_w3_g;
|
862 |
|
|
|
863 |
|
|
//assign lsu_byp_byte_zero_extend_w3[5] =
|
864 |
|
|
// lsu_byp_byte_zero_extend_w3[4] ;
|
865 |
|
|
assign lsu_byp_byte_sign_extend_w3[5] =
|
866 |
|
|
lsu_byp_byte_sign_extend_w3[4] ;
|
867 |
|
|
//assign lsu_byp_byte_zero_extend_w3[6] =
|
868 |
|
|
// lsu_byp_byte_zero_extend_w3[4] ;
|
869 |
|
|
assign lsu_byp_byte_sign_extend_w3[6] =
|
870 |
|
|
lsu_byp_byte_sign_extend_w3[4] ;
|
871 |
|
|
//assign lsu_byp_byte_zero_extend_w3[7] =
|
872 |
|
|
// lsu_byp_byte_zero_extend_w3[4] ;
|
873 |
|
|
assign lsu_byp_byte_sign_extend_w3[7] =
|
874 |
|
|
lsu_byp_byte_sign_extend_w3[4] ;
|
875 |
|
|
|
876 |
|
|
|
877 |
|
|
//mux4ds #(14) zero_sign_sel_mux (
|
878 |
|
|
// .in0 ({lsu_byp_byte_zero_extend_w0[7:1],lsu_byp_byte_sign_extend_w0[7:1]}),
|
879 |
|
|
// .in1 ({lsu_byp_byte_zero_extend_w1[7:1],lsu_byp_byte_sign_extend_w1[7:1]}),
|
880 |
|
|
// .in2 ({lsu_byp_byte_zero_extend_w2[7:1],lsu_byp_byte_sign_extend_w2[7:1]}),
|
881 |
|
|
// .in3 ({lsu_byp_byte_zero_extend_w3[7:1],lsu_byp_byte_sign_extend_w3[7:1]}),
|
882 |
|
|
// .sel0 (cache_way_mx_sel[0]),
|
883 |
|
|
// .sel1 (cache_way_mx_sel[1]),
|
884 |
|
|
// .sel2 (cache_way_mx_sel[2]),
|
885 |
|
|
// .sel3 (cache_way_mx_sel[3]),
|
886 |
|
|
// .dout ({lsu_byp_byte_zero_extend[7:1],lsu_byp_byte_sign_extend[7:1]})
|
887 |
|
|
//);
|
888 |
|
|
|
889 |
|
|
//assign lsu_byp_byte_zero_extend[3:1] =
|
890 |
|
|
// (cache_way_mx_sel[0] ? lsu_byp_byte_zero_extend_w0[3:1] : 3'b0 ) |
|
891 |
|
|
// (cache_way_mx_sel[1] ? lsu_byp_byte_zero_extend_w1[3:1] : 3'b0 ) |
|
892 |
|
|
// (cache_way_mx_sel[2] ? lsu_byp_byte_zero_extend_w2[3:1] : 3'b0 ) |
|
893 |
|
|
// (cache_way_mx_sel[3] ? lsu_byp_byte_zero_extend_w3[3:1] : 3'b0 ) ;
|
894 |
|
|
|
895 |
|
|
assign lsu_byp_byte_sign_extend[7:1] =
|
896 |
|
|
(cache_way_mx_sel[0] ? lsu_byp_byte_sign_extend_w0[7:1] : 7'b0) |
|
897 |
|
|
(cache_way_mx_sel[1] ? lsu_byp_byte_sign_extend_w1[7:1] : 7'b0) |
|
898 |
|
|
(cache_way_mx_sel[2] ? lsu_byp_byte_sign_extend_w2[7:1] : 7'b0) |
|
899 |
|
|
(cache_way_mx_sel[3] ? lsu_byp_byte_sign_extend_w3[7:1] : 7'b0) ;
|
900 |
|
|
|
901 |
|
|
|
902 |
|
|
|
903 |
113 |
albert.wat |
dff_s #(37) stgg_mergesel(
|
904 |
95 |
fafa1971 |
.din ({
|
905 |
|
|
merge7_sel_byte0_m, merge7_sel_byte7_m,
|
906 |
|
|
merge6_sel_byte1_m, merge6_sel_byte6_m,
|
907 |
|
|
merge5_sel_byte2_m, merge5_sel_byte5_m,
|
908 |
|
|
merge4_sel_byte3_m, merge4_sel_byte4_m,
|
909 |
|
|
merge3_sel_byte0_m, merge3_sel_byte3_m,
|
910 |
|
|
merge3_sel_byte4_m, merge3_sel_byte7_default_m, merge3_sel_byte_m,
|
911 |
|
|
merge2_sel_byte1_m, merge2_sel_byte2_m, merge2_sel_byte5_m,
|
912 |
|
|
merge2_sel_byte6_default_m, merge2_sel_byte_m,
|
913 |
|
|
merge0_sel_byte0_m, merge0_sel_byte1_m,
|
914 |
|
|
merge0_sel_byte2_m, merge0_sel_byte3_default_m,
|
915 |
|
|
merge0_sel_byte4_m, merge0_sel_byte5_m,
|
916 |
|
|
merge0_sel_byte6_m, merge0_sel_byte7_default_m,
|
917 |
|
|
merge1_sel_byte0_m, merge1_sel_byte1_m,
|
918 |
|
|
merge1_sel_byte2_m, merge1_sel_byte3_default_m,
|
919 |
|
|
merge1_sel_byte4_m, merge1_sel_byte5_m,
|
920 |
|
|
merge1_sel_byte6_m, merge1_sel_byte7_default_m,
|
921 |
|
|
merge0_sel_byte_1h_m,merge1_sel_byte_1h_m, merge1_sel_byte_2h_m
|
922 |
|
|
}),
|
923 |
|
|
.q ({
|
924 |
|
|
merge7_sel_byte0, merge7_sel_byte7,
|
925 |
|
|
merge6_sel_byte1, merge6_sel_byte6,
|
926 |
|
|
merge5_sel_byte2, merge5_sel_byte5,
|
927 |
|
|
merge4_sel_byte3, merge4_sel_byte4,
|
928 |
|
|
merge3_sel_byte0, merge3_sel_byte3,
|
929 |
|
|
merge3_sel_byte4, merge3_sel_byte7,merge3_sel_byte,
|
930 |
|
|
merge2_sel_byte1, merge2_sel_byte2, merge2_sel_byte5,
|
931 |
|
|
merge2_sel_byte6, merge2_sel_byte,
|
932 |
|
|
merge0_sel_byte0, merge0_sel_byte1,
|
933 |
|
|
merge0_sel_byte2, merge0_sel_byte3,
|
934 |
|
|
merge0_sel_byte4, merge0_sel_byte5,
|
935 |
|
|
merge0_sel_byte6, merge0_sel_byte7,
|
936 |
|
|
merge1_sel_byte0, merge1_sel_byte1,
|
937 |
|
|
merge1_sel_byte2, merge1_sel_byte3,
|
938 |
|
|
merge1_sel_byte4, merge1_sel_byte5,
|
939 |
|
|
merge1_sel_byte6, merge1_sel_byte7,
|
940 |
|
|
merge0_sel_byte_1h,merge1_sel_byte_1h, merge1_sel_byte_2h
|
941 |
|
|
}),
|
942 |
|
|
.clk (clk),
|
943 |
113 |
albert.wat |
.se (se), `SIMPLY_RISC_SCANIN, .so ()
|
944 |
95 |
fafa1971 |
);
|
945 |
|
|
|
946 |
|
|
|
947 |
|
|
assign lsu_exu_dfill_data_w2[63:0] = align_byte[63:0] ;
|
948 |
|
|
assign lsu_ffu_ld_data[63:0] = align_byte[63:0] ;
|
949 |
|
|
|
950 |
|
|
endmodule
|
951 |
|
|
|
952 |
|
|
|