1 |
95 |
fafa1971 |
// ========== Copyright Header Begin ==========================================
|
2 |
|
|
//
|
3 |
|
|
// OpenSPARC T1 Processor File: lsu_qdp2.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 |
|
|
// Module Name: LSU_QDP2
|
29 |
|
|
// Description: LSU CPX Datapath.
|
30 |
|
|
*/
|
31 |
|
|
////////////////////////////////////////////////////////////////////////
|
32 |
|
|
// header file includes
|
33 |
|
|
////////////////////////////////////////////////////////////////////////
|
34 |
113 |
albert.wat |
`include "sys.h" // system level definition file which contains the
|
35 |
95 |
fafa1971 |
// time scale definition
|
36 |
113 |
albert.wat |
`include "iop.h"
|
37 |
95 |
fafa1971 |
|
38 |
113 |
albert.wat |
`include "lsu.h"
|
39 |
95 |
fafa1971 |
|
40 |
|
|
////////////////////////////////////////////////////////////////////////
|
41 |
|
|
// Local header file includes / local defines
|
42 |
|
|
////////////////////////////////////////////////////////////////////////
|
43 |
|
|
|
44 |
|
|
//FPGA_SYN enables all FPGA related modifications
|
45 |
113 |
albert.wat |
`ifdef FPGA_SYN
|
46 |
|
|
`define FPGA_SYN_CLK_EN
|
47 |
|
|
`define FPGA_SYN_CLK_DFF
|
48 |
|
|
`endif
|
49 |
95 |
fafa1971 |
|
50 |
|
|
module lsu_qdp2 ( /*AUTOARG*/
|
51 |
|
|
// Outputs
|
52 |
|
|
so, lsu_l2fill_data, dfq_wdata, dfq_tid, lsu_dcache_fill_data_e,
|
53 |
|
|
lsu_ifill_pkt, lsu_pcx_fwd_pkt, lsu_cpx_pkt_strm_ack,
|
54 |
|
|
lsu_cpx_pkt_vld, lsu_cpx_pkt_atm_st_cmplt, lsu_cpx_pkt_tid,
|
55 |
|
|
lsu_cpx_pkt_invwy, lsu_cpx_pkt_inv_pa, lsu_cpx_pkt_l2miss,
|
56 |
|
|
lsu_dfq_byp_invwy_vld, lsu_dfq_byp_type, lsu_dfq_byp_flush,
|
57 |
|
|
lsu_dfq_byp_tid, lsu_cpu_inv_data_b13to9, lsu_cpu_inv_data_b7to2,
|
58 |
|
|
lsu_cpu_inv_data_b0, lsu_iobrdge_wr_data, lsu_iobrdge_tap_rq_type,
|
59 |
|
|
lsu_cpx_pkt_perror_dinv, lsu_cpx_pkt_perror_iinv,
|
60 |
|
|
lsu_cpx_pkt_perror_set, lsu_cpx_pkt_ld_err, lsu_dfq_byp_binit_st,
|
61 |
|
|
lsu_cpx_pkt_binit_st, lsu_cpx_pkt_prefetch, lsu_cpx_pkt_prefetch2,
|
62 |
|
|
lsu_dfq_byp_cpx_inv, lsu_dfq_byp_stack_adr_b54,
|
63 |
|
|
lsu_dfq_byp_stack_wrway, lsu_dfq_byp_atm, dcache_iob_addr_e,
|
64 |
|
|
st_dcfill_addr, lsu_st_way_e, lsu_dcache_iob_way_e,
|
65 |
|
|
lsu_st_dcfill_size_e, lsu_cpx_pkt_ifill_type, lsu_cpx_pkt_atomic,
|
66 |
|
|
// Inputs
|
67 |
|
|
rst_tri_en, rclk, si, se, lsu_dfill_data_sel_hi, dfq_byp_ff_en,
|
68 |
|
|
dfq_rd_vld_d1, dfq_rdata, cpx_spc_data_cx, stb_rdata_ramd_buf,
|
69 |
|
|
stb_rdata_ramd_b74_buf, stb_rdata_ramc_buf, lsu_stb_pcx_rvld_d1,
|
70 |
|
|
lsu_diagnstc_wr_data_e, lsu_diagnstc_dc_prty_invrt_e,
|
71 |
|
|
mbist_write_data, cpx_fwd_pkt_en_cx, lsu_cpu_dcd_sel,
|
72 |
|
|
lsu_cpu_uhlf_sel, lsu_cpxpkt_type_dcd_cx, lsu_dc_iob_access_e,
|
73 |
|
|
lsu_dcfill_data_mx_sel_e, lsu_cpx_spc_inv_vld, lsu_cpx_thrdid,
|
74 |
|
|
lsu_cpx_stack_dcfill_vld, pcx_rq_for_stb_d1, lsu_dfq_ld_vld,
|
75 |
|
|
lsu_dfq_st_vld, lsu_dfq_ldst_vld
|
76 |
|
|
) ;
|
77 |
|
|
|
78 |
|
|
/*AUTOINPUT*/
|
79 |
|
|
// Beginning of automatic inputs (from unused autoinst inputs)
|
80 |
|
|
// End of automatics
|
81 |
|
|
//
|
82 |
|
|
input rst_tri_en;
|
83 |
|
|
|
84 |
|
|
input rclk ;
|
85 |
|
|
input si;
|
86 |
|
|
input se;
|
87 |
|
|
output so;
|
88 |
|
|
|
89 |
|
|
input lsu_dfill_data_sel_hi ; // select hi or low order 8B.
|
90 |
|
|
//input dcfill_src_dfq_sel ;
|
91 |
|
|
input dfq_byp_ff_en ;
|
92 |
|
|
input dfq_rd_vld_d1 ;
|
93 |
113 |
albert.wat |
input [`DFQ_WIDTH:0] dfq_rdata ; // dfq rd output
|
94 |
|
|
input [`CPX_WIDTH-1:0] cpx_spc_data_cx; // cpx to processor pkt
|
95 |
95 |
fafa1971 |
//input [2:0] stb_dfq_rd_id ; // stb entry id
|
96 |
|
|
input [69:0] stb_rdata_ramd_buf ; // stb0 data ram output.
|
97 |
|
|
input stb_rdata_ramd_b74_buf ; // stb0 data ram output.
|
98 |
|
|
input [14:9] stb_rdata_ramc_buf ; // stb0 tag ram output.
|
99 |
|
|
input lsu_stb_pcx_rvld_d1 ; // stb has been read-delayby1cycle
|
100 |
|
|
//input lsu_stb_dfq_rvld ; // wr to dfq stb bypass ff
|
101 |
|
|
//input [1:0] lmq_pcx_pkt_sz ;
|
102 |
|
|
//input [39:0] lmq_pcx_pkt_addr ;
|
103 |
|
|
|
104 |
|
|
// diagnostic write information
|
105 |
|
|
//input lsu_diagnstc_wr_src_sel_e ; // diagnstc write - diag/store
|
106 |
|
|
input [63:0] lsu_diagnstc_wr_data_e ; // Store data
|
107 |
|
|
input [7:0] lsu_diagnstc_dc_prty_invrt_e ; // invert parity of dw
|
108 |
|
|
//input [3:0] lsu_diagnstc_wr_way_e ; // cache way to be written
|
109 |
|
|
//input [10:0] lsu_diagnstc_wr_addr_e ; // address
|
110 |
|
|
|
111 |
|
|
//input lsu_ifill_pkt_vld ; // ifill pkt vld
|
112 |
|
|
//input lsu_bist_wvld_e ; // bist write to dcache
|
113 |
|
|
//input lsu_bist_rvld_e ; // bist read from dcache
|
114 |
|
|
|
115 |
|
|
//input [6:0] mbist_dcache_index ; // bist rd/wr address
|
116 |
|
|
//input mbist_dcache_word;
|
117 |
|
|
//input [1:0] mbist_dcache_way;
|
118 |
|
|
input [7:0] mbist_write_data ; // bist wdata
|
119 |
|
|
|
120 |
|
|
input cpx_fwd_pkt_en_cx ; // cpx fwd reply/req
|
121 |
|
|
input [7:0] lsu_cpu_dcd_sel ;
|
122 |
|
|
input lsu_cpu_uhlf_sel ;
|
123 |
|
|
input [5:0] lsu_cpxpkt_type_dcd_cx ;
|
124 |
|
|
//input lsu_st_wr_sel_e ;
|
125 |
|
|
//input [1:0] lmq_ld_way ;
|
126 |
|
|
//input [1:0] lsu_st_ack_wrwy ; // cache set way to write to.
|
127 |
|
|
//input [1:0] lsu_st_ack_addr_b54 ;
|
128 |
|
|
//input [1:0] lsu_stb_rd_tid ;
|
129 |
|
|
input lsu_dc_iob_access_e ; // iob read/write of dcache
|
130 |
|
|
|
131 |
|
|
//input tmb_l;
|
132 |
|
|
//input [3:0] lsu_dcfill_mx_sel_e;
|
133 |
|
|
//input lsu_dcfill_addr_mx_sel_e;
|
134 |
|
|
input lsu_dcfill_data_mx_sel_e;
|
135 |
|
|
|
136 |
|
|
input lsu_cpx_spc_inv_vld;
|
137 |
|
|
input [3:0] lsu_cpx_thrdid;
|
138 |
|
|
input lsu_cpx_stack_dcfill_vld ;
|
139 |
|
|
input [3:0] pcx_rq_for_stb_d1;
|
140 |
|
|
|
141 |
|
|
input lsu_dfq_ld_vld ;
|
142 |
|
|
input lsu_dfq_st_vld ;
|
143 |
|
|
input lsu_dfq_ldst_vld ;
|
144 |
|
|
|
145 |
|
|
/*AUTOOUTPUT*/
|
146 |
|
|
// Beginning of automatic outputs (from unused autoinst outputs)
|
147 |
|
|
// End of automatics
|
148 |
|
|
//
|
149 |
|
|
|
150 |
|
|
output [63:0] lsu_l2fill_data ; // dfill data for write to irf
|
151 |
|
|
|
152 |
113 |
albert.wat |
output [`DFQ_WIDTH:0] dfq_wdata ;
|
153 |
95 |
fafa1971 |
output [1:0] dfq_tid ; // thread-id for load at head of DFQ.
|
154 |
|
|
|
155 |
|
|
output [143:0] lsu_dcache_fill_data_e ;// store-write/ld-miss fill
|
156 |
|
|
|
157 |
113 |
albert.wat |
output [`CPX_VLD-1:0] lsu_ifill_pkt ;
|
158 |
95 |
fafa1971 |
output [107:0] lsu_pcx_fwd_pkt ; // local fwd reply/req
|
159 |
|
|
output lsu_cpx_pkt_strm_ack ;
|
160 |
|
|
output lsu_cpx_pkt_vld ;
|
161 |
|
|
output lsu_cpx_pkt_atm_st_cmplt ;
|
162 |
|
|
output [1:0] lsu_cpx_pkt_tid ;
|
163 |
|
|
output [1:0] lsu_cpx_pkt_invwy ; // invalidate way
|
164 |
|
|
output [4:0] lsu_cpx_pkt_inv_pa ; // invalidate pa [10:6]
|
165 |
|
|
output lsu_cpx_pkt_l2miss ; // ld req missed in L2
|
166 |
|
|
output lsu_dfq_byp_invwy_vld ;
|
167 |
|
|
output [5:0] lsu_dfq_byp_type ;
|
168 |
|
|
output lsu_dfq_byp_flush ;
|
169 |
|
|
//output [2:0] lsu_dfq_byp_cpuid ;
|
170 |
|
|
output [1:0] lsu_dfq_byp_tid ;
|
171 |
|
|
//output [13:0] lsu_cpu_inv_data ;
|
172 |
|
|
output [13:9] lsu_cpu_inv_data_b13to9 ;
|
173 |
|
|
output [7:2] lsu_cpu_inv_data_b7to2 ;
|
174 |
|
|
output lsu_cpu_inv_data_b0 ;
|
175 |
|
|
//output lsu_dfq_byp_stquad_pkt2 ;
|
176 |
|
|
//output lsu_cpx_pkt_stquad_pkt2 ;
|
177 |
|
|
output [43:0] lsu_iobrdge_wr_data ;
|
178 |
|
|
output [8:0] lsu_iobrdge_tap_rq_type ;
|
179 |
|
|
//output lsu_dfq_byp_perror_dinv ; // dtag perror corr. st ack
|
180 |
|
|
//output lsu_dfq_byp_perror_iinv ; // itag perror corr. st ack
|
181 |
|
|
output lsu_cpx_pkt_perror_dinv ; // dtag perror corr. st ack
|
182 |
|
|
output lsu_cpx_pkt_perror_iinv ; // itag perror corr. st ack
|
183 |
|
|
output [1:0] lsu_cpx_pkt_perror_set ; // dtag perror - spec. b54
|
184 |
|
|
output [1:0] lsu_cpx_pkt_ld_err ; // err field - cpx ld pkt
|
185 |
|
|
output lsu_dfq_byp_binit_st ; // blk-init st in bypass.
|
186 |
|
|
output lsu_cpx_pkt_binit_st ; // blk-init store
|
187 |
|
|
output lsu_cpx_pkt_prefetch; // prefetch
|
188 |
|
|
output lsu_cpx_pkt_prefetch2; // prefetch - for dctl
|
189 |
|
|
|
190 |
|
|
output lsu_dfq_byp_cpx_inv;
|
191 |
|
|
//output lsu_dfq_byp_stack_dcfill_vld;
|
192 |
|
|
output [1:0] lsu_dfq_byp_stack_adr_b54;
|
193 |
|
|
output [1:0] lsu_dfq_byp_stack_wrway;
|
194 |
|
|
output lsu_dfq_byp_atm;
|
195 |
|
|
|
196 |
|
|
//dcache_fill_addr_e change
|
197 |
|
|
output [7:0] dcache_iob_addr_e;
|
198 |
|
|
output [10:0] st_dcfill_addr;
|
199 |
|
|
|
200 |
|
|
output [1:0] lsu_st_way_e;
|
201 |
|
|
output [1:0] lsu_dcache_iob_way_e;
|
202 |
|
|
|
203 |
|
|
output [1:0] lsu_st_dcfill_size_e;
|
204 |
|
|
|
205 |
|
|
/*AUTOWIRE*/
|
206 |
|
|
// Beginning of automatic wires (for undeclared instantiated-module outputs)
|
207 |
|
|
// End of automatics
|
208 |
|
|
wire [13:0] cpx_cpulo_inv_data ;
|
209 |
|
|
wire [13:0] cpx_cpuhi_inv_data ;
|
210 |
|
|
//wire [`STB_PCX_WIDTH-1:0] stb_pcx_pkt ;
|
211 |
|
|
//wire [`STB_DFQ_WIDTH-1:0] stb_dfq_pkt_data ;
|
212 |
113 |
albert.wat |
wire [`STB_DFQ_WIDTH-1:0] stb_dfq_data_in ;
|
213 |
95 |
fafa1971 |
//wire [`DFQ_WIDTH-1:0] cpx_dfq_data ;
|
214 |
|
|
//wire [`DFQ_WIDTH-1:0] cpx_dfq_data_d1 ;
|
215 |
|
|
//wire [`CPX_WIDTH-1:0] cpx_data_cx_d1 ;
|
216 |
|
|
//wire cpx_st_cmplt_d1 ;
|
217 |
113 |
albert.wat |
wire [`DFQ_WIDTH:0] dfq_byp_mx_data ;
|
218 |
|
|
wire [`DFQ_WIDTH-1:0] dfq_byp_ff_data ;
|
219 |
95 |
fafa1971 |
//wire [`STB_DFQ_WIDTH-1:0] store_dfq_pkt ;
|
220 |
|
|
wire [127:0] st_dcfill_data ;
|
221 |
|
|
wire [63:0] dcache_wr_data ;
|
222 |
|
|
wire [127:0] ldinv_dcfill_data ;
|
223 |
|
|
//wire [`LMQ_WIDTH-1:0] lmq0_pcx_pkt, lmq1_pcx_pkt ;
|
224 |
|
|
//wire [`LMQ_WIDTH-1:0] lmq2_pcx_pkt, lmq3_pcx_pkt ;
|
225 |
|
|
wire [127:0] lsu_dcfill_data ;
|
226 |
|
|
wire [15:0] dcache_wr_parity_mod ;
|
227 |
|
|
//wire [3:0] bist_rsel_way_e ;
|
228 |
|
|
wire [107:0] cpx_fwd_pkt_din ;
|
229 |
|
|
|
230 |
|
|
//wire [3:0] bist_rsel_way_m ;
|
231 |
|
|
//wire [3:0] lsu_bist_rsel_way_wb ; // way select for read
|
232 |
|
|
wire [1:0] cpx_st_dcfill_wrway;
|
233 |
113 |
albert.wat |
wire [`STB_DFQ_VLD:0] stb_dcfill_data_mx;
|
234 |
95 |
fafa1971 |
wire clk;
|
235 |
|
|
wire [13:0] lsu_cpu_inv_data ;
|
236 |
|
|
|
237 |
|
|
assign clk = rclk;
|
238 |
|
|
|
239 |
|
|
|
240 |
|
|
//=================================================================================================
|
241 |
|
|
// STB Datapath
|
242 |
|
|
//=================================================================================================
|
243 |
|
|
|
244 |
|
|
// PCX PKT FORMATTING
|
245 |
|
|
// THREAD0
|
246 |
|
|
//assign stb_pcx_pkt[`STB_PCX_VLD] = lsu_stb_pcx_rvld_d1 ; // Valid
|
247 |
|
|
// Support stores for now.
|
248 |
|
|
//assign stb_pcx_pkt[`STB_PCX_RQ_HI:`STB_PCX_RQ_LO] = stb_rdata_ramd[74:72] ; // Rq-type
|
249 |
|
|
//assign stb_pcx_pkt[`STB_PCX_NC] = stb_rdata_ramd[74] ; // NC
|
250 |
|
|
// cpu-id will be inserted on way out of core.
|
251 |
|
|
//assign stb_pcx_pkt[`STB_PCX_TH_HI:`STB_PCX_TH_LO] = lsu_stb_rd_tid[1:0] ; // TID
|
252 |
|
|
// bf-id is not required.
|
253 |
|
|
//assign stb_pcx_pkt[`STB_PCX_WY_HI:`STB_PCX_WY_LO] = stb_rdata_ramd[71:70] ; // WAY
|
254 |
|
|
//assign stb_pcx_pkt[`STB_PCX_SZ_HI:`STB_PCX_SZ_LO] =
|
255 |
|
|
// stb_rdata_ramd[69:68]; // Size
|
256 |
|
|
//assign stb_pcx_pkt[`STB_PCX_AD_HI:`STB_PCX_AD_LO] =
|
257 |
|
|
// {stb_rdata_ramc[44:9],stb_rdata_ramd[67:64]} ;// Addr
|
258 |
|
|
//assign stb_pcx_pkt[`STB_PCX_DA_HI:`STB_PCX_DA_LO] =
|
259 |
|
|
// stb_rdata_ramd[63:0]; // Data
|
260 |
|
|
|
261 |
|
|
// STB to DFQ Data Formatting
|
262 |
|
|
// THREAD0
|
263 |
113 |
albert.wat |
assign stb_dfq_data_in[`STB_DFQ_WIDTH-1:0] =
|
264 |
95 |
fafa1971 |
{lsu_stb_pcx_rvld_d1, // 82:82 vld //stb_pcx_pkt[`STB_PCX_VLD],
|
265 |
|
|
stb_rdata_ramd_b74_buf, // 81:81 ?? //stb_rdata_ramd[74],
|
266 |
|
|
2'b00, // 80:79 not used
|
267 |
|
|
//stb_pcx_pkt[`STB_PCX_WY_HI:`STB_PCX_WY_LO],
|
268 |
|
|
3'b000, // 78:76 instead of stb_dfq_rd_id[2:0],
|
269 |
|
|
stb_rdata_ramd_buf[69:68], // 75:74 size //stb_pcx_pkt[`STB_PCX_SZ_HI:`STB_PCX_SZ_LO],
|
270 |
|
|
{stb_rdata_ramc_buf[14:9],stb_rdata_ramd_buf[67:64]}, // 73:64 Addr //stb_pcx_pkt[`STB_PCX_AD_LO+9:`STB_PCX_AD_LO],
|
271 |
|
|
stb_rdata_ramd_buf[63:0]}; // 63:0 data //stb_pcx_pkt[`STB_PCX_DA_HI:`STB_PCX_DA_LO]};
|
272 |
|
|
|
273 |
|
|
|
274 |
|
|
// STB DATA BYPASS FLOP
|
275 |
|
|
// Data is read out on read for pcx. The data is then
|
276 |
|
|
// bypassed to the dfq when the st-ack is received.
|
277 |
|
|
//wire [3:0] pcx_rq_for_stb_d1;
|
278 |
|
|
wire [3:0] clk_stb_data;
|
279 |
113 |
albert.wat |
wire [`STB_DFQ_VLD:0] stb_dfq_pkt_data0,
|
280 |
95 |
fafa1971 |
stb_dfq_pkt_data1,
|
281 |
|
|
stb_dfq_pkt_data2,
|
282 |
|
|
stb_dfq_pkt_data3;
|
283 |
|
|
|
284 |
|
|
// timing fix: 9/15/03 - reduce loading on pcx_rq_for_stb[3:0] to stb_clt[0-3]. it had FO2 (stb_ctl,qdp2 - cap=0.5-0.8)
|
285 |
|
|
// move the flop from qdp2 to qctl1
|
286 |
|
|
|
287 |
|
|
//flop pcx rq to read stb data
|
288 |
|
|
//dff #(4) pcx_rq_for_stb_ff (
|
289 |
|
|
// .din (pcx_rq_for_stb[3:0]),
|
290 |
|
|
// .q (pcx_rq_for_stb_d1[3:0]),
|
291 |
|
|
// .clk (clk),
|
292 |
113 |
albert.wat |
// .se (1'b0), `SIMPLY_RISC_SCANIN, .so ());
|
293 |
95 |
fafa1971 |
|
294 |
|
|
//dffe #(83) stb_dfq_byp_ff (
|
295 |
|
|
// .din (stb_dfq_data_in[`STB_DFQ_VLD:0]),
|
296 |
|
|
// .q (stb_dfq_pkt_data[`STB_DFQ_VLD:0]),
|
297 |
|
|
// .en (lsu_stb_dfq_rvld), .clk (clk),
|
298 |
113 |
albert.wat |
// .se (1'b0), `SIMPLY_RISC_SCANIN, .so ()
|
299 |
95 |
fafa1971 |
// );
|
300 |
|
|
|
301 |
|
|
//THREAD0
|
302 |
113 |
albert.wat |
`ifdef FPGA_SYN_CLK_EN
|
303 |
|
|
`else
|
304 |
|
|
clken_buf stb_dfq_byp0_clken(
|
305 |
|
|
.clk(clk_stb_data[0]),
|
306 |
|
|
.rclk(clk),
|
307 |
|
|
.enb_l(~pcx_rq_for_stb_d1[0]),
|
308 |
|
|
.tmb_l(~se));
|
309 |
|
|
`endif
|
310 |
95 |
fafa1971 |
|
311 |
113 |
albert.wat |
`ifdef FPGA_SYN_CLK_DFF
|
312 |
|
|
dffe_s #(83) stb_dfq_byp0_ff (
|
313 |
|
|
.din (stb_dfq_data_in[`STB_DFQ_VLD:0]),
|
314 |
|
|
.q (stb_dfq_pkt_data0[`STB_DFQ_VLD:0]),
|
315 |
95 |
fafa1971 |
.en (~(~pcx_rq_for_stb_d1[0])), .clk(clk),
|
316 |
113 |
albert.wat |
.se (1'b0), `SIMPLY_RISC_SCANIN, .so ());
|
317 |
|
|
`else
|
318 |
|
|
dff_s #(83) stb_dfq_byp0_ff (
|
319 |
|
|
.din (stb_dfq_data_in[`STB_DFQ_VLD:0]),
|
320 |
|
|
.q (stb_dfq_pkt_data0[`STB_DFQ_VLD:0]),
|
321 |
|
|
.clk (clk_stb_data[0]),
|
322 |
|
|
.se (1'b0), `SIMPLY_RISC_SCANIN, .so ());
|
323 |
|
|
`endif
|
324 |
95 |
fafa1971 |
|
325 |
|
|
//THREAD1
|
326 |
113 |
albert.wat |
`ifdef FPGA_SYN_CLK_EN
|
327 |
|
|
`else
|
328 |
|
|
clken_buf stb_dfq_byp1_clken(
|
329 |
|
|
.clk(clk_stb_data[1]),
|
330 |
|
|
.rclk(clk),
|
331 |
|
|
.enb_l(~pcx_rq_for_stb_d1[1]),
|
332 |
|
|
.tmb_l(~se));
|
333 |
|
|
`endif
|
334 |
95 |
fafa1971 |
|
335 |
113 |
albert.wat |
`ifdef FPGA_SYN_CLK_DFF
|
336 |
|
|
dffe_s #(83) stb_dfq_byp1_ff (
|
337 |
|
|
.din (stb_dfq_data_in[`STB_DFQ_VLD:0]),
|
338 |
|
|
.q (stb_dfq_pkt_data1[`STB_DFQ_VLD:0]),
|
339 |
95 |
fafa1971 |
.en (~(~pcx_rq_for_stb_d1[1])), .clk(clk),
|
340 |
113 |
albert.wat |
.se (1'b0), `SIMPLY_RISC_SCANIN, .so ());
|
341 |
|
|
`else
|
342 |
|
|
dff_s #(83) stb_dfq_byp1_ff (
|
343 |
|
|
.din (stb_dfq_data_in[`STB_DFQ_VLD:0]),
|
344 |
|
|
.q (stb_dfq_pkt_data1[`STB_DFQ_VLD:0]),
|
345 |
|
|
.clk (clk_stb_data[1]),
|
346 |
|
|
.se (1'b0), `SIMPLY_RISC_SCANIN, .so ());
|
347 |
|
|
`endif
|
348 |
95 |
fafa1971 |
|
349 |
|
|
//THREAD2
|
350 |
113 |
albert.wat |
`ifdef FPGA_SYN_CLK_EN
|
351 |
|
|
`else
|
352 |
|
|
clken_buf stb_dfq_byp2_clken(
|
353 |
|
|
.clk(clk_stb_data[2]),
|
354 |
|
|
.rclk(clk),
|
355 |
|
|
.enb_l(~pcx_rq_for_stb_d1[2]),
|
356 |
|
|
.tmb_l(~se));
|
357 |
|
|
`endif
|
358 |
95 |
fafa1971 |
|
359 |
113 |
albert.wat |
`ifdef FPGA_SYN_CLK_DFF
|
360 |
|
|
dffe_s #(83) stb_dfq_byp2_ff (
|
361 |
|
|
.din (stb_dfq_data_in[`STB_DFQ_VLD:0]),
|
362 |
|
|
.q (stb_dfq_pkt_data2[`STB_DFQ_VLD:0]),
|
363 |
95 |
fafa1971 |
.en (~(~pcx_rq_for_stb_d1[2])), .clk(clk),
|
364 |
113 |
albert.wat |
.se (1'b0), `SIMPLY_RISC_SCANIN, .so ());
|
365 |
|
|
`else
|
366 |
|
|
dff_s #(83) stb_dfq_byp2_ff (
|
367 |
|
|
.din (stb_dfq_data_in[`STB_DFQ_VLD:0]),
|
368 |
|
|
.q (stb_dfq_pkt_data2[`STB_DFQ_VLD:0]),
|
369 |
|
|
.clk (clk_stb_data[2]),
|
370 |
|
|
.se (1'b0), `SIMPLY_RISC_SCANIN, .so ());
|
371 |
|
|
`endif
|
372 |
95 |
fafa1971 |
|
373 |
|
|
//THREAD3
|
374 |
113 |
albert.wat |
`ifdef FPGA_SYN_CLK_EN
|
375 |
|
|
`else
|
376 |
|
|
clken_buf stb_dfq_byp3_clken(
|
377 |
|
|
.clk(clk_stb_data[3]),
|
378 |
|
|
.rclk(clk),
|
379 |
|
|
.enb_l(~pcx_rq_for_stb_d1[3]),
|
380 |
|
|
.tmb_l(~se));
|
381 |
|
|
`endif
|
382 |
95 |
fafa1971 |
|
383 |
113 |
albert.wat |
`ifdef FPGA_SYN_CLK_DFF
|
384 |
|
|
dffe_s #(83) stb_dfq_byp3_ff (
|
385 |
|
|
.din (stb_dfq_data_in[`STB_DFQ_VLD:0]),
|
386 |
|
|
.q (stb_dfq_pkt_data3[`STB_DFQ_VLD:0]),
|
387 |
95 |
fafa1971 |
.en (~(~pcx_rq_for_stb_d1[3])), .clk(clk),
|
388 |
113 |
albert.wat |
.se (1'b0), `SIMPLY_RISC_SCANIN, .so ());
|
389 |
|
|
`else
|
390 |
|
|
dff_s #(83) stb_dfq_byp3_ff (
|
391 |
|
|
.din (stb_dfq_data_in[`STB_DFQ_VLD:0]),
|
392 |
|
|
.q (stb_dfq_pkt_data3[`STB_DFQ_VLD:0]),
|
393 |
|
|
.clk (clk_stb_data[3]),
|
394 |
|
|
.se (1'b0), `SIMPLY_RISC_SCANIN, .so ());
|
395 |
|
|
`endif
|
396 |
95 |
fafa1971 |
|
397 |
|
|
// MUX the store data if cpx_pkt==st_ack w/ dcfill vld=1
|
398 |
113 |
albert.wat |
mux4ds #(`STB_DFQ_VLD+1) stb_data_mx (
|
399 |
|
|
.in0 (stb_dfq_pkt_data0[`STB_DFQ_VLD:0]),
|
400 |
|
|
.in1 (stb_dfq_pkt_data1[`STB_DFQ_VLD:0]),
|
401 |
|
|
.in2 (stb_dfq_pkt_data2[`STB_DFQ_VLD:0]),
|
402 |
|
|
.in3 (stb_dfq_pkt_data3[`STB_DFQ_VLD:0]),
|
403 |
95 |
fafa1971 |
.sel0 (lsu_cpx_thrdid[0]),
|
404 |
|
|
.sel1 (lsu_cpx_thrdid[1]),
|
405 |
|
|
.sel2 (lsu_cpx_thrdid[2]),
|
406 |
|
|
.sel3 (lsu_cpx_thrdid[3]),
|
407 |
113 |
albert.wat |
.dout (stb_dcfill_data_mx[`STB_DFQ_VLD:0])
|
408 |
95 |
fafa1971 |
);
|
409 |
|
|
|
410 |
|
|
//NOTE: mux this raw data w/ modified data to generate dfq input and feed into dfq_wdata
|
411 |
|
|
|
412 |
|
|
|
413 |
|
|
|
414 |
|
|
|
415 |
|
|
//=================================================================================================
|
416 |
|
|
// FWD PKT - REQ/REPLY
|
417 |
|
|
//=================================================================================================
|
418 |
|
|
|
419 |
|
|
// Design Note !! - Bus can be decreased - do not have to keep tag.
|
420 |
|
|
|
421 |
|
|
// TAP ACCESS FORMAT
|
422 |
|
|
// BEGIN (OLD)
|
423 |
|
|
// Control bits :
|
424 |
|
|
// R/W,TID,BIST,MARGIN,DEFEATURE,PC (R=1,W=0)
|
425 |
|
|
// These 7b are mapped to bits 70:64 of the cpx pkt.
|
426 |
|
|
// (R/W is the highest order bit).
|
427 |
|
|
// *Note that a write to pc is ignored by hardware.
|
428 |
|
|
// *The cpx-reply will not contain the control information.
|
429 |
|
|
// *TID(Thread id) applies only to pc and defeature.
|
430 |
|
|
// Data bits :
|
431 |
|
|
// PC(48b),Margin(36b),Bist-Ctl(14b),Defeature(4b).
|
432 |
|
|
// The largest field of 48b is mapped to bits 47:0 of the cpx pkt.
|
433 |
|
|
// END (OLD)
|
434 |
|
|
|
435 |
|
|
// Control bits (mapped to data[127:96] of cpx packet):
|
436 |
|
|
// L1I data,L1D data,BIST,MARGIN,DEFEATURE,PC,TID[1:0]
|
437 |
|
|
// These 8b are mapped to bits 103:96 of the cpx pkt.
|
438 |
|
|
// Unused bits are zeros.
|
439 |
|
|
// (TID is the lowest order 2 bits).
|
440 |
|
|
// *Note that a write to pc is ignored by hardware.
|
441 |
|
|
// *The cpx-reply will not contain the control information.
|
442 |
|
|
// *TID(Thread id) applies only to pc and defeature.
|
443 |
|
|
//
|
444 |
|
|
// Address bits (mapped to data[95:64] of cpx packet):
|
445 |
|
|
// This is used to access the L1 cache arrays. This field
|
446 |
|
|
// is a dont-care for the bist/margin/defeature/pc ASIs.
|
447 |
|
|
// Only the lower 32 address bits are specified here.
|
448 |
|
|
// The core (lsu) will pad zeros create a 64-bit address.
|
449 |
|
|
//
|
450 |
|
|
// Data bits (mapped to data[63:0] of cpx packet):
|
451 |
|
|
// PC(48b),Margin(36b),Bist-Ctl(14b),Defeature(4b).
|
452 |
|
|
// The largest field of 48b is mapped to bits 47:0 of the cpx pkt.
|
453 |
|
|
|
454 |
|
|
|
455 |
|
|
// Formatted to contain fwd req which is of largest size.
|
456 |
|
|
// Truncate address !!! 40b should not be required.
|
457 |
|
|
assign cpx_fwd_pkt_din[107:0] =
|
458 |
|
|
{
|
459 |
113 |
albert.wat |
cpx_spc_data_cx[`CPX_NC], // r/!w (1b)
|
460 |
95 |
fafa1971 |
cpx_spc_data_cx[133:131], // src/tar (3b)
|
461 |
|
|
cpx_spc_data_cx[103:0] // 64b data + 40b addr (104b)
|
462 |
|
|
} ;
|
463 |
|
|
|
464 |
|
|
// Contains cpx fwd reply or req
|
465 |
|
|
//dffe #(108) fwdpkt_ff (
|
466 |
|
|
// .din (cpx_fwd_pkt_din[107:0]),
|
467 |
|
|
// .q (lsu_pcx_fwd_pkt[107:0]),
|
468 |
|
|
// .en (cpx_fwd_pkt_en_cx),
|
469 |
|
|
// .clk (clk),
|
470 |
113 |
albert.wat |
// .se (1'b0), `SIMPLY_RISC_SCANIN, .so ()
|
471 |
95 |
fafa1971 |
// );
|
472 |
|
|
|
473 |
113 |
albert.wat |
`ifdef FPGA_SYN_CLK_EN
|
474 |
|
|
`else
|
475 |
|
|
clken_buf fwdpkt_clken(
|
476 |
|
|
.clk(clk_cpx_fwd_pkt_en_cx),
|
477 |
|
|
.rclk(clk),
|
478 |
|
|
.enb_l(~cpx_fwd_pkt_en_cx),
|
479 |
|
|
.tmb_l(~se));
|
480 |
|
|
`endif
|
481 |
95 |
fafa1971 |
|
482 |
113 |
albert.wat |
`ifdef FPGA_SYN_CLK_DFF
|
483 |
|
|
dffe_s #(108) fwdpkt_ff (
|
484 |
95 |
fafa1971 |
.din (cpx_fwd_pkt_din[107:0]),
|
485 |
|
|
.q (lsu_pcx_fwd_pkt[107:0]),
|
486 |
|
|
.en (~(~cpx_fwd_pkt_en_cx)), .clk(clk),
|
487 |
113 |
albert.wat |
.se (1'b0), `SIMPLY_RISC_SCANIN, .so ());
|
488 |
|
|
`else
|
489 |
|
|
dff_s #(108) fwdpkt_ff (
|
490 |
|
|
.din (cpx_fwd_pkt_din[107:0]),
|
491 |
|
|
.q (lsu_pcx_fwd_pkt[107:0]),
|
492 |
|
|
.clk (clk_cpx_fwd_pkt_en_cx),
|
493 |
|
|
.se (1'b0), `SIMPLY_RISC_SCANIN, .so ());
|
494 |
|
|
`endif
|
495 |
95 |
fafa1971 |
|
496 |
|
|
|
497 |
|
|
// New mapping for address bits given that tag is gone. (OBSOLETE)
|
498 |
|
|
// pkt[74:73] - Way
|
499 |
|
|
// pkt[72:65] - Set Index
|
500 |
|
|
// pkt[64] - Word
|
501 |
|
|
// New mapping - based on 0-in testing, alignment with PRM.
|
502 |
|
|
// pkt[76:75] - Way
|
503 |
|
|
// pkt[74:68] - Set Index
|
504 |
|
|
// pkt[67] -DWord
|
505 |
|
|
|
506 |
|
|
wire [7:0] dcache_iob_addr_e ;
|
507 |
|
|
assign dcache_iob_addr_e[7:0] = lsu_pcx_fwd_pkt[74:67] ;
|
508 |
|
|
|
509 |
|
|
//wire [3:0] dcache_iob_wy_e ;
|
510 |
|
|
//assign dcache_iob_wy_e[0] = ~lsu_pcx_fwd_pkt[76] & ~lsu_pcx_fwd_pkt[75] ;
|
511 |
|
|
//assign dcache_iob_wy_e[1] = ~lsu_pcx_fwd_pkt[76] & lsu_pcx_fwd_pkt[75] ;
|
512 |
|
|
//assign dcache_iob_wy_e[2] = lsu_pcx_fwd_pkt[76] & ~lsu_pcx_fwd_pkt[75] ;
|
513 |
|
|
//assign dcache_iob_wy_e[3] = lsu_pcx_fwd_pkt[76] & lsu_pcx_fwd_pkt[75] ;
|
514 |
|
|
|
515 |
|
|
assign lsu_dcache_iob_way_e [1:0] = {lsu_pcx_fwd_pkt[76], lsu_pcx_fwd_pkt[75]};
|
516 |
|
|
|
517 |
|
|
wire [63:0] dcache_iob_data_e ;
|
518 |
|
|
assign dcache_iob_data_e[63:0] = lsu_pcx_fwd_pkt[63:0] ;
|
519 |
|
|
|
520 |
|
|
assign lsu_iobrdge_wr_data[43:0] = lsu_pcx_fwd_pkt[43:0] ;
|
521 |
|
|
assign lsu_iobrdge_tap_rq_type[8:0] = {lsu_pcx_fwd_pkt[107],lsu_pcx_fwd_pkt[103:96]} ;
|
522 |
|
|
|
523 |
|
|
//=================================================================================================
|
524 |
|
|
// DFQ PKT SELECTION
|
525 |
|
|
//=================================================================================================
|
526 |
|
|
|
527 |
|
|
// There are two sources :
|
528 |
|
|
// - from the ccx - load,inv
|
529 |
|
|
// - from the stb - ack'ed store update.
|
530 |
|
|
// ** store updates do not have to be inserted into DFQ for ordering purposes. An inv will
|
531 |
|
|
// clear stale data in the stb and bypass flops to ensure TSO.
|
532 |
|
|
|
533 |
|
|
// to be written to dfq if bypass full else wr to byp mx.
|
534 |
|
|
//assign dfq_wdata[`DFQ_WIDTH:0] =
|
535 |
|
|
// {lsu_cpx_spc_inv_vld,lsu_cpxpkt_type_dcd_cx[5:0],cpx_spc_data_cx[`CPX_WIDTH-1:0]};
|
536 |
|
|
// //{{(`DFQ_WIDTH-`CPX_WIDTH)1'b0},cpx_spc_data_cx[`CPX_WIDTH-1:0]},
|
537 |
|
|
|
538 |
113 |
albert.wat |
wire [`DFQ_WIDTH:0] dfq_st_data,dfq_cpx_raw_wdata;
|
539 |
95 |
fafa1971 |
wire [1:0] cpx_st_ack_addr_b54;
|
540 |
|
|
|
541 |
113 |
albert.wat |
assign dfq_cpx_raw_wdata[`DFQ_WIDTH:0] =
|
542 |
|
|
{lsu_cpx_spc_inv_vld,lsu_cpxpkt_type_dcd_cx[5:0],cpx_spc_data_cx[`CPX_WIDTH-1:0]};
|
543 |
95 |
fafa1971 |
|
544 |
113 |
albert.wat |
assign dfq_st_data[`DFQ_WIDTH:0] =
|
545 |
95 |
fafa1971 |
{lsu_cpx_spc_inv_vld,lsu_cpxpkt_type_dcd_cx[5:0],
|
546 |
113 |
albert.wat |
cpx_spc_data_cx[`CPX_WIDTH-1:87],
|
547 |
95 |
fafa1971 |
cpx_st_ack_addr_b54[1:0], // 86:85
|
548 |
|
|
cpx_st_dcfill_wrway[1:0], // 84:83
|
549 |
113 |
albert.wat |
stb_dcfill_data_mx[`STB_DFQ_VLD:0]}; // 82:0
|
550 |
95 |
fafa1971 |
|
551 |
113 |
albert.wat |
mux2ds #(`DFQ_WIDTH+1) dfq_st_data_mx (
|
552 |
|
|
.in0 (dfq_st_data[`DFQ_WIDTH:0]),
|
553 |
|
|
.in1 (dfq_cpx_raw_wdata[`DFQ_WIDTH:0]),
|
554 |
95 |
fafa1971 |
.sel0 (lsu_cpx_stack_dcfill_vld),
|
555 |
|
|
.sel1 (~lsu_cpx_stack_dcfill_vld),
|
556 |
113 |
albert.wat |
.dout (dfq_wdata[`DFQ_WIDTH:0])
|
557 |
95 |
fafa1971 |
);
|
558 |
|
|
|
559 |
|
|
//timing fix: 05/31/03: decouple byp mux from lsu_cpx_stack_dcfill_vld
|
560 |
|
|
// i.e. replace dfq_wdata w/ dfq_cpx_raw_wdata in byp mux
|
561 |
|
|
// select between dfq output and cpx bypass.
|
562 |
113 |
albert.wat |
mux2ds #(`DFQ_WIDTH+1) dfq_byp_mx (
|
563 |
|
|
.in0 (dfq_rdata[`DFQ_WIDTH:0]),
|
564 |
|
|
.in1 (dfq_cpx_raw_wdata[`DFQ_WIDTH:0]),
|
565 |
95 |
fafa1971 |
.sel0 (dfq_rd_vld_d1),
|
566 |
|
|
.sel1 (~dfq_rd_vld_d1),
|
567 |
113 |
albert.wat |
.dout (dfq_byp_mx_data[`DFQ_WIDTH:0])
|
568 |
95 |
fafa1971 |
);
|
569 |
|
|
|
570 |
113 |
albert.wat |
assign lsu_dfq_byp_cpx_inv = dfq_byp_mx_data[`DFQ_WIDTH];
|
571 |
|
|
assign lsu_dfq_byp_tid[1:0] = dfq_byp_mx_data[`CPX_TH_HI:`CPX_TH_LO] ;
|
572 |
95 |
fafa1971 |
//assign lsu_dfq_byp_cpuid[2:0] = dfq_byp_mx_data[`CPX_INV_CID_HI:`CPX_INV_CID_LO] ;
|
573 |
113 |
albert.wat |
assign lsu_dfq_byp_flush = dfq_byp_mx_data[`CPX_NC] ;
|
574 |
|
|
assign lsu_dfq_byp_invwy_vld = dfq_byp_mx_data[`CPX_WYVLD] ;
|
575 |
95 |
fafa1971 |
|
576 |
|
|
//assign lsu_dfq_byp_type[5:0] = dfq_byp_mx_data[`DFQ_WIDTH-1:`DFQ_WIDTH-6] ;
|
577 |
113 |
albert.wat |
assign lsu_dfq_byp_type[5:3] = dfq_byp_mx_data[`DFQ_WIDTH-1:`DFQ_WIDTH-3] ;
|
578 |
|
|
assign lsu_dfq_byp_type[2] = dfq_byp_mx_data[`DFQ_WIDTH-4] & dfq_rd_vld_d1;
|
579 |
|
|
assign lsu_dfq_byp_type[1:0] = dfq_byp_mx_data[`DFQ_WIDTH-5:`DFQ_WIDTH-6] ;
|
580 |
95 |
fafa1971 |
|
581 |
|
|
//assign lsu_dfq_byp_stquad_pkt2 = dfq_byp_mx_data[130] ;
|
582 |
|
|
assign lsu_dfq_byp_binit_st = dfq_byp_mx_data[125] ;
|
583 |
|
|
//assign lsu_dfq_byp_perror_iinv = dfq_byp_mx_data[`CPX_PERR_DINV+1] ;
|
584 |
|
|
//assign lsu_dfq_byp_perror_dinv = dfq_byp_mx_data[`CPX_PERR_DINV] ;
|
585 |
|
|
//assign lsu_dfq_byp_stack_dcfill_vld = dfq_byp_mx_data[87] ;
|
586 |
|
|
assign lsu_dfq_byp_stack_adr_b54[1:0] = dfq_byp_mx_data[86:85] ;
|
587 |
|
|
assign lsu_dfq_byp_stack_wrway[1:0] = dfq_byp_mx_data[84:83] ;
|
588 |
|
|
|
589 |
113 |
albert.wat |
assign lsu_ifill_pkt[`CPX_VLD-1:0] = dfq_byp_mx_data[`CPX_VLD-1:0] ;
|
590 |
95 |
fafa1971 |
//assign lsu_ifill_pkt[`CPX_WIDTH-1:0] = {lsu_ifill_pkt_vld,dfq_byp_mx_data[`CPX_VLD-1:0]} ;
|
591 |
|
|
|
592 |
|
|
assign lsu_dfq_byp_atm = dfq_byp_mx_data[129] ;
|
593 |
|
|
|
594 |
|
|
// Decode in qctl !!!
|
595 |
|
|
//assign dfq_byp_tid[1:0] = dfq_byp_mx_data[`CPX_TH_HI:`CPX_TH_LO] ;
|
596 |
|
|
//assign dfq_byp_tid[1:0] = dfq_byp_mx_data[`DFQ_TH_HI:`DFQ_TH_LO] ;
|
597 |
|
|
|
598 |
|
|
// Stage dfq output
|
599 |
|
|
// In case of multiple inv or other such cases, pkt will be held in
|
600 |
|
|
// byp ff until pkt completely utilized.
|
601 |
|
|
//dffe #(`DFQ_WIDTH) dfq_data_stg (
|
602 |
|
|
// .din (dfq_byp_mx_data[`DFQ_WIDTH-1:0]),
|
603 |
|
|
// .q (dfq_byp_ff_data[`DFQ_WIDTH-1:0]),
|
604 |
|
|
// .en (dfq_byp_ff_en), .clk (clk),
|
605 |
113 |
albert.wat |
// .se (1'b0), `SIMPLY_RISC_SCANIN, .so ()
|
606 |
95 |
fafa1971 |
//);
|
607 |
|
|
|
608 |
113 |
albert.wat |
`ifdef FPGA_SYN_CLK_EN
|
609 |
|
|
`else
|
610 |
|
|
clken_buf dfq_byp_ff_en_clken(
|
611 |
|
|
.clk(clk_dfq_byp_ff_en),
|
612 |
|
|
.rclk(clk),
|
613 |
|
|
.enb_l(~dfq_byp_ff_en),
|
614 |
|
|
.tmb_l(~se));
|
615 |
|
|
`endif
|
616 |
95 |
fafa1971 |
|
617 |
113 |
albert.wat |
`ifdef FPGA_SYN_CLK_DFF
|
618 |
|
|
dffe_s #(`DFQ_WIDTH) dfq_data_stg (
|
619 |
|
|
.din (dfq_byp_mx_data[`DFQ_WIDTH-1:0]),
|
620 |
|
|
.q (dfq_byp_ff_data[`DFQ_WIDTH-1:0]),
|
621 |
95 |
fafa1971 |
.en (~(~dfq_byp_ff_en)), .clk(clk),
|
622 |
113 |
albert.wat |
.se (1'b0), `SIMPLY_RISC_SCANIN, .so ());
|
623 |
|
|
`else
|
624 |
|
|
dff_s #(`DFQ_WIDTH) dfq_data_stg (
|
625 |
|
|
.din (dfq_byp_mx_data[`DFQ_WIDTH-1:0]),
|
626 |
|
|
.q (dfq_byp_ff_data[`DFQ_WIDTH-1:0]),
|
627 |
|
|
.clk (clk_dfq_byp_ff_en),
|
628 |
|
|
.se (1'b0), `SIMPLY_RISC_SCANIN, .so ());
|
629 |
|
|
`endif
|
630 |
95 |
fafa1971 |
|
631 |
|
|
|
632 |
|
|
// To be decoded in qctl
|
633 |
|
|
//assign lsu_st_cmplt_type = dfq_byp_ff_data[`DFQ_ST_CMPLT];
|
634 |
|
|
|
635 |
113 |
albert.wat |
assign dfq_tid[1:0] = dfq_byp_ff_data[`CPX_TH_HI:`CPX_TH_LO] ;
|
636 |
95 |
fafa1971 |
|
637 |
|
|
output lsu_cpx_pkt_ifill_type;
|
638 |
|
|
output lsu_cpx_pkt_atomic ;
|
639 |
|
|
|
640 |
|
|
// Should some of these be in-flight ?
|
641 |
|
|
//assign lsu_cpx_pkt_rqtype[3:0] = dfq_byp_ff_data[`CPX_RQ_HI:`CPX_RQ_LO] ;
|
642 |
113 |
albert.wat |
assign lsu_cpx_pkt_ifill_type = dfq_byp_ff_data[`DFQ_WIDTH-2];
|
643 |
|
|
assign lsu_cpx_pkt_tid[1:0] = dfq_byp_ff_data[`CPX_TH_HI:`CPX_TH_LO] ;
|
644 |
|
|
assign lsu_cpx_pkt_vld = dfq_byp_ff_data[`CPX_VLD] ;
|
645 |
95 |
fafa1971 |
assign lsu_cpx_pkt_atm_st_cmplt = dfq_byp_ff_data[129] ;
|
646 |
113 |
albert.wat |
assign lsu_cpx_pkt_invwy[1:0] = dfq_byp_ff_data[`CPX_WY_HI:`CPX_WY_LO] ;
|
647 |
95 |
fafa1971 |
// Upper 6bits are used to store decoded request type information.
|
648 |
113 |
albert.wat |
assign lsu_cpx_pkt_strm_ack = dfq_byp_ff_data[`DFQ_WIDTH-5];
|
649 |
95 |
fafa1971 |
//assign lsu_cpx_pkt_inv_pa[4:0] = dfq_byp_ff_data[`CPX_INV_PA_HI-1:`CPX_INV_PA_LO]; //!!
|
650 |
113 |
albert.wat |
assign lsu_cpx_pkt_inv_pa[4:0] = dfq_byp_ff_data[`CPX_INV_PA_HI:`CPX_INV_PA_LO];
|
651 |
95 |
fafa1971 |
assign lsu_cpx_pkt_atomic = dfq_byp_ff_data[129] | //atomic st ack
|
652 |
|
|
dfq_byp_ff_data[131] ; //stquad pkt1
|
653 |
|
|
//assign lsu_cpx_pkt_stquad_pkt2 = dfq_byp_ff_data[130] ;
|
654 |
|
|
assign lsu_cpx_pkt_binit_st = dfq_byp_ff_data[125] ;
|
655 |
|
|
assign lsu_cpx_pkt_prefetch = dfq_byp_ff_data[128] ; // for qctl2
|
656 |
|
|
assign lsu_cpx_pkt_prefetch2 = dfq_byp_ff_data[128] ; // for dctl
|
657 |
|
|
//assign lsu_spu_strm_st = dfq_byp_ff_data[134] ; // strm store ack (vs. ma)
|
658 |
|
|
|
659 |
113 |
albert.wat |
assign lsu_cpx_pkt_perror_iinv = dfq_byp_ff_data[`CPX_PERR_DINV+1] ;
|
660 |
|
|
assign lsu_cpx_pkt_perror_dinv = dfq_byp_ff_data[`CPX_PERR_DINV] ;
|
661 |
95 |
fafa1971 |
assign lsu_cpx_pkt_perror_set[1:0] =
|
662 |
113 |
albert.wat |
dfq_byp_ff_data[`CPX_PERR_DINV_AD5:`CPX_PERR_DINV_AD4] ;
|
663 |
95 |
fafa1971 |
|
664 |
|
|
assign lsu_cpx_pkt_ld_err[1:0] = dfq_byp_ff_data[138:137] ;
|
665 |
|
|
assign lsu_cpx_pkt_l2miss = dfq_byp_ff_data[139] ;
|
666 |
|
|
|
667 |
|
|
|
668 |
|
|
//=================================================================================================
|
669 |
|
|
// DFQ OUTPUT - LOCAL PROCESSING
|
670 |
|
|
//=================================================================================================
|
671 |
|
|
|
672 |
|
|
|
673 |
|
|
mux4ds #(14) invfld_lo_sel (
|
674 |
113 |
albert.wat |
.in0 ({dfq_byp_mx_data[`CPX_A11_C0_HI:`CPX_A11_C0_LO],
|
675 |
|
|
dfq_byp_mx_data[`CPX_A10_C0_HI:`CPX_A10_C0_LO],
|
676 |
|
|
dfq_byp_mx_data[`CPX_A01_C0_HI:`CPX_A01_C0_LO],
|
677 |
|
|
dfq_byp_mx_data[`CPX_A00_C0_HI:`CPX_A00_C0_LO]}),
|
678 |
|
|
.in1 ({dfq_byp_mx_data[`CPX_A11_C1_HI:`CPX_A11_C1_LO],
|
679 |
|
|
dfq_byp_mx_data[`CPX_A10_C1_HI:`CPX_A10_C1_LO],
|
680 |
|
|
dfq_byp_mx_data[`CPX_A01_C1_HI:`CPX_A01_C1_LO],
|
681 |
|
|
dfq_byp_mx_data[`CPX_A00_C1_HI:`CPX_A00_C1_LO]}),
|
682 |
|
|
.in2 ({dfq_byp_mx_data[`CPX_A11_C2_HI:`CPX_A11_C2_LO],
|
683 |
|
|
dfq_byp_mx_data[`CPX_A10_C2_HI:`CPX_A10_C2_LO],
|
684 |
|
|
dfq_byp_mx_data[`CPX_A01_C2_HI:`CPX_A01_C2_LO],
|
685 |
|
|
dfq_byp_mx_data[`CPX_A00_C2_HI:`CPX_A00_C2_LO]}),
|
686 |
|
|
.in3 ({dfq_byp_mx_data[`CPX_A11_C3_HI:`CPX_A11_C3_LO],
|
687 |
|
|
dfq_byp_mx_data[`CPX_A10_C3_HI:`CPX_A10_C3_LO],
|
688 |
|
|
dfq_byp_mx_data[`CPX_A01_C3_HI:`CPX_A01_C3_LO],
|
689 |
|
|
dfq_byp_mx_data[`CPX_A00_C3_HI:`CPX_A00_C3_LO]}),
|
690 |
95 |
fafa1971 |
.sel0 (lsu_cpu_dcd_sel[0]),
|
691 |
|
|
.sel1 (lsu_cpu_dcd_sel[1]),
|
692 |
|
|
.sel2 (lsu_cpu_dcd_sel[2]),
|
693 |
|
|
.sel3 (lsu_cpu_dcd_sel[3]),
|
694 |
|
|
.dout (cpx_cpulo_inv_data[13:0])
|
695 |
|
|
);
|
696 |
|
|
|
697 |
|
|
mux4ds #(14) invfld_hi_sel (
|
698 |
113 |
albert.wat |
.in0 ({dfq_byp_mx_data[`CPX_A11_C4_HI:`CPX_A11_C4_LO],
|
699 |
|
|
dfq_byp_mx_data[`CPX_A10_C4_HI:`CPX_A10_C4_LO],
|
700 |
|
|
dfq_byp_mx_data[`CPX_A01_C4_HI:`CPX_A01_C4_LO],
|
701 |
|
|
dfq_byp_mx_data[`CPX_A00_C4_HI:`CPX_A00_C4_LO]}),
|
702 |
|
|
.in1 ({dfq_byp_mx_data[`CPX_A11_C5_HI:`CPX_A11_C5_LO],
|
703 |
|
|
dfq_byp_mx_data[`CPX_A10_C5_HI:`CPX_A10_C5_LO],
|
704 |
|
|
dfq_byp_mx_data[`CPX_A01_C5_HI:`CPX_A01_C5_LO],
|
705 |
|
|
dfq_byp_mx_data[`CPX_A00_C5_HI:`CPX_A00_C5_LO]}),
|
706 |
|
|
.in2 ({dfq_byp_mx_data[`CPX_A11_C6_HI:`CPX_A11_C6_LO],
|
707 |
|
|
dfq_byp_mx_data[`CPX_A10_C6_HI:`CPX_A10_C6_LO],
|
708 |
|
|
dfq_byp_mx_data[`CPX_A01_C6_HI:`CPX_A01_C6_LO],
|
709 |
|
|
dfq_byp_mx_data[`CPX_A00_C6_HI:`CPX_A00_C6_LO]}),
|
710 |
|
|
.in3 ({dfq_byp_mx_data[`CPX_A11_C7_HI:`CPX_A11_C7_LO],
|
711 |
|
|
dfq_byp_mx_data[`CPX_A10_C7_HI:`CPX_A10_C7_LO],
|
712 |
|
|
dfq_byp_mx_data[`CPX_A01_C7_HI:`CPX_A01_C7_LO],
|
713 |
|
|
dfq_byp_mx_data[`CPX_A00_C7_HI:`CPX_A00_C7_LO]}),
|
714 |
95 |
fafa1971 |
.sel0 (lsu_cpu_dcd_sel[4]),
|
715 |
|
|
.sel1 (lsu_cpu_dcd_sel[5]),
|
716 |
|
|
.sel2 (lsu_cpu_dcd_sel[6]),
|
717 |
|
|
.sel3 (lsu_cpu_dcd_sel[7]),
|
718 |
|
|
.dout (cpx_cpuhi_inv_data[13:0])
|
719 |
|
|
);
|
720 |
|
|
|
721 |
|
|
|
722 |
|
|
mux2ds #(14) invfld_sel (
|
723 |
|
|
.in0 (cpx_cpulo_inv_data[13:0]),
|
724 |
|
|
.in1 (cpx_cpuhi_inv_data[13:0]),
|
725 |
|
|
.sel0 (~lsu_cpu_uhlf_sel),
|
726 |
|
|
.sel1 (lsu_cpu_uhlf_sel),
|
727 |
|
|
.dout (lsu_cpu_inv_data[13:0])
|
728 |
|
|
);
|
729 |
|
|
|
730 |
|
|
assign lsu_cpu_inv_data_b13to9[13:9] = lsu_cpu_inv_data[13:9] ;
|
731 |
|
|
assign lsu_cpu_inv_data_b7to2[7:2] = lsu_cpu_inv_data[7:2] ;
|
732 |
|
|
assign lsu_cpu_inv_data_b0 = lsu_cpu_inv_data[0] ;
|
733 |
|
|
|
734 |
|
|
// same structure as above for st data write way
|
735 |
|
|
wire [13:0] cpx_cpulo_dcfill_wrway,
|
736 |
|
|
cpx_cpuhi_dcfill_wrway,
|
737 |
|
|
cpx_st_dcfill_wrway_sel;
|
738 |
|
|
|
739 |
|
|
|
740 |
|
|
mux4ds #(14) st_dcfill_wrway_lo (
|
741 |
113 |
albert.wat |
.in0 ({cpx_spc_data_cx[`CPX_A11_C0_HI:`CPX_A11_C0_LO],
|
742 |
|
|
cpx_spc_data_cx[`CPX_A10_C0_HI:`CPX_A10_C0_LO],
|
743 |
|
|
cpx_spc_data_cx[`CPX_A01_C0_HI:`CPX_A01_C0_LO],
|
744 |
|
|
cpx_spc_data_cx[`CPX_A00_C0_HI:`CPX_A00_C0_LO]}),
|
745 |
|
|
.in1 ({cpx_spc_data_cx[`CPX_A11_C1_HI:`CPX_A11_C1_LO],
|
746 |
|
|
cpx_spc_data_cx[`CPX_A10_C1_HI:`CPX_A10_C1_LO],
|
747 |
|
|
cpx_spc_data_cx[`CPX_A01_C1_HI:`CPX_A01_C1_LO],
|
748 |
|
|
cpx_spc_data_cx[`CPX_A00_C1_HI:`CPX_A00_C1_LO]}),
|
749 |
|
|
.in2 ({cpx_spc_data_cx[`CPX_A11_C2_HI:`CPX_A11_C2_LO],
|
750 |
|
|
cpx_spc_data_cx[`CPX_A10_C2_HI:`CPX_A10_C2_LO],
|
751 |
|
|
cpx_spc_data_cx[`CPX_A01_C2_HI:`CPX_A01_C2_LO],
|
752 |
|
|
cpx_spc_data_cx[`CPX_A00_C2_HI:`CPX_A00_C2_LO]}),
|
753 |
|
|
.in3 ({cpx_spc_data_cx[`CPX_A11_C3_HI:`CPX_A11_C3_LO],
|
754 |
|
|
cpx_spc_data_cx[`CPX_A10_C3_HI:`CPX_A10_C3_LO],
|
755 |
|
|
cpx_spc_data_cx[`CPX_A01_C3_HI:`CPX_A01_C3_LO],
|
756 |
|
|
cpx_spc_data_cx[`CPX_A00_C3_HI:`CPX_A00_C3_LO]}),
|
757 |
95 |
fafa1971 |
.sel0 (lsu_cpu_dcd_sel[0]),
|
758 |
|
|
.sel1 (lsu_cpu_dcd_sel[1]),
|
759 |
|
|
.sel2 (lsu_cpu_dcd_sel[2]),
|
760 |
|
|
.sel3 (lsu_cpu_dcd_sel[3]),
|
761 |
|
|
.dout (cpx_cpulo_dcfill_wrway[13:0])
|
762 |
|
|
);
|
763 |
|
|
|
764 |
|
|
mux4ds #(14) st_dcfill_wrway_hi (
|
765 |
113 |
albert.wat |
.in0 ({cpx_spc_data_cx[`CPX_A11_C4_HI:`CPX_A11_C4_LO],
|
766 |
|
|
cpx_spc_data_cx[`CPX_A10_C4_HI:`CPX_A10_C4_LO],
|
767 |
|
|
cpx_spc_data_cx[`CPX_A01_C4_HI:`CPX_A01_C4_LO],
|
768 |
|
|
cpx_spc_data_cx[`CPX_A00_C4_HI:`CPX_A00_C4_LO]}),
|
769 |
|
|
.in1 ({cpx_spc_data_cx[`CPX_A11_C5_HI:`CPX_A11_C5_LO],
|
770 |
|
|
cpx_spc_data_cx[`CPX_A10_C5_HI:`CPX_A10_C5_LO],
|
771 |
|
|
cpx_spc_data_cx[`CPX_A01_C5_HI:`CPX_A01_C5_LO],
|
772 |
|
|
cpx_spc_data_cx[`CPX_A00_C5_HI:`CPX_A00_C5_LO]}),
|
773 |
|
|
.in2 ({cpx_spc_data_cx[`CPX_A11_C6_HI:`CPX_A11_C6_LO],
|
774 |
|
|
cpx_spc_data_cx[`CPX_A10_C6_HI:`CPX_A10_C6_LO],
|
775 |
|
|
cpx_spc_data_cx[`CPX_A01_C6_HI:`CPX_A01_C6_LO],
|
776 |
|
|
cpx_spc_data_cx[`CPX_A00_C6_HI:`CPX_A00_C6_LO]}),
|
777 |
|
|
.in3 ({cpx_spc_data_cx[`CPX_A11_C7_HI:`CPX_A11_C7_LO],
|
778 |
|
|
cpx_spc_data_cx[`CPX_A10_C7_HI:`CPX_A10_C7_LO],
|
779 |
|
|
cpx_spc_data_cx[`CPX_A01_C7_HI:`CPX_A01_C7_LO],
|
780 |
|
|
cpx_spc_data_cx[`CPX_A00_C7_HI:`CPX_A00_C7_LO]}),
|
781 |
95 |
fafa1971 |
.sel0 (lsu_cpu_dcd_sel[4]),
|
782 |
|
|
.sel1 (lsu_cpu_dcd_sel[5]),
|
783 |
|
|
.sel2 (lsu_cpu_dcd_sel[6]),
|
784 |
|
|
.sel3 (lsu_cpu_dcd_sel[7]),
|
785 |
|
|
.dout (cpx_cpuhi_dcfill_wrway[13:0])
|
786 |
|
|
);
|
787 |
|
|
|
788 |
|
|
|
789 |
|
|
|
790 |
|
|
mux2ds #(14) st_dcfill_wrway_sel (
|
791 |
|
|
.in0 (cpx_cpulo_dcfill_wrway[13:0]),
|
792 |
|
|
.in1 (cpx_cpuhi_dcfill_wrway[13:0]),
|
793 |
|
|
.sel0 (~lsu_cpu_uhlf_sel),
|
794 |
|
|
.sel1 (lsu_cpu_uhlf_sel),
|
795 |
|
|
.dout (cpx_st_dcfill_wrway_sel[13:0])
|
796 |
|
|
);
|
797 |
|
|
|
798 |
|
|
// select the appropriate offset
|
799 |
|
|
|
800 |
|
|
//bug3718 - 0in bug - cpx_st_dcfill_wrway_sel can be multi-hot foe non-stack cpx responses
|
801 |
|
|
// hence qual w/ stack req type
|
802 |
|
|
wire [3:0] st_dcfill_wrway_mxsel ;
|
803 |
|
|
|
804 |
|
|
assign st_dcfill_wrway_mxsel[0] = (lsu_cpxpkt_type_dcd_cx[2] & cpx_st_dcfill_wrway_sel[0]) & ~rst_tri_en ;
|
805 |
|
|
assign st_dcfill_wrway_mxsel[1] = (lsu_cpxpkt_type_dcd_cx[2] & cpx_st_dcfill_wrway_sel[4]) & ~rst_tri_en ;
|
806 |
|
|
assign st_dcfill_wrway_mxsel[2] = (lsu_cpxpkt_type_dcd_cx[2] & cpx_st_dcfill_wrway_sel[7]) & ~rst_tri_en ;
|
807 |
|
|
assign st_dcfill_wrway_mxsel[3] = ~|st_dcfill_wrway_mxsel[2:0] | rst_tri_en;
|
808 |
|
|
|
809 |
|
|
mux4ds #(2) st_dcfill_wrway_sel_b54 (
|
810 |
|
|
.in0 (cpx_st_dcfill_wrway_sel[3:2]),
|
811 |
|
|
.in1 (cpx_st_dcfill_wrway_sel[6:5]),
|
812 |
|
|
.in2 (cpx_st_dcfill_wrway_sel[10:9]),
|
813 |
|
|
.in3 (cpx_st_dcfill_wrway_sel[13:12]),
|
814 |
|
|
.sel0 (st_dcfill_wrway_mxsel[0]),
|
815 |
|
|
.sel1 (st_dcfill_wrway_mxsel[1]),
|
816 |
|
|
.sel2 (st_dcfill_wrway_mxsel[2]),
|
817 |
|
|
.sel3 (st_dcfill_wrway_mxsel[3]),
|
818 |
|
|
.dout (cpx_st_dcfill_wrway[1:0])
|
819 |
|
|
);
|
820 |
|
|
|
821 |
|
|
|
822 |
|
|
assign cpx_st_ack_addr_b54[0] = cpx_st_dcfill_wrway_sel[4] | cpx_st_dcfill_wrway_sel[11] ;
|
823 |
|
|
assign cpx_st_ack_addr_b54[1] = cpx_st_dcfill_wrway_sel[7] | cpx_st_dcfill_wrway_sel[11] ;
|
824 |
|
|
|
825 |
|
|
//=================================================================================================
|
826 |
|
|
|
827 |
|
|
|
828 |
|
|
//assign store_dfq_pkt[`STB_DFQ_WIDTH-1:0] = stb_dfq_pkt_data[`STB_DFQ_WIDTH-1:0] ;
|
829 |
|
|
|
830 |
|
|
// Items generated/prior to fill cycle (but after DFQ read).
|
831 |
|
|
// This logic will be put in qctl and then be fwded to dcache.
|
832 |
|
|
// - Parity (16b) - load & store.
|
833 |
|
|
// - Byte Enable (16b) - store (8b), ld (16b) all high.
|
834 |
|
|
// - Cache Tag (30b) - obtained from LMQ.
|
835 |
|
|
// - RD1 (5b) - obtained from LMQ.
|
836 |
|
|
// - RD2 (5b) - obtained from LMQ.
|
837 |
|
|
// ** DFQ will contain either loads or inv.
|
838 |
|
|
|
839 |
|
|
// Need to do alignment. Assume dw for now.
|
840 |
|
|
// For a load, a bypass will always happen, a write is
|
841 |
|
|
|
842 |
|
|
// Mux in diagnostic information. Only data is muxed in because
|
843 |
|
|
// all other info is critical
|
844 |
|
|
|
845 |
|
|
wire [63:0] diagnstc_wr_data;
|
846 |
|
|
|
847 |
113 |
albert.wat |
dff_s #(64) diagnstc_wr_data_ff (
|
848 |
95 |
fafa1971 |
.din (lsu_diagnstc_wr_data_e[63:0]),
|
849 |
|
|
.q (diagnstc_wr_data[63:0]),
|
850 |
|
|
.clk (clk),
|
851 |
113 |
albert.wat |
.se (1'b0), `SIMPLY_RISC_SCANIN, .so ()
|
852 |
95 |
fafa1971 |
);
|
853 |
|
|
|
854 |
|
|
mux2ds #(64) dcwr_sel (
|
855 |
|
|
//.in0 ({store_dfq_pkt[`STB_DFQ_DA_HI:`STB_DFQ_DA_LO]}),
|
856 |
113 |
albert.wat |
.in0 ({dfq_byp_ff_data[`STB_DFQ_DA_HI:`STB_DFQ_DA_LO]}),
|
857 |
95 |
fafa1971 |
.in1 ({diagnstc_wr_data[63:0]}),
|
858 |
|
|
.sel0 ( lsu_dfq_st_vld),
|
859 |
|
|
.sel1 (~lsu_dfq_st_vld),
|
860 |
|
|
//.sel0 (~lsu_diagnstc_wr_src_sel_e),
|
861 |
|
|
//.sel1 ( lsu_diagnstc_wr_src_sel_e),
|
862 |
|
|
.dout (dcache_wr_data[63:0])
|
863 |
|
|
);
|
864 |
|
|
|
865 |
|
|
|
866 |
|
|
// store currently assumed to be dword.
|
867 |
|
|
// st dword is duplicated across 16B.
|
868 |
|
|
// currently assume st and not atomics supported.
|
869 |
|
|
// The width can be reduced !!!
|
870 |
|
|
assign st_dcfill_data[127:0] =
|
871 |
|
|
{ //dfq_byp_ff_data[`STB_DFQ_VLD],
|
872 |
|
|
//2'b00, // need thread-id
|
873 |
|
|
//2'b00,1'b0,5'b00000,
|
874 |
|
|
// dfq_byp_ff_data[84:83], // 131:130 - wr_way[1:0]
|
875 |
|
|
// dfq_byp_ff_data[`STB_DFQ_SZ_HI:`STB_DFQ_SZ_LO], // 129:128 - size[1:0]
|
876 |
|
|
//29'd0, //!!! reduce
|
877 |
|
|
//{dfq_byp_ff_data[`CPX_INV_PA_HI:`CPX_INV_PA_LO], // addr 10:6
|
878 |
|
|
//dfq_byp_ff_data[86:85], // addr 5:4
|
879 |
|
|
//dfq_byp_ff_data[`STB_DFQ_AD_LO+3:`STB_DFQ_AD_LO]}, // addr 3:0
|
880 |
|
|
dcache_wr_data[63:0], // 127:64
|
881 |
|
|
dcache_wr_data[63:0]}; // 63:0
|
882 |
|
|
|
883 |
|
|
assign st_dcfill_addr[10:0] =
|
884 |
113 |
albert.wat |
{dfq_byp_ff_data[`CPX_INV_PA_HI:`CPX_INV_PA_LO], // addr 10:6
|
885 |
95 |
fafa1971 |
dfq_byp_ff_data[86:85], // addr 5:4
|
886 |
113 |
albert.wat |
dfq_byp_ff_data[`STB_DFQ_AD_LO+3:`STB_DFQ_AD_LO]}; // addr 3:0
|
887 |
95 |
fafa1971 |
|
888 |
|
|
// lmq0_pcx_pkt will have to be brought in. Same for lmq_ld_addr
|
889 |
|
|
// The width can be reduced !!!
|
890 |
|
|
|
891 |
|
|
//potentially we can take one cycle earlier version dfq_st_data
|
892 |
|
|
assign lsu_st_way_e[1:0] = dfq_byp_ff_data[84:83];
|
893 |
113 |
albert.wat |
assign lsu_st_dcfill_size_e [1:0] = dfq_byp_ff_data[`STB_DFQ_SZ_HI:`STB_DFQ_SZ_LO];
|
894 |
95 |
fafa1971 |
|
895 |
|
|
assign ldinv_dcfill_data[127:0] =
|
896 |
|
|
{ //1'b0,
|
897 |
|
|
//dfq_byp_ff_data[`DFQ_TH_HI:`DFQ_TH_LO],
|
898 |
|
|
//dfq_byp_ff_data[`DFQ_LD_TYPE:`DFQ_INV_TYPE],
|
899 |
|
|
//1'b1, //assume ld always writes.
|
900 |
|
|
//5'b00000,
|
901 |
|
|
// lmq_ld_way[1:0], // 131:130 - way[1:0]- dfq_byp_ff_data[`DFQ_WY_HI:`DFQ_WY_LO],
|
902 |
|
|
// 2'b0, // 129:128 - size[1:0]- lmq_pcx_pkt_sz[1:0], //!!! reduce
|
903 |
|
|
//40'b0, //lmq_pcx_pkt_addr[39:0], //!!! reduce
|
904 |
113 |
albert.wat |
dfq_byp_ff_data[`DFQ_DA_HI:`DFQ_DA_LO]}; // 127:0
|
905 |
95 |
fafa1971 |
|
906 |
|
|
|
907 |
|
|
// Select between dfq-bypass (ld-inv) and store.
|
908 |
|
|
// *** cpu-id currently hardwired in pkt
|
909 |
|
|
// This may be further restricted in width !!!
|
910 |
|
|
|
911 |
|
|
mux2ds #(128) dfq_pkt_src (
|
912 |
|
|
.in0 (st_dcfill_data[127:0]),
|
913 |
|
|
.in1 (ldinv_dcfill_data[127:0]),
|
914 |
|
|
.sel0 (~lsu_dfq_ld_vld),
|
915 |
|
|
.sel1 (lsu_dfq_ld_vld),
|
916 |
|
|
.dout (lsu_dcfill_data[127:0])
|
917 |
|
|
);
|
918 |
|
|
|
919 |
|
|
// Parity Generation for write data - from load or store.
|
920 |
|
|
wire [15:0] dcache_wr_parity ;
|
921 |
|
|
lsu_dc_parity_gen parity_gen (
|
922 |
113 |
albert.wat |
.data_in (lsu_dcfill_data[`DCFILL_DA_HI:`DCFILL_DA_LO]),
|
923 |
95 |
fafa1971 |
.parity_out (dcache_wr_parity[15:0])
|
924 |
|
|
);
|
925 |
|
|
|
926 |
|
|
// Bug 4125. Corrupt parity if l2 unc err detected. Corrupt both upper and lower half
|
927 |
|
|
// as subsequent read will pick up one of two halves.
|
928 |
|
|
//wire parity_byte0_flip ;
|
929 |
|
|
//wire parity_byte8_flip ;
|
930 |
|
|
wire ld_unc_error ;
|
931 |
113 |
albert.wat |
assign ld_unc_error = (dfq_byp_ff_data[138] & dfq_byp_ff_data[`DFQ_WIDTH-1]); // not critical !
|
932 |
95 |
fafa1971 |
|
933 |
|
|
//bug7021/ECO7022
|
934 |
|
|
//assign parity_byte0_flip = dcache_wr_parity[0] ^ ld_unc_error ;
|
935 |
|
|
//assign parity_byte8_flip = dcache_wr_parity[8] ^ ld_unc_error ;
|
936 |
|
|
|
937 |
|
|
wire [15:0] parity_byte_flip;
|
938 |
|
|
assign parity_byte_flip[15:0] = dcache_wr_parity[15:0] ^ {16{ld_unc_error }};
|
939 |
|
|
|
940 |
|
|
//assign dcache_wr_parity_mod[15:0] =
|
941 |
|
|
// lsu_diagnstc_wr_src_sel_e ?
|
942 |
|
|
// ({lsu_diagnstc_dc_prty_invrt_e[7:0],lsu_diagnstc_dc_prty_invrt_e[7:0]} ^ dcache_wr_parity[15:0]) :
|
943 |
|
|
// dcache_wr_parity[15:0] ;
|
944 |
|
|
|
945 |
|
|
wire [15:0] diagnstc_wr_parity;
|
946 |
|
|
|
947 |
|
|
assign diagnstc_wr_parity[15:0] = {lsu_diagnstc_dc_prty_invrt_e[7:0],lsu_diagnstc_dc_prty_invrt_e[7:0]} ^ dcache_wr_parity[15:0];
|
948 |
|
|
|
949 |
|
|
mux2ds #(16) dcache_wr_parity_mod_mux (
|
950 |
|
|
.in0(diagnstc_wr_parity[15:0]),
|
951 |
|
|
// .in1({dcache_wr_parity[15:9],parity_byte8_flip,dcache_wr_parity[7:1],parity_byte0_flip}),
|
952 |
|
|
.in1(parity_byte_flip[15:0]), //bug7021/ECO7022
|
953 |
|
|
.sel0(~lsu_dfq_ldst_vld),
|
954 |
|
|
.sel1( lsu_dfq_ldst_vld),
|
955 |
|
|
//.sel0(lsu_diagnstc_wr_src_sel_e),
|
956 |
|
|
//.sel1(~lsu_diagnstc_wr_src_sel_e),
|
957 |
|
|
.dout(dcache_wr_parity_mod[15:0])
|
958 |
|
|
);
|
959 |
|
|
|
960 |
|
|
|
961 |
|
|
// Bist read and write address sent thru fill_addr
|
962 |
|
|
//assign lsu_dcache_fill_addr_e[10:0] =
|
963 |
|
|
//lsu_dc_iob_access_e ? {dcache_iob_addr_e[7:0],2'b00} :
|
964 |
|
|
//(lsu_bist_wvld_e | lsu_bist_rvld_e) ? {1'b0, lsu_bist_addr_e[7:0],2'b00} : //??FIX
|
965 |
|
|
// lsu_diagnstc_wr_src_sel_e ? lsu_diagnstc_wr_addr_e[10:0] :
|
966 |
|
|
// lsu_dcfill_data[`DCFILL_AD_LO+10:`DCFILL_AD_LO];
|
967 |
|
|
|
968 |
|
|
// wire [10:0] lsu_dcache_fill_addr_e;
|
969 |
|
|
|
970 |
|
|
//mux4ds #(11) lsu_dcache_fill_addr_e_mux (
|
971 |
|
|
// .in0 ({dcache_iob_addr_e[8:0],2'b00}),
|
972 |
|
|
// .in1 ({mbist_dcache_index[6:0], mbist_dcache_word, 3'b00}),
|
973 |
|
|
// .in2 (lsu_diagnstc_wr_addr_e[10:0]),
|
974 |
|
|
// .in3 (lsu_dcfill_data[`DCFILL_AD_LO+10:`DCFILL_AD_LO]),
|
975 |
|
|
// .sel0 (lsu_dcfill_mx_sel_e[0]),
|
976 |
|
|
// .sel1 (lsu_dcfill_mx_sel_e[1]),
|
977 |
|
|
// .sel2 (lsu_dcfill_mx_sel_e[2]),
|
978 |
|
|
// .sel3 (lsu_dcfill_mx_sel_e[3]),
|
979 |
|
|
// .dout (lsu_dcache_fill_addr_e[10:0])
|
980 |
|
|
//);
|
981 |
|
|
|
982 |
|
|
wire [63:0] misc_fill_data_e ;
|
983 |
|
|
// Use smaller width mux to save area.
|
984 |
|
|
//assign misc_fill_data_e[63:0] =
|
985 |
|
|
//lsu_dc_iob_access_e ? dcache_iob_data_e[63:0] :
|
986 |
|
|
// {32{lsu_bist_wdata_e[1:0]}} ;
|
987 |
|
|
|
988 |
|
|
wire [7:0] mbist_write_data_d1;
|
989 |
|
|
|
990 |
113 |
albert.wat |
dff_s #(8) mbist_write_data_ff (
|
991 |
95 |
fafa1971 |
.din (mbist_write_data[7:0]),
|
992 |
|
|
.q (mbist_write_data_d1[7:0]),
|
993 |
|
|
.clk (clk),
|
994 |
113 |
albert.wat |
.se (1'b0), `SIMPLY_RISC_SCANIN, .so ()
|
995 |
95 |
fafa1971 |
);
|
996 |
|
|
|
997 |
|
|
|
998 |
|
|
wire [3:0] misc_fill_parity_e;
|
999 |
|
|
assign misc_fill_parity_e[3:0] = {4{~lsu_dc_iob_access_e}} & mbist_write_data_d1[3:0];
|
1000 |
|
|
|
1001 |
|
|
mux2ds #(64) misc_fill_data_e_mux (
|
1002 |
|
|
.in0(dcache_iob_data_e[63:0]),
|
1003 |
|
|
.in1({8{mbist_write_data_d1[7:0]}}),
|
1004 |
|
|
.sel0(lsu_dc_iob_access_e),
|
1005 |
|
|
.sel1(~lsu_dc_iob_access_e),
|
1006 |
|
|
.dout(misc_fill_data_e[63:0])
|
1007 |
|
|
);
|
1008 |
|
|
|
1009 |
|
|
mux2ds #(144) lsu_dcache_fill_data_e_mux (
|
1010 |
|
|
.in0({misc_fill_data_e[63:0],misc_fill_data_e[63:0],{4{misc_fill_parity_e[3:0]}}}),
|
1011 |
113 |
albert.wat |
.in1({lsu_dcfill_data[`DCFILL_DA_HI:`DCFILL_DA_LO],dcache_wr_parity_mod[15:0]}),
|
1012 |
95 |
fafa1971 |
.sel0(lsu_dcfill_data_mx_sel_e),
|
1013 |
|
|
.sel1(~lsu_dcfill_data_mx_sel_e),
|
1014 |
|
|
.dout(lsu_dcache_fill_data_e[143:0])
|
1015 |
|
|
);
|
1016 |
|
|
|
1017 |
|
|
//assign lsu_dcache_fill_size_e[1:0] =
|
1018 |
|
|
//(lsu_dc_iob_access_e | lsu_bist_wvld_e | lsu_diagnstc_wr_src_sel_e) ? 2'b11 :
|
1019 |
|
|
// lsu_dcfill_data[`DCFILL_SZ_HI:`DCFILL_SZ_LO] ;
|
1020 |
|
|
|
1021 |
|
|
|
1022 |
|
|
|
1023 |
|
|
// wire [1:0] bist_way_e;
|
1024 |
|
|
|
1025 |
|
|
//assign bist_way_e[1:0] = (lsu_bist_rvld_e | lsu_bist_wvld_e) ?
|
1026 |
|
|
// mbist_dcache_way[1:0] : 2'b00;
|
1027 |
|
|
|
1028 |
|
|
//assign bist_rsel_way_e[0] = ~bist_way_e[1] & ~bist_way_e[0] ;
|
1029 |
|
|
//assign bist_rsel_way_e[1] = ~bist_way_e[1] & bist_way_e[0] ;
|
1030 |
|
|
//assign bist_rsel_way_e[2] = bist_way_e[1] & ~bist_way_e[0] ;
|
1031 |
|
|
//assign bist_rsel_way_e[3] = bist_way_e[1] & bist_way_e[0] ;
|
1032 |
|
|
|
1033 |
|
|
// assign lsu_bist_rsel_way_e[3:0] = bist_rsel_way_e[3:0];
|
1034 |
|
|
|
1035 |
|
|
|
1036 |
|
|
// This staging may have to go elsewhere
|
1037 |
|
|
//always @(posedge clk)
|
1038 |
|
|
// begin
|
1039 |
|
|
// bist_rsel_way_m[3:0] <= bist_rsel_way_e[3:0] ;
|
1040 |
|
|
// end
|
1041 |
|
|
|
1042 |
|
|
//always @(posedge clk)
|
1043 |
|
|
// begin
|
1044 |
|
|
// lsu_bist_rsel_way_wb[3:0] <= bist_rsel_way_m[3:0] ;
|
1045 |
|
|
// end
|
1046 |
|
|
|
1047 |
|
|
//dff #(4) bist_rsel_way_m_ff (
|
1048 |
|
|
// .din (bist_rsel_way_e[3:0]),
|
1049 |
|
|
// .q (bist_rsel_way_m[3:0]),
|
1050 |
|
|
// .clk (clk),
|
1051 |
113 |
albert.wat |
// .se (1'b0), `SIMPLY_RISC_SCANIN, .so ()
|
1052 |
95 |
fafa1971 |
// );
|
1053 |
|
|
|
1054 |
|
|
//dff #(4) lsu_bist_rsel_way_wb_ff (
|
1055 |
|
|
// .din (bist_rsel_way_m[3:0]),
|
1056 |
|
|
// .q (lsu_bist_rsel_way_wb[3:0]),
|
1057 |
|
|
// .clk (clk),
|
1058 |
113 |
albert.wat |
// .se (1'b0), `SIMPLY_RISC_SCANIN, .so ()
|
1059 |
95 |
fafa1971 |
// );
|
1060 |
|
|
|
1061 |
|
|
//assign lsu_dcache_fill_way_e[0] =
|
1062 |
|
|
//lsu_dc_iob_access_e ? dcache_iob_wy_e[0] :
|
1063 |
|
|
// (lsu_bist_wvld_e | lsu_bist_rvld_e) ? bist_rsel_way_e[0] :
|
1064 |
|
|
// lsu_diagnstc_wr_src_sel_e ? lsu_diagnstc_wr_way_e[0] :
|
1065 |
|
|
// ~lsu_dcfill_data[`DCFILL_WY_HI] & ~lsu_dcfill_data[`DCFILL_WY_LO] ;
|
1066 |
|
|
//assign lsu_dcache_fill_way_e[1] =
|
1067 |
|
|
//lsu_dc_iob_access_e ? dcache_iob_wy_e[1] :
|
1068 |
|
|
// (lsu_bist_wvld_e | lsu_bist_rvld_e) ? bist_rsel_way_e[1] :
|
1069 |
|
|
// lsu_diagnstc_wr_src_sel_e ? lsu_diagnstc_wr_way_e[1] :
|
1070 |
|
|
// ~lsu_dcfill_data[`DCFILL_WY_HI] & lsu_dcfill_data[`DCFILL_WY_LO] ;
|
1071 |
|
|
//assign lsu_dcache_fill_way_e[2] =
|
1072 |
|
|
//lsu_dc_iob_access_e ? dcache_iob_wy_e[2] :
|
1073 |
|
|
// (lsu_bist_wvld_e | lsu_bist_rvld_e) ? bist_rsel_way_e[2] :
|
1074 |
|
|
// lsu_diagnstc_wr_src_sel_e ? lsu_diagnstc_wr_way_e[2] :
|
1075 |
|
|
// lsu_dcfill_data[`DCFILL_WY_HI] & ~lsu_dcfill_data[`DCFILL_WY_LO] ;
|
1076 |
|
|
//assign lsu_dcache_fill_way_e[3] =
|
1077 |
|
|
//lsu_dc_iob_access_e ? dcache_iob_wy_e[3] :
|
1078 |
|
|
// (lsu_bist_wvld_e | lsu_bist_rvld_e) ? bist_rsel_way_e[3] :
|
1079 |
|
|
// lsu_diagnstc_wr_src_sel_e ? lsu_diagnstc_wr_way_e[3] :
|
1080 |
|
|
// lsu_dcfill_data[`DCFILL_WY_HI] & lsu_dcfill_data[`DCFILL_WY_LO] ;
|
1081 |
|
|
|
1082 |
|
|
/*
|
1083 |
|
|
mux4ds #(1) lsu_dcache_fill_way0_e_mux (
|
1084 |
|
|
.in0 (dcache_iob_wy_e[0]),
|
1085 |
|
|
.in1 (bist_rsel_way_e[0]),
|
1086 |
|
|
.in2 (lsu_diagnstc_wr_way_e[0]),
|
1087 |
|
|
.in3 (~lsu_dcfill_data[131] & ~lsu_dcfill_data[130]),
|
1088 |
|
|
.sel0 (lsu_dcfill_mx_sel_e[0]),
|
1089 |
|
|
.sel1 (lsu_dcfill_mx_sel_e[1]),
|
1090 |
|
|
.sel2 (lsu_dcfill_mx_sel_e[2]),
|
1091 |
|
|
.sel3 (lsu_dcfill_mx_sel_e[3]),
|
1092 |
|
|
.dout (lsu_dcache_fill_way_e[0]));
|
1093 |
|
|
|
1094 |
|
|
mux4ds #(1) lsu_dcache_fill_way1_e_mux (
|
1095 |
|
|
.in0 (dcache_iob_wy_e[1]),
|
1096 |
|
|
.in1 (bist_rsel_way_e[1]),
|
1097 |
|
|
.in2 (lsu_diagnstc_wr_way_e[1]),
|
1098 |
|
|
.in3 (~lsu_dcfill_data[131] & lsu_dcfill_data[130]),
|
1099 |
|
|
.sel0 (lsu_dcfill_mx_sel_e[0]),
|
1100 |
|
|
.sel1 (lsu_dcfill_mx_sel_e[1]),
|
1101 |
|
|
.sel2 (lsu_dcfill_mx_sel_e[2]),
|
1102 |
|
|
.sel3 (lsu_dcfill_mx_sel_e[3]),
|
1103 |
|
|
.dout (lsu_dcache_fill_way_e[1]));
|
1104 |
|
|
|
1105 |
|
|
mux4ds #(1) lsu_dcache_fill_way2_e_mux (
|
1106 |
|
|
.in0 (dcache_iob_wy_e[2]),
|
1107 |
|
|
.in1 (bist_rsel_way_e[2]),
|
1108 |
|
|
.in2 (lsu_diagnstc_wr_way_e[2]),
|
1109 |
|
|
.in3 ( lsu_dcfill_data[131] & ~lsu_dcfill_data[130]),
|
1110 |
|
|
.sel0 (lsu_dcfill_mx_sel_e[0]),
|
1111 |
|
|
.sel1 (lsu_dcfill_mx_sel_e[1]),
|
1112 |
|
|
.sel2 (lsu_dcfill_mx_sel_e[2]),
|
1113 |
|
|
.sel3 (lsu_dcfill_mx_sel_e[3]),
|
1114 |
|
|
.dout (lsu_dcache_fill_way_e[2]));
|
1115 |
|
|
|
1116 |
|
|
|
1117 |
|
|
mux4ds #(1) lsu_dcache_fill_way3_e_mux (
|
1118 |
|
|
.in0 (dcache_iob_wy_e[3]),
|
1119 |
|
|
.in1 (bist_rsel_way_e[3]),
|
1120 |
|
|
.in2 (lsu_diagnstc_wr_way_e[3]),
|
1121 |
|
|
.in3 ( lsu_dcfill_data[131] & lsu_dcfill_data[130]),
|
1122 |
|
|
.sel0 (lsu_dcfill_mx_sel_e[0]),
|
1123 |
|
|
.sel1 (lsu_dcfill_mx_sel_e[1]),
|
1124 |
|
|
.sel2 (lsu_dcfill_mx_sel_e[2]),
|
1125 |
|
|
.sel3 (lsu_dcfill_mx_sel_e[3]),
|
1126 |
|
|
.dout (lsu_dcache_fill_way_e[3]));
|
1127 |
|
|
*/
|
1128 |
|
|
// assign lsu_dcache_fill_way_enc_e[0] = lsu_dcache_fill_way_e[1] | lsu_dcache_fill_way_e[3];
|
1129 |
|
|
// assign lsu_dcache_fill_way_enc_e[1] = lsu_dcache_fill_way_e[2] | lsu_dcache_fill_way_e[3];
|
1130 |
|
|
|
1131 |
|
|
wire [63:0] l2fill_data_e;
|
1132 |
|
|
|
1133 |
|
|
mux2ds #(64) half_sel (
|
1134 |
113 |
albert.wat |
.in0 (lsu_dcfill_data[`DCFILL_DA_HI:`DCFILL_DA_LO+64]),
|
1135 |
|
|
.in1 (lsu_dcfill_data[`DCFILL_DA_LO+63:`DCFILL_DA_LO]),
|
1136 |
95 |
fafa1971 |
.sel0 (lsu_dfill_data_sel_hi), .sel1 (~lsu_dfill_data_sel_hi),
|
1137 |
|
|
.dout (l2fill_data_e[63:0])
|
1138 |
|
|
);
|
1139 |
|
|
|
1140 |
113 |
albert.wat |
dff_s #(64) stgm_l2fd (
|
1141 |
95 |
fafa1971 |
.din (l2fill_data_e[63:0]),
|
1142 |
|
|
.q (lsu_l2fill_data[63:0]),
|
1143 |
|
|
.clk (clk),
|
1144 |
113 |
albert.wat |
.se (se), `SIMPLY_RISC_SCANIN, .so ()
|
1145 |
95 |
fafa1971 |
);
|
1146 |
|
|
|
1147 |
|
|
endmodule
|