Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / design / sys / iop / ncu / rtl / ncu_c2isd_ctl.v
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: ncu_c2isd_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`define RF_RDEN_OFFSTATE 1'b1
36
37//====================================
38`define NCU_INTMANRF_DEPTH 128
39`define NCU_INTMANRF_DATAWIDTH 16
40`define NCU_INTMANRF_ADDRWIDTH 7
41//====================================
42
43//====================================
44`define NCU_MONDORF_DEPTH 64
45`define NCU_MONDORF_DATAWIDTH 72
46`define NCU_MONDORF_ADDRWIDTH 6
47//====================================
48
49//====================================
50`define NCU_CPUBUFRF_DEPTH 32
51`define NCU_CPUBUFRF_DATAWIDTH 144
52`define NCU_CPUBUFRF_ADDRWIDTH 5
53//====================================
54
55//====================================
56`define NCU_IOBUFRF_DEPTH 32
57`define NCU_IOBUFRF_DATAWIDTH 144
58`define NCU_IOBUFRF_ADDRWIDTH 5
59//====================================
60
61//====================================
62`define NCU_IOBUF1RF_DEPTH 32
63`define NCU_IOBUF1RF_DATAWIDTH 32
64`define NCU_IOBUF1RF_ADDRWIDTH 5
65//====================================
66
67//====================================
68`define NCU_INTBUFRF_DEPTH 32
69`define NCU_INTBUFRF_DATAWIDTH 144
70`define NCU_INTBUFRF_ADDRWIDTH 5
71//====================================
72
73//== fix me : need to remove when warm //
74//== becomes available //
75`define WMR_LENGTH 10'd999
76`define WMR_LENGTH_P1 10'd1000
77
78//// NCU CSR_MAN address 80_0000_xxxx ////
79`define NCU_CSR_MAN 16'h0000
80`define NCU_CREG_INTMAN 16'h0000
81//`define NCU_CREG_INTVECDISP 16'h0800
82`define NCU_CREG_MONDOINVEC 16'h0a00
83`define NCU_CREG_SERNUM 16'h1000
84`define NCU_CREG_FUSESTAT 16'h1008
85`define NCU_CREG_COREAVAIL 16'h1010
86`define NCU_CREG_BANKAVAIL 16'h1018
87`define NCU_CREG_BANK_ENABLE 16'h1020
88`define NCU_CREG_BANK_ENABLE_STATUS 16'h1028
89`define NCU_CREG_L2_HASH_ENABLE 16'h1030
90`define NCU_CREG_L2_HASH_ENABLE_STATUS 16'h1038
91
92
93`define NCU_CREG_MEM32_BASE 16'h2000
94`define NCU_CREG_MEM32_MASK 16'h2008
95`define NCU_CREG_MEM64_BASE 16'h2010
96`define NCU_CREG_MEM64_MASK 16'h2018
97`define NCU_CREG_IOCON_BASE 16'h2020
98`define NCU_CREG_IOCON_MASK 16'h2028
99`define NCU_CREG_MMUFSH 16'h2030
100
101`define NCU_CREG_ESR 16'h3000
102`define NCU_CREG_ELE 16'h3008
103`define NCU_CREG_EIE 16'h3010
104`define NCU_CREG_EJR 16'h3018
105`define NCU_CREG_FEE 16'h3020
106`define NCU_CREG_PER 16'h3028
107`define NCU_CREG_SIISYN 16'h3030
108`define NCU_CREG_NCUSYN 16'h3038
109`define NCU_CREG_SCKSEL 16'h3040
110`define NCU_CREG_DBGTRIG_EN 16'h4000
111
112//// NUC CSR_MONDO address 80_0004_xxxx ////
113`define NCU_CSR_MONDO 16'h0004
114`define NCU_CREG_MDATA0 16'h0000
115`define NCU_CREG_MDATA1 16'h0200
116`define NCU_CREG_MDATA0_ALIAS 16'h0400
117`define NCU_CREG_MDATA1_ALIAS 16'h0600
118`define NCU_CREG_MBUSY 16'h0800
119`define NCU_CREG_MBUSY_ALIAS 16'h0a00
120
121
122
123// ASI shared reg 90_xxxx_xxxx//
124`define NCU_ASI_A_HIT 10'h104 // 6-bits cpuid and thread id are "x"
125`define NCU_ASI_B_HIT 10'h1CC // 6-bits cpuid and thread id are "x"
126`define NCU_ASI_C_HIT 10'h114 // 6-bits cpuid and thread id are "x"
127`define NCU_ASI_COREAVAIL 16'h0000
128`define NCU_ASI_CORE_ENABLE_STATUS 16'h0010
129`define NCU_ASI_CORE_ENABLE 16'h0020
130`define NCU_ASI_XIR_STEERING 16'h0030
131`define NCU_ASI_CORE_RUNNINGRW 16'h0050
132`define NCU_ASI_CORE_RUNNING_STATUS 16'h0058
133`define NCU_ASI_CORE_RUNNING_W1S 16'h0060
134`define NCU_ASI_CORE_RUNNING_W1C 16'h0068
135`define NCU_ASI_INTVECDISP 16'h0000
136`define NCU_ASI_ERR_STR 16'h1000
137`define NCU_ASI_WMR_VEC_MASK 16'h0018
138`define NCU_ASI_CMP_TICK_ENABLE 16'h0038
139
140
141//// UCB packet type ////
142`define UCB_READ_NACK 4'b0000 // ack/nack types
143`define UCB_READ_ACK 4'b0001
144`define UCB_WRITE_ACK 4'b0010
145`define UCB_IFILL_ACK 4'b0011
146`define UCB_IFILL_NACK 4'b0111
147
148`define UCB_READ_REQ 4'b0100 // req types
149`define UCB_WRITE_REQ 4'b0101
150`define UCB_IFILL_REQ 4'b0110
151
152`define UCB_INT 4'b1000 // plain interrupt
153`define UCB_INT_VEC 4'b1100 // interrupt with vector
154`define UCB_INT_SOC_UE 4'b1001 // soc interrup ue
155`define UCB_INT_SOC_CE 4'b1010 // soc interrup ce
156`define UCB_RESET_VEC 4'b0101 // reset with vector
157`define UCB_IDLE_VEC 4'b1110 // idle with vector
158`define UCB_RESUME_VEC 4'b1111 // resume with vector
159
160`define UCB_INT_SOC 4'b1101 // soc interrup ce
161
162
163//// PCX packet type ////
164`define PCX_LOAD_RQ 5'b00000
165`define PCX_IMISS_RQ 5'b10000
166`define PCX_STORE_RQ 5'b00001
167`define PCX_FWD_RQs 5'b01101
168`define PCX_FWD_RPYs 5'b01110
169
170//// CPX packet type ////
171//`define CPX_LOAD_RET 4'b0000
172`define CPX_LOAD_RET 4'b1000
173`define CPX_ST_ACK 4'b0100
174//`define CPX_IFILL_RET 4'b0001
175`define CPX_IFILL_RET 4'b1001
176`define CPX_INT_RET 4'b0111
177`define CPX_INT_SOC 4'b1101
178//`define CPX_FWD_RQ_RET 4'b1010
179//`define CPX_FWD_RPY_RET 4'b1011
180
181
182
183
184//// Global CSR decode ////
185`define NCU_CSR 8'h80
186`define NIU_CSR 8'h81
187//`define RNG_CSR 8'h82
188`define DBG1_CSR 8'h86
189`define CCU_CSR 8'h83
190`define MCU_CSR 8'h84
191`define TCU_CSR 8'h85
192`define DMU_CSR 8'h88
193`define RCU_CSR 8'h89
194`define NCU_ASI 8'h90
195 /////8'h91 ~ 9F reserved
196 /////8'hA0 ~ BF L2 CSR////
197`define DMU_PIO 4'hC // C0 ~ CF
198 /////8'hB0 ~ FE reserved
199`define SSI_CSR 8'hFF
200
201
202//// NCU_SSI ////
203`define SSI_ADDR 12'hFF_F
204`define SSI_ADDR_TIMEOUT_REG 40'hFF_0001_0088
205`define SSI_ADDR_LOG_REG 40'hFF_0000_0018
206
207`define IF_IDLE 2'b00
208`define IF_ACPT 2'b01
209`define IF_DROP 2'b10
210
211`define SSI_IDLE 3'b000
212`define SSI_REQ 3'b001
213`define SSI_WDATA 3'b011
214`define SSI_REQ_PAR 3'b101
215`define SSI_ACK 3'b111
216`define SSI_RDATA 3'b110
217`define SSI_ACK_PAR 3'b010
218
219
220
221
222
223
224
225
226
227
228module ncu_c2isd_ctl (
229 iol2clk,
230 tcu_scan_en,
231 scan_in,
232 scan_out,
233 tcu_pce_ov,
234 tcu_clk_stop,
235 tcu_aclk,
236 tcu_bclk,
237 tap_iob_packet,
238 cpubuf_dout,
239 cpubuf_rd,
240 pas,
241 pa_ld,
242 pcx_packet,
243 pcx_packet_ue,
244 cpubuf_uei,
245 pcx_packet_pe,
246 cpubuf_pei,
247 tap_sel,
248 cpu_packet_type,
249 cpu_packet_size,
250 c2i_packet_addr,
251 c2i_packet,
252 c2i_rd_nack_packet,
253 wr_ack_iopkt,
254 mb0_cpubuf_bus_sel,
255 cpubuf_mb0_data,
256 cpubufsyn) ;
257wire cpubuf_pa_ff_scanin;
258wire cpubuf_pa_ff_scanout;
259wire [143:0] cpubuf_pa;
260wire l1clk;
261wire [143:0] cpubuf_dout_muxed_a;
262wire eccchk6i_0;
263wire eccchk6i_1;
264wire cpubuf_ue_n;
265wire unused_ce;
266wire [5:0] cpubuf_dout_muxed_b;
267wire [4:0] unused_co;
268wire [9:0] cpubuf_pfail_n;
269wire [128:0] cpubuf_dout_muxed;
270wire pcx_packet_ff_scanin;
271wire pcx_packet_ff_scanout;
272wire cpubufsyn_ff_scanin;
273wire cpubufsyn_ff_scanout;
274wire pcx_packet_pe_ff_scanin;
275wire pcx_packet_pe_ff_scanout;
276wire pcx_packet_ue_ff_scanin;
277wire pcx_packet_ue_ff_scanout;
278wire [127:0] cpu_packet;
279wire [144:0] wr_ack_packet;
280wire [7:0] wr_ack_packet_cpu;
281wire [3:0] nack_packet_type;
282wire siclk;
283wire soclk;
284wire se;
285wire pce_ov;
286wire stop;
287
288
289////////////////////////////////////////////////////////////////////////
290// Signal declarations
291////////////////////////////////////////////////////////////////////////
292// Global interface
293input iol2clk;
294
295input tcu_scan_en;
296input scan_in;
297output scan_out;
298input tcu_pce_ov;
299input tcu_clk_stop;
300input tcu_aclk;
301input tcu_bclk;
302
303// TAP interface
304input [127:0] tap_iob_packet;
305
306// CPU buffer interface
307input [143:0] cpubuf_dout;
308
309// c2i sc blk //
310input cpubuf_rd;
311input pas;
312input pa_ld;
313output [128:0] pcx_packet;
314output pcx_packet_ue;
315input cpubuf_uei;
316output pcx_packet_pe;
317input cpubuf_pei;
318input tap_sel;
319input [3:0] cpu_packet_type;
320input [2:0] cpu_packet_size;
321
322output [39:0] c2i_packet_addr;
323
324// UCB buffer interface
325output [127:0] c2i_packet;
326
327// Nack buffer interface
328output [63:0] c2i_rd_nack_packet;
329
330// i2c slow datapath interface
331output [152:0] wr_ack_iopkt;
332
333// mb0 signals //
334input [4:0] mb0_cpubuf_bus_sel;
335output [7:0] cpubuf_mb0_data;
336
337// err par //
338output [50:0] cpubufsyn;
339
340
341// Internal signals
342
343reg [7:0] cpubuf_mb0_data;
344always@(cpubuf_dout or mb0_cpubuf_bus_sel) begin
345 case(mb0_cpubuf_bus_sel[4:0]) //synopsys parallel_case full_case infer_mux
346 5'd0 : cpubuf_mb0_data[7:0] = {6'b0,cpubuf_dout[129:128]};
347 5'd1 : cpubuf_mb0_data[7:0] = cpubuf_dout[127:120];
348 5'd2 : cpubuf_mb0_data[7:0] = cpubuf_dout[119:112];
349 5'd3 : cpubuf_mb0_data[7:0] = cpubuf_dout[111:104];
350 5'd4 : cpubuf_mb0_data[7:0] = cpubuf_dout[103: 96];
351 5'd5 : cpubuf_mb0_data[7:0] = cpubuf_dout[ 95: 88];
352 5'd6 : cpubuf_mb0_data[7:0] = cpubuf_dout[ 87: 80];
353 5'd7 : cpubuf_mb0_data[7:0] = cpubuf_dout[ 79: 72];
354 5'd8 : cpubuf_mb0_data[7:0] = cpubuf_dout[ 71: 64];
355 5'd9 : cpubuf_mb0_data[7:0] = cpubuf_dout[ 63: 56];
356 5'd10 : cpubuf_mb0_data[7:0] = cpubuf_dout[ 55: 48];
357 5'd11 : cpubuf_mb0_data[7:0] = cpubuf_dout[ 47: 40];
358 5'd12 : cpubuf_mb0_data[7:0] = cpubuf_dout[ 39: 32];
359 5'd13 : cpubuf_mb0_data[7:0] = cpubuf_dout[ 31: 24];
360 5'd14 : cpubuf_mb0_data[7:0] = cpubuf_dout[ 23: 16];
361 5'd15 : cpubuf_mb0_data[7:0] = cpubuf_dout[ 15: 8];
362 default: cpubuf_mb0_data[7:0] = cpubuf_dout[ 7: 0];
363 endcase
364end
365/*****************************************************************
366 * Flop data from CPU buffer
367 *****************************************************************/
368ncu_c2isd_ctl_msff_ctl_macro__en_1__width_144 cpubuf_pa_ff
369 (
370 .scan_in(cpubuf_pa_ff_scanin),
371 .scan_out(cpubuf_pa_ff_scanout),
372 .dout (cpubuf_pa[143:0]),
373 .l1clk (l1clk),
374 .en (pa_ld),
375 .din (cpubuf_dout[143:0]),
376 .siclk(siclk),
377 .soclk(soclk)
378 );
379
380//reg [15:0] cntr;
381//initial cntr[15:0]=16'b0;
382//always@(posedge iol2clk) begin
383 //cntr[15:0] <= mov ? cntr[15:0]+1'b1 : cntr[15:0] ;
384//end
385
386
387assign cpubuf_dout_muxed_a[143:0] = pas ? cpubuf_pa[143:0] : cpubuf_dout[143:0] ;
388
389assign eccchk6i_0 = cpubuf_dout_muxed_a[129]^cpubuf_uei;
390assign eccchk6i_1 = cpubuf_dout_muxed_a[130]^cpubuf_uei;
391ncu_eccchk6_ctl c2isdeccchk6 (.din(cpubuf_dout_muxed_a[122:117]),
392 .ci({cpubuf_dout_muxed_a[133:131],eccchk6i_1,eccchk6i_0}),
393 .ue(cpubuf_ue_n),
394 .ce(unused_ce),
395 .dout(cpubuf_dout_muxed_b[5:0]),
396 .co(unused_co[4:0]) );
397
398assign cpubuf_pfail_n[0] = ~^{cpubuf_dout_muxed_a[0], cpubuf_dout_muxed_a[10], cpubuf_dout_muxed_a[20],
399 cpubuf_dout_muxed_a[30], cpubuf_dout_muxed_a[40], cpubuf_dout_muxed_a[50],
400 cpubuf_dout_muxed_a[60], cpubuf_dout_muxed_a[70], cpubuf_dout_muxed_a[80],
401 cpubuf_dout_muxed_a[90], cpubuf_dout_muxed_a[100],cpubuf_dout_muxed_a[110],
402 cpubuf_dout_muxed_a[134],cpubuf_pei};
403assign cpubuf_pfail_n[1] = ~^{cpubuf_dout_muxed_a[1], cpubuf_dout_muxed_a[11], cpubuf_dout_muxed_a[21],
404 cpubuf_dout_muxed_a[31], cpubuf_dout_muxed_a[41], cpubuf_dout_muxed_a[51],
405 cpubuf_dout_muxed_a[61], cpubuf_dout_muxed_a[70], cpubuf_dout_muxed_a[81],
406 cpubuf_dout_muxed_a[91], cpubuf_dout_muxed_a[101],cpubuf_dout_muxed_a[111],
407 cpubuf_dout_muxed_a[135]};
408assign cpubuf_pfail_n[2] = ~^{cpubuf_dout_muxed_a[2], cpubuf_dout_muxed_a[12], cpubuf_dout_muxed_a[22],
409 cpubuf_dout_muxed_a[32], cpubuf_dout_muxed_a[42], cpubuf_dout_muxed_a[52],
410 cpubuf_dout_muxed_a[62], cpubuf_dout_muxed_a[72], cpubuf_dout_muxed_a[82],
411 cpubuf_dout_muxed_a[92], cpubuf_dout_muxed_a[102],cpubuf_dout_muxed_a[114],
412 cpubuf_dout_muxed_a[136]};
413assign cpubuf_pfail_n[3] = ~^{cpubuf_dout_muxed_a[3], cpubuf_dout_muxed_a[13], cpubuf_dout_muxed_a[23],
414 cpubuf_dout_muxed_a[33], cpubuf_dout_muxed_a[43], cpubuf_dout_muxed_a[52],
415 cpubuf_dout_muxed_a[63], cpubuf_dout_muxed_a[73], cpubuf_dout_muxed_a[83],
416 cpubuf_dout_muxed_a[93], cpubuf_dout_muxed_a[103],cpubuf_dout_muxed_a[124],
417 cpubuf_dout_muxed_a[137]};
418assign cpubuf_pfail_n[4] = ~^{cpubuf_dout_muxed_a[4], cpubuf_dout_muxed_a[14], cpubuf_dout_muxed_a[24],
419 cpubuf_dout_muxed_a[34], cpubuf_dout_muxed_a[44], cpubuf_dout_muxed_a[54],
420 cpubuf_dout_muxed_a[64], cpubuf_dout_muxed_a[74], cpubuf_dout_muxed_a[84],
421 cpubuf_dout_muxed_a[94], cpubuf_dout_muxed_a[104],cpubuf_dout_muxed_a[125],
422 cpubuf_dout_muxed_a[138]};
423assign cpubuf_pfail_n[5] = ~^{cpubuf_dout_muxed_a[5], cpubuf_dout_muxed_a[15], cpubuf_dout_muxed_a[25],
424 cpubuf_dout_muxed_a[35], cpubuf_dout_muxed_a[45], cpubuf_dout_muxed_a[55],
425 cpubuf_dout_muxed_a[65], cpubuf_dout_muxed_a[75], cpubuf_dout_muxed_a[85],
426 cpubuf_dout_muxed_a[95], cpubuf_dout_muxed_a[105],cpubuf_dout_muxed_a[126],
427 cpubuf_dout_muxed_a[139]};
428assign cpubuf_pfail_n[6] = ~^{cpubuf_dout_muxed_a[6], cpubuf_dout_muxed_a[16], cpubuf_dout_muxed_a[26],
429 cpubuf_dout_muxed_a[36], cpubuf_dout_muxed_a[46], cpubuf_dout_muxed_a[56],
430 cpubuf_dout_muxed_a[66], cpubuf_dout_muxed_a[76], cpubuf_dout_muxed_a[86],
431 cpubuf_dout_muxed_a[96], cpubuf_dout_muxed_a[106],cpubuf_dout_muxed_a[127],
432 cpubuf_dout_muxed_a[140]};
433assign cpubuf_pfail_n[7] = ~^{cpubuf_dout_muxed_a[7], cpubuf_dout_muxed_a[17], cpubuf_dout_muxed_a[27],
434 cpubuf_dout_muxed_a[37], cpubuf_dout_muxed_a[47], cpubuf_dout_muxed_a[57],
435 cpubuf_dout_muxed_a[67], cpubuf_dout_muxed_a[77], cpubuf_dout_muxed_a[87],
436 cpubuf_dout_muxed_a[98], cpubuf_dout_muxed_a[107],cpubuf_dout_muxed_a[128],
437 cpubuf_dout_muxed_a[141]};
438assign cpubuf_pfail_n[8] = ~^{cpubuf_dout_muxed_a[8], cpubuf_dout_muxed_a[18], cpubuf_dout_muxed_a[28],
439 cpubuf_dout_muxed_a[38], cpubuf_dout_muxed_a[48], cpubuf_dout_muxed_a[58],
440 cpubuf_dout_muxed_a[68], cpubuf_dout_muxed_a[78], cpubuf_dout_muxed_a[88],
441 cpubuf_dout_muxed_a[98], cpubuf_dout_muxed_a[108],cpubuf_dout_muxed_a[142]};
442assign cpubuf_pfail_n[9] = ~^{cpubuf_dout_muxed_a[9], cpubuf_dout_muxed_a[19], cpubuf_dout_muxed_a[29],
443 cpubuf_dout_muxed_a[39], cpubuf_dout_muxed_a[49], cpubuf_dout_muxed_a[59],
444 cpubuf_dout_muxed_a[69], cpubuf_dout_muxed_a[79], cpubuf_dout_muxed_a[89],
445 cpubuf_dout_muxed_a[99], cpubuf_dout_muxed_a[109],cpubuf_dout_muxed_a[143]};
446
447
448assign cpubuf_dout_muxed[128:0] = {cpubuf_dout_muxed_a[128:123],cpubuf_dout_muxed_b[5:0],cpubuf_dout_muxed_a[116:0]};
449ncu_c2isd_ctl_msff_ctl_macro__en_1__width_129 pcx_packet_ff
450 (
451 .scan_in(pcx_packet_ff_scanin),
452 .scan_out(pcx_packet_ff_scanout),
453 .dout (pcx_packet[128:0]),
454 .l1clk (l1clk),
455 .en (cpubuf_rd),
456 .din (cpubuf_dout_muxed[128:0]),
457 .siclk(siclk),
458 .soclk(soclk)
459 );
460
461ncu_c2isd_ctl_msff_ctl_macro__en_1__width_51 cpubufsyn_ff
462 (
463 .scan_in(cpubufsyn_ff_scanin),
464 .scan_out(cpubufsyn_ff_scanout),
465 .dout (cpubufsyn[50:0]),
466 .l1clk (l1clk),
467 .en (cpubuf_rd),
468 .din ({cpubuf_dout_muxed_a[128:124],cpubuf_dout_muxed_b[5:0],cpubuf_dout_muxed_a[103:64]}),
469 .siclk(siclk),
470 .soclk(soclk)
471 );
472
473ncu_c2isd_ctl_msff_ctl_macro__en_1__width_1 pcx_packet_pe_ff
474 (
475 .scan_in(pcx_packet_pe_ff_scanin),
476 .scan_out(pcx_packet_pe_ff_scanout),
477 .dout (pcx_packet_pe),
478 .l1clk (l1clk),
479 .en (cpubuf_rd),
480 .din (|cpubuf_pfail_n[9:0]),
481 .siclk(siclk),
482 .soclk(soclk)
483 );
484
485ncu_c2isd_ctl_msff_ctl_macro__en_1__width_1 pcx_packet_ue_ff
486 (
487 .scan_in(pcx_packet_ue_ff_scanin),
488 .scan_out(pcx_packet_ue_ff_scanout),
489 .dout (pcx_packet_ue),
490 .l1clk (l1clk),
491 .en (cpubuf_rd),
492 .din (cpubuf_ue_n),
493 .siclk(siclk),
494 .soclk(soclk)
495 );
496
497
498
499
500
501//// parity check for normal data path ////
502
503// Convert from PCX format to UCB format
504assign cpu_packet[127:0] = // request packet to IO devices
505 {pcx_packet[63:0], // data [127:64]
506 pcx_packet[114], // reserved bit[63] (bis)
507 pcx_packet[111:104], // reserved bits [62:55] (bytemask)
508 pcx_packet[103:64], // address [54:15]
509 cpu_packet_size[2:0], // size [14:12]
510 2'b00, // buffer ID [11:10]
511 pcx_packet[122:117], // cpu thr ID [9:4]
512 cpu_packet_type[3:0]} ; // packet type [3:0]
513
514assign wr_ack_packet[144:0] = {
515 `CPX_ST_ACK , // return type [144:141]
516 1'b0, // l2miss [140]
517 2'b0, // error [139:138]
518 1'b1, // NC [137]
519 pcx_packet[119:117], // thread ID [136:134]
520 6'b0, // [133:128]
521 2'b0, // XX [127:126]
522 pcx_packet[114], // BIS [125]
523 2'b0, // XX [124:123]
524 pcx_packet[69:68], // addr[5:4] [122:121]
525 pcx_packet[122:120], // cpu ID [120:118]
526 1'b0, // [117]
527 pcx_packet[74:70], // addr[10:6] [116:112]
528 7'b0, // XXXXXXX [111:105]
529 pcx_packet[67], // addr[3] [104]
530 pcx_packet[111:104], // byte mask [103:96]
531 32'b0, // unused [95:64]
532 pcx_packet[63:0] }; // data [63:0]
533
534assign wr_ack_packet_cpu[7:0] = 8'b0000_0001 << pcx_packet[122:120];
535
536assign wr_ack_iopkt[152:0] = {wr_ack_packet_cpu[7:0],wr_ack_packet[144:0]};
537
538/*****************************************************************
539 * Mux between TAP and CPU packet
540 *****************************************************************/
541// TAP packets priority > PCX packets priority
542assign c2i_packet[127:0] = tap_sel ? tap_iob_packet[127:0] : cpu_packet[127:0];
543
544assign c2i_packet_addr[39:0] = c2i_packet[54:15];
545
546
547/*****************************************************************
548 * Generate read nack for read to undefined address space
549 *****************************************************************/
550//assign nack_packet_type[3:0] = (cpu_packet[3:0] == `UCB_IFILL_REQ) ? `UCB_IFILL_NACK : `UCB_READ_NACK ;
551assign nack_packet_type[3:0] =
552 ((~tap_sel&(cpu_packet[3:0] ==`UCB_IFILL_REQ)) |
553 ( tap_sel&(tap_iob_packet[3:0]==`UCB_IFILL_REQ))) ? `UCB_IFILL_NACK : `UCB_READ_NACK ;
554
555assign c2i_rd_nack_packet[63:0] = {9'b0, // reserved bits
556 40'b0, // address
557 3'b0, // size
558 c2i_packet[11:10], // buffer ID
559 c2i_packet[9:4], // thread ID
560 nack_packet_type[3:0] }; // packet type
561
562
563
564/**** adding clock header ****/
565ncu_c2isd_ctl_l1clkhdr_ctl_macro clkgen (
566 .l2clk (iol2clk),
567 .l1en (1'b1),
568 .l1clk (l1clk),
569 .pce_ov(pce_ov),
570 .stop(stop),
571 .se(se)
572 );
573
574/*** building tcu port ***/
575assign siclk = tcu_aclk;
576assign soclk = tcu_bclk;
577assign se = tcu_scan_en;
578assign pce_ov = tcu_pce_ov;
579assign stop = tcu_clk_stop;
580
581// fixscan start:
582assign cpubuf_pa_ff_scanin = scan_in ;
583assign pcx_packet_ff_scanin = cpubuf_pa_ff_scanout ;
584assign cpubufsyn_ff_scanin = pcx_packet_ff_scanout ;
585assign pcx_packet_pe_ff_scanin = cpubufsyn_ff_scanout ;
586assign pcx_packet_ue_ff_scanin = pcx_packet_pe_ff_scanout ;
587assign scan_out = pcx_packet_ue_ff_scanout ;
588// fixscan end:
589endmodule // c2i_sdp
590
591
592// Local Variables:
593// verilog-auto-sense-defines-constant:t
594// End:
595
596
597
598
599
600
601
602
603
604// any PARAMS parms go into naming of macro
605
606module ncu_c2isd_ctl_msff_ctl_macro__en_1__width_144 (
607 din,
608 en,
609 l1clk,
610 scan_in,
611 siclk,
612 soclk,
613 dout,
614 scan_out);
615wire [143:0] fdin;
616wire [142:0] so;
617
618 input [143:0] din;
619 input en;
620 input l1clk;
621 input scan_in;
622
623
624 input siclk;
625 input soclk;
626
627 output [143:0] dout;
628 output scan_out;
629assign fdin[143:0] = (din[143:0] & {144{en}}) | (dout[143:0] & ~{144{en}});
630
631
632
633
634
635
636dff #(144) d0_0 (
637.l1clk(l1clk),
638.siclk(siclk),
639.soclk(soclk),
640.d(fdin[143:0]),
641.si({scan_in,so[142:0]}),
642.so({so[142:0],scan_out}),
643.q(dout[143:0])
644);
645
646
647
648
649
650
651
652
653
654
655
656
657endmodule
658
659
660
661
662
663
664
665// any PARAMS parms go into naming of macro
666
667module ncu_c2isd_ctl_msff_ctl_macro__en_1__width_129 (
668 din,
669 en,
670 l1clk,
671 scan_in,
672 siclk,
673 soclk,
674 dout,
675 scan_out);
676wire [128:0] fdin;
677wire [127:0] so;
678
679 input [128:0] din;
680 input en;
681 input l1clk;
682 input scan_in;
683
684
685 input siclk;
686 input soclk;
687
688 output [128:0] dout;
689 output scan_out;
690assign fdin[128:0] = (din[128:0] & {129{en}}) | (dout[128:0] & ~{129{en}});
691
692
693
694
695
696
697dff #(129) d0_0 (
698.l1clk(l1clk),
699.siclk(siclk),
700.soclk(soclk),
701.d(fdin[128:0]),
702.si({scan_in,so[127:0]}),
703.so({so[127:0],scan_out}),
704.q(dout[128:0])
705);
706
707
708
709
710
711
712
713
714
715
716
717
718endmodule
719
720
721
722
723
724
725
726
727
728
729
730
731
732// any PARAMS parms go into naming of macro
733
734module ncu_c2isd_ctl_msff_ctl_macro__en_1__width_51 (
735 din,
736 en,
737 l1clk,
738 scan_in,
739 siclk,
740 soclk,
741 dout,
742 scan_out);
743wire [50:0] fdin;
744wire [49:0] so;
745
746 input [50:0] din;
747 input en;
748 input l1clk;
749 input scan_in;
750
751
752 input siclk;
753 input soclk;
754
755 output [50:0] dout;
756 output scan_out;
757assign fdin[50:0] = (din[50:0] & {51{en}}) | (dout[50:0] & ~{51{en}});
758
759
760
761
762
763
764dff #(51) d0_0 (
765.l1clk(l1clk),
766.siclk(siclk),
767.soclk(soclk),
768.d(fdin[50:0]),
769.si({scan_in,so[49:0]}),
770.so({so[49:0],scan_out}),
771.q(dout[50:0])
772);
773
774
775
776
777
778
779
780
781
782
783
784
785endmodule
786
787
788
789
790
791
792
793
794
795
796
797
798
799// any PARAMS parms go into naming of macro
800
801module ncu_c2isd_ctl_msff_ctl_macro__en_1__width_1 (
802 din,
803 en,
804 l1clk,
805 scan_in,
806 siclk,
807 soclk,
808 dout,
809 scan_out);
810wire [0:0] fdin;
811
812 input [0:0] din;
813 input en;
814 input l1clk;
815 input scan_in;
816
817
818 input siclk;
819 input soclk;
820
821 output [0:0] dout;
822 output scan_out;
823assign fdin[0:0] = (din[0:0] & {1{en}}) | (dout[0:0] & ~{1{en}});
824
825
826
827
828
829
830dff #(1) d0_0 (
831.l1clk(l1clk),
832.siclk(siclk),
833.soclk(soclk),
834.d(fdin[0:0]),
835.si(scan_in),
836.so(scan_out),
837.q(dout[0:0])
838);
839
840
841
842
843
844
845
846
847
848
849
850
851endmodule
852
853
854
855
856
857
858
859
860
861
862
863
864
865// any PARAMS parms go into naming of macro
866
867module ncu_c2isd_ctl_l1clkhdr_ctl_macro (
868 l2clk,
869 l1en,
870 pce_ov,
871 stop,
872 se,
873 l1clk);
874
875
876 input l2clk;
877 input l1en;
878 input pce_ov;
879 input stop;
880 input se;
881 output l1clk;
882
883
884
885
886
887cl_sc1_l1hdr_8x c_0 (
888
889
890 .l2clk(l2clk),
891 .pce(l1en),
892 .l1clk(l1clk),
893 .se(se),
894 .pce_ov(pce_ov),
895 .stop(stop)
896);
897
898
899
900endmodule
901
902
903
904
905
906
907
908