Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / design / sys / iop / ncu / rtl / ncu_ssiuif_ctl.v
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: ncu_ssiuif_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
227module ncu_ssiuif_ctl (
228 iol2clk,
229 tcu_pce_ov,
230 tcu_clk_stop,
231 tcu_scan_en,
232 tcu_aclk,
233 tcu_bclk,
234 scan_in,
235 scan_out,
236 io_jbi_ext_int_l,
237 ucb_ucbif_rd_req_vld,
238 ucb_ucbif_ifill_req_vld,
239 ucb_ucbif_wr_req_vld,
240 ucb_ucbif_thr_id_in,
241 ucb_ucbif_buf_id_in,
242 ucb_ucbif_size_in,
243 ucb_ucbif_addr_in,
244 ucb_ucbif_data_in,
245 ucb_ucbif_ack_busy,
246 ucb_ucbif_int_busy,
247 ucbif_ucb_req_acpted,
248 ucbif_ucb_rd_ack_vld,
249 ucbif_ucb_rd_nack_vld,
250 ucbif_ucb_ifill_ack_vld,
251 ucbif_ucb_ifill_nack_vld,
252 ucbif_ucb_thr_id_out,
253 ucbif_ucb_buf_id_out,
254 ucbif_ucb_data_out,
255 ucbif_ucb_int_vld,
256 ucbif_ucb_int_type,
257 ucbif_ucb_dev_id,
258 sif_ucbif_busy,
259 ucbif_sif_vld,
260 ucbif_sif_rw,
261 ucbif_sif_size,
262 ucbif_sif_addr,
263 ucbif_sif_wdata,
264 sif_ucbif_rdata,
265 sif_ucbif_rdata_vld,
266 ucbif_sif_rdata_accpt,
267 ucbif_sif_timeout_accpt,
268 sif_ucbif_timeout,
269 sif_ucbif_timeout_rw,
270 sif_ucbif_par_err,
271 ucbif_sif_timeval) ;
272wire timeout_reg_en;
273wire [1:0] if_sm;
274wire timeout_reg_addr_match;
275wire [24:0] next_timeout_reg;
276wire toreg_ld1_n;
277wire [24:0] timeout_reg;
278wire [23:0] timeout_timeval;
279wire timeout_erren;
280wire ssi_addr_match;
281wire ifill_en;
282wire next_ifill;
283wire log_reg_addr_match;
284wire [1:0] log_reg;
285wire log_parity_reg;
286wire log_tout_reg;
287wire log_reg_en;
288wire log_par_err;
289wire log_timeout;
290wire ack_vld;
291wire ifill;
292wire next_ucbif_sif_rdata_accpt;
293wire next_ucbif_sif_timeout_accpt;
294wire [5:0] next_ucbif_ucb_thr_id_out;
295wire [1:0] next_ucbif_ucb_buf_id_out;
296wire ucbif_ucb_thr_id_out_en;
297wire ucbif_ucb_buf_id_out_en;
298wire err_int_rst_l;
299wire err_int_accpt;
300wire next_err_int;
301wire err_int;
302wire ext_int_l_negedge_rst_l;
303wire ext_int_accpt;
304wire next_ext_int_l_negedge;
305wire ext_int_l;
306wire ext_int_l_d1;
307wire ext_int_l_d2;
308wire ext_int_l_d3;
309wire ext_int_l_d4;
310wire ext_int_l_d5;
311wire ext_int_l_d6;
312wire ext_int_l_d7;
313wire ext_int_l_negedge;
314wire u_dff_io_jbi_ext_int_l_pre_sync_scanin;
315wire u_dff_io_jbi_ext_int_l_pre_sync_scanout;
316wire io_jbi_ext_int_l_pre_sync;
317wire l1clk;
318wire u_dff_io_jbi_ext_int_l_sync_scanin;
319wire u_dff_io_jbi_ext_int_l_sync_scanout;
320wire io_jbi_ext_int_l_sync;
321wire u_dff_timeout_reg_scanin;
322wire u_dff_timeout_reg_scanout;
323wire u_dff_log_parity_reg_scanin;
324wire u_dff_log_parity_reg_scanout;
325wire u_dff_log_tout_reg_scanin;
326wire u_dff_log_tout_reg_scanout;
327wire u_dff_ext_int_l_scanin;
328wire u_dff_ext_int_l_scanout;
329wire u_dff_ext_int_l_d1_scanin;
330wire u_dff_ext_int_l_d1_scanout;
331wire u_dff_ext_int_l_d2_scanin;
332wire u_dff_ext_int_l_d2_scanout;
333wire u_dff_ext_int_l_d3_scanin;
334wire u_dff_ext_int_l_d3_scanout;
335wire u_dff_ext_int_l_d4_scanin;
336wire u_dff_ext_int_l_d4_scanout;
337wire u_dff_ext_int_l_d5_scanin;
338wire u_dff_ext_int_l_d5_scanout;
339wire u_dff_ext_int_l_d6_scanin;
340wire u_dff_ext_int_l_d6_scanout;
341wire u_dff_ext_int_l_d7_scanin;
342wire u_dff_ext_int_l_d7_scanout;
343wire u_dffrl_if_sm_scanin;
344wire u_dffrl_if_sm_scanout;
345wire u_dffrl_ucbif_sif_rdata_accpt_scanin;
346wire u_dffrl_ucbif_sif_rdata_accpt_scanout;
347wire u_dffrl_ucbif_sif_timeout_accpt_scanin;
348wire u_dffrl_ucbif_sif_timeout_accpt_scanout;
349wire n_err_int;
350wire u_dffrl_err_int_scanin;
351wire u_dffrl_err_int_scanout;
352wire n_ext_int_l_negedge;
353wire u_dffrl_ext_int_l_negedge_scanin;
354wire u_dffrl_ext_int_l_negedge_scanout;
355wire toreg_ld0_ff_scanin;
356wire toreg_ld0_ff_scanout;
357wire toreg_ld0_;
358wire toreg_ld1_ff_scanin;
359wire toreg_ld1_ff_scanout;
360wire u_dffrle_ifill_scanin;
361wire u_dffrle_ifill_scanout;
362wire u_dffrle_ucbif_ucb_thr_id_out_scanin;
363wire u_dffrle_ucbif_ucb_thr_id_out_scanout;
364wire u_dffrle_ucbif_ucb_buf_id_out_scanin;
365wire u_dffrle_ucbif_ucb_buf_id_out_scanout;
366wire siclk;
367wire soclk;
368wire se;
369wire pce_ov;
370wire stop;
371
372////////////////////////////////////////////////////////////////////////
373// Interface signal list declarations
374////////////////////////////////////////////////////////////////////////
375input iol2clk;
376input tcu_pce_ov;
377input tcu_clk_stop;
378input tcu_scan_en;
379input tcu_aclk;
380input tcu_bclk;
381input scan_in;
382output scan_out;
383
384// pad
385input io_jbi_ext_int_l;
386
387// ucb interface
388input ucb_ucbif_rd_req_vld;
389input ucb_ucbif_ifill_req_vld; // 4-byte read
390input ucb_ucbif_wr_req_vld;
391input [5:0] ucb_ucbif_thr_id_in;
392input [1:0] ucb_ucbif_buf_id_in;
393input [2:0] ucb_ucbif_size_in;
394input [39:0] ucb_ucbif_addr_in;
395input [63:0] ucb_ucbif_data_in;
396input ucb_ucbif_ack_busy;
397input ucb_ucbif_int_busy;
398output ucbif_ucb_req_acpted;
399output ucbif_ucb_rd_ack_vld;
400output ucbif_ucb_rd_nack_vld;
401output ucbif_ucb_ifill_ack_vld;
402output ucbif_ucb_ifill_nack_vld;
403output [5:0] ucbif_ucb_thr_id_out;
404output [1:0] ucbif_ucb_buf_id_out;
405output [63:0] ucbif_ucb_data_out;
406output ucbif_ucb_int_vld;
407output [3:0] ucbif_ucb_int_type;
408output [8:0] ucbif_ucb_dev_id;
409
410//issue SSI command
411input sif_ucbif_busy;
412output ucbif_sif_vld;
413output ucbif_sif_rw; //instr w/o data will have no dlen asserted
414output [1:0] ucbif_sif_size;
415output [27:0] ucbif_sif_addr;
416output [63:0] ucbif_sif_wdata;
417
418//read return data
419input [63:0] sif_ucbif_rdata;
420input sif_ucbif_rdata_vld;
421output ucbif_sif_rdata_accpt;
422output ucbif_sif_timeout_accpt;
423
424// SSI CSR
425input sif_ucbif_timeout;
426input sif_ucbif_timeout_rw;
427input sif_ucbif_par_err;
428output [23:0] ucbif_sif_timeval;
429
430
431//parameter SSI_ADDR = 12'hFF_F,
432 //SSI_ADDR_TIMEOUT_REG = 40'hFF_0001_0088,
433 //SSI_ADDR_LOG_REG = 40'hFF_0000_0018;
434
435//parameter IF_IDLE = 2'b00,
436 //IF_ACPT = 2'b01,
437 //IF_DROP = 2'b10;
438
439////////////////////////////////////////////////////////////////////////
440// Interface signal type declarations
441////////////////////////////////////////////////////////////////////////
442reg [63:0] ucbif_ucb_data_out;
443reg [8:0] ucbif_ucb_dev_id;
444reg [1:0] ucbif_sif_size;
445
446reg [1:0] next_if_sm;
447reg next_log_parity_reg;
448reg next_log_tout_reg;
449
450
451
452
453
454
455
456
457
458
459//-----------------------
460// Timeout Register
461//-----------------------
462
463assign timeout_reg_en = if_sm[1:0] == `IF_ACPT
464 & timeout_reg_addr_match
465 & ucb_ucbif_wr_req_vld;
466
467//assign next_timeout_reg[24:0] = ~toreg_ld1_n ? 25'h080_0000 :
468assign next_timeout_reg[24:0] = ~toreg_ld1_n ? 25'h020_0000 :
469 timeout_reg_en ? ucb_ucbif_data_in[24:0] : timeout_reg[24:0] ;
470
471assign timeout_timeval[23:0] = timeout_reg[23:0];
472assign timeout_erren = timeout_reg[24];
473
474assign ucbif_sif_timeval = timeout_timeval;
475
476//*******************************************************************************
477// Accept UBC Request
478//*******************************************************************************
479
480always @(/*AUTOSENSE*/if_sm or sif_ucbif_busy or ssi_addr_match
481 or ucb_ucbif_ack_busy or ucb_ucbif_ifill_req_vld
482 or ucb_ucbif_rd_req_vld or ucb_ucbif_size_in
483 or ucb_ucbif_wr_req_vld) begin
484case (if_sm[1:0])
485 `IF_IDLE: begin
486 if ((ucb_ucbif_rd_req_vld
487 | ucb_ucbif_wr_req_vld
488 | ucb_ucbif_ifill_req_vld)
489 & ~sif_ucbif_busy) begin
490 if ( (~ucb_ucbif_ifill_req_vld
491 & ucb_ucbif_size_in == 3'b111) //drop all 16-byte req and nack reads
492 | (ucb_ucbif_ifill_req_vld
493 & ~ssi_addr_match)) //drop ifill access to ssi csr
494 next_if_sm[1:0] = `IF_DROP ;
495 else
496 next_if_sm[1:0] = `IF_ACPT ;
497 end
498 else
499 next_if_sm[1:0] = `IF_IDLE ;
500 end
501
502 `IF_ACPT: begin
503 if (ssi_addr_match)
504 next_if_sm[1:0] = `IF_IDLE ;
505 else begin
506 // reg addr match
507 if (ucb_ucbif_rd_req_vld
508 & ucb_ucbif_ack_busy)
509 next_if_sm[1:0] = `IF_ACPT ; // wait until ~ack_busy to accept reg read
510 else
511 next_if_sm[1:0] = `IF_IDLE ;
512 end
513 end
514
515 `IF_DROP: begin
516 if ( (ucb_ucbif_rd_req_vld | ucb_ucbif_ifill_req_vld)
517 & ucb_ucbif_ack_busy)
518 next_if_sm[1:0] = `IF_DROP ;
519 else
520 next_if_sm[1:0] = `IF_IDLE ;
521 end
522
523 default: begin
524 next_if_sm[1:0] = 2'b0 ;
525 end
526endcase
527end
528
529
530assign ucbif_ucb_req_acpted = (if_sm[1:0] == `IF_ACPT
531 & ~( ~ssi_addr_match // reg read
532 & ucb_ucbif_rd_req_vld
533 & ucb_ucbif_ack_busy))
534 | ( if_sm[1:0] == `IF_DROP
535 & next_if_sm[1:0] == `IF_IDLE);
536
537assign ifill_en = next_if_sm[1:0] == `IF_ACPT ;
538assign next_ifill = ucb_ucbif_ifill_req_vld;
539
540//------------------
541// Address Decode
542//------------------
543assign timeout_reg_addr_match = ucb_ucbif_addr_in[39:0] == `SSI_ADDR_TIMEOUT_REG ;
544assign log_reg_addr_match = ucb_ucbif_addr_in[39:0] == `SSI_ADDR_LOG_REG ;
545assign ssi_addr_match = ucb_ucbif_addr_in[39:28] == `SSI_ADDR ;
546
547//-----------------------
548// Log Register
549//-----------------------
550
551assign log_reg[1] = log_parity_reg;
552assign log_reg[0] = log_tout_reg;
553
554assign log_reg_en = if_sm[1:0] == `IF_ACPT
555 & log_reg_addr_match
556 & ucb_ucbif_wr_req_vld;
557
558assign log_par_err = sif_ucbif_par_err
559 & timeout_erren
560 & (~sif_ucbif_rdata_vld
561 | ucbif_sif_rdata_accpt);
562assign log_timeout = sif_ucbif_timeout
563 & ucbif_sif_timeout_accpt
564 & timeout_erren;
565
566always @ ( /*AUTOSENSE*/log_par_err or log_parity_reg or log_reg_en
567 or ucb_ucbif_data_in) begin
568if (log_reg_en & ucb_ucbif_data_in[1])
569 next_log_parity_reg = 1'b0;
570else begin
571 if (log_par_err)
572 next_log_parity_reg = 1'b1;
573 else
574 next_log_parity_reg = log_parity_reg;
575end
576end
577
578always @ ( /*AUTOSENSE*/log_reg_en or log_timeout or log_tout_reg
579 or ucb_ucbif_data_in) begin
580if (log_reg_en & ucb_ucbif_data_in[0])
581 next_log_tout_reg = 1'b0;
582else begin
583 if (log_timeout)
584 next_log_tout_reg = 1'b1;
585 else
586 next_log_tout_reg = log_tout_reg;
587end
588end
589
590//------------------------
591// Launch SSI Transaction
592//------------------------
593assign ucbif_sif_vld = if_sm[1:0] == `IF_IDLE
594 & next_if_sm[1:0] == `IF_ACPT
595 & ssi_addr_match;
596assign ucbif_sif_rw = ~ucb_ucbif_wr_req_vld;
597assign ucbif_sif_addr = ucb_ucbif_addr_in[27:0];
598assign ucbif_sif_wdata = ucb_ucbif_data_in[63:0];
599
600always @ ( /*AUTOSENSE*/ucb_ucbif_ifill_req_vld or ucb_ucbif_size_in) begin
601if (ucb_ucbif_ifill_req_vld)
602 ucbif_sif_size = 2'b10;
603else
604 ucbif_sif_size = ucb_ucbif_size_in[1:0];
605end
606
607
608//*******************************************************************************
609// Return Read Data
610//*******************************************************************************
611assign ack_vld = (sif_ucbif_rdata_vld
612 & ~ucbif_sif_rdata_accpt
613 & ~ucb_ucbif_ack_busy) //SSI rd return
614 | (if_sm[1:0] == `IF_ACPT
615 & ~ssi_addr_match // reg addr match
616 & ucb_ucbif_rd_req_vld
617 & ~ucb_ucbif_ack_busy);
618
619assign ucbif_ucb_rd_ack_vld = ack_vld & ~sif_ucbif_par_err & ~ifill;
620assign ucbif_ucb_ifill_ack_vld = ack_vld & ~sif_ucbif_par_err & ifill;
621
622assign ucbif_ucb_rd_nack_vld = ( ~ifill
623 & ( (ack_vld & sif_ucbif_par_err)
624 | (sif_ucbif_timeout
625 & sif_ucbif_timeout_rw
626 & ~ucb_ucbif_ack_busy)))
627 | (if_sm[1:0] == `IF_DROP
628 & ucb_ucbif_rd_req_vld
629 & ~ucb_ucbif_ack_busy);
630
631assign ucbif_ucb_ifill_nack_vld = (ifill
632 & ( (ack_vld & sif_ucbif_par_err)
633 | (sif_ucbif_timeout
634 & sif_ucbif_timeout_rw
635 & ~ucb_ucbif_ack_busy)))
636 | (if_sm[1:0] == `IF_DROP
637 & ucb_ucbif_ifill_req_vld
638 & ~ucb_ucbif_ack_busy);
639
640always @(/*AUTOSENSE*/if_sm or log_reg or sif_ucbif_rdata
641 or sif_ucbif_timeout or timeout_reg or ucb_ucbif_addr_in) begin
642if (if_sm[1:0] == `IF_IDLE)
643 ucbif_ucb_data_out[63:0] = sif_ucbif_rdata[63:0];
644else if (sif_ucbif_timeout)
645 ucbif_ucb_data_out[63:0] = 64'b0;
646else begin
647 case (ucb_ucbif_addr_in[39:0])
648 `SSI_ADDR_TIMEOUT_REG: ucbif_ucb_data_out[63:0] = { 39'b0, timeout_reg[24:0] };
649 `SSI_ADDR_LOG_REG: ucbif_ucb_data_out[63:0] = { 62'b0, log_reg[1:0] };
650 default: ucbif_ucb_data_out[63:0] = 64'b0;
651 endcase
652end
653end
654
655assign next_ucbif_sif_rdata_accpt = sif_ucbif_rdata_vld
656 & ~ucbif_sif_rdata_accpt
657 & ~ucb_ucbif_ack_busy;
658
659assign next_ucbif_sif_timeout_accpt = sif_ucbif_timeout
660 & ~ucbif_sif_timeout_accpt
661 & ( ~sif_ucbif_timeout_rw
662 | ~ucb_ucbif_ack_busy);
663
664assign next_ucbif_ucb_thr_id_out[5:0] = ucb_ucbif_thr_id_in[5:0];
665assign next_ucbif_ucb_buf_id_out[1:0] = ucb_ucbif_buf_id_in[1:0];
666assign ucbif_ucb_thr_id_out_en = next_if_sm[1:0] != `IF_IDLE ;
667assign ucbif_ucb_buf_id_out_en = next_if_sm[1:0] != `IF_IDLE ;
668
669//*******************************************************************************
670// Interrupt
671//*******************************************************************************
672
673// error interrupt
674assign err_int_rst_l = ~err_int_accpt;
675assign next_err_int = err_int | log_par_err | log_timeout;
676
677// external interrupt
678assign ext_int_l_negedge_rst_l = ~ext_int_accpt;
679assign next_ext_int_l_negedge = ~ext_int_l
680 & ~ext_int_l_d1
681 & ~ext_int_l_d2
682 & ~ext_int_l_d3
683 & ext_int_l_d4
684 & ext_int_l_d5
685 & ext_int_l_d6
686 & ext_int_l_d7;
687
688// signal interrupt
689// - for simplicity, always give error interrupts priority
690assign err_int_accpt = ~ucb_ucbif_int_busy & err_int;
691assign ext_int_accpt = ~ucb_ucbif_int_busy & ~err_int & ext_int_l_negedge;
692
693assign ucbif_ucb_int_vld = err_int_accpt | ext_int_accpt;
694
695always @ ( /*AUTOSENSE*/err_int_accpt) begin
696if (err_int_accpt)
697 //original IOB in N1 only looks at the lower 2 bit of the dev_id
698 //ucbif_ucb_dev_id = 9'd17;
699 ucbif_ucb_dev_id = 9'd1;
700else
701 //ucbif_ucb_dev_id = 9'd30;
702 ucbif_ucb_dev_id = 9'd2;
703end
704
705assign ucbif_ucb_int_type = 4'b1000;
706
707//*******************************************************************************
708// Synchronization DFF
709//*******************************************************************************
710//----------------------
711// Async -> JBUS
712//----------------------
713
714ncu_ssiuif_ctl_msff_ctl_macro__width_1 u_dff_io_jbi_ext_int_l_pre_sync
715 (
716 .scan_in(u_dff_io_jbi_ext_int_l_pre_sync_scanin),
717 .scan_out(u_dff_io_jbi_ext_int_l_pre_sync_scanout),
718 .dout (io_jbi_ext_int_l_pre_sync),
719 .l1clk (l1clk),
720 .din (io_jbi_ext_int_l),
721 .siclk(siclk),
722 .soclk(soclk)
723 );
724
725ncu_ssiuif_ctl_msff_ctl_macro__width_1 u_dff_io_jbi_ext_int_l_sync
726 (
727 .scan_in(u_dff_io_jbi_ext_int_l_sync_scanin),
728 .scan_out(u_dff_io_jbi_ext_int_l_sync_scanout),
729 .dout (io_jbi_ext_int_l_sync),
730 .l1clk (l1clk),
731 .din (io_jbi_ext_int_l_pre_sync),
732 .siclk(siclk),
733 .soclk(soclk)
734 );
735
736//*******************************************************************************
737// DFF Instantiations
738//*******************************************************************************
739ncu_ssiuif_ctl_msff_ctl_macro__width_25 u_dff_timeout_reg
740 (
741 .scan_in(u_dff_timeout_reg_scanin),
742 .scan_out(u_dff_timeout_reg_scanout),
743 .dout (timeout_reg[24:0]),
744 .l1clk (l1clk),
745 .din (next_timeout_reg[24:0]),
746 .siclk(siclk),
747 .soclk(soclk)
748 );
749
750ncu_ssiuif_ctl_msff_ctl_macro__width_1 u_dff_log_parity_reg
751 (
752 .scan_in(u_dff_log_parity_reg_scanin),
753 .scan_out(u_dff_log_parity_reg_scanout),
754 .dout (log_parity_reg),
755 .l1clk (l1clk),
756 .din (next_log_parity_reg),
757 .siclk(siclk),
758 .soclk(soclk)
759 );
760
761ncu_ssiuif_ctl_msff_ctl_macro__width_1 u_dff_log_tout_reg
762 (
763 .scan_in(u_dff_log_tout_reg_scanin),
764 .scan_out(u_dff_log_tout_reg_scanout),
765 .dout (log_tout_reg),
766 .l1clk (l1clk),
767 .din (next_log_tout_reg),
768 .siclk(siclk),
769 .soclk(soclk)
770 );
771
772ncu_ssiuif_ctl_msff_ctl_macro__width_1 u_dff_ext_int_l
773 (
774 .scan_in(u_dff_ext_int_l_scanin),
775 .scan_out(u_dff_ext_int_l_scanout),
776 .dout (ext_int_l),
777 .l1clk (l1clk),
778 .din (io_jbi_ext_int_l_sync),
779 .siclk(siclk),
780 .soclk(soclk)
781 );
782
783ncu_ssiuif_ctl_msff_ctl_macro__width_1 u_dff_ext_int_l_d1
784 (
785 .scan_in(u_dff_ext_int_l_d1_scanin),
786 .scan_out(u_dff_ext_int_l_d1_scanout),
787 .dout (ext_int_l_d1),
788 .l1clk (l1clk),
789 .din (ext_int_l),
790 .siclk(siclk),
791 .soclk(soclk)
792 );
793
794ncu_ssiuif_ctl_msff_ctl_macro__width_1 u_dff_ext_int_l_d2
795 (
796 .scan_in(u_dff_ext_int_l_d2_scanin),
797 .scan_out(u_dff_ext_int_l_d2_scanout),
798 .dout (ext_int_l_d2),
799 .l1clk (l1clk),
800 .din (ext_int_l_d1),
801 .siclk(siclk),
802 .soclk(soclk)
803 );
804
805ncu_ssiuif_ctl_msff_ctl_macro__width_1 u_dff_ext_int_l_d3
806 (
807 .scan_in(u_dff_ext_int_l_d3_scanin),
808 .scan_out(u_dff_ext_int_l_d3_scanout),
809 .dout (ext_int_l_d3),
810 .l1clk (l1clk),
811 .din (ext_int_l_d2),
812 .siclk(siclk),
813 .soclk(soclk)
814 );
815
816ncu_ssiuif_ctl_msff_ctl_macro__width_1 u_dff_ext_int_l_d4
817 (
818 .scan_in(u_dff_ext_int_l_d4_scanin),
819 .scan_out(u_dff_ext_int_l_d4_scanout),
820 .dout (ext_int_l_d4),
821 .l1clk (l1clk),
822 .din (ext_int_l_d3),
823 .siclk(siclk),
824 .soclk(soclk)
825 );
826
827ncu_ssiuif_ctl_msff_ctl_macro__width_1 u_dff_ext_int_l_d5
828 (
829 .scan_in(u_dff_ext_int_l_d5_scanin),
830 .scan_out(u_dff_ext_int_l_d5_scanout),
831 .dout (ext_int_l_d5),
832 .l1clk (l1clk),
833 .din (ext_int_l_d4),
834 .siclk(siclk),
835 .soclk(soclk)
836 );
837
838ncu_ssiuif_ctl_msff_ctl_macro__width_1 u_dff_ext_int_l_d6
839 (
840 .scan_in(u_dff_ext_int_l_d6_scanin),
841 .scan_out(u_dff_ext_int_l_d6_scanout),
842 .dout (ext_int_l_d6),
843 .l1clk (l1clk),
844 .din (ext_int_l_d5),
845 .siclk(siclk),
846 .soclk(soclk)
847 );
848
849ncu_ssiuif_ctl_msff_ctl_macro__width_1 u_dff_ext_int_l_d7
850 (
851 .scan_in(u_dff_ext_int_l_d7_scanin),
852 .scan_out(u_dff_ext_int_l_d7_scanout),
853 .dout (ext_int_l_d7),
854 .l1clk (l1clk),
855 .din (ext_int_l_d6),
856 .siclk(siclk),
857 .soclk(soclk)
858 );
859
860
861//*******************************************************************************
862// DFFR Instantiations
863//*******************************************************************************
864
865ncu_ssiuif_ctl_msff_ctl_macro__width_2 u_dffrl_if_sm
866 (
867 .scan_in(u_dffrl_if_sm_scanin),
868 .scan_out(u_dffrl_if_sm_scanout),
869 .dout (if_sm[1:0]),
870 .l1clk (l1clk),
871 .din (next_if_sm[1:0]),
872 .siclk(siclk),
873 .soclk(soclk)
874 );
875
876ncu_ssiuif_ctl_msff_ctl_macro__width_1 u_dffrl_ucbif_sif_rdata_accpt
877 (
878 .scan_in(u_dffrl_ucbif_sif_rdata_accpt_scanin),
879 .scan_out(u_dffrl_ucbif_sif_rdata_accpt_scanout),
880 .dout (ucbif_sif_rdata_accpt),
881 .l1clk (l1clk),
882 .din (next_ucbif_sif_rdata_accpt),
883 .siclk(siclk),
884 .soclk(soclk)
885 );
886
887ncu_ssiuif_ctl_msff_ctl_macro__width_1 u_dffrl_ucbif_sif_timeout_accpt
888 (
889 .scan_in(u_dffrl_ucbif_sif_timeout_accpt_scanin),
890 .scan_out(u_dffrl_ucbif_sif_timeout_accpt_scanout),
891 .dout (ucbif_sif_timeout_accpt),
892 .l1clk (l1clk),
893 .din (next_ucbif_sif_timeout_accpt),
894 .siclk(siclk),
895 .soclk(soclk)
896 );
897
898assign n_err_int = err_int_rst_l ? next_err_int : 1'b0 ;
899ncu_ssiuif_ctl_msff_ctl_macro__width_1 u_dffrl_err_int
900 (
901 .scan_in(u_dffrl_err_int_scanin),
902 .scan_out(u_dffrl_err_int_scanout),
903 .dout (err_int),
904 .l1clk (l1clk),
905 .din (n_err_int),
906 .siclk(siclk),
907 .soclk(soclk)
908 );
909
910assign n_ext_int_l_negedge = ext_int_l_negedge_rst_l ? next_ext_int_l_negedge : 1'b0 ;
911ncu_ssiuif_ctl_msff_ctl_macro__width_1 u_dffrl_ext_int_l_negedge
912 (
913 .scan_in(u_dffrl_ext_int_l_negedge_scanin),
914 .scan_out(u_dffrl_ext_int_l_negedge_scanout),
915 .dout (ext_int_l_negedge),
916 .l1clk (l1clk),
917 .din (n_ext_int_l_negedge),
918 .siclk(siclk),
919 .soclk(soclk)
920 );
921
922
923ncu_ssiuif_ctl_msff_ctl_macro__width_1 toreg_ld0_ff
924 (
925 .scan_in(toreg_ld0_ff_scanin),
926 .scan_out(toreg_ld0_ff_scanout),
927 .dout (toreg_ld0_),
928 .l1clk (l1clk),
929 .din (1'b1),
930 .siclk(siclk),
931 .soclk(soclk)
932 );
933
934
935ncu_ssiuif_ctl_msff_ctl_macro__width_1 toreg_ld1_ff
936 (
937 .scan_in(toreg_ld1_ff_scanin),
938 .scan_out(toreg_ld1_ff_scanout),
939 .dout (toreg_ld1_n),
940 .l1clk (l1clk),
941 .din (toreg_ld0_),
942 .siclk(siclk),
943 .soclk(soclk)
944 );
945
946//*******************************************************************************
947// DFFRE Instantiations
948//*******************************************************************************
949
950ncu_ssiuif_ctl_msff_ctl_macro__en_1__width_1 u_dffrle_ifill
951 (
952 .scan_in(u_dffrle_ifill_scanin),
953 .scan_out(u_dffrle_ifill_scanout),
954 .dout (ifill),
955 .l1clk (l1clk),
956 .en (ifill_en),
957 .din (next_ifill),
958 .siclk(siclk),
959 .soclk(soclk)
960 );
961
962ncu_ssiuif_ctl_msff_ctl_macro__en_1__width_6 u_dffrle_ucbif_ucb_thr_id_out
963 (
964 .scan_in(u_dffrle_ucbif_ucb_thr_id_out_scanin),
965 .scan_out(u_dffrle_ucbif_ucb_thr_id_out_scanout),
966 .dout (ucbif_ucb_thr_id_out[5:0]),
967 .l1clk (l1clk),
968 .en (ucbif_ucb_thr_id_out_en),
969 .din (next_ucbif_ucb_thr_id_out[5:0]),
970 .siclk(siclk),
971 .soclk(soclk)
972 );
973
974ncu_ssiuif_ctl_msff_ctl_macro__en_1__width_2 u_dffrle_ucbif_ucb_buf_id_out
975 (
976 .scan_in(u_dffrle_ucbif_ucb_buf_id_out_scanin),
977 .scan_out(u_dffrle_ucbif_ucb_buf_id_out_scanout),
978 .dout (ucbif_ucb_buf_id_out[1:0]),
979 .l1clk (l1clk),
980 .en (ucbif_ucb_buf_id_out_en),
981 .din (next_ucbif_ucb_buf_id_out[1:0]),
982 .siclk(siclk),
983 .soclk(soclk)
984 );
985
986
987//*******************************************************************************
988// Rule Checks
989//*******************************************************************************
990
991//synopsys translate_off
992
993//always @ ( /*AUTOSENSE*/if_sm or sif_ucbif_rdata_vld) begin
994//@iol2clk;
995//if (if_sm == IF_ACPT & sif_ucbif_rdata_vld)
996 //$dispmon ("jbi_ssi_ucbif", 49, "%d %m: ERROR - unexpected read return in IF_ACPT state", $time);
997//end
998
999//synopsys translate_on
1000
1001
1002/**** adding clock header ****/
1003ncu_ssiuif_ctl_l1clkhdr_ctl_macro clkgen (
1004 .l2clk (iol2clk),
1005 .l1en (1'b1),
1006 .l1clk (l1clk),
1007 .pce_ov(pce_ov),
1008 .stop(stop),
1009 .se(se)
1010 );
1011
1012/*** building tcu port ***/
1013assign siclk = tcu_aclk;
1014assign soclk = tcu_bclk;
1015assign se = tcu_scan_en;
1016assign pce_ov = tcu_pce_ov;
1017assign stop = tcu_clk_stop;
1018
1019// fixscan start:
1020assign u_dff_io_jbi_ext_int_l_pre_sync_scanin = scan_in ;
1021assign u_dff_io_jbi_ext_int_l_sync_scanin = u_dff_io_jbi_ext_int_l_pre_sync_scanout;
1022assign u_dff_timeout_reg_scanin = u_dff_io_jbi_ext_int_l_sync_scanout;
1023assign u_dff_log_parity_reg_scanin = u_dff_timeout_reg_scanout;
1024assign u_dff_log_tout_reg_scanin = u_dff_log_parity_reg_scanout;
1025assign u_dff_ext_int_l_scanin = u_dff_log_tout_reg_scanout;
1026assign u_dff_ext_int_l_d1_scanin = u_dff_ext_int_l_scanout ;
1027assign u_dff_ext_int_l_d2_scanin = u_dff_ext_int_l_d1_scanout;
1028assign u_dff_ext_int_l_d3_scanin = u_dff_ext_int_l_d2_scanout;
1029assign u_dff_ext_int_l_d4_scanin = u_dff_ext_int_l_d3_scanout;
1030assign u_dff_ext_int_l_d5_scanin = u_dff_ext_int_l_d4_scanout;
1031assign u_dff_ext_int_l_d6_scanin = u_dff_ext_int_l_d5_scanout;
1032assign u_dff_ext_int_l_d7_scanin = u_dff_ext_int_l_d6_scanout;
1033assign u_dffrl_if_sm_scanin = u_dff_ext_int_l_d7_scanout;
1034assign u_dffrl_ucbif_sif_rdata_accpt_scanin = u_dffrl_if_sm_scanout ;
1035assign u_dffrl_ucbif_sif_timeout_accpt_scanin = u_dffrl_ucbif_sif_rdata_accpt_scanout;
1036assign u_dffrl_err_int_scanin = u_dffrl_ucbif_sif_timeout_accpt_scanout;
1037assign u_dffrl_ext_int_l_negedge_scanin = u_dffrl_err_int_scanout ;
1038assign toreg_ld0_ff_scanin = u_dffrl_ext_int_l_negedge_scanout;
1039assign toreg_ld1_ff_scanin = toreg_ld0_ff_scanout ;
1040assign u_dffrle_ifill_scanin = toreg_ld1_ff_scanout ;
1041assign u_dffrle_ucbif_ucb_thr_id_out_scanin = u_dffrle_ifill_scanout ;
1042assign u_dffrle_ucbif_ucb_buf_id_out_scanin = u_dffrle_ucbif_ucb_thr_id_out_scanout;
1043assign scan_out = u_dffrle_ucbif_ucb_buf_id_out_scanout;
1044// fixscan end:
1045endmodule
1046
1047// Local Variables:
1048// verilog-library-directories:("." "../../common/rtl")
1049// verilog-auto-sense-defines-constant:t
1050// End:
1051
1052
1053
1054
1055
1056
1057
1058
1059// any PARAMS parms go into naming of macro
1060
1061module ncu_ssiuif_ctl_msff_ctl_macro__width_1 (
1062 din,
1063 l1clk,
1064 scan_in,
1065 siclk,
1066 soclk,
1067 dout,
1068 scan_out);
1069wire [0:0] fdin;
1070
1071 input [0:0] din;
1072 input l1clk;
1073 input scan_in;
1074
1075
1076 input siclk;
1077 input soclk;
1078
1079 output [0:0] dout;
1080 output scan_out;
1081assign fdin[0:0] = din[0:0];
1082
1083
1084
1085
1086
1087
1088dff #(1) d0_0 (
1089.l1clk(l1clk),
1090.siclk(siclk),
1091.soclk(soclk),
1092.d(fdin[0:0]),
1093.si(scan_in),
1094.so(scan_out),
1095.q(dout[0:0])
1096);
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109endmodule
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123// any PARAMS parms go into naming of macro
1124
1125module ncu_ssiuif_ctl_msff_ctl_macro__width_25 (
1126 din,
1127 l1clk,
1128 scan_in,
1129 siclk,
1130 soclk,
1131 dout,
1132 scan_out);
1133wire [24:0] fdin;
1134wire [23:0] so;
1135
1136 input [24:0] din;
1137 input l1clk;
1138 input scan_in;
1139
1140
1141 input siclk;
1142 input soclk;
1143
1144 output [24:0] dout;
1145 output scan_out;
1146assign fdin[24:0] = din[24:0];
1147
1148
1149
1150
1151
1152
1153dff #(25) d0_0 (
1154.l1clk(l1clk),
1155.siclk(siclk),
1156.soclk(soclk),
1157.d(fdin[24:0]),
1158.si({scan_in,so[23:0]}),
1159.so({so[23:0],scan_out}),
1160.q(dout[24:0])
1161);
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174endmodule
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188// any PARAMS parms go into naming of macro
1189
1190module ncu_ssiuif_ctl_msff_ctl_macro__width_2 (
1191 din,
1192 l1clk,
1193 scan_in,
1194 siclk,
1195 soclk,
1196 dout,
1197 scan_out);
1198wire [1:0] fdin;
1199wire [0:0] so;
1200
1201 input [1:0] din;
1202 input l1clk;
1203 input scan_in;
1204
1205
1206 input siclk;
1207 input soclk;
1208
1209 output [1:0] dout;
1210 output scan_out;
1211assign fdin[1:0] = din[1:0];
1212
1213
1214
1215
1216
1217
1218dff #(2) d0_0 (
1219.l1clk(l1clk),
1220.siclk(siclk),
1221.soclk(soclk),
1222.d(fdin[1:0]),
1223.si({scan_in,so[0:0]}),
1224.so({so[0:0],scan_out}),
1225.q(dout[1:0])
1226);
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239endmodule
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253// any PARAMS parms go into naming of macro
1254
1255module ncu_ssiuif_ctl_msff_ctl_macro__en_1__width_1 (
1256 din,
1257 en,
1258 l1clk,
1259 scan_in,
1260 siclk,
1261 soclk,
1262 dout,
1263 scan_out);
1264wire [0:0] fdin;
1265
1266 input [0:0] din;
1267 input en;
1268 input l1clk;
1269 input scan_in;
1270
1271
1272 input siclk;
1273 input soclk;
1274
1275 output [0:0] dout;
1276 output scan_out;
1277assign fdin[0:0] = (din[0:0] & {1{en}}) | (dout[0:0] & ~{1{en}});
1278
1279
1280
1281
1282
1283
1284dff #(1) d0_0 (
1285.l1clk(l1clk),
1286.siclk(siclk),
1287.soclk(soclk),
1288.d(fdin[0:0]),
1289.si(scan_in),
1290.so(scan_out),
1291.q(dout[0:0])
1292);
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305endmodule
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319// any PARAMS parms go into naming of macro
1320
1321module ncu_ssiuif_ctl_msff_ctl_macro__en_1__width_6 (
1322 din,
1323 en,
1324 l1clk,
1325 scan_in,
1326 siclk,
1327 soclk,
1328 dout,
1329 scan_out);
1330wire [5:0] fdin;
1331wire [4:0] so;
1332
1333 input [5:0] din;
1334 input en;
1335 input l1clk;
1336 input scan_in;
1337
1338
1339 input siclk;
1340 input soclk;
1341
1342 output [5:0] dout;
1343 output scan_out;
1344assign fdin[5:0] = (din[5:0] & {6{en}}) | (dout[5:0] & ~{6{en}});
1345
1346
1347
1348
1349
1350
1351dff #(6) d0_0 (
1352.l1clk(l1clk),
1353.siclk(siclk),
1354.soclk(soclk),
1355.d(fdin[5:0]),
1356.si({scan_in,so[4:0]}),
1357.so({so[4:0],scan_out}),
1358.q(dout[5:0])
1359);
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372endmodule
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386// any PARAMS parms go into naming of macro
1387
1388module ncu_ssiuif_ctl_msff_ctl_macro__en_1__width_2 (
1389 din,
1390 en,
1391 l1clk,
1392 scan_in,
1393 siclk,
1394 soclk,
1395 dout,
1396 scan_out);
1397wire [1:0] fdin;
1398wire [0:0] so;
1399
1400 input [1:0] din;
1401 input en;
1402 input l1clk;
1403 input scan_in;
1404
1405
1406 input siclk;
1407 input soclk;
1408
1409 output [1:0] dout;
1410 output scan_out;
1411assign fdin[1:0] = (din[1:0] & {2{en}}) | (dout[1:0] & ~{2{en}});
1412
1413
1414
1415
1416
1417
1418dff #(2) d0_0 (
1419.l1clk(l1clk),
1420.siclk(siclk),
1421.soclk(soclk),
1422.d(fdin[1:0]),
1423.si({scan_in,so[0:0]}),
1424.so({so[0:0],scan_out}),
1425.q(dout[1:0])
1426);
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439endmodule
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453// any PARAMS parms go into naming of macro
1454
1455module ncu_ssiuif_ctl_l1clkhdr_ctl_macro (
1456 l2clk,
1457 l1en,
1458 pce_ov,
1459 stop,
1460 se,
1461 l1clk);
1462
1463
1464 input l2clk;
1465 input l1en;
1466 input pce_ov;
1467 input stop;
1468 input se;
1469 output l1clk;
1470
1471
1472
1473
1474
1475cl_sc1_l1hdr_8x c_0 (
1476
1477
1478 .l2clk(l2clk),
1479 .pce(l1en),
1480 .l1clk(l1clk),
1481 .se(se),
1482 .pce_ov(pce_ov),
1483 .stop(stop)
1484);
1485
1486
1487
1488endmodule
1489
1490
1491
1492
1493
1494
1495
1496