Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | // ========== Copyright Header Begin ========================================== |
2 | // | |
3 | // OpenSPARC T2 Processor File: mcu_woq_ctl.v | |
4 | // Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved | |
5 | // 4150 Network Circle, Santa Clara, California 95054, U.S.A. | |
6 | // | |
7 | // * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
8 | // | |
9 | // This program is free software; you can redistribute it and/or modify | |
10 | // it under the terms of the GNU General Public License as published by | |
11 | // the Free Software Foundation; version 2 of the License. | |
12 | // | |
13 | // This program is distributed in the hope that it will be useful, | |
14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | // GNU General Public License for more details. | |
17 | // | |
18 | // You should have received a copy of the GNU General Public License | |
19 | // along with this program; if not, write to the Free Software | |
20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
21 | // | |
22 | // For the avoidance of doubt, and except that if any non-GPL license | |
23 | // choice is available it will apply instead, Sun elects to use only | |
24 | // the General Public License version 2 (GPLv2) at this time for any | |
25 | // software where a choice of GPL license versions is made | |
26 | // available with the language indicating that GPLv2 or any later version | |
27 | // may be used, or where a choice of which version of the GPL is applied is | |
28 | // otherwise unspecified. | |
29 | // | |
30 | // Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, | |
31 | // CA 95054 USA or visit www.sun.com if you need additional information or | |
32 | // have any questions. | |
33 | // | |
34 | // ========== Copyright Header End ============================================ | |
35 | module mcu_woq_ctl ( | |
36 | woq0_wdq_rd, | |
37 | woq0_wr_queue_clear, | |
38 | woq1_wdq_rd, | |
39 | woq1_wr_queue_clear, | |
40 | woq_wdq_radr, | |
41 | woq_wadr_parity, | |
42 | woq_io_wdata_sel, | |
43 | woq_entry0, | |
44 | woq_entry1, | |
45 | woq_entry_valid, | |
46 | woq_entry0_val, | |
47 | woq_entry1_val, | |
48 | woq_wr_bank_val, | |
49 | woq_wr_addr_picked, | |
50 | woq_wr1_addr_picked, | |
51 | woq_wr2_addr_picked, | |
52 | woq_wr_index_picked, | |
53 | woq_wr1_index_picked, | |
54 | woq_wr2_index_picked, | |
55 | woq_wr_wdq_index_picked, | |
56 | woq_wr1_wdq_index_picked, | |
57 | woq_wr2_wdq_index_picked, | |
58 | woq_wr_adr_queue_sel, | |
59 | woq_wr1_adr_queue_sel, | |
60 | woq_wr2_adr_queue_sel, | |
61 | woq0_wr_entry_picked, | |
62 | woq1_wr_entry_picked, | |
63 | woq1_wr_picked, | |
64 | woq_wdata_wsn, | |
65 | woq_err_st_wait_free, | |
66 | woq_err_fifo_empty, | |
67 | woq_wr_req_out, | |
68 | woq_pd_mode_wr_decr, | |
69 | woq0_wdq_entry_free, | |
70 | woq1_wdq_entry_free, | |
71 | woq0_wrq_clear_ent, | |
72 | woq1_wrq_clear_ent, | |
73 | woq_owr_empty, | |
74 | woq_empty, | |
75 | woq_wr_error_mode, | |
76 | woq_wdata_send, | |
77 | woq_err_pdm_wr_incr, | |
78 | woq_err_pdm_wr_decr, | |
79 | drq0_wr_queue_ent0, | |
80 | drq0_wr_queue_ent1, | |
81 | drq0_wr_queue_ent2, | |
82 | drq0_wr_queue_ent3, | |
83 | drq0_wr_queue_ent4, | |
84 | drq0_wr_queue_ent5, | |
85 | drq0_wr_queue_ent6, | |
86 | drq0_wr_queue_ent7, | |
87 | drq0_wdq_valid, | |
88 | drq1_wr_queue_ent0, | |
89 | drq1_wr_queue_ent1, | |
90 | drq1_wr_queue_ent2, | |
91 | drq1_wr_queue_ent3, | |
92 | drq1_wr_queue_ent4, | |
93 | drq1_wr_queue_ent5, | |
94 | drq1_wr_queue_ent6, | |
95 | drq1_wr_queue_ent7, | |
96 | drq1_wdq_valid, | |
97 | drif_wr_entry_picked, | |
98 | drif_init, | |
99 | drif_init_mcu_done, | |
100 | drif_mcu_state_1, | |
101 | drif_mcu_state_2, | |
102 | drif_mcu_state_3, | |
103 | drif_mcu_state_4, | |
104 | drif_mcu_state_5, | |
105 | drif_mcu_state_6, | |
106 | drif_sync_frame_req_l, | |
107 | drif_sync_frame_req_early3_l, | |
108 | drif_single_channel_mode, | |
109 | drif_pd_mode_pending, | |
110 | drif_eight_bank_mode, | |
111 | drif_stacked_dimm, | |
112 | drif_blk_new_openbank, | |
113 | drif_err_fifo_empty, | |
114 | drif_wr_bc_stall, | |
115 | drif_refresh_rank, | |
116 | drif_hw_selfrsh, | |
117 | fbdic_l0_state, | |
118 | fbdic_chnl_reset_error_mode, | |
119 | drif_woq_free, | |
120 | fbdic_clear_wrq_ent, | |
121 | fbdic_scr_frame_req_d4, | |
122 | fbdic_error_mode, | |
123 | pdmc_rank_avail, | |
124 | drif_dimm_wr_available, | |
125 | l1clk, | |
126 | scan_in, | |
127 | scan_out, | |
128 | tcu_aclk, | |
129 | tcu_bclk, | |
130 | tcu_scan_en); | |
131 | wire siclk; | |
132 | wire soclk; | |
133 | wire se; | |
134 | wire woq_priority_in; | |
135 | wire [15:0] woq_wr_queue_reg; | |
136 | wire woq_priority_en; | |
137 | wire [2:0] woq_wdata_cnt; | |
138 | wire woq_wdata_cnt_en; | |
139 | wire ff_priority_scanin; | |
140 | wire ff_priority_scanout; | |
141 | wire woq_priority; | |
142 | wire [2:0] woq_wdata_cnt_in; | |
143 | wire [1:0] woq_io_wdata_sel_p2; | |
144 | wire ff_io_wdata_sel_scanin; | |
145 | wire ff_io_wdata_sel_scanout; | |
146 | wire [1:0] woq_io_wdata_sel_p1; | |
147 | wire woq_dimm_stall; | |
148 | wire woq_dimm0_stall; | |
149 | wire woq_dimm1_stall; | |
150 | wire woq_dimm2_stall; | |
151 | wire woq_dimm3_stall; | |
152 | wire woq_dimm4_stall; | |
153 | wire woq_dimm5_stall; | |
154 | wire woq_dimm6_stall; | |
155 | wire woq_dimm7_stall; | |
156 | wire woq_err_st_data; | |
157 | wire ff_wdata_cnt_scanin; | |
158 | wire ff_wdata_cnt_scanout; | |
159 | wire woq_wdata_l2bank_in; | |
160 | wire woq_wdata_l2bank_en; | |
161 | wire ff_wdata_l2bank_scanin; | |
162 | wire ff_wdata_l2bank_scanout; | |
163 | wire woq_wdata_l2bank_out; | |
164 | wire woq_wdata_l2bank; | |
165 | wire [15:0] woq_err_xact; | |
166 | wire woq_last_wr_data; | |
167 | wire woq_wr_addr_enq; | |
168 | wire [7:0] woq_entry0_addrq; | |
169 | wire [7:0] woq_entry1_addrq; | |
170 | wire [3:0] woq_entry0_bnk; | |
171 | wire [3:0] woq_entry1_bnk; | |
172 | wire [7:0] woq_wrq_ent0_index_dec; | |
173 | wire [7:0] woq_wrq_ent1_index_dec; | |
174 | wire [15:0] woq_entry0_mux; | |
175 | wire [4:0] raddr; | |
176 | wire [15:0] reg0; | |
177 | wire [15:0] reg1; | |
178 | wire [15:0] reg2; | |
179 | wire [15:0] reg3; | |
180 | wire [15:0] reg4; | |
181 | wire [15:0] reg5; | |
182 | wire [15:0] reg6; | |
183 | wire [15:0] reg7; | |
184 | wire [15:0] reg8; | |
185 | wire [15:0] reg9; | |
186 | wire [15:0] reg10; | |
187 | wire [15:0] reg11; | |
188 | wire [15:0] reg12; | |
189 | wire [15:0] reg13; | |
190 | wire [15:0] reg14; | |
191 | wire [15:0] reg15; | |
192 | wire [15:0] woq_entry0_bank_dec; | |
193 | wire woq_entry0_rank_avail; | |
194 | wire [15:0] woq_ent0_rank_dec; | |
195 | wire [15:0] woq_rank_avail; | |
196 | wire [15:0] woq_entry1_bank_dec; | |
197 | wire woq_entry1_rank_avail; | |
198 | wire [15:0] woq_ent1_rank_dec; | |
199 | wire [4:0] waddr_in; | |
200 | wire [4:0] waddr; | |
201 | wire ff_waddr_scanin; | |
202 | wire ff_waddr_scanout; | |
203 | wire [1:0] woq_deq_cnt; | |
204 | wire [4:0] raddr_in; | |
205 | wire ff_raddr_scanin; | |
206 | wire ff_raddr_scanout; | |
207 | wire woq_full; | |
208 | wire woq_not_empty; | |
209 | wire woq_err_st_wr_req; | |
210 | wire [4:0] woq_entry_cnt; | |
211 | wire woq_reg0_en; | |
212 | wire ff_reg0_scanin; | |
213 | wire ff_reg0_scanout; | |
214 | wire woq_reg1_en; | |
215 | wire ff_reg1_scanin; | |
216 | wire ff_reg1_scanout; | |
217 | wire woq_reg2_en; | |
218 | wire ff_reg2_scanin; | |
219 | wire ff_reg2_scanout; | |
220 | wire woq_reg3_en; | |
221 | wire ff_reg3_scanin; | |
222 | wire ff_reg3_scanout; | |
223 | wire woq_reg4_en; | |
224 | wire ff_reg4_scanin; | |
225 | wire ff_reg4_scanout; | |
226 | wire woq_reg5_en; | |
227 | wire ff_reg5_scanin; | |
228 | wire ff_reg5_scanout; | |
229 | wire woq_reg6_en; | |
230 | wire ff_reg6_scanin; | |
231 | wire ff_reg6_scanout; | |
232 | wire woq_reg7_en; | |
233 | wire ff_reg7_scanin; | |
234 | wire ff_reg7_scanout; | |
235 | wire woq_reg8_en; | |
236 | wire ff_reg8_scanin; | |
237 | wire ff_reg8_scanout; | |
238 | wire woq_reg9_en; | |
239 | wire ff_reg9_scanin; | |
240 | wire ff_reg9_scanout; | |
241 | wire woq_reg10_en; | |
242 | wire ff_reg10_scanin; | |
243 | wire ff_reg10_scanout; | |
244 | wire woq_reg11_en; | |
245 | wire ff_reg11_scanin; | |
246 | wire ff_reg11_scanout; | |
247 | wire woq_reg12_en; | |
248 | wire ff_reg12_scanin; | |
249 | wire ff_reg12_scanout; | |
250 | wire woq_reg13_en; | |
251 | wire ff_reg13_scanin; | |
252 | wire ff_reg13_scanout; | |
253 | wire woq_reg14_en; | |
254 | wire ff_reg14_scanin; | |
255 | wire ff_reg14_scanout; | |
256 | wire woq_reg15_en; | |
257 | wire ff_reg15_scanin; | |
258 | wire ff_reg15_scanout; | |
259 | wire [4:0] woq_owr_ptr_in; | |
260 | wire [4:0] woq_owr_ptr; | |
261 | wire ff_owr_ptr_scanin; | |
262 | wire ff_owr_ptr_scanout; | |
263 | wire [1:0] woq_wr_req_out_in; | |
264 | wire ff_wr_req_out_scanin; | |
265 | wire ff_wr_req_out_scanout; | |
266 | wire [1:0] woq_owr_free; | |
267 | wire [15:0] woq_owr_ent0; | |
268 | wire [15:0] woq_owr_ent1; | |
269 | wire [7:0] woq_owr_ent0_wdq_dec; | |
270 | wire [7:0] woq_owr_ent1_wdq_dec; | |
271 | wire [7:0] woq0_wdq_free; | |
272 | wire woq_err_st_wait_clear; | |
273 | wire [7:0] woq_err_wdq_dec; | |
274 | wire [7:0] woq1_wdq_free; | |
275 | wire ff_woq_free_d1_scanin; | |
276 | wire ff_woq_free_d1_scanout; | |
277 | wire [0:0] drif_woq_free_d1; | |
278 | wire [7:0] woq0_wdq_free_accum_in; | |
279 | wire [7:0] woq0_wdq_free_accum; | |
280 | wire [7:0] woq1_wdq_free_accum_in; | |
281 | wire [7:0] woq1_wdq_free_accum; | |
282 | wire woq_wrq_wdq_entry_clr; | |
283 | wire ff_wdq_free_accum_scanin; | |
284 | wire ff_wdq_free_accum_scanout; | |
285 | wire [7:0] woq0_wdq_entry_free_in; | |
286 | wire [7:0] woq1_wdq_entry_free_in; | |
287 | wire ff_wdq_entry_free_scanin; | |
288 | wire ff_wdq_entry_free_scanout; | |
289 | wire [7:0] woq_owr_ent0_wrq_dec; | |
290 | wire [7:0] woq_owr_ent1_wrq_dec; | |
291 | wire [7:0] woq0_wrq_clear; | |
292 | wire [7:0] woq_err_wrq_dec; | |
293 | wire [7:0] woq1_wrq_clear; | |
294 | wire [7:0] woq0_wrq_clear_accum_in; | |
295 | wire [7:0] woq0_wrq_clear_accum; | |
296 | wire [7:0] woq1_wrq_clear_accum_in; | |
297 | wire [7:0] woq1_wrq_clear_accum; | |
298 | wire ff_wrq_clear_accum_scanin; | |
299 | wire ff_wrq_clear_accum_scanout; | |
300 | wire [15:0] woq_entry0_pd_mode_decr; | |
301 | wire [15:0] woq_entry1_pd_mode_decr; | |
302 | wire [15:0] woq_pd_mode_wr_decr_in; | |
303 | wire ff_pd_mode_wr_decr_scanin; | |
304 | wire ff_pd_mode_wr_decr_scanout; | |
305 | wire woq_wr_error_mode_in; | |
306 | wire ff_wr_error_mode_scanin; | |
307 | wire ff_wr_error_mode_scanout; | |
308 | wire [4:0] woq_error_ptr_in; | |
309 | wire [4:0] woq_error_ptr; | |
310 | wire ff_error_ptr_scanin; | |
311 | wire ff_error_ptr_scanout; | |
312 | wire [3:0] woq_wr_err_state; | |
313 | wire inv_woq_err_st_data_next; | |
314 | wire woq_err_st_data_next; | |
315 | wire inv_woq_err_st_data; | |
316 | wire ff_wr_err_state_scanin; | |
317 | wire ff_wr_err_state_scanout; | |
318 | wire woq_err_st_wait_free_next; | |
319 | wire woq_wr_retry_error; | |
320 | wire [15:0] woq_err_pdm_wr; | |
321 | wire woq_dimm0_wrcnt_incr; | |
322 | wire woq_dimm0_wrcnt_decr; | |
323 | wire [2:0] woq_dimm0_wrcnt_in; | |
324 | wire [2:0] woq_dimm0_wrcnt; | |
325 | wire ff_dimm0_wrcnt_scanin; | |
326 | wire ff_dimm0_wrcnt_scanout; | |
327 | wire woq_dimm1_wrcnt_incr; | |
328 | wire woq_dimm1_wrcnt_decr; | |
329 | wire [2:0] woq_dimm1_wrcnt_in; | |
330 | wire [2:0] woq_dimm1_wrcnt; | |
331 | wire ff_dimm1_wrcnt_scanin; | |
332 | wire ff_dimm1_wrcnt_scanout; | |
333 | wire woq_dimm2_wrcnt_incr; | |
334 | wire woq_dimm2_wrcnt_decr; | |
335 | wire [2:0] woq_dimm2_wrcnt_in; | |
336 | wire [2:0] woq_dimm2_wrcnt; | |
337 | wire ff_dimm2_wrcnt_scanin; | |
338 | wire ff_dimm2_wrcnt_scanout; | |
339 | wire woq_dimm3_wrcnt_incr; | |
340 | wire woq_dimm3_wrcnt_decr; | |
341 | wire [2:0] woq_dimm3_wrcnt_in; | |
342 | wire [2:0] woq_dimm3_wrcnt; | |
343 | wire ff_dimm3_wrcnt_scanin; | |
344 | wire ff_dimm3_wrcnt_scanout; | |
345 | wire woq_dimm4_wrcnt_incr; | |
346 | wire woq_dimm4_wrcnt_decr; | |
347 | wire [2:0] woq_dimm4_wrcnt_in; | |
348 | wire [2:0] woq_dimm4_wrcnt; | |
349 | wire ff_dimm4_wrcnt_scanin; | |
350 | wire ff_dimm4_wrcnt_scanout; | |
351 | wire woq_dimm5_wrcnt_incr; | |
352 | wire woq_dimm5_wrcnt_decr; | |
353 | wire [2:0] woq_dimm5_wrcnt_in; | |
354 | wire [2:0] woq_dimm5_wrcnt; | |
355 | wire ff_dimm5_wrcnt_scanin; | |
356 | wire ff_dimm5_wrcnt_scanout; | |
357 | wire woq_dimm6_wrcnt_incr; | |
358 | wire woq_dimm6_wrcnt_decr; | |
359 | wire [2:0] woq_dimm6_wrcnt_in; | |
360 | wire [2:0] woq_dimm6_wrcnt; | |
361 | wire ff_dimm6_wrcnt_scanin; | |
362 | wire ff_dimm6_wrcnt_scanout; | |
363 | wire woq_dimm7_wrcnt_incr; | |
364 | wire woq_dimm7_wrcnt_decr; | |
365 | wire [2:0] woq_dimm7_wrcnt_in; | |
366 | wire [2:0] woq_dimm7_wrcnt; | |
367 | wire ff_dimm7_wrcnt_scanin; | |
368 | wire ff_dimm7_wrcnt_scanout; | |
369 | ||
370 | ||
371 | output woq0_wdq_rd; | |
372 | output [7:0] woq0_wr_queue_clear; | |
373 | ||
374 | output woq1_wdq_rd; | |
375 | output [7:0] woq1_wr_queue_clear; | |
376 | ||
377 | output [4:0] woq_wdq_radr; | |
378 | output woq_wadr_parity; | |
379 | output [1:0] woq_io_wdata_sel; | |
380 | ||
381 | output [15:0] woq_entry0; | |
382 | output [15:0] woq_entry1; | |
383 | output [2:0] woq_entry_valid; | |
384 | ||
385 | output [15:0] woq_entry0_val; | |
386 | output [15:0] woq_entry1_val; | |
387 | ||
388 | output [15:0] woq_wr_bank_val; | |
389 | ||
390 | output [9:0] woq_wr_addr_picked; | |
391 | output [9:0] woq_wr1_addr_picked; | |
392 | output [9:0] woq_wr2_addr_picked; | |
393 | ||
394 | output [2:0] woq_wr_index_picked; | |
395 | output [2:0] woq_wr1_index_picked; | |
396 | output [2:0] woq_wr2_index_picked; | |
397 | ||
398 | output [2:0] woq_wr_wdq_index_picked; | |
399 | output [2:0] woq_wr1_wdq_index_picked; | |
400 | output [2:0] woq_wr2_wdq_index_picked; | |
401 | ||
402 | output [7:0] woq_wr_adr_queue_sel; | |
403 | output [7:0] woq_wr1_adr_queue_sel; | |
404 | output [7:0] woq_wr2_adr_queue_sel; | |
405 | ||
406 | output [7:0] woq0_wr_entry_picked; | |
407 | output [7:0] woq1_wr_entry_picked; | |
408 | ||
409 | output [2:0] woq1_wr_picked; | |
410 | ||
411 | output woq_wdata_wsn; | |
412 | output woq_err_st_wait_free; | |
413 | output woq_err_fifo_empty; | |
414 | output [1:0] woq_wr_req_out; | |
415 | output [15:0] woq_pd_mode_wr_decr; | |
416 | ||
417 | output [7:0] woq0_wdq_entry_free; | |
418 | output [7:0] woq1_wdq_entry_free; | |
419 | output [7:0] woq0_wrq_clear_ent; | |
420 | output [7:0] woq1_wrq_clear_ent; | |
421 | ||
422 | output woq_owr_empty; | |
423 | output woq_empty; | |
424 | output woq_wr_error_mode; | |
425 | output woq_wdata_send; | |
426 | ||
427 | output [15:0] woq_err_pdm_wr_incr; | |
428 | output [15:0] woq_err_pdm_wr_decr; | |
429 | ||
430 | input [14:0] drq0_wr_queue_ent0; | |
431 | input [14:0] drq0_wr_queue_ent1; | |
432 | input [14:0] drq0_wr_queue_ent2; | |
433 | input [14:0] drq0_wr_queue_ent3; | |
434 | input [14:0] drq0_wr_queue_ent4; | |
435 | input [14:0] drq0_wr_queue_ent5; | |
436 | input [14:0] drq0_wr_queue_ent6; | |
437 | input [14:0] drq0_wr_queue_ent7; | |
438 | input [7:0] drq0_wdq_valid; | |
439 | ||
440 | input [14:0] drq1_wr_queue_ent0; | |
441 | input [14:0] drq1_wr_queue_ent1; | |
442 | input [14:0] drq1_wr_queue_ent2; | |
443 | input [14:0] drq1_wr_queue_ent3; | |
444 | input [14:0] drq1_wr_queue_ent4; | |
445 | input [14:0] drq1_wr_queue_ent5; | |
446 | input [14:0] drq1_wr_queue_ent6; | |
447 | input [14:0] drq1_wr_queue_ent7; | |
448 | input [7:0] drq1_wdq_valid; | |
449 | ||
450 | input [2:0] drif_wr_entry_picked; | |
451 | input drif_init; | |
452 | input drif_init_mcu_done; | |
453 | input drif_mcu_state_1; | |
454 | input drif_mcu_state_2; | |
455 | input drif_mcu_state_3; | |
456 | input drif_mcu_state_4; | |
457 | input drif_mcu_state_5; | |
458 | input drif_mcu_state_6; | |
459 | input drif_sync_frame_req_l; | |
460 | input drif_sync_frame_req_early3_l; | |
461 | input drif_single_channel_mode; | |
462 | input drif_pd_mode_pending; | |
463 | input drif_eight_bank_mode; | |
464 | input drif_stacked_dimm; | |
465 | input drif_blk_new_openbank; | |
466 | input drif_err_fifo_empty; | |
467 | input drif_wr_bc_stall; | |
468 | input [3:0] drif_refresh_rank; // rank being refreshed; requests are blocked to this rank | |
469 | // during refresh | |
470 | input drif_hw_selfrsh; | |
471 | ||
472 | input fbdic_l0_state; | |
473 | input fbdic_chnl_reset_error_mode; | |
474 | input [1:0] drif_woq_free; | |
475 | input fbdic_clear_wrq_ent; | |
476 | input fbdic_scr_frame_req_d4; | |
477 | input fbdic_error_mode; | |
478 | ||
479 | input [15:0] pdmc_rank_avail; | |
480 | input [7:0] drif_dimm_wr_available; | |
481 | ||
482 | input l1clk; | |
483 | input scan_in; | |
484 | output scan_out; | |
485 | input tcu_aclk; | |
486 | input tcu_bclk; | |
487 | input tcu_scan_en; | |
488 | ||
489 | // Scan reassigns | |
490 | assign siclk = tcu_aclk; | |
491 | assign soclk = tcu_bclk; | |
492 | assign se = tcu_scan_en; | |
493 | ||
494 | reg woq_err_st_wait_free_in; | |
495 | reg woq_err_st_wait_clear_in; | |
496 | reg woq_err_st_wr_req_in; | |
497 | reg woq_err_st_data_in; | |
498 | ||
499 | assign woq_priority_in = ~woq_wr_queue_reg[15]; | |
500 | assign woq_priority_en = drif_single_channel_mode ? woq_wdata_cnt[2:0] == 3'h7 & woq_wdata_cnt_en : | |
501 | woq_wdata_cnt[1:0] == 2'h3 & woq_wdata_cnt_en; | |
502 | ||
503 | mcu_woq_ctl_msff_ctl_macro__en_1 ff_priority ( | |
504 | .scan_in(ff_priority_scanin), | |
505 | .scan_out(ff_priority_scanout), | |
506 | .din(woq_priority_in), | |
507 | .dout(woq_priority), | |
508 | .en(woq_priority_en), | |
509 | .l1clk(l1clk), | |
510 | .siclk(siclk), | |
511 | .soclk(soclk)); | |
512 | ||
513 | assign woq_wdata_cnt_in[2:0] = drif_single_channel_mode ? woq_wdata_cnt[2:0] + 3'h1 : {1'b0, woq_wdata_cnt[1:0] + 2'h1}; | |
514 | ||
515 | // select between upper and lower double words when in single channel mode | |
516 | assign woq_io_wdata_sel_p2[1:0] = drif_single_channel_mode ? {woq_wdata_cnt[0],~woq_wdata_cnt[0]} : 2'h1; | |
517 | ||
518 | mcu_woq_ctl_msff_ctl_macro__width_4 ff_io_wdata_sel ( | |
519 | .scan_in(ff_io_wdata_sel_scanin), | |
520 | .scan_out(ff_io_wdata_sel_scanout), | |
521 | .din({woq_io_wdata_sel_p2[1:0],woq_io_wdata_sel_p1[1:0]}), | |
522 | .dout({woq_io_wdata_sel_p1[1:0],woq_io_wdata_sel[1:0]}), | |
523 | .l1clk(l1clk), | |
524 | .siclk(siclk), | |
525 | .soclk(soclk)); | |
526 | ||
527 | assign woq_dimm_stall = woq_dimm0_stall | woq_dimm1_stall | woq_dimm2_stall | woq_dimm3_stall | | |
528 | woq_dimm4_stall | woq_dimm5_stall | woq_dimm6_stall | woq_dimm7_stall; | |
529 | assign woq_wdata_cnt_en = (fbdic_l0_state | fbdic_chnl_reset_error_mode) & drif_sync_frame_req_early3_l & | |
530 | ~woq_dimm_stall & ~drif_wr_bc_stall & ~drif_mcu_state_3 & ~drif_mcu_state_5 & ~drif_mcu_state_6 & | |
531 | ((~woq_priority | ~(|drq1_wdq_valid[7:0])) & (|drq0_wdq_valid[7:0]) & ~woq_wr_error_mode | | |
532 | (woq_priority | ~(|drq0_wdq_valid[7:0])) & (|drq1_wdq_valid[7:0]) & ~woq_wr_error_mode | | |
533 | ~woq_err_fifo_empty & woq_wr_error_mode & woq_err_st_data) & | |
534 | (woq_wdata_cnt[2:0] != 3'h0 | woq_wdata_cnt[2:0] == 3'h0 & ~drif_pd_mode_pending & | |
535 | ~drif_blk_new_openbank & (drif_err_fifo_empty | woq_wr_error_mode) & ~fbdic_error_mode & | |
536 | ~drif_mcu_state_2 & ~drif_hw_selfrsh); | |
537 | ||
538 | mcu_woq_ctl_msff_ctl_macro__en_1__width_3 ff_wdata_cnt ( | |
539 | .scan_in(ff_wdata_cnt_scanin), | |
540 | .scan_out(ff_wdata_cnt_scanout), | |
541 | .din(woq_wdata_cnt_in[2:0]), | |
542 | .dout(woq_wdata_cnt[2:0]), | |
543 | .en(woq_wdata_cnt_en), | |
544 | .l1clk(l1clk), | |
545 | .siclk(siclk), | |
546 | .soclk(soclk)); | |
547 | ||
548 | // used to stall error reads until all write data has been sent | |
549 | assign woq_wdata_send = woq_wdata_cnt_en | woq_wdata_cnt[2:0] != 3'h0; | |
550 | ||
551 | // Select which L2 bank request is from | |
552 | assign woq_wdata_l2bank_in = (woq_priority | ~(|drq0_wdq_valid[7:0])) & (|drq1_wdq_valid[7:0]); | |
553 | assign woq_wdata_l2bank_en = woq_wdata_cnt_en & woq_wdata_cnt[2:0] == 3'h0; | |
554 | ||
555 | mcu_woq_ctl_msff_ctl_macro__en_1 ff_wdata_l2bank ( | |
556 | .scan_in(ff_wdata_l2bank_scanin), | |
557 | .scan_out(ff_wdata_l2bank_scanout), | |
558 | .din(woq_wdata_l2bank_in), | |
559 | .dout(woq_wdata_l2bank_out), | |
560 | .en(woq_wdata_l2bank_en), | |
561 | .l1clk(l1clk), | |
562 | .siclk(siclk), | |
563 | .soclk(soclk)); | |
564 | ||
565 | assign woq_wdata_l2bank = woq_wdata_l2bank_en ? woq_wdata_l2bank_in : woq_wdata_l2bank_out; | |
566 | ||
567 | // Entry to write into WOQ | |
568 | assign woq_wr_queue_reg[14:0] = woq_wr_error_mode ? woq_err_xact[14:0] : | |
569 | woq_wdata_l2bank ? drq1_wr_queue_ent0[14:0] : drq0_wr_queue_ent0[14:0]; | |
570 | assign woq_wr_queue_reg[15] = woq_wr_error_mode ? woq_err_xact[15] : woq_wdata_l2bank; | |
571 | ||
572 | assign woq_wdata_wsn = (woq_wdata_cnt[1:0] == 2'h1) & woq_wr_queue_reg[3] | | |
573 | (woq_wdata_cnt[1:0] == 2'h2) & woq_wr_queue_reg[4] | | |
574 | (woq_wdata_cnt[1:0] == 2'h3) & woq_wr_queue_reg[5]; | |
575 | ||
576 | // pull off address parity to XOR with ECC | |
577 | assign woq_wadr_parity = woq_wr_queue_reg[8]; | |
578 | ||
579 | // Check that entry is cleared from DRQ at same time entry is placed in WOQ | |
580 | // 0in custom -fire (woq_wr_addr_enq ^ (woq0_wr_queue_clear[0] | woq1_wr_queue_clear[0])) | |
581 | ||
582 | // clear entry from drq once data has been sent to DIMM | |
583 | assign woq0_wr_queue_clear[0] = ~woq_wdata_l2bank & woq_wdata_cnt_en & ~woq_wr_error_mode & | |
584 | (drif_single_channel_mode ? (woq_wdata_cnt[2:0] == 3'h7) : (woq_wdata_cnt[1:0] == 2'h3)); | |
585 | assign woq1_wr_queue_clear[0] = woq_wdata_l2bank & woq_wdata_cnt_en & ~woq_wr_error_mode & | |
586 | (drif_single_channel_mode ? (woq_wdata_cnt[2:0] == 3'h7) : (woq_wdata_cnt[1:0] == 2'h3)); | |
587 | assign woq0_wr_queue_clear[7:1] = 7'h0; | |
588 | assign woq1_wr_queue_clear[7:1] = 7'h0; | |
589 | ||
590 | // WDQ read address | |
591 | assign woq_wdq_radr[4:0] = drif_single_channel_mode ? {woq_wr_queue_reg[14:12],woq_wdata_cnt[2:1]} : | |
592 | {woq_wr_queue_reg[14:12],woq_wdata_cnt[1:0]}; | |
593 | assign woq0_wdq_rd = woq_wdata_cnt_en & (woq_wr_error_mode ? ~woq_err_xact[15] : ~woq_wdata_l2bank); | |
594 | assign woq1_wdq_rd = woq_wdata_cnt_en & (woq_wr_error_mode ? woq_err_xact[15] : woq_wdata_l2bank); | |
595 | ||
596 | // Write Ordering Queue RAM | |
597 | assign woq_last_wr_data = (drif_single_channel_mode ? woq_wdata_cnt[2:0] == 3'h7 & woq_wdata_cnt_en : | |
598 | woq_wdata_cnt[1:0] == 2'h3 & woq_wdata_cnt_en); | |
599 | assign woq_wr_addr_enq = ~woq_wr_error_mode & woq_last_wr_data; | |
600 | ||
601 | // decoded bank of write entry picked | |
602 | assign woq1_wr_picked[2:0] = drif_wr_entry_picked[2:0] & {woq_entry1[15],woq_entry0[15],woq_entry0[15]}; | |
603 | ||
604 | assign woq0_wr_entry_picked[7:0] = {8{drif_wr_entry_picked[0] & ~woq_entry0[15]}} & woq_entry0_addrq[7:0] | | |
605 | {8{drif_wr_entry_picked[1] & ~woq_entry0[15]}} & woq_entry0_addrq[7:0] | | |
606 | {8{drif_wr_entry_picked[2] & ~woq_entry1[15]}} & woq_entry1_addrq[7:0]; | |
607 | assign woq1_wr_entry_picked[7:0] = {8{drif_wr_entry_picked[0] & woq_entry0[15]}} & woq_entry0_addrq[7:0] | | |
608 | {8{drif_wr_entry_picked[1] & woq_entry0[15]}} & woq_entry0_addrq[7:0] | | |
609 | {8{drif_wr_entry_picked[2] & woq_entry1[15]}} & woq_entry1_addrq[7:0]; | |
610 | ||
611 | // address picked | |
612 | assign woq_wr_addr_picked[9:0] = {woq_entry0[8:3],woq_entry0_bnk[3],woq_entry0[2:0]}; | |
613 | assign woq_wr1_addr_picked[9:0] = {woq_entry0[8:3],woq_entry0_bnk[3],woq_entry0[2:0]}; | |
614 | assign woq_wr2_addr_picked[9:0] = {woq_entry1[8:3],woq_entry1_bnk[3],woq_entry1[2:0]}; | |
615 | ||
616 | // address queue entry location | |
617 | assign woq_wr_index_picked[2:0] = woq_entry0[11:9]; | |
618 | assign woq_wr1_index_picked[2:0] = woq_entry0[11:9]; | |
619 | assign woq_wr2_index_picked[2:0] = woq_entry1[11:9]; | |
620 | ||
621 | // wdq queue entry location | |
622 | assign woq_wr_wdq_index_picked[2:0] = woq_entry0[14:12]; | |
623 | assign woq_wr1_wdq_index_picked[2:0] = woq_entry0[14:12]; | |
624 | assign woq_wr2_wdq_index_picked[2:0] = woq_entry1[14:12]; | |
625 | ||
626 | // select for write address queue entry | |
627 | assign woq_wr_adr_queue_sel[7:0] = {8{drif_wr_entry_picked[0]}} & woq_wrq_ent0_index_dec[7:0]; | |
628 | assign woq_wr1_adr_queue_sel[7:0] = {8{drif_wr_entry_picked[1]}} & woq_wrq_ent0_index_dec[7:0]; | |
629 | assign woq_wr2_adr_queue_sel[7:0] = {8{drif_wr_entry_picked[2]}} & woq_wrq_ent1_index_dec[7:0]; | |
630 | ||
631 | // Entry 0,1 selection | |
632 | assign {woq_entry0_mux[15:0],woq_entry1[15:0]} = | |
633 | {32{raddr[3:0] == 4'h0}} & {reg0[15:0], reg1[15:0]} | | |
634 | {32{raddr[3:0] == 4'h1}} & {reg1[15:0], reg2[15:0]} | | |
635 | {32{raddr[3:0] == 4'h2}} & {reg2[15:0], reg3[15:0]} | | |
636 | {32{raddr[3:0] == 4'h3}} & {reg3[15:0], reg4[15:0]} | | |
637 | {32{raddr[3:0] == 4'h4}} & {reg4[15:0], reg5[15:0]} | | |
638 | {32{raddr[3:0] == 4'h5}} & {reg5[15:0], reg6[15:0]} | | |
639 | {32{raddr[3:0] == 4'h6}} & {reg6[15:0], reg7[15:0]} | | |
640 | {32{raddr[3:0] == 4'h7}} & {reg7[15:0], reg8[15:0]} | | |
641 | {32{raddr[3:0] == 4'h8}} & {reg8[15:0], reg9[15:0]} | | |
642 | {32{raddr[3:0] == 4'h9}} & {reg9[15:0], reg10[15:0]} | | |
643 | {32{raddr[3:0] == 4'ha}} & {reg10[15:0],reg11[15:0]} | | |
644 | {32{raddr[3:0] == 4'hb}} & {reg11[15:0],reg12[15:0]} | | |
645 | {32{raddr[3:0] == 4'hc}} & {reg12[15:0],reg13[15:0]} | | |
646 | {32{raddr[3:0] == 4'hd}} & {reg13[15:0],reg14[15:0]} | | |
647 | {32{raddr[3:0] == 4'he}} & {reg14[15:0],reg15[15:0]}| | |
648 | {32{raddr[3:0] == 4'hf}} & {reg15[15:0],reg0[15:0]}; | |
649 | ||
650 | assign woq_entry0[15:0] = woq_wr_error_mode ? woq_err_xact[15:0] : woq_entry0_mux[15:0]; | |
651 | ||
652 | // Entry 0 decodes | |
653 | assign woq_entry0_bnk[3:0] = {drif_eight_bank_mode ? (drif_stacked_dimm ? woq_entry0[6] : | |
654 | woq_entry0[3]) : | |
655 | (drif_stacked_dimm ? woq_entry0[3] : | |
656 | woq_entry0[4]), woq_entry0[2:0]}; | |
657 | ||
658 | assign woq_entry0_val[15:0] = woq_entry0_bank_dec[15:0] & {16{woq_entry_valid[0] & woq_entry0_rank_avail & | |
659 | ((drif_mcu_state_2 | drif_mcu_state_4) & ~drif_init & | |
660 | woq_entry0[6:3] != drif_refresh_rank[3:0] | drif_mcu_state_1)}}; | |
661 | assign woq_entry0_bank_dec[15:0] = | |
662 | {woq_entry0_bnk[3:0] == 4'hf, woq_entry0_bnk[3:0] == 4'he, | |
663 | woq_entry0_bnk[3:0] == 4'hd, woq_entry0_bnk[3:0] == 4'hc, | |
664 | woq_entry0_bnk[3:0] == 4'hb, woq_entry0_bnk[3:0] == 4'ha, | |
665 | woq_entry0_bnk[3:0] == 4'h9, woq_entry0_bnk[3:0] == 4'h8, | |
666 | woq_entry0_bnk[3:0] == 4'h7, woq_entry0_bnk[3:0] == 4'h6, | |
667 | woq_entry0_bnk[3:0] == 4'h5, woq_entry0_bnk[3:0] == 4'h4, | |
668 | woq_entry0_bnk[3:0] == 4'h3, woq_entry0_bnk[3:0] == 4'h2, | |
669 | woq_entry0_bnk[3:0] == 4'h1, woq_entry0_bnk[3:0] == 4'h0}; | |
670 | ||
671 | assign woq_ent0_rank_dec[15:0] = {woq_entry0[6:3] == 4'hf, woq_entry0[6:3] == 4'he, | |
672 | woq_entry0[6:3] == 4'hd, woq_entry0[6:3] == 4'hc, | |
673 | woq_entry0[6:3] == 4'hb, woq_entry0[6:3] == 4'ha, | |
674 | woq_entry0[6:3] == 4'h9, woq_entry0[6:3] == 4'h8, | |
675 | woq_entry0[6:3] == 4'h7, woq_entry0[6:3] == 4'h6, | |
676 | woq_entry0[6:3] == 4'h5, woq_entry0[6:3] == 4'h4, | |
677 | woq_entry0[6:3] == 4'h3, woq_entry0[6:3] == 4'h2, | |
678 | woq_entry0[6:3] == 4'h1, woq_entry0[6:3] == 4'h0}; | |
679 | assign woq_entry0_rank_avail = |(woq_ent0_rank_dec[15:0] & woq_rank_avail[15:0]); | |
680 | ||
681 | assign woq_entry0_addrq[7:0] = {woq_entry0[11:9] == 3'h7, | |
682 | woq_entry0[11:9] == 3'h6, | |
683 | woq_entry0[11:9] == 3'h5, | |
684 | woq_entry0[11:9] == 3'h4, | |
685 | woq_entry0[11:9] == 3'h3, | |
686 | woq_entry0[11:9] == 3'h2, | |
687 | woq_entry0[11:9] == 3'h1, | |
688 | woq_entry0[11:9] == 3'h0}; | |
689 | ||
690 | assign woq_wrq_ent0_index_dec[7:0] = { (woq_entry0[11:9] == 3'h7), (woq_entry0[11:9] == 3'h6), | |
691 | (woq_entry0[11:9] == 3'h5), (woq_entry0[11:9] == 3'h4), | |
692 | (woq_entry0[11:9] == 3'h3), (woq_entry0[11:9] == 3'h2), | |
693 | (woq_entry0[11:9] == 3'h1), (woq_entry0[11:9] == 3'h0) }; | |
694 | ||
695 | // Entry 1 decodes | |
696 | assign woq_entry1_bnk[3:0] = {drif_eight_bank_mode ? (drif_stacked_dimm ? woq_entry1[6] : | |
697 | woq_entry1[3]) : | |
698 | (drif_stacked_dimm ? woq_entry1[3] : | |
699 | woq_entry1[4]), woq_entry1[2:0]}; | |
700 | ||
701 | assign woq_entry1_val[15:0] = woq_entry1_bank_dec[15:0] & {16{woq_entry_valid[1] & woq_entry1_rank_avail & | |
702 | ((drif_mcu_state_2 | drif_mcu_state_4) & ~drif_init & | |
703 | woq_entry1[6:3] != drif_refresh_rank[3:0] | drif_mcu_state_1)}}; | |
704 | assign woq_entry1_bank_dec[15:0] = | |
705 | {woq_entry1_bnk[3:0] == 4'hf, woq_entry1_bnk[3:0] == 4'he, | |
706 | woq_entry1_bnk[3:0] == 4'hd, woq_entry1_bnk[3:0] == 4'hc, | |
707 | woq_entry1_bnk[3:0] == 4'hb, woq_entry1_bnk[3:0] == 4'ha, | |
708 | woq_entry1_bnk[3:0] == 4'h9, woq_entry1_bnk[3:0] == 4'h8, | |
709 | woq_entry1_bnk[3:0] == 4'h7, woq_entry1_bnk[3:0] == 4'h6, | |
710 | woq_entry1_bnk[3:0] == 4'h5, woq_entry1_bnk[3:0] == 4'h4, | |
711 | woq_entry1_bnk[3:0] == 4'h3, woq_entry1_bnk[3:0] == 4'h2, | |
712 | woq_entry1_bnk[3:0] == 4'h1, woq_entry1_bnk[3:0] == 4'h0}; | |
713 | ||
714 | assign woq_ent1_rank_dec[15:0] = {woq_entry1[6:3] == 4'hf, woq_entry1[6:3] == 4'he, | |
715 | woq_entry1[6:3] == 4'hd, woq_entry1[6:3] == 4'hc, | |
716 | woq_entry1[6:3] == 4'hb, woq_entry1[6:3] == 4'ha, | |
717 | woq_entry1[6:3] == 4'h9, woq_entry1[6:3] == 4'h8, | |
718 | woq_entry1[6:3] == 4'h7, woq_entry1[6:3] == 4'h6, | |
719 | woq_entry1[6:3] == 4'h5, woq_entry1[6:3] == 4'h4, | |
720 | woq_entry1[6:3] == 4'h3, woq_entry1[6:3] == 4'h2, | |
721 | woq_entry1[6:3] == 4'h1, woq_entry1[6:3] == 4'h0}; | |
722 | assign woq_entry1_rank_avail = |(woq_ent1_rank_dec[15:0] & woq_rank_avail[15:0]); | |
723 | ||
724 | assign woq_entry1_addrq[7:0] = {woq_entry1[11:9] == 3'h7, | |
725 | woq_entry1[11:9] == 3'h6, | |
726 | woq_entry1[11:9] == 3'h5, | |
727 | woq_entry1[11:9] == 3'h4, | |
728 | woq_entry1[11:9] == 3'h3, | |
729 | woq_entry1[11:9] == 3'h2, | |
730 | woq_entry1[11:9] == 3'h1, | |
731 | woq_entry1[11:9] == 3'h0}; | |
732 | ||
733 | assign woq_wrq_ent1_index_dec[7:0] = { (woq_entry1[11:9] == 3'h7), (woq_entry1[11:9] == 3'h6), | |
734 | (woq_entry1[11:9] == 3'h5), (woq_entry1[11:9] == 3'h4), | |
735 | (woq_entry1[11:9] == 3'h3), (woq_entry1[11:9] == 3'h2), | |
736 | (woq_entry1[11:9] == 3'h1), (woq_entry1[11:9] == 3'h0) }; | |
737 | ||
738 | // decoded bank so scheduler will know which banks have pending write requests | |
739 | assign woq_wr_bank_val[15:0] = woq_entry0_bank_dec[15:0] & {16{woq_entry_valid[0]}} | |
740 | | woq_entry1_bank_dec[15:0] & {16{woq_entry_valid[1]}}; | |
741 | ||
742 | // Queue read and write pointers | |
743 | assign waddr_in[4:0] = woq_wr_addr_enq ? waddr[4:0] + 5'h1 : waddr[4:0]; | |
744 | mcu_woq_ctl_msff_ctl_macro__width_5 ff_waddr ( | |
745 | .scan_in(ff_waddr_scanin), | |
746 | .scan_out(ff_waddr_scanout), | |
747 | .din(waddr_in[4:0]), | |
748 | .dout(waddr[4:0]), | |
749 | .l1clk(l1clk), | |
750 | .siclk(siclk), | |
751 | .soclk(soclk)); | |
752 | ||
753 | assign woq_deq_cnt[1:0] = {2{~woq_wr_error_mode}} & (drif_wr_entry_picked[2:0] == 3'h1 ? 2'h1 : | |
754 | drif_wr_entry_picked[2:0] == 3'h2 ? 2'h1 : | |
755 | drif_wr_entry_picked[2:0] == 3'h6 ? 2'h2 : 2'h0); | |
756 | ||
757 | assign raddr_in[4:0] = woq_wr_error_mode ? waddr[4:0] : raddr[4:0] + {3'h0,woq_deq_cnt[1:0]}; | |
758 | mcu_woq_ctl_msff_ctl_macro__width_5 ff_raddr ( | |
759 | .scan_in(ff_raddr_scanin), | |
760 | .scan_out(ff_raddr_scanout), | |
761 | .din(raddr_in[4:0]), | |
762 | .dout(raddr[4:0]), | |
763 | .l1clk(l1clk), | |
764 | .siclk(siclk), | |
765 | .soclk(soclk)); | |
766 | ||
767 | assign woq_full = waddr[4:0] == {~raddr[4],raddr[3:0]}; | |
768 | assign woq_not_empty = (waddr[4:0] != raddr[4:0]) & ~woq_wr_error_mode | woq_err_st_wr_req; | |
769 | assign woq_empty = ~woq_not_empty; | |
770 | ||
771 | // woq entry count | |
772 | assign woq_entry_cnt[4:0] = waddr[4:0] > raddr[4:0] ? waddr[4:0] - raddr[4:0] : ~(raddr[4:0] - waddr[4:0]) + 5'h1; | |
773 | assign woq_entry_valid[2:0] = woq_wr_error_mode & woq_err_st_wr_req ? 3'h1 : | |
774 | woq_wr_error_mode & ~woq_err_st_wr_req ? 3'h0 : | |
775 | {woq_entry_cnt[4:0] >= 5'h3, woq_entry_cnt[4:0] >= 5'h2, ~woq_empty}; | |
776 | ||
777 | // Queue storage | |
778 | ||
779 | assign woq_reg0_en = woq_wr_addr_enq & waddr[3:0] == 4'h0; | |
780 | ||
781 | mcu_woq_ctl_msff_ctl_macro__en_1__width_16 ff_reg0 ( | |
782 | .scan_in(ff_reg0_scanin), | |
783 | .scan_out(ff_reg0_scanout), | |
784 | .din(woq_wr_queue_reg[15:0]), | |
785 | .dout(reg0[15:0]), | |
786 | .en(woq_reg0_en), | |
787 | .l1clk(l1clk), | |
788 | .siclk(siclk), | |
789 | .soclk(soclk)); | |
790 | ||
791 | assign woq_reg1_en = woq_wr_addr_enq & waddr[3:0] == 4'h1; | |
792 | ||
793 | mcu_woq_ctl_msff_ctl_macro__en_1__width_16 ff_reg1 ( | |
794 | .scan_in(ff_reg1_scanin), | |
795 | .scan_out(ff_reg1_scanout), | |
796 | .din(woq_wr_queue_reg[15:0]), | |
797 | .dout(reg1[15:0]), | |
798 | .en(woq_reg1_en), | |
799 | .l1clk(l1clk), | |
800 | .siclk(siclk), | |
801 | .soclk(soclk)); | |
802 | ||
803 | assign woq_reg2_en = woq_wr_addr_enq & waddr[3:0] == 4'h2; | |
804 | ||
805 | mcu_woq_ctl_msff_ctl_macro__en_1__width_16 ff_reg2 ( | |
806 | .scan_in(ff_reg2_scanin), | |
807 | .scan_out(ff_reg2_scanout), | |
808 | .din(woq_wr_queue_reg[15:0]), | |
809 | .dout(reg2[15:0]), | |
810 | .en(woq_reg2_en), | |
811 | .l1clk(l1clk), | |
812 | .siclk(siclk), | |
813 | .soclk(soclk)); | |
814 | ||
815 | assign woq_reg3_en = woq_wr_addr_enq & waddr[3:0] == 4'h3; | |
816 | ||
817 | mcu_woq_ctl_msff_ctl_macro__en_1__width_16 ff_reg3 ( | |
818 | .scan_in(ff_reg3_scanin), | |
819 | .scan_out(ff_reg3_scanout), | |
820 | .din(woq_wr_queue_reg[15:0]), | |
821 | .dout(reg3[15:0]), | |
822 | .en(woq_reg3_en), | |
823 | .l1clk(l1clk), | |
824 | .siclk(siclk), | |
825 | .soclk(soclk)); | |
826 | ||
827 | assign woq_reg4_en = woq_wr_addr_enq & waddr[3:0] == 4'h4; | |
828 | ||
829 | mcu_woq_ctl_msff_ctl_macro__en_1__width_16 ff_reg4 ( | |
830 | .scan_in(ff_reg4_scanin), | |
831 | .scan_out(ff_reg4_scanout), | |
832 | .din(woq_wr_queue_reg[15:0]), | |
833 | .dout(reg4[15:0]), | |
834 | .en(woq_reg4_en), | |
835 | .l1clk(l1clk), | |
836 | .siclk(siclk), | |
837 | .soclk(soclk)); | |
838 | ||
839 | assign woq_reg5_en = woq_wr_addr_enq & waddr[3:0] == 4'h5; | |
840 | ||
841 | mcu_woq_ctl_msff_ctl_macro__en_1__width_16 ff_reg5 ( | |
842 | .scan_in(ff_reg5_scanin), | |
843 | .scan_out(ff_reg5_scanout), | |
844 | .din(woq_wr_queue_reg[15:0]), | |
845 | .dout(reg5[15:0]), | |
846 | .en(woq_reg5_en), | |
847 | .l1clk(l1clk), | |
848 | .siclk(siclk), | |
849 | .soclk(soclk)); | |
850 | ||
851 | assign woq_reg6_en = woq_wr_addr_enq & waddr[3:0] == 4'h6; | |
852 | ||
853 | mcu_woq_ctl_msff_ctl_macro__en_1__width_16 ff_reg6 ( | |
854 | .scan_in(ff_reg6_scanin), | |
855 | .scan_out(ff_reg6_scanout), | |
856 | .din(woq_wr_queue_reg[15:0]), | |
857 | .dout(reg6[15:0]), | |
858 | .en(woq_reg6_en), | |
859 | .l1clk(l1clk), | |
860 | .siclk(siclk), | |
861 | .soclk(soclk)); | |
862 | ||
863 | assign woq_reg7_en = woq_wr_addr_enq & waddr[3:0] == 4'h7; | |
864 | ||
865 | mcu_woq_ctl_msff_ctl_macro__en_1__width_16 ff_reg7 ( | |
866 | .scan_in(ff_reg7_scanin), | |
867 | .scan_out(ff_reg7_scanout), | |
868 | .din(woq_wr_queue_reg[15:0]), | |
869 | .dout(reg7[15:0]), | |
870 | .en(woq_reg7_en), | |
871 | .l1clk(l1clk), | |
872 | .siclk(siclk), | |
873 | .soclk(soclk)); | |
874 | ||
875 | assign woq_reg8_en = woq_wr_addr_enq & waddr[3:0] == 4'h8; | |
876 | ||
877 | mcu_woq_ctl_msff_ctl_macro__en_1__width_16 ff_reg8 ( | |
878 | .scan_in(ff_reg8_scanin), | |
879 | .scan_out(ff_reg8_scanout), | |
880 | .din(woq_wr_queue_reg[15:0]), | |
881 | .dout(reg8[15:0]), | |
882 | .en(woq_reg8_en), | |
883 | .l1clk(l1clk), | |
884 | .siclk(siclk), | |
885 | .soclk(soclk)); | |
886 | ||
887 | assign woq_reg9_en = woq_wr_addr_enq & waddr[3:0] == 4'h9; | |
888 | ||
889 | mcu_woq_ctl_msff_ctl_macro__en_1__width_16 ff_reg9 ( | |
890 | .scan_in(ff_reg9_scanin), | |
891 | .scan_out(ff_reg9_scanout), | |
892 | .din(woq_wr_queue_reg[15:0]), | |
893 | .dout(reg9[15:0]), | |
894 | .en(woq_reg9_en), | |
895 | .l1clk(l1clk), | |
896 | .siclk(siclk), | |
897 | .soclk(soclk)); | |
898 | ||
899 | assign woq_reg10_en = woq_wr_addr_enq & waddr[3:0] == 4'ha; | |
900 | ||
901 | mcu_woq_ctl_msff_ctl_macro__en_1__width_16 ff_reg10 ( | |
902 | .scan_in(ff_reg10_scanin), | |
903 | .scan_out(ff_reg10_scanout), | |
904 | .din(woq_wr_queue_reg[15:0]), | |
905 | .dout(reg10[15:0]), | |
906 | .en(woq_reg10_en), | |
907 | .l1clk(l1clk), | |
908 | .siclk(siclk), | |
909 | .soclk(soclk)); | |
910 | ||
911 | assign woq_reg11_en = woq_wr_addr_enq & waddr[3:0] == 4'hb; | |
912 | ||
913 | mcu_woq_ctl_msff_ctl_macro__en_1__width_16 ff_reg11 ( | |
914 | .scan_in(ff_reg11_scanin), | |
915 | .scan_out(ff_reg11_scanout), | |
916 | .din(woq_wr_queue_reg[15:0]), | |
917 | .dout(reg11[15:0]), | |
918 | .en(woq_reg11_en), | |
919 | .l1clk(l1clk), | |
920 | .siclk(siclk), | |
921 | .soclk(soclk)); | |
922 | ||
923 | assign woq_reg12_en = woq_wr_addr_enq & waddr[3:0] == 4'hc; | |
924 | ||
925 | mcu_woq_ctl_msff_ctl_macro__en_1__width_16 ff_reg12 ( | |
926 | .scan_in(ff_reg12_scanin), | |
927 | .scan_out(ff_reg12_scanout), | |
928 | .din(woq_wr_queue_reg[15:0]), | |
929 | .dout(reg12[15:0]), | |
930 | .en(woq_reg12_en), | |
931 | .l1clk(l1clk), | |
932 | .siclk(siclk), | |
933 | .soclk(soclk)); | |
934 | ||
935 | assign woq_reg13_en = woq_wr_addr_enq & waddr[3:0] == 4'hd; | |
936 | ||
937 | mcu_woq_ctl_msff_ctl_macro__en_1__width_16 ff_reg13 ( | |
938 | .scan_in(ff_reg13_scanin), | |
939 | .scan_out(ff_reg13_scanout), | |
940 | .din(woq_wr_queue_reg[15:0]), | |
941 | .dout(reg13[15:0]), | |
942 | .en(woq_reg13_en), | |
943 | .l1clk(l1clk), | |
944 | .siclk(siclk), | |
945 | .soclk(soclk)); | |
946 | ||
947 | assign woq_reg14_en = woq_wr_addr_enq & waddr[3:0] == 4'he; | |
948 | ||
949 | mcu_woq_ctl_msff_ctl_macro__en_1__width_16 ff_reg14 ( | |
950 | .scan_in(ff_reg14_scanin), | |
951 | .scan_out(ff_reg14_scanout), | |
952 | .din(woq_wr_queue_reg[15:0]), | |
953 | .dout(reg14[15:0]), | |
954 | .en(woq_reg14_en), | |
955 | .l1clk(l1clk), | |
956 | .siclk(siclk), | |
957 | .soclk(soclk)); | |
958 | ||
959 | assign woq_reg15_en = woq_wr_addr_enq & waddr[3:0] == 4'hf; | |
960 | ||
961 | mcu_woq_ctl_msff_ctl_macro__en_1__width_16 ff_reg15 ( | |
962 | .scan_in(ff_reg15_scanin), | |
963 | .scan_out(ff_reg15_scanout), | |
964 | .din(woq_wr_queue_reg[15:0]), | |
965 | .dout(reg15[15:0]), | |
966 | .en(woq_reg15_en), | |
967 | .l1clk(l1clk), | |
968 | .siclk(siclk), | |
969 | .soclk(soclk)); | |
970 | ||
971 | // Outstanding write request pointer - points to first transaction that hasn't completed | |
972 | assign woq_owr_ptr_in[4:0] = woq_wr_error_mode ? waddr[4:0] : woq_owr_ptr[4:0] + {3'h0,drif_woq_free[1:0]}; | |
973 | mcu_woq_ctl_msff_ctl_macro__width_5 ff_owr_ptr ( | |
974 | .scan_in(ff_owr_ptr_scanin), | |
975 | .scan_out(ff_owr_ptr_scanout), | |
976 | .din(woq_owr_ptr_in[4:0]), | |
977 | .dout(woq_owr_ptr[4:0]), | |
978 | .l1clk(l1clk), | |
979 | .siclk(siclk), | |
980 | .soclk(soclk)); | |
981 | ||
982 | assign woq_owr_empty = (woq_owr_ptr[4:0] == waddr[4:0]); | |
983 | ||
984 | // For debug bus: number of writes completing | |
985 | assign woq_wr_req_out_in[1:0] = drif_woq_free[1:0]; | |
986 | mcu_woq_ctl_msff_ctl_macro__width_2 ff_wr_req_out ( | |
987 | .scan_in(ff_wr_req_out_scanin), | |
988 | .scan_out(ff_wr_req_out_scanout), | |
989 | .din(woq_wr_req_out_in[1:0]), | |
990 | .dout(woq_wr_req_out[1:0]), | |
991 | .l1clk(l1clk), | |
992 | .siclk(siclk), | |
993 | .soclk(soclk)); | |
994 | ||
995 | assign woq_owr_free[1:0] = woq_wr_error_mode ? 2'h0 : {drif_woq_free[1],|drif_woq_free[1:0]}; | |
996 | ||
997 | ||
998 | // | |
999 | assign {woq_owr_ent0[15:0], woq_owr_ent1[15:0]} = | |
1000 | {32{woq_owr_ptr[3:0] == 4'h0}} & {reg0[15:0], reg1[15:0]} | | |
1001 | {32{woq_owr_ptr[3:0] == 4'h1}} & {reg1[15:0], reg2[15:0]} | | |
1002 | {32{woq_owr_ptr[3:0] == 4'h2}} & {reg2[15:0], reg3[15:0]} | | |
1003 | {32{woq_owr_ptr[3:0] == 4'h3}} & {reg3[15:0], reg4[15:0]} | | |
1004 | {32{woq_owr_ptr[3:0] == 4'h4}} & {reg4[15:0], reg5[15:0]} | | |
1005 | {32{woq_owr_ptr[3:0] == 4'h5}} & {reg5[15:0], reg6[15:0]} | | |
1006 | {32{woq_owr_ptr[3:0] == 4'h6}} & {reg6[15:0], reg7[15:0]} | | |
1007 | {32{woq_owr_ptr[3:0] == 4'h7}} & {reg7[15:0], reg8[15:0]} | | |
1008 | {32{woq_owr_ptr[3:0] == 4'h8}} & {reg8[15:0], reg9[15:0]} | | |
1009 | {32{woq_owr_ptr[3:0] == 4'h9}} & {reg9[15:0], reg10[15:0]} | | |
1010 | {32{woq_owr_ptr[3:0] == 4'ha}} & {reg10[15:0], reg11[15:0]} | | |
1011 | {32{woq_owr_ptr[3:0] == 4'hb}} & {reg11[15:0], reg12[15:0]} | | |
1012 | {32{woq_owr_ptr[3:0] == 4'hc}} & {reg12[15:0], reg13[15:0]} | | |
1013 | {32{woq_owr_ptr[3:0] == 4'hd}} & {reg13[15:0], reg14[15:0]} | | |
1014 | {32{woq_owr_ptr[3:0] == 4'he}} & {reg14[15:0], reg15[15:0]} | | |
1015 | {32{woq_owr_ptr[3:0] == 4'hf}} & {reg15[15:0], reg0[15:0]}; | |
1016 | ||
1017 | // Free write data queue entries in l2if's | |
1018 | assign woq_owr_ent0_wdq_dec[7:0] = {woq_owr_ent0[14:12] == 3'h7, woq_owr_ent0[14:12] == 3'h6, | |
1019 | woq_owr_ent0[14:12] == 3'h5, woq_owr_ent0[14:12] == 3'h4, | |
1020 | woq_owr_ent0[14:12] == 3'h3, woq_owr_ent0[14:12] == 3'h2, | |
1021 | woq_owr_ent0[14:12] == 3'h1, woq_owr_ent0[14:12] == 3'h0}; | |
1022 | assign woq_owr_ent1_wdq_dec[7:0] = {woq_owr_ent1[14:12] == 3'h7, woq_owr_ent1[14:12] == 3'h6, | |
1023 | woq_owr_ent1[14:12] == 3'h5, woq_owr_ent1[14:12] == 3'h4, | |
1024 | woq_owr_ent1[14:12] == 3'h3, woq_owr_ent1[14:12] == 3'h2, | |
1025 | woq_owr_ent1[14:12] == 3'h1, woq_owr_ent1[14:12] == 3'h0}; | |
1026 | ||
1027 | assign woq0_wdq_free[7:0] = {8{~woq_owr_ent0[15] & woq_owr_free[0] & ~woq_wr_error_mode}} & woq_owr_ent0_wdq_dec[7:0] | | |
1028 | {8{~woq_owr_ent1[15] & woq_owr_free[1] & ~woq_wr_error_mode}} & woq_owr_ent1_wdq_dec[7:0] | | |
1029 | {8{~woq_err_xact[15] & fbdic_clear_wrq_ent & woq_err_st_wait_clear}} & woq_err_wdq_dec[7:0]; | |
1030 | assign woq1_wdq_free[7:0] = {8{ woq_owr_ent0[15] & woq_owr_free[0] & ~woq_wr_error_mode}} & woq_owr_ent0_wdq_dec[7:0] | | |
1031 | {8{ woq_owr_ent1[15] & woq_owr_free[1] & ~woq_wr_error_mode}} & woq_owr_ent1_wdq_dec[7:0] | | |
1032 | {8{ woq_err_xact[15] & fbdic_clear_wrq_ent & woq_err_st_wait_clear}} & woq_err_wdq_dec[7:0]; | |
1033 | ||
1034 | mcu_woq_ctl_msff_ctl_macro ff_woq_free_d1 ( | |
1035 | .scan_in(ff_woq_free_d1_scanin), | |
1036 | .scan_out(ff_woq_free_d1_scanout), | |
1037 | .din(drif_woq_free[0]), | |
1038 | .dout(drif_woq_free_d1[0]), | |
1039 | .l1clk(l1clk), | |
1040 | .siclk(siclk), | |
1041 | .soclk(soclk)); | |
1042 | ||
1043 | assign woq0_wdq_free_accum_in[7:0] = woq0_wdq_free_accum[7:0] | woq0_wdq_free[7:0]; | |
1044 | assign woq1_wdq_free_accum_in[7:0] = woq1_wdq_free_accum[7:0] | woq1_wdq_free[7:0]; | |
1045 | ||
1046 | assign woq_wrq_wdq_entry_clr = fbdic_clear_wrq_ent | fbdic_scr_frame_req_d4 | fbdic_chnl_reset_error_mode | | |
1047 | ~fbdic_l0_state; | |
1048 | ||
1049 | mcu_woq_ctl_msff_ctl_macro__clr_1__width_16 ff_wdq_free_accum ( | |
1050 | .scan_in(ff_wdq_free_accum_scanin), | |
1051 | .scan_out(ff_wdq_free_accum_scanout), | |
1052 | .din({woq0_wdq_free_accum_in[7:0],woq1_wdq_free_accum_in[7:0]}), | |
1053 | .dout({woq0_wdq_free_accum[7:0],woq1_wdq_free_accum[7:0]}), | |
1054 | .clr(woq_wrq_wdq_entry_clr), | |
1055 | .l1clk(l1clk), | |
1056 | .siclk(siclk), | |
1057 | .soclk(soclk)); | |
1058 | ||
1059 | assign woq0_wdq_entry_free_in[7:0] = fbdic_clear_wrq_ent | fbdic_chnl_reset_error_mode ? | |
1060 | woq0_wdq_free_accum_in[7:0] : 8'h0; | |
1061 | assign woq1_wdq_entry_free_in[7:0] = fbdic_clear_wrq_ent | fbdic_chnl_reset_error_mode ? | |
1062 | woq1_wdq_free_accum_in[7:0] : 8'h0; | |
1063 | ||
1064 | mcu_woq_ctl_msff_ctl_macro__width_16 ff_wdq_entry_free ( | |
1065 | .scan_in(ff_wdq_entry_free_scanin), | |
1066 | .scan_out(ff_wdq_entry_free_scanout), | |
1067 | .din({woq0_wdq_entry_free_in[7:0],woq1_wdq_entry_free_in[7:0]}), | |
1068 | .dout({woq0_wdq_entry_free[7:0],woq1_wdq_entry_free[7:0]}), | |
1069 | .l1clk(l1clk), | |
1070 | .siclk(siclk), | |
1071 | .soclk(soclk)); | |
1072 | ||
1073 | // free write address queue entries in drq's | |
1074 | assign woq_owr_ent0_wrq_dec[7:0] = {woq_owr_ent0[11:9] == 3'h7, woq_owr_ent0[11:9] == 3'h6, | |
1075 | woq_owr_ent0[11:9] == 3'h5, woq_owr_ent0[11:9] == 3'h4, | |
1076 | woq_owr_ent0[11:9] == 3'h3, woq_owr_ent0[11:9] == 3'h2, | |
1077 | woq_owr_ent0[11:9] == 3'h1, woq_owr_ent0[11:9] == 3'h0}; | |
1078 | assign woq_owr_ent1_wrq_dec[7:0] = {woq_owr_ent1[11:9] == 3'h7, woq_owr_ent1[11:9] == 3'h6, | |
1079 | woq_owr_ent1[11:9] == 3'h5, woq_owr_ent1[11:9] == 3'h4, | |
1080 | woq_owr_ent1[11:9] == 3'h3, woq_owr_ent1[11:9] == 3'h2, | |
1081 | woq_owr_ent1[11:9] == 3'h1, woq_owr_ent1[11:9] == 3'h0}; | |
1082 | ||
1083 | assign woq0_wrq_clear[7:0] = {8{~woq_owr_ent0[15] & woq_owr_free[0] & ~woq_wr_error_mode}} & woq_owr_ent0_wrq_dec[7:0] | | |
1084 | {8{~woq_owr_ent1[15] & woq_owr_free[1] & ~woq_wr_error_mode}} & woq_owr_ent1_wrq_dec[7:0] | | |
1085 | {8{~woq_err_xact[15] & fbdic_clear_wrq_ent & woq_err_st_wait_clear}} & woq_err_wrq_dec[7:0]; | |
1086 | assign woq1_wrq_clear[7:0] = {8{ woq_owr_ent0[15] & woq_owr_free[0] & ~woq_wr_error_mode}} & woq_owr_ent0_wrq_dec[7:0] | | |
1087 | {8{ woq_owr_ent1[15] & woq_owr_free[1] & ~woq_wr_error_mode}} & woq_owr_ent1_wrq_dec[7:0] | | |
1088 | {8{ woq_err_xact[15] & fbdic_clear_wrq_ent & woq_err_st_wait_clear}} & woq_err_wrq_dec[7:0]; | |
1089 | ||
1090 | assign woq0_wrq_clear_accum_in[7:0] = woq0_wrq_clear_accum[7:0] | woq0_wrq_clear[7:0]; | |
1091 | assign woq1_wrq_clear_accum_in[7:0] = woq1_wrq_clear_accum[7:0] | woq1_wrq_clear[7:0]; | |
1092 | ||
1093 | mcu_woq_ctl_msff_ctl_macro__clr_1__width_16 ff_wrq_clear_accum ( | |
1094 | .scan_in(ff_wrq_clear_accum_scanin), | |
1095 | .scan_out(ff_wrq_clear_accum_scanout), | |
1096 | .din({woq0_wrq_clear_accum_in[7:0],woq1_wrq_clear_accum_in[7:0]}), | |
1097 | .dout({woq0_wrq_clear_accum[7:0],woq1_wrq_clear_accum[7:0]}), | |
1098 | .clr(woq_wrq_wdq_entry_clr), | |
1099 | .l1clk(l1clk), | |
1100 | .siclk(siclk), | |
1101 | .soclk(soclk)); | |
1102 | ||
1103 | assign woq0_wrq_clear_ent[7:0] = fbdic_clear_wrq_ent | fbdic_chnl_reset_error_mode ? | |
1104 | woq0_wrq_clear_accum_in[7:0] : 8'h0; | |
1105 | assign woq1_wrq_clear_ent[7:0] = fbdic_clear_wrq_ent | fbdic_chnl_reset_error_mode ? | |
1106 | woq1_wrq_clear_accum_in[7:0] : 8'h0; | |
1107 | ||
1108 | // Decrement signals for power down mode counters | |
1109 | assign woq_entry0_pd_mode_decr[15:0] = {woq_entry0[6:3] == 4'hf, woq_entry0[6:3] == 4'he, | |
1110 | woq_entry0[6:3] == 4'hd, woq_entry0[6:3] == 4'hc, | |
1111 | woq_entry0[6:3] == 4'hb, woq_entry0[6:3] == 4'ha, | |
1112 | woq_entry0[6:3] == 4'h9, woq_entry0[6:3] == 4'h8, | |
1113 | woq_entry0[6:3] == 4'h7, woq_entry0[6:3] == 4'h6, | |
1114 | woq_entry0[6:3] == 4'h5, woq_entry0[6:3] == 4'h4, | |
1115 | woq_entry0[6:3] == 4'h3, woq_entry0[6:3] == 4'h2, | |
1116 | woq_entry0[6:3] == 4'h1, woq_entry0[6:3] == 4'h0}; | |
1117 | assign woq_entry1_pd_mode_decr[15:0] = {woq_entry1[6:3] == 4'hf, woq_entry1[6:3] == 4'he, | |
1118 | woq_entry1[6:3] == 4'hd, woq_entry1[6:3] == 4'hc, | |
1119 | woq_entry1[6:3] == 4'hb, woq_entry1[6:3] == 4'ha, | |
1120 | woq_entry1[6:3] == 4'h9, woq_entry1[6:3] == 4'h8, | |
1121 | woq_entry1[6:3] == 4'h7, woq_entry1[6:3] == 4'h6, | |
1122 | woq_entry1[6:3] == 4'h5, woq_entry1[6:3] == 4'h4, | |
1123 | woq_entry1[6:3] == 4'h3, woq_entry1[6:3] == 4'h2, | |
1124 | woq_entry1[6:3] == 4'h1, woq_entry1[6:3] == 4'h0}; | |
1125 | assign woq_pd_mode_wr_decr_in[15:0] = {16{drif_wr_entry_picked[0] & ~woq_wr_error_mode}} & woq_entry0_pd_mode_decr[15:0] | | |
1126 | {16{drif_wr_entry_picked[1]}} & woq_entry0_pd_mode_decr[15:0] | | |
1127 | {16{drif_wr_entry_picked[2]}} & woq_entry1_pd_mode_decr[15:0]; | |
1128 | ||
1129 | mcu_woq_ctl_msff_ctl_macro__width_16 ff_pd_mode_wr_decr ( | |
1130 | .scan_in(ff_pd_mode_wr_decr_scanin), | |
1131 | .scan_out(ff_pd_mode_wr_decr_scanout), | |
1132 | .din(woq_pd_mode_wr_decr_in[15:0]), | |
1133 | .dout(woq_pd_mode_wr_decr[15:0]), | |
1134 | .l1clk(l1clk), | |
1135 | .siclk(siclk), | |
1136 | .soclk(soclk)); | |
1137 | ||
1138 | // set error mode to resend writes after channel error | |
1139 | assign woq_wr_error_mode_in = fbdic_scr_frame_req_d4 ? 1'b1 : woq_err_fifo_empty ? 1'b0 : woq_wr_error_mode; | |
1140 | ||
1141 | mcu_woq_ctl_msff_ctl_macro ff_wr_error_mode ( | |
1142 | .scan_in(ff_wr_error_mode_scanin), | |
1143 | .scan_out(ff_wr_error_mode_scanout), | |
1144 | .din(woq_wr_error_mode_in), | |
1145 | .dout(woq_wr_error_mode), | |
1146 | .l1clk(l1clk), | |
1147 | .siclk(siclk), | |
1148 | .soclk(soclk)); | |
1149 | ||
1150 | // Error request pointer - points to first write transaction whose completion hasn't been verified. | |
1151 | // If an southbound channel error occurs, start reissuing writes here | |
1152 | assign woq_error_ptr_in[4:0] = fbdic_clear_wrq_ent & ~woq_wr_error_mode ? woq_owr_ptr[4:0] : | |
1153 | woq_err_st_wait_clear & fbdic_clear_wrq_ent ? woq_error_ptr[4:0] + 5'h1 : woq_error_ptr[4:0]; | |
1154 | mcu_woq_ctl_msff_ctl_macro__width_5 ff_error_ptr ( | |
1155 | .scan_in(ff_error_ptr_scanin), | |
1156 | .scan_out(ff_error_ptr_scanout), | |
1157 | .din(woq_error_ptr_in[4:0]), | |
1158 | .dout(woq_error_ptr[4:0]), | |
1159 | .l1clk(l1clk), | |
1160 | .siclk(siclk), | |
1161 | .soclk(soclk)); | |
1162 | ||
1163 | assign woq_err_xact[15:0] = {16{woq_error_ptr[3:0] == 4'h0}} & reg0[15:0] | | |
1164 | {16{woq_error_ptr[3:0] == 4'h1}} & reg1[15:0] | | |
1165 | {16{woq_error_ptr[3:0] == 4'h2}} & reg2[15:0] | | |
1166 | {16{woq_error_ptr[3:0] == 4'h3}} & reg3[15:0] | | |
1167 | {16{woq_error_ptr[3:0] == 4'h4}} & reg4[15:0] | | |
1168 | {16{woq_error_ptr[3:0] == 4'h5}} & reg5[15:0] | | |
1169 | {16{woq_error_ptr[3:0] == 4'h6}} & reg6[15:0] | | |
1170 | {16{woq_error_ptr[3:0] == 4'h7}} & reg7[15:0] | | |
1171 | {16{woq_error_ptr[3:0] == 4'h8}} & reg8[15:0] | | |
1172 | {16{woq_error_ptr[3:0] == 4'h9}} & reg9[15:0] | | |
1173 | {16{woq_error_ptr[3:0] == 4'ha}} & reg10[15:0] | | |
1174 | {16{woq_error_ptr[3:0] == 4'hb}} & reg11[15:0] | | |
1175 | {16{woq_error_ptr[3:0] == 4'hc}} & reg12[15:0] | | |
1176 | {16{woq_error_ptr[3:0] == 4'hd}} & reg13[15:0] | | |
1177 | {16{woq_error_ptr[3:0] == 4'he}} & reg14[15:0] | | |
1178 | {16{woq_error_ptr[3:0] == 4'hf}} & reg15[15:0]; | |
1179 | ||
1180 | assign woq_err_fifo_empty = woq_error_ptr[4:0] == waddr[4:0]; | |
1181 | ||
1182 | assign woq_err_wdq_dec[7:0] = { woq_err_xact[14:12] == 3'h7, woq_err_xact[14:12] == 3'h6, | |
1183 | woq_err_xact[14:12] == 3'h5, woq_err_xact[14:12] == 3'h4, | |
1184 | woq_err_xact[14:12] == 3'h3, woq_err_xact[14:12] == 3'h2, | |
1185 | woq_err_xact[14:12] == 3'h1, woq_err_xact[14:12] == 3'h0}; | |
1186 | ||
1187 | assign woq_err_wrq_dec[7:0] = { woq_err_xact[11:9] == 3'h7, woq_err_xact[11:9] == 3'h6, | |
1188 | woq_err_xact[11:9] == 3'h5, woq_err_xact[11:9] == 3'h4, | |
1189 | woq_err_xact[11:9] == 3'h3, woq_err_xact[11:9] == 3'h2, | |
1190 | woq_err_xact[11:9] == 3'h1, woq_err_xact[11:9] == 3'h0}; | |
1191 | ||
1192 | // 0in one_hot -var woq_wr_err_state[3:0] | |
1193 | assign woq_wr_err_state[3:0] = {woq_err_st_wait_clear,woq_err_st_wait_free,woq_err_st_wr_req,woq_err_st_data}; | |
1194 | ||
1195 | assign inv_woq_err_st_data_next = ~woq_err_st_data_next; | |
1196 | assign woq_err_st_data = ~inv_woq_err_st_data; | |
1197 | mcu_woq_ctl_msff_ctl_macro__width_4 ff_wr_err_state ( | |
1198 | .scan_in(ff_wr_err_state_scanin), | |
1199 | .scan_out(ff_wr_err_state_scanout), | |
1200 | .din({inv_woq_err_st_data_next, woq_err_st_wr_req_in, woq_err_st_wait_free_next, woq_err_st_wait_clear_in}), | |
1201 | .dout({inv_woq_err_st_data, woq_err_st_wr_req, woq_err_st_wait_free, woq_err_st_wait_clear}), | |
1202 | .l1clk(l1clk), | |
1203 | .siclk(siclk), | |
1204 | .soclk(soclk)); | |
1205 | ||
1206 | assign woq_wr_retry_error = woq_err_st_wr_req & ~drif_wr_entry_picked[0] & | |
1207 | (fbdic_scr_frame_req_d4 | ~fbdic_l0_state); | |
1208 | ||
1209 | assign woq_err_st_data_next = woq_err_st_data_in | woq_wr_retry_error; | |
1210 | assign woq_err_st_wait_free_next = woq_err_st_wait_free_in & ~woq_wr_retry_error; | |
1211 | ||
1212 | always @(woq_wr_error_mode or woq_last_wr_data or drif_wr_entry_picked or drif_woq_free or | |
1213 | woq_err_st_data or woq_err_st_wr_req or woq_err_st_wait_free or woq_err_st_wait_clear or | |
1214 | fbdic_clear_wrq_ent or fbdic_error_mode or fbdic_scr_frame_req_d4 or fbdic_l0_state) | |
1215 | begin | |
1216 | woq_err_st_data_in = 1'b0; | |
1217 | woq_err_st_wr_req_in = 1'b0; | |
1218 | woq_err_st_wait_free_in = 1'b0; | |
1219 | woq_err_st_wait_clear_in = 1'b0; | |
1220 | ||
1221 | case (1'b1) | |
1222 | woq_err_st_data: begin | |
1223 | if (woq_wr_error_mode & woq_last_wr_data) | |
1224 | woq_err_st_wr_req_in = 1'b1; | |
1225 | else | |
1226 | woq_err_st_data_in = 1'b1; | |
1227 | end | |
1228 | ||
1229 | woq_err_st_wr_req: begin | |
1230 | if (drif_wr_entry_picked[0] | fbdic_scr_frame_req_d4 | ~fbdic_l0_state) | |
1231 | woq_err_st_wait_free_in = 1'b1; | |
1232 | else | |
1233 | woq_err_st_wr_req_in = 1'b1; | |
1234 | end | |
1235 | ||
1236 | woq_err_st_wait_free: begin | |
1237 | if (drif_woq_free[0]) | |
1238 | woq_err_st_wait_clear_in = 1'b1; | |
1239 | else | |
1240 | woq_err_st_wait_free_in = 1'b1; | |
1241 | end | |
1242 | ||
1243 | woq_err_st_wait_clear: begin | |
1244 | if (fbdic_clear_wrq_ent | fbdic_error_mode) | |
1245 | woq_err_st_data_in = 1'b1; | |
1246 | else | |
1247 | woq_err_st_wait_clear_in = 1'b1; | |
1248 | end | |
1249 | ||
1250 | default: ; | |
1251 | endcase | |
1252 | end | |
1253 | ||
1254 | assign woq_err_pdm_wr[15:0] = {woq_err_xact[6:3] == 4'hf, woq_err_xact[6:3] == 4'he, | |
1255 | woq_err_xact[6:3] == 4'hd, woq_err_xact[6:3] == 4'hc, | |
1256 | woq_err_xact[6:3] == 4'hb, woq_err_xact[6:3] == 4'ha, | |
1257 | woq_err_xact[6:3] == 4'h9, woq_err_xact[6:3] == 4'h8, | |
1258 | woq_err_xact[6:3] == 4'h7, woq_err_xact[6:3] == 4'h6, | |
1259 | woq_err_xact[6:3] == 4'h5, woq_err_xact[6:3] == 4'h4, | |
1260 | woq_err_xact[6:3] == 4'h3, woq_err_xact[6:3] == 4'h2, | |
1261 | woq_err_xact[6:3] == 4'h1, woq_err_xact[6:3] == 4'h0}; | |
1262 | ||
1263 | assign woq_err_pdm_wr_incr[15:0] = {16{woq_err_st_data & woq_last_wr_data & woq_wr_error_mode}} & woq_err_pdm_wr[15:0]; | |
1264 | assign woq_err_pdm_wr_decr[15:0] = {16{woq_err_st_wr_req & | |
1265 | (drif_wr_entry_picked[0] | fbdic_scr_frame_req_d4 | ~fbdic_l0_state)}} & | |
1266 | woq_err_pdm_wr[15:0]; | |
1267 | ||
1268 | // Counters for outstanding write data to each dimm, limit to 7 for dual-channel mode | |
1269 | // and 3 for single-channel mode | |
1270 | assign woq_dimm0_wrcnt_incr = woq_wr_addr_enq & woq_wr_queue_reg[5:3] == 3'h0; | |
1271 | assign woq_dimm0_wrcnt_decr = (|drif_wr_entry_picked[1:0]) & woq_entry0[5:3] == 3'h0 | | |
1272 | drif_wr_entry_picked[2] & woq_entry1[5:3] == 3'h0; | |
1273 | assign woq_dimm0_wrcnt_in[2:0] = woq_dimm0_wrcnt_incr & ~woq_dimm0_wrcnt_decr ? woq_dimm0_wrcnt[2:0] + 3'h1 : | |
1274 | ~woq_dimm0_wrcnt_incr & woq_dimm0_wrcnt_decr ? woq_dimm0_wrcnt[2:0] - 3'h1 : | |
1275 | woq_dimm0_wrcnt[2:0]; | |
1276 | ||
1277 | // 0in overflow -var woq_dimm0_wrcnt[2:0] -active ~woq_wr_error_mode | |
1278 | // 0in underflow -var woq_dimm0_wrcnt[2:0] -active ~woq_wr_error_mode | |
1279 | mcu_woq_ctl_msff_ctl_macro__clr_1__width_3 ff_dimm0_wrcnt ( | |
1280 | .scan_in(ff_dimm0_wrcnt_scanin), | |
1281 | .scan_out(ff_dimm0_wrcnt_scanout), | |
1282 | .din(woq_dimm0_wrcnt_in[2:0]), | |
1283 | .dout(woq_dimm0_wrcnt[2:0]), | |
1284 | .clr(woq_wr_error_mode), | |
1285 | .l1clk(l1clk), | |
1286 | .siclk(siclk), | |
1287 | .soclk(soclk)); | |
1288 | ||
1289 | assign woq_dimm0_stall = drif_single_channel_mode ? &woq_dimm0_wrcnt[1:0] : &woq_dimm0_wrcnt[2:0]; | |
1290 | ||
1291 | // | |
1292 | assign woq_dimm1_wrcnt_incr = woq_wr_addr_enq & woq_wr_queue_reg[5:3] == 3'h1; | |
1293 | assign woq_dimm1_wrcnt_decr = (|drif_wr_entry_picked[1:0]) & woq_entry0[5:3] == 3'h1 | | |
1294 | drif_wr_entry_picked[2] & woq_entry1[5:3] == 3'h1; | |
1295 | assign woq_dimm1_wrcnt_in[2:0] = woq_dimm1_wrcnt_incr & ~woq_dimm1_wrcnt_decr ? woq_dimm1_wrcnt[2:0] + 3'h1 : | |
1296 | ~woq_dimm1_wrcnt_incr & woq_dimm1_wrcnt_decr ? woq_dimm1_wrcnt[2:0] - 3'h1 : | |
1297 | woq_dimm1_wrcnt[2:0]; | |
1298 | ||
1299 | // 0in overflow -var woq_dimm1_wrcnt[2:0] -active ~woq_wr_error_mode | |
1300 | // 0in underflow -var woq_dimm1_wrcnt[2:0] -active ~woq_wr_error_mode | |
1301 | mcu_woq_ctl_msff_ctl_macro__clr_1__width_3 ff_dimm1_wrcnt ( | |
1302 | .scan_in(ff_dimm1_wrcnt_scanin), | |
1303 | .scan_out(ff_dimm1_wrcnt_scanout), | |
1304 | .din(woq_dimm1_wrcnt_in[2:0]), | |
1305 | .dout(woq_dimm1_wrcnt[2:0]), | |
1306 | .clr(woq_wr_error_mode), | |
1307 | .l1clk(l1clk), | |
1308 | .siclk(siclk), | |
1309 | .soclk(soclk)); | |
1310 | ||
1311 | assign woq_dimm1_stall = drif_single_channel_mode ? &woq_dimm1_wrcnt[1:0] : &woq_dimm1_wrcnt[2:0]; | |
1312 | ||
1313 | // | |
1314 | assign woq_dimm2_wrcnt_incr = woq_wr_addr_enq & woq_wr_queue_reg[5:3] == 3'h2; | |
1315 | assign woq_dimm2_wrcnt_decr = (|drif_wr_entry_picked[1:0]) & woq_entry0[5:3] == 3'h2 | | |
1316 | drif_wr_entry_picked[2] & woq_entry1[5:3] == 3'h2; | |
1317 | assign woq_dimm2_wrcnt_in[2:0] = woq_dimm2_wrcnt_incr & ~woq_dimm2_wrcnt_decr ? woq_dimm2_wrcnt[2:0] + 3'h1 : | |
1318 | ~woq_dimm2_wrcnt_incr & woq_dimm2_wrcnt_decr ? woq_dimm2_wrcnt[2:0] - 3'h1 : | |
1319 | woq_dimm2_wrcnt[2:0]; | |
1320 | ||
1321 | // 0in overflow -var woq_dimm2_wrcnt[2:0] -active ~woq_wr_error_mode | |
1322 | // 0in underflow -var woq_dimm2_wrcnt[2:0] -active ~woq_wr_error_mode | |
1323 | mcu_woq_ctl_msff_ctl_macro__clr_1__width_3 ff_dimm2_wrcnt ( | |
1324 | .scan_in(ff_dimm2_wrcnt_scanin), | |
1325 | .scan_out(ff_dimm2_wrcnt_scanout), | |
1326 | .din(woq_dimm2_wrcnt_in[2:0]), | |
1327 | .dout(woq_dimm2_wrcnt[2:0]), | |
1328 | .clr(woq_wr_error_mode), | |
1329 | .l1clk(l1clk), | |
1330 | .siclk(siclk), | |
1331 | .soclk(soclk)); | |
1332 | ||
1333 | assign woq_dimm2_stall = drif_single_channel_mode ? &woq_dimm2_wrcnt[1:0] : &woq_dimm2_wrcnt[2:0]; | |
1334 | ||
1335 | // | |
1336 | assign woq_dimm3_wrcnt_incr = woq_wr_addr_enq & woq_wr_queue_reg[5:3] == 3'h3; | |
1337 | assign woq_dimm3_wrcnt_decr = (|drif_wr_entry_picked[1:0]) & woq_entry0[5:3] == 3'h3 | | |
1338 | drif_wr_entry_picked[2] & woq_entry1[5:3] == 3'h3; | |
1339 | assign woq_dimm3_wrcnt_in[2:0] = woq_dimm3_wrcnt_incr & ~woq_dimm3_wrcnt_decr ? woq_dimm3_wrcnt[2:0] + 3'h1 : | |
1340 | ~woq_dimm3_wrcnt_incr & woq_dimm3_wrcnt_decr ? woq_dimm3_wrcnt[2:0] - 3'h1 : | |
1341 | woq_dimm3_wrcnt[2:0]; | |
1342 | ||
1343 | // 0in overflow -var woq_dimm3_wrcnt[2:0] -active ~woq_wr_error_mode | |
1344 | // 0in underflow -var woq_dimm3_wrcnt[2:0] -active ~woq_wr_error_mode | |
1345 | mcu_woq_ctl_msff_ctl_macro__clr_1__width_3 ff_dimm3_wrcnt ( | |
1346 | .scan_in(ff_dimm3_wrcnt_scanin), | |
1347 | .scan_out(ff_dimm3_wrcnt_scanout), | |
1348 | .din(woq_dimm3_wrcnt_in[2:0]), | |
1349 | .dout(woq_dimm3_wrcnt[2:0]), | |
1350 | .clr(woq_wr_error_mode), | |
1351 | .l1clk(l1clk), | |
1352 | .siclk(siclk), | |
1353 | .soclk(soclk)); | |
1354 | ||
1355 | assign woq_dimm3_stall = drif_single_channel_mode ? &woq_dimm3_wrcnt[1:0] : &woq_dimm3_wrcnt[2:0]; | |
1356 | ||
1357 | // | |
1358 | assign woq_dimm4_wrcnt_incr = woq_wr_addr_enq & woq_wr_queue_reg[5:3] == 3'h4; | |
1359 | assign woq_dimm4_wrcnt_decr = (|drif_wr_entry_picked[1:0]) & woq_entry0[5:3] == 3'h4 | | |
1360 | drif_wr_entry_picked[2] & woq_entry1[5:3] == 3'h4; | |
1361 | assign woq_dimm4_wrcnt_in[2:0] = woq_dimm4_wrcnt_incr & ~woq_dimm4_wrcnt_decr ? woq_dimm4_wrcnt[2:0] + 3'h1 : | |
1362 | ~woq_dimm4_wrcnt_incr & woq_dimm4_wrcnt_decr ? woq_dimm4_wrcnt[2:0] - 3'h1 : | |
1363 | woq_dimm4_wrcnt[2:0]; | |
1364 | ||
1365 | // 0in overflow -var woq_dimm4_wrcnt[2:0] -active ~woq_wr_error_mode | |
1366 | // 0in underflow -var woq_dimm4_wrcnt[2:0] -active ~woq_wr_error_mode | |
1367 | mcu_woq_ctl_msff_ctl_macro__clr_1__width_3 ff_dimm4_wrcnt ( | |
1368 | .scan_in(ff_dimm4_wrcnt_scanin), | |
1369 | .scan_out(ff_dimm4_wrcnt_scanout), | |
1370 | .din(woq_dimm4_wrcnt_in[2:0]), | |
1371 | .dout(woq_dimm4_wrcnt[2:0]), | |
1372 | .clr(woq_wr_error_mode), | |
1373 | .l1clk(l1clk), | |
1374 | .siclk(siclk), | |
1375 | .soclk(soclk)); | |
1376 | ||
1377 | assign woq_dimm4_stall = drif_single_channel_mode ? &woq_dimm4_wrcnt[1:0] : &woq_dimm4_wrcnt[2:0]; | |
1378 | ||
1379 | // | |
1380 | assign woq_dimm5_wrcnt_incr = woq_wr_addr_enq & woq_wr_queue_reg[5:3] == 3'h5; | |
1381 | assign woq_dimm5_wrcnt_decr = (|drif_wr_entry_picked[1:0]) & woq_entry0[5:3] == 3'h5 | | |
1382 | drif_wr_entry_picked[2] & woq_entry1[5:3] == 3'h5; | |
1383 | assign woq_dimm5_wrcnt_in[2:0] = woq_dimm5_wrcnt_incr & ~woq_dimm5_wrcnt_decr ? woq_dimm5_wrcnt[2:0] + 3'h1 : | |
1384 | ~woq_dimm5_wrcnt_incr & woq_dimm5_wrcnt_decr ? woq_dimm5_wrcnt[2:0] - 3'h1 : | |
1385 | woq_dimm5_wrcnt[2:0]; | |
1386 | ||
1387 | // 0in overflow -var woq_dimm5_wrcnt[2:0] -active ~woq_wr_error_mode | |
1388 | // 0in underflow -var woq_dimm5_wrcnt[2:0] -active ~woq_wr_error_mode | |
1389 | mcu_woq_ctl_msff_ctl_macro__clr_1__width_3 ff_dimm5_wrcnt ( | |
1390 | .scan_in(ff_dimm5_wrcnt_scanin), | |
1391 | .scan_out(ff_dimm5_wrcnt_scanout), | |
1392 | .din(woq_dimm5_wrcnt_in[2:0]), | |
1393 | .dout(woq_dimm5_wrcnt[2:0]), | |
1394 | .clr(woq_wr_error_mode), | |
1395 | .l1clk(l1clk), | |
1396 | .siclk(siclk), | |
1397 | .soclk(soclk)); | |
1398 | ||
1399 | assign woq_dimm5_stall = drif_single_channel_mode ? &woq_dimm5_wrcnt[1:0] : &woq_dimm5_wrcnt[2:0]; | |
1400 | ||
1401 | // | |
1402 | assign woq_dimm6_wrcnt_incr = woq_wr_addr_enq & woq_wr_queue_reg[5:3] == 3'h6; | |
1403 | assign woq_dimm6_wrcnt_decr = (|drif_wr_entry_picked[1:0]) & woq_entry0[5:3] == 3'h6 | | |
1404 | drif_wr_entry_picked[2] & woq_entry1[5:3] == 3'h6; | |
1405 | assign woq_dimm6_wrcnt_in[2:0] = woq_dimm6_wrcnt_incr & ~woq_dimm6_wrcnt_decr ? woq_dimm6_wrcnt[2:0] + 3'h1 : | |
1406 | ~woq_dimm6_wrcnt_incr & woq_dimm6_wrcnt_decr ? woq_dimm6_wrcnt[2:0] - 3'h1 : | |
1407 | woq_dimm6_wrcnt[2:0]; | |
1408 | ||
1409 | // 0in overflow -var woq_dimm6_wrcnt[2:0] -active ~woq_wr_error_mode | |
1410 | // 0in underflow -var woq_dimm6_wrcnt[2:0] -active ~woq_wr_error_mode | |
1411 | mcu_woq_ctl_msff_ctl_macro__clr_1__width_3 ff_dimm6_wrcnt ( | |
1412 | .scan_in(ff_dimm6_wrcnt_scanin), | |
1413 | .scan_out(ff_dimm6_wrcnt_scanout), | |
1414 | .din(woq_dimm6_wrcnt_in[2:0]), | |
1415 | .dout(woq_dimm6_wrcnt[2:0]), | |
1416 | .clr(woq_wr_error_mode), | |
1417 | .l1clk(l1clk), | |
1418 | .siclk(siclk), | |
1419 | .soclk(soclk)); | |
1420 | ||
1421 | assign woq_dimm6_stall = drif_single_channel_mode ? &woq_dimm6_wrcnt[1:0] : &woq_dimm6_wrcnt[2:0]; | |
1422 | ||
1423 | // | |
1424 | assign woq_dimm7_wrcnt_incr = woq_wr_addr_enq & woq_wr_queue_reg[5:3] == 3'h7; | |
1425 | assign woq_dimm7_wrcnt_decr = (|drif_wr_entry_picked[1:0]) & woq_entry0[5:3] == 3'h7 | | |
1426 | drif_wr_entry_picked[2] & woq_entry1[5:3] == 3'h7; | |
1427 | assign woq_dimm7_wrcnt_in[2:0] = woq_dimm7_wrcnt_incr & ~woq_dimm7_wrcnt_decr ? woq_dimm7_wrcnt[2:0] + 3'h1 : | |
1428 | ~woq_dimm7_wrcnt_incr & woq_dimm7_wrcnt_decr ? woq_dimm7_wrcnt[2:0] - 3'h1 : | |
1429 | woq_dimm7_wrcnt[2:0]; | |
1430 | ||
1431 | // 0in overflow -var woq_dimm7_wrcnt[2:0] -active ~woq_wr_error_mode | |
1432 | // 0in underflow -var woq_dimm7_wrcnt[2:0] -active ~woq_wr_error_mode | |
1433 | mcu_woq_ctl_msff_ctl_macro__clr_1__width_3 ff_dimm7_wrcnt ( | |
1434 | .scan_in(ff_dimm7_wrcnt_scanin), | |
1435 | .scan_out(ff_dimm7_wrcnt_scanout), | |
1436 | .din(woq_dimm7_wrcnt_in[2:0]), | |
1437 | .dout(woq_dimm7_wrcnt[2:0]), | |
1438 | .clr(woq_wr_error_mode), | |
1439 | .l1clk(l1clk), | |
1440 | .siclk(siclk), | |
1441 | .soclk(soclk)); | |
1442 | ||
1443 | assign woq_dimm7_stall = drif_single_channel_mode ? &woq_dimm7_wrcnt[1:0] : &woq_dimm7_wrcnt[2:0]; | |
1444 | ||
1445 | // rank available | |
1446 | assign woq_rank_avail[15:0] = pdmc_rank_avail[15:0] & {drif_dimm_wr_available[7:0],drif_dimm_wr_available[7:0]}; | |
1447 | ||
1448 | // fixscan start: | |
1449 | assign ff_priority_scanin = scan_in ; | |
1450 | assign ff_io_wdata_sel_scanin = ff_priority_scanout ; | |
1451 | assign ff_wdata_cnt_scanin = ff_io_wdata_sel_scanout ; | |
1452 | assign ff_wdata_l2bank_scanin = ff_wdata_cnt_scanout ; | |
1453 | assign ff_waddr_scanin = ff_wdata_l2bank_scanout ; | |
1454 | assign ff_raddr_scanin = ff_waddr_scanout ; | |
1455 | assign ff_reg0_scanin = ff_raddr_scanout ; | |
1456 | assign ff_reg1_scanin = ff_reg0_scanout ; | |
1457 | assign ff_reg2_scanin = ff_reg1_scanout ; | |
1458 | assign ff_reg3_scanin = ff_reg2_scanout ; | |
1459 | assign ff_reg4_scanin = ff_reg3_scanout ; | |
1460 | assign ff_reg5_scanin = ff_reg4_scanout ; | |
1461 | assign ff_reg6_scanin = ff_reg5_scanout ; | |
1462 | assign ff_reg7_scanin = ff_reg6_scanout ; | |
1463 | assign ff_reg8_scanin = ff_reg7_scanout ; | |
1464 | assign ff_reg9_scanin = ff_reg8_scanout ; | |
1465 | assign ff_reg10_scanin = ff_reg9_scanout ; | |
1466 | assign ff_reg11_scanin = ff_reg10_scanout ; | |
1467 | assign ff_reg12_scanin = ff_reg11_scanout ; | |
1468 | assign ff_reg13_scanin = ff_reg12_scanout ; | |
1469 | assign ff_reg14_scanin = ff_reg13_scanout ; | |
1470 | assign ff_reg15_scanin = ff_reg14_scanout ; | |
1471 | assign ff_owr_ptr_scanin = ff_reg15_scanout ; | |
1472 | assign ff_wr_req_out_scanin = ff_owr_ptr_scanout ; | |
1473 | assign ff_woq_free_d1_scanin = ff_wr_req_out_scanout ; | |
1474 | assign ff_wdq_free_accum_scanin = ff_woq_free_d1_scanout ; | |
1475 | assign ff_wdq_entry_free_scanin = ff_wdq_free_accum_scanout; | |
1476 | assign ff_wrq_clear_accum_scanin = ff_wdq_entry_free_scanout; | |
1477 | assign ff_pd_mode_wr_decr_scanin = ff_wrq_clear_accum_scanout; | |
1478 | assign ff_wr_error_mode_scanin = ff_pd_mode_wr_decr_scanout; | |
1479 | assign ff_error_ptr_scanin = ff_wr_error_mode_scanout ; | |
1480 | assign ff_wr_err_state_scanin = ff_error_ptr_scanout ; | |
1481 | assign ff_dimm0_wrcnt_scanin = ff_wr_err_state_scanout ; | |
1482 | assign ff_dimm1_wrcnt_scanin = ff_dimm0_wrcnt_scanout ; | |
1483 | assign ff_dimm2_wrcnt_scanin = ff_dimm1_wrcnt_scanout ; | |
1484 | assign ff_dimm3_wrcnt_scanin = ff_dimm2_wrcnt_scanout ; | |
1485 | assign ff_dimm4_wrcnt_scanin = ff_dimm3_wrcnt_scanout ; | |
1486 | assign ff_dimm5_wrcnt_scanin = ff_dimm4_wrcnt_scanout ; | |
1487 | assign ff_dimm6_wrcnt_scanin = ff_dimm5_wrcnt_scanout ; | |
1488 | assign ff_dimm7_wrcnt_scanin = ff_dimm6_wrcnt_scanout ; | |
1489 | assign scan_out = ff_dimm7_wrcnt_scanout ; | |
1490 | // fixscan end: | |
1491 | endmodule | |
1492 | ||
1493 | ||
1494 | ||
1495 | ||
1496 | ||
1497 | ||
1498 | // any PARAMS parms go into naming of macro | |
1499 | ||
1500 | module mcu_woq_ctl_msff_ctl_macro__en_1 ( | |
1501 | din, | |
1502 | en, | |
1503 | l1clk, | |
1504 | scan_in, | |
1505 | siclk, | |
1506 | soclk, | |
1507 | dout, | |
1508 | scan_out); | |
1509 | wire [0:0] fdin; | |
1510 | ||
1511 | input [0:0] din; | |
1512 | input en; | |
1513 | input l1clk; | |
1514 | input scan_in; | |
1515 | ||
1516 | ||
1517 | input siclk; | |
1518 | input soclk; | |
1519 | ||
1520 | output [0:0] dout; | |
1521 | output scan_out; | |
1522 | assign fdin[0:0] = (din[0:0] & {1{en}}) | (dout[0:0] & ~{1{en}}); | |
1523 | ||
1524 | ||
1525 | ||
1526 | ||
1527 | ||
1528 | ||
1529 | dff #(1) d0_0 ( | |
1530 | .l1clk(l1clk), | |
1531 | .siclk(siclk), | |
1532 | .soclk(soclk), | |
1533 | .d(fdin[0:0]), | |
1534 | .si(scan_in), | |
1535 | .so(scan_out), | |
1536 | .q(dout[0:0]) | |
1537 | ); | |
1538 | ||
1539 | ||
1540 | ||
1541 | ||
1542 | ||
1543 | ||
1544 | ||
1545 | ||
1546 | ||
1547 | ||
1548 | ||
1549 | ||
1550 | endmodule | |
1551 | ||
1552 | ||
1553 | ||
1554 | ||
1555 | ||
1556 | ||
1557 | ||
1558 | ||
1559 | ||
1560 | ||
1561 | ||
1562 | ||
1563 | ||
1564 | // any PARAMS parms go into naming of macro | |
1565 | ||
1566 | module mcu_woq_ctl_msff_ctl_macro__width_4 ( | |
1567 | din, | |
1568 | l1clk, | |
1569 | scan_in, | |
1570 | siclk, | |
1571 | soclk, | |
1572 | dout, | |
1573 | scan_out); | |
1574 | wire [3:0] fdin; | |
1575 | wire [2:0] so; | |
1576 | ||
1577 | input [3:0] din; | |
1578 | input l1clk; | |
1579 | input scan_in; | |
1580 | ||
1581 | ||
1582 | input siclk; | |
1583 | input soclk; | |
1584 | ||
1585 | output [3:0] dout; | |
1586 | output scan_out; | |
1587 | assign fdin[3:0] = din[3:0]; | |
1588 | ||
1589 | ||
1590 | ||
1591 | ||
1592 | ||
1593 | ||
1594 | dff #(4) d0_0 ( | |
1595 | .l1clk(l1clk), | |
1596 | .siclk(siclk), | |
1597 | .soclk(soclk), | |
1598 | .d(fdin[3:0]), | |
1599 | .si({scan_in,so[2:0]}), | |
1600 | .so({so[2:0],scan_out}), | |
1601 | .q(dout[3:0]) | |
1602 | ); | |
1603 | ||
1604 | ||
1605 | ||
1606 | ||
1607 | ||
1608 | ||
1609 | ||
1610 | ||
1611 | ||
1612 | ||
1613 | ||
1614 | ||
1615 | endmodule | |
1616 | ||
1617 | ||
1618 | ||
1619 | ||
1620 | ||
1621 | ||
1622 | ||
1623 | ||
1624 | ||
1625 | ||
1626 | ||
1627 | ||
1628 | ||
1629 | // any PARAMS parms go into naming of macro | |
1630 | ||
1631 | module mcu_woq_ctl_msff_ctl_macro__en_1__width_3 ( | |
1632 | din, | |
1633 | en, | |
1634 | l1clk, | |
1635 | scan_in, | |
1636 | siclk, | |
1637 | soclk, | |
1638 | dout, | |
1639 | scan_out); | |
1640 | wire [2:0] fdin; | |
1641 | wire [1:0] so; | |
1642 | ||
1643 | input [2:0] din; | |
1644 | input en; | |
1645 | input l1clk; | |
1646 | input scan_in; | |
1647 | ||
1648 | ||
1649 | input siclk; | |
1650 | input soclk; | |
1651 | ||
1652 | output [2:0] dout; | |
1653 | output scan_out; | |
1654 | assign fdin[2:0] = (din[2:0] & {3{en}}) | (dout[2:0] & ~{3{en}}); | |
1655 | ||
1656 | ||
1657 | ||
1658 | ||
1659 | ||
1660 | ||
1661 | dff #(3) d0_0 ( | |
1662 | .l1clk(l1clk), | |
1663 | .siclk(siclk), | |
1664 | .soclk(soclk), | |
1665 | .d(fdin[2:0]), | |
1666 | .si({scan_in,so[1:0]}), | |
1667 | .so({so[1:0],scan_out}), | |
1668 | .q(dout[2:0]) | |
1669 | ); | |
1670 | ||
1671 | ||
1672 | ||
1673 | ||
1674 | ||
1675 | ||
1676 | ||
1677 | ||
1678 | ||
1679 | ||
1680 | ||
1681 | ||
1682 | endmodule | |
1683 | ||
1684 | ||
1685 | ||
1686 | ||
1687 | ||
1688 | ||
1689 | ||
1690 | ||
1691 | ||
1692 | ||
1693 | ||
1694 | ||
1695 | ||
1696 | // any PARAMS parms go into naming of macro | |
1697 | ||
1698 | module mcu_woq_ctl_msff_ctl_macro__width_5 ( | |
1699 | din, | |
1700 | l1clk, | |
1701 | scan_in, | |
1702 | siclk, | |
1703 | soclk, | |
1704 | dout, | |
1705 | scan_out); | |
1706 | wire [4:0] fdin; | |
1707 | wire [3:0] so; | |
1708 | ||
1709 | input [4:0] din; | |
1710 | input l1clk; | |
1711 | input scan_in; | |
1712 | ||
1713 | ||
1714 | input siclk; | |
1715 | input soclk; | |
1716 | ||
1717 | output [4:0] dout; | |
1718 | output scan_out; | |
1719 | assign fdin[4:0] = din[4:0]; | |
1720 | ||
1721 | ||
1722 | ||
1723 | ||
1724 | ||
1725 | ||
1726 | dff #(5) d0_0 ( | |
1727 | .l1clk(l1clk), | |
1728 | .siclk(siclk), | |
1729 | .soclk(soclk), | |
1730 | .d(fdin[4:0]), | |
1731 | .si({scan_in,so[3:0]}), | |
1732 | .so({so[3:0],scan_out}), | |
1733 | .q(dout[4:0]) | |
1734 | ); | |
1735 | ||
1736 | ||
1737 | ||
1738 | ||
1739 | ||
1740 | ||
1741 | ||
1742 | ||
1743 | ||
1744 | ||
1745 | ||
1746 | ||
1747 | endmodule | |
1748 | ||
1749 | ||
1750 | ||
1751 | ||
1752 | ||
1753 | ||
1754 | ||
1755 | ||
1756 | ||
1757 | ||
1758 | ||
1759 | ||
1760 | ||
1761 | // any PARAMS parms go into naming of macro | |
1762 | ||
1763 | module mcu_woq_ctl_msff_ctl_macro__en_1__width_16 ( | |
1764 | din, | |
1765 | en, | |
1766 | l1clk, | |
1767 | scan_in, | |
1768 | siclk, | |
1769 | soclk, | |
1770 | dout, | |
1771 | scan_out); | |
1772 | wire [15:0] fdin; | |
1773 | wire [14:0] so; | |
1774 | ||
1775 | input [15:0] din; | |
1776 | input en; | |
1777 | input l1clk; | |
1778 | input scan_in; | |
1779 | ||
1780 | ||
1781 | input siclk; | |
1782 | input soclk; | |
1783 | ||
1784 | output [15:0] dout; | |
1785 | output scan_out; | |
1786 | assign fdin[15:0] = (din[15:0] & {16{en}}) | (dout[15:0] & ~{16{en}}); | |
1787 | ||
1788 | ||
1789 | ||
1790 | ||
1791 | ||
1792 | ||
1793 | dff #(16) d0_0 ( | |
1794 | .l1clk(l1clk), | |
1795 | .siclk(siclk), | |
1796 | .soclk(soclk), | |
1797 | .d(fdin[15:0]), | |
1798 | .si({scan_in,so[14:0]}), | |
1799 | .so({so[14:0],scan_out}), | |
1800 | .q(dout[15:0]) | |
1801 | ); | |
1802 | ||
1803 | ||
1804 | ||
1805 | ||
1806 | ||
1807 | ||
1808 | ||
1809 | ||
1810 | ||
1811 | ||
1812 | ||
1813 | ||
1814 | endmodule | |
1815 | ||
1816 | ||
1817 | ||
1818 | ||
1819 | ||
1820 | ||
1821 | ||
1822 | ||
1823 | ||
1824 | ||
1825 | ||
1826 | ||
1827 | ||
1828 | // any PARAMS parms go into naming of macro | |
1829 | ||
1830 | module mcu_woq_ctl_msff_ctl_macro__width_2 ( | |
1831 | din, | |
1832 | l1clk, | |
1833 | scan_in, | |
1834 | siclk, | |
1835 | soclk, | |
1836 | dout, | |
1837 | scan_out); | |
1838 | wire [1:0] fdin; | |
1839 | wire [0:0] so; | |
1840 | ||
1841 | input [1:0] din; | |
1842 | input l1clk; | |
1843 | input scan_in; | |
1844 | ||
1845 | ||
1846 | input siclk; | |
1847 | input soclk; | |
1848 | ||
1849 | output [1:0] dout; | |
1850 | output scan_out; | |
1851 | assign fdin[1:0] = din[1:0]; | |
1852 | ||
1853 | ||
1854 | ||
1855 | ||
1856 | ||
1857 | ||
1858 | dff #(2) d0_0 ( | |
1859 | .l1clk(l1clk), | |
1860 | .siclk(siclk), | |
1861 | .soclk(soclk), | |
1862 | .d(fdin[1:0]), | |
1863 | .si({scan_in,so[0:0]}), | |
1864 | .so({so[0:0],scan_out}), | |
1865 | .q(dout[1:0]) | |
1866 | ); | |
1867 | ||
1868 | ||
1869 | ||
1870 | ||
1871 | ||
1872 | ||
1873 | ||
1874 | ||
1875 | ||
1876 | ||
1877 | ||
1878 | ||
1879 | endmodule | |
1880 | ||
1881 | ||
1882 | ||
1883 | ||
1884 | ||
1885 | ||
1886 | ||
1887 | ||
1888 | ||
1889 | ||
1890 | ||
1891 | ||
1892 | ||
1893 | // any PARAMS parms go into naming of macro | |
1894 | ||
1895 | module mcu_woq_ctl_msff_ctl_macro ( | |
1896 | din, | |
1897 | l1clk, | |
1898 | scan_in, | |
1899 | siclk, | |
1900 | soclk, | |
1901 | dout, | |
1902 | scan_out); | |
1903 | wire [0:0] fdin; | |
1904 | ||
1905 | input [0:0] din; | |
1906 | input l1clk; | |
1907 | input scan_in; | |
1908 | ||
1909 | ||
1910 | input siclk; | |
1911 | input soclk; | |
1912 | ||
1913 | output [0:0] dout; | |
1914 | output scan_out; | |
1915 | assign fdin[0:0] = din[0:0]; | |
1916 | ||
1917 | ||
1918 | ||
1919 | ||
1920 | ||
1921 | ||
1922 | dff #(1) d0_0 ( | |
1923 | .l1clk(l1clk), | |
1924 | .siclk(siclk), | |
1925 | .soclk(soclk), | |
1926 | .d(fdin[0:0]), | |
1927 | .si(scan_in), | |
1928 | .so(scan_out), | |
1929 | .q(dout[0:0]) | |
1930 | ); | |
1931 | ||
1932 | ||
1933 | ||
1934 | ||
1935 | ||
1936 | ||
1937 | ||
1938 | ||
1939 | ||
1940 | ||
1941 | ||
1942 | ||
1943 | endmodule | |
1944 | ||
1945 | ||
1946 | ||
1947 | ||
1948 | ||
1949 | ||
1950 | ||
1951 | ||
1952 | ||
1953 | ||
1954 | ||
1955 | ||
1956 | ||
1957 | // any PARAMS parms go into naming of macro | |
1958 | ||
1959 | module mcu_woq_ctl_msff_ctl_macro__clr_1__width_16 ( | |
1960 | din, | |
1961 | clr, | |
1962 | l1clk, | |
1963 | scan_in, | |
1964 | siclk, | |
1965 | soclk, | |
1966 | dout, | |
1967 | scan_out); | |
1968 | wire [15:0] fdin; | |
1969 | wire [14:0] so; | |
1970 | ||
1971 | input [15:0] din; | |
1972 | input clr; | |
1973 | input l1clk; | |
1974 | input scan_in; | |
1975 | ||
1976 | ||
1977 | input siclk; | |
1978 | input soclk; | |
1979 | ||
1980 | output [15:0] dout; | |
1981 | output scan_out; | |
1982 | assign fdin[15:0] = din[15:0] & ~{16{clr}}; | |
1983 | ||
1984 | ||
1985 | ||
1986 | ||
1987 | ||
1988 | ||
1989 | dff #(16) d0_0 ( | |
1990 | .l1clk(l1clk), | |
1991 | .siclk(siclk), | |
1992 | .soclk(soclk), | |
1993 | .d(fdin[15:0]), | |
1994 | .si({scan_in,so[14:0]}), | |
1995 | .so({so[14:0],scan_out}), | |
1996 | .q(dout[15:0]) | |
1997 | ); | |
1998 | ||
1999 | ||
2000 | ||
2001 | ||
2002 | ||
2003 | ||
2004 | ||
2005 | ||
2006 | ||
2007 | ||
2008 | ||
2009 | ||
2010 | endmodule | |
2011 | ||
2012 | ||
2013 | ||
2014 | ||
2015 | ||
2016 | ||
2017 | ||
2018 | ||
2019 | ||
2020 | ||
2021 | ||
2022 | ||
2023 | ||
2024 | // any PARAMS parms go into naming of macro | |
2025 | ||
2026 | module mcu_woq_ctl_msff_ctl_macro__width_16 ( | |
2027 | din, | |
2028 | l1clk, | |
2029 | scan_in, | |
2030 | siclk, | |
2031 | soclk, | |
2032 | dout, | |
2033 | scan_out); | |
2034 | wire [15:0] fdin; | |
2035 | wire [14:0] so; | |
2036 | ||
2037 | input [15:0] din; | |
2038 | input l1clk; | |
2039 | input scan_in; | |
2040 | ||
2041 | ||
2042 | input siclk; | |
2043 | input soclk; | |
2044 | ||
2045 | output [15:0] dout; | |
2046 | output scan_out; | |
2047 | assign fdin[15:0] = din[15:0]; | |
2048 | ||
2049 | ||
2050 | ||
2051 | ||
2052 | ||
2053 | ||
2054 | dff #(16) d0_0 ( | |
2055 | .l1clk(l1clk), | |
2056 | .siclk(siclk), | |
2057 | .soclk(soclk), | |
2058 | .d(fdin[15:0]), | |
2059 | .si({scan_in,so[14:0]}), | |
2060 | .so({so[14:0],scan_out}), | |
2061 | .q(dout[15:0]) | |
2062 | ); | |
2063 | ||
2064 | ||
2065 | ||
2066 | ||
2067 | ||
2068 | ||
2069 | ||
2070 | ||
2071 | ||
2072 | ||
2073 | ||
2074 | ||
2075 | endmodule | |
2076 | ||
2077 | ||
2078 | ||
2079 | ||
2080 | ||
2081 | ||
2082 | ||
2083 | ||
2084 | ||
2085 | ||
2086 | ||
2087 | ||
2088 | ||
2089 | // any PARAMS parms go into naming of macro | |
2090 | ||
2091 | module mcu_woq_ctl_msff_ctl_macro__clr_1__width_3 ( | |
2092 | din, | |
2093 | clr, | |
2094 | l1clk, | |
2095 | scan_in, | |
2096 | siclk, | |
2097 | soclk, | |
2098 | dout, | |
2099 | scan_out); | |
2100 | wire [2:0] fdin; | |
2101 | wire [1:0] so; | |
2102 | ||
2103 | input [2:0] din; | |
2104 | input clr; | |
2105 | input l1clk; | |
2106 | input scan_in; | |
2107 | ||
2108 | ||
2109 | input siclk; | |
2110 | input soclk; | |
2111 | ||
2112 | output [2:0] dout; | |
2113 | output scan_out; | |
2114 | assign fdin[2:0] = din[2:0] & ~{3{clr}}; | |
2115 | ||
2116 | ||
2117 | ||
2118 | ||
2119 | ||
2120 | ||
2121 | dff #(3) d0_0 ( | |
2122 | .l1clk(l1clk), | |
2123 | .siclk(siclk), | |
2124 | .soclk(soclk), | |
2125 | .d(fdin[2:0]), | |
2126 | .si({scan_in,so[1:0]}), | |
2127 | .so({so[1:0],scan_out}), | |
2128 | .q(dout[2:0]) | |
2129 | ); | |
2130 | ||
2131 | ||
2132 | ||
2133 | ||
2134 | ||
2135 | ||
2136 | ||
2137 | ||
2138 | ||
2139 | ||
2140 | ||
2141 | ||
2142 | endmodule | |
2143 | ||
2144 | ||
2145 | ||
2146 | ||
2147 | ||
2148 | ||
2149 | ||
2150 |