Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / design / sys / iop / tcu / rtl / tcu_jtag_tap_ctl.v
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: tcu_jtag_tap_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 TAP_RESET 4'hF
36`define TAP_CAP_IR 4'hE
37`define TAP_UPDATE_IR 4'hD
38`define TAP_RTI 4'hC
39`define TAP_PAUSE_IR 4'hB
40`define TAP_SHIFT_IR 4'hA
41`define TAP_EXIT1_IR 4'h9
42`define TAP_EXIT2_IR 4'h8
43`define TAP_SEL_DR 4'h7
44`define TAP_CAP_DR 4'h6
45`define TAP_UPDATE_DR 4'h5
46`define TAP_SEL_IR 4'h4
47`define TAP_PAUSE_DR 4'h3
48`define TAP_SHIFT_DR 4'h2
49`define TAP_EXIT1_DR 4'h1
50`define TAP_EXIT2_DR 4'h0
51
52//*****************************
53// JTAG IDCODE - bits 27:1 need to be UPDATED
54// 31:28 = jtag_id[3:0] Version = 4 bits
55// 27:12 = 0bxxxx_xxxx_xxxx_xxxx Part Number = 16 bits
56// 11:1 = 0b000_0011_1110 Manuf. Id. = 11 bits; Sun=0x03e
57// 0 = 1'b1 lsb is constant one = 1 bit
58//*****************************
59`define PART_ID 16'h2aaa
60`define MANUF_ID 11'h3e
61
62//*****************************
63// JTAG Instruction Opcodes
64//*****************************
65
66`define TAP_EXTEST 8'h00
67`define TAP_BYPASS 8'hff
68`define TAP_IDCODE 8'h01
69`define TAP_SAMPLE_PRELOAD 8'h02
70`define TAP_HIGHZ 8'h03
71`define TAP_CLAMP 8'h04
72`define TAP_EXTEST_PULSE 8'h05
73`define TAP_EXTEST_TRAIN 8'h06
74
75`define TAP_CREG_ADDR 8'h08
76`define TAP_CREG_WDATA 8'h09
77`define TAP_CREG_RDATA 8'h0a
78`define TAP_CREG_SCRATCH 8'h0b
79`define TAP_NCU_WR 8'h0c
80`define TAP_NCU_RD 8'h0d
81`define TAP_NCU_WADDR 8'h0e
82`define TAP_NCU_WDATA 8'h0f
83`define TAP_NCU_RADDR 8'h10
84
85`define TAP_SERSCAN 8'h80
86`define TAP_CHAINSEL 8'h81
87`define TAP_MT_ACCESS 8'h82
88`define TAP_MT_CLEAR 8'h83
89`define TAP_MT_SCAN 8'h84
90
91`define TAP_TP_ACCESS 8'h88
92`define TAP_TP_CLEAR 8'h89
93
94`define TAP_FUSE_READ 8'h28
95`define TAP_FUSE_BYPASS_DATA 8'h29
96`define TAP_FUSE_BYPASS 8'h2a
97`define TAP_FUSE_ROW_ADDR 8'h2b
98`define TAP_FUSE_COL_ADDR 8'h2c
99`define TAP_FUSE_READ_MODE 8'h2d
100`define TAP_FUSE_DEST_SAMPLE 8'h2e
101`define TAP_FUSE_RVCLR 8'h2f
102
103`define TAP_MBIST_CLKSTPEN 8'h13
104`define TAP_MBIST_BYPASS 8'h14
105`define TAP_MBIST_MODE 8'h15
106`define TAP_MBIST_START 8'h16
107`define TAP_MBIST_RESULT 8'h18
108`define TAP_MBIST_DIAG 8'h19
109`define TAP_MBIST_GETDONE 8'h1a
110`define TAP_MBIST_GETFAIL 8'h1b
111`define TAP_DMO_ACCESS 8'h1c
112`define TAP_DMO_CLEAR 8'h1d
113`define TAP_DMO_CONFIG 8'h1e
114`define TAP_MBIST_ABORT 8'h1f
115
116`define TAP_SPC_SHSCAN 5'b00110
117`define TAP_SPCTHR0_SHSCAN 8'h30
118`define TAP_SPCTHR1_SHSCAN 8'h31
119`define TAP_SPCTHR2_SHSCAN 8'h32
120`define TAP_SPCTHR3_SHSCAN 8'h33
121`define TAP_SPCTHR4_SHSCAN 8'h34
122`define TAP_SPCTHR5_SHSCAN 8'h35
123`define TAP_SPCTHR6_SHSCAN 8'h36
124`define TAP_SPCTHR7_SHSCAN 8'h37
125`define TAP_L2T_SHSCAN 8'h38
126
127`define TAP_CLOCK_SSTOP 8'h40
128`define TAP_CLOCK_HSTOP 8'h41
129`define TAP_CLOCK_START 8'h42
130`define TAP_CLOCK_DOMAIN 8'h43
131`define TAP_CLOCK_STATUS 8'h44
132`define TAP_CLKSTP_DELAY 8'h45
133`define TAP_CORE_SELECT 8'h46
134
135`define TAP_DE_COUNT 8'h48
136`define TAP_CYCLE_COUNT 8'h49
137`define TAP_TCU_DCR 8'h4A
138`define TAP_CORE_RUN_STATUS 8'h4C
139`define TAP_DOSS_ENABLE 8'h4D
140`define TAP_DOSS_MODE 8'h4E
141`define TAP_SS_REQUEST 8'h4F
142
143`define TAP_DOSS_STATUS 8'h50
144`define TAP_CS_MODE 8'h51
145`define TAP_CS_STATUS 8'h52
146
147`define TAP_L2_ADDR 8'h58
148`define TAP_L2_WRDATA 8'h59
149`define TAP_L2_WR 8'h5A
150`define TAP_L2_RD 8'h5B
151
152`define TAP_LBIST_START 8'h60
153`define TAP_LBIST_BYPASS 8'h61
154`define TAP_LBIST_MODE 8'h62
155`define TAP_LBIST_ACCESS 8'h63
156`define TAP_LBIST_GETDONE 8'h64
157`define TAP_LBIST_ABORT 8'h65
158
159`define TAP_STCI_ACCESS 8'h90
160`define TAP_STCI_CLEAR 8'h91
161
162`define TAP_JTPOR_ACCESS 8'hA0
163`define TAP_JTPOR_CLEAR 8'hA1
164`define TAP_JTPOR_STATUS 8'hA2
165`define TAP_SCKBYP_ACCESS 8'hA3
166`define TAP_SCKBYP_CLEAR 8'hA4
167
168
169
170
171module tcu_jtag_tap_ctl (
172 io_tdi,
173 io_tms,
174 io_tck,
175 io_trst_l,
176 jtag_dr_tdo,
177 ext_dr_tdo,
178 bypass_sel,
179 ext_jtag_instr,
180 tap_tdo,
181 tap_tdo_en,
182 tap_state,
183 instr,
184 next_instr,
185 capture_dr_state,
186 shift_dr_state,
187 update_dr_state,
188 update_ireg,
189 tlr_state,
190 tap_scan_in,
191 siclk,
192 soclk,
193 tcu_jtag_se,
194 tap_scan_out);
195wire tck_l;
196wire l1en;
197wire pce_ov;
198wire stop;
199wire se;
200wire l1tck;
201wire tap_state_reg_scanin;
202wire tap_state_reg_scanout;
203wire [3:0] tap_next_state_l;
204wire [3:0] tap_state_l;
205wire [3:0] tap_next_state;
206wire capture_ir_state;
207wire shift_ir_state;
208wire update_ir_state;
209wire shift_exit1_dr_state;
210wire [7:0] tap_instr_reg_scanin;
211wire [7:0] tap_instr_reg_scanout;
212wire [0:0] next_instr_l;
213wire [0:0] instr_l;
214wire [7:0] instr_q;
215wire tap_instr_reg_scanout_l;
216wire ireg_tdo;
217wire bypass_reg_scanin;
218wire bypass_reg_scanout;
219wire next_tdi_bypass;
220wire bypass_tdo;
221wire next_tdo;
222wire bypass_ll_reg_scanin;
223wire bypass_ll_reg_scanout_unused;
224wire int_dr_tdo;
225wire tdo_enable_reg_scanin;
226wire tdo_enable_reg_scanout_unused;
227wire next_tdo_en;
228wire tdo_en;
229wire tlr_state_reg_scanin;
230wire tlr_state_reg_scanout;
231wire tap_next_tlr_l;
232wire tlr_out_l;
233
234 //inputs
235 input io_tdi;
236 input io_tms;
237 input io_tck;
238 input io_trst_l;
239 input jtag_dr_tdo; // scan-outs from jtag internal data regs
240 input ext_dr_tdo; // scan-outs from data regs external to jtag
241 input bypass_sel; // indicates an instr. will use the bypass reg.
242 input ext_jtag_instr;
243 //outputs
244 output tap_tdo;
245 output tap_tdo_en;
246 output [3:0] tap_state; // output [15:0] jtag_sm_state;
247 output [7:0] instr;
248 output [7:0] next_instr;
249 output capture_dr_state;
250 output shift_dr_state;
251 output update_dr_state;
252 output update_ireg;
253 output tlr_state;
254
255 //scan
256 input tap_scan_in;
257 input siclk;
258 input soclk;
259 input tcu_jtag_se;
260 output tap_scan_out;
261
262 //assign tck = io_tck;
263 assign tck_l = ~io_tck;
264
265 // Scan reassigns
266 assign l1en = 1'b1; // this is "ce" or "pce"
267 assign pce_ov = 1'b1;
268 assign stop = 1'b0;
269 assign se = tcu_jtag_se;
270
271 tcu_jtag_tap_ctl_l1clkhdr_ctl_macro tap_clkgen
272 (
273 .l2clk (io_tck),
274 .l1clk (l1tck ),
275 .l1en(l1en),
276 .pce_ov(pce_ov),
277 .stop(stop),
278 .se(se)
279 );
280
281 ////////////////////////////////////////////////////////////////////////
282 // TAP State Machine
283 ////////////////////////////////////////////////////////////////////////
284
285 //register bank to store TAP state; these will change to reset flops when available
286 tcu_jtag_tap_ctl_msff_ctl_macro__jtag_1__width_4 tap_state_reg
287 (
288 .scan_in (tap_state_reg_scanin),
289 .scan_out (tap_state_reg_scanout),
290 .l1clk (l1tck),
291 .updateclk (l1tck),
292 .reset (~io_trst_l),
293 .din (tap_next_state_l[3:0]),
294 .dout (tap_state_l[3:0]),
295 .siclk(siclk),
296 .soclk(soclk)
297 );
298 //inverting because of reset value, to allow flush of zeros
299 assign tap_next_state_l[3:0] = ~tap_next_state[3:0];
300 assign tap_state = ~tap_state_l;
301
302
303 //tap states (tap_state[3:0]) mapped to common industry usage
304 // - see jtag.h include file
305 reg [3:0] next_state;
306 always @ (tap_state or io_tms) begin
307 case (tap_state)
308 `TAP_RESET: begin
309 if (io_tms) next_state[3:0] = `TAP_RESET;
310 else next_state[3:0] = `TAP_RTI;
311 end
312 `TAP_RTI: begin
313 if (io_tms) next_state[3:0] = `TAP_SEL_DR;
314 else next_state[3:0] = `TAP_RTI;
315 end
316 `TAP_SEL_DR: begin
317 if (io_tms) next_state[3:0] = `TAP_SEL_IR;
318 else next_state[3:0] = `TAP_CAP_DR;
319 end
320 `TAP_CAP_DR: begin
321 if (io_tms) next_state[3:0] = `TAP_EXIT1_DR;
322 else next_state[3:0] = `TAP_SHIFT_DR;
323 end
324 `TAP_SHIFT_DR: begin
325 if (io_tms) next_state[3:0] = `TAP_EXIT1_DR;
326 else next_state[3:0] = `TAP_SHIFT_DR;
327 end
328 `TAP_EXIT1_DR: begin
329 if (io_tms) next_state[3:0] = `TAP_UPDATE_DR;
330 else next_state[3:0] = `TAP_PAUSE_DR;
331 end
332 `TAP_PAUSE_DR: begin
333 if (io_tms) next_state[3:0] = `TAP_EXIT2_DR;
334 else next_state[3:0] = `TAP_PAUSE_DR;
335 end
336 `TAP_EXIT2_DR: begin
337 if (io_tms) next_state[3:0] = `TAP_UPDATE_DR;
338 else next_state[3:0] = `TAP_SHIFT_DR;
339 end
340 `TAP_UPDATE_DR: begin
341 if (io_tms) next_state[3:0] = `TAP_SEL_DR;
342 else next_state[3:0] = `TAP_RTI;
343 end
344 `TAP_SEL_IR: begin
345 if (io_tms) next_state[3:0] = `TAP_RESET;
346 else next_state[3:0] = `TAP_CAP_IR;
347 end
348 `TAP_CAP_IR: begin
349 if (io_tms) next_state[3:0] = `TAP_EXIT1_IR;
350 else next_state[3:0] = `TAP_SHIFT_IR;
351 end
352 `TAP_SHIFT_IR: begin
353 if (io_tms) next_state[3:0] = `TAP_EXIT1_IR;
354 else next_state[3:0] = `TAP_SHIFT_IR;
355 end
356 `TAP_EXIT1_IR: begin
357 if (io_tms) next_state[3:0] = `TAP_UPDATE_IR;
358 else next_state[3:0] = `TAP_PAUSE_IR;
359 end
360 `TAP_PAUSE_IR: begin
361 if (io_tms) next_state[3:0] = `TAP_EXIT2_IR;
362 else next_state[3:0] = `TAP_PAUSE_IR;
363 end
364 `TAP_EXIT2_IR: begin
365 if (io_tms) next_state[3:0] = `TAP_UPDATE_IR;
366 else next_state[3:0] = `TAP_SHIFT_IR;
367 end
368 `TAP_UPDATE_IR: begin
369 if (io_tms) next_state[3:0] = `TAP_SEL_DR;
370 else next_state[3:0] = `TAP_RTI;
371 end
372 default: next_state[3:0] = 4'b1111;
373 endcase
374 end
375
376 // implement asynchronous reset
377 // --do this until we get reset flops in library
378 assign tap_next_state = io_trst_l ? next_state[3:0] : 4'hF;
379
380 ////////////////////////////////////////////////////////////////////////
381 // Signals to indicate specific tap states
382 ////////////////////////////////////////////////////////////////////////
383 assign capture_dr_state = (tap_state[3:0] == `TAP_CAP_DR);
384 assign shift_dr_state = (tap_state[3:0] == `TAP_SHIFT_DR);
385 //assign pause_dr_state = (tap_state[3:0] == `TAP_PAUSE_DR);
386 assign update_dr_state = (tap_state[3:0] == `TAP_UPDATE_DR);
387 assign capture_ir_state = (tap_state[3:0] == `TAP_CAP_IR);
388 assign shift_ir_state = (tap_state[3:0] == `TAP_SHIFT_IR);
389 assign update_ir_state = (tap_state[3:0] == `TAP_UPDATE_IR);
390 assign shift_exit1_dr_state = (tap_state[3:0] == `TAP_SHIFT_DR) |
391 (tap_state[3:0] == `TAP_EXIT1_DR);
392 //assign shift_exit2_dr_state = (tap_state[3:0] == `TAP_SHIFT_DR) |
393 // (tap_state[3:0] == `TAP_EXIT2_DR);
394 //assign cap_shift_dr_state = (tap_state[3:0] == `TAP_CAP_DR) |
395 // (tap_state[3:0] == `TAP_SHIFT_DR);
396 //assign tlr_state = 1'b1; //(tap_state[3:0] == `TAP_RESET); // TLR ECO
397
398 //// ClockDR signal to boundary scan logic - this will change when bscan
399 //// clocking is finalized?
400 //msff_ctl_macro clock_dr_reg (width=1)
401 //(
402 // .scan_in (clock_dr_reg_scanin),
403 // .scan_out (clock_dr_reg_scanout),
404 // .l1clk (tck_l),
405 // .din (cap_shift_dr_state),
406 // .dout (pre_clock_dr)
407 //);
408 //
409 //assign clock_dr = pre_clock_dr & tck;
410
411 ////////////////////////////////////////////////////////////////////////
412 // Instruction Register
413 ////////////////////////////////////////////////////////////////////////
414/*
415 // this is the instruction SHIFT register; separate lsb out of grouping
416 // when trst_l used?
417 msff_ctl_macro tap_instr_shift_reg (width=8)
418 (
419 .scan_in (tap_instr_shift_reg_scanin),
420 .scan_out (tap_instr_shift_reg_scanout),
421 .l1clk (l1tck),
422 .din ({next_new_instr[7:1],next_new_instr_l[0]}),
423 .dout ({new_instr[7:1], new_instr_l[0]})
424 );
425
426 // Invert these so during capture_ir state, 1 is effectively put in lsb
427 // - this also allows flush of 0's to put IDCODE into shift IReg
428 assign new_instr[0] = ~new_instr_l[0];
429 assign next_new_instr_l[0] = ~next_new_instr[0];
430
431 // this perfoms shift of IReg, and gets IDCODE during capIR
432 assign next_new_instr[7:0] = shift_ir_state ? {io_tdi, new_instr[7:1]}
433 : capture_ir_state ? 8'b00000001 : new_instr[7:0];
434 // this is TDO output of shift IReg
435 assign ireg_tdo = new_instr[0];
436
437 // this is the instruction UPDATE register - gets tck_l
438 // - it needs to load IDCODE instr. during TLR state, and asynchronously during trst_l
439 msff_ctl_macro tap_instr_upd_reg (width=8)
440 (
441 .scan_in (tap_instr_upd_reg_scanin),
442 .scan_out (tap_instr_upd_reg_scanout_unused),
443 .l1clk (tck_l),
444 .din ({next_instr[7:1],next_instr_l[0]}),
445 .dout ({instr[7:1],instr_l[0]})
446 );
447
448 // Invert these so during test-logic-reset state, 1 is effectively put in lsb
449 // - this also allows flush of 0's to put IDCODE into update IReg
450 assign instr[0] = ~instr_l[0];
451 assign next_instr_l[0] = ~next_instr[0];
452
453 // this puts IDCODE in during TLR state, and new instr. during update_IR
454 assign next_instr[7:0] = update_ir_state ? new_instr[7:0]
455 : tlr_state ? 8'b00000001 : instr[7:0];
456*/
457
458 tcu_jtag_tap_ctl_msff_ctl_macro__fs_1__jtag_1__width_8 tap_instr_reg
459 (
460 .scan_in (tap_instr_reg_scanin[7:0]),
461 .scan_out (tap_instr_reg_scanout[7:0]),
462 .l1clk (l1tck),
463 .updateclk (update_ireg),
464 .reset (~io_trst_l),
465 .din ({next_instr[7:1],next_instr_l[0]}),
466 .dout ({instr[7:1],instr_l[0]}),
467 .siclk(siclk),
468 .soclk(soclk)
469 );
470 assign instr[0] = ~instr_l[0];
471 assign next_instr_l[0] = ~next_instr[0];
472
473 assign instr_q[7:0] = {tap_instr_reg_scanout[7], tap_instr_reg_scanout[6],
474 tap_instr_reg_scanout[5], tap_instr_reg_scanout[4],
475 tap_instr_reg_scanout[3], tap_instr_reg_scanout[2],
476 tap_instr_reg_scanout[1], tap_instr_reg_scanout_l};
477 assign tap_instr_reg_scanout_l = ~tap_instr_reg_scanout[0];
478
479 assign next_instr[7:0] = shift_ir_state ? {io_tdi, instr_q[7:1]}
480 : capture_ir_state ? 8'b00000001
481 : tlr_state ? 8'b00000001 : instr_q[7:0];
482 // TLR ECO
483// assign update_ireg = ~l1tck & (update_ir_state | tlr_state) & io_trst_l;
484 assign update_ireg = ~l1tck & (tap_state[3] & tap_state[2] & tap_state[0]) & io_trst_l;
485 //assign update_ireg = ~l1tck & (update_ir_state | 1'b0 ) & io_trst_l;
486
487 // this is TDO output of IReg
488 //assign ireg_tdo = instr[0];
489 assign ireg_tdo = tap_instr_reg_scanout_l;
490
491
492 ////////////////////////////////////////////////////////////////////////
493 // Bypass Register
494 ////////////////////////////////////////////////////////////////////////
495
496 // bypass register
497 // - needs to load 0 at tck rising in capDR when bypass selected
498 // - does not need trst_l
499 tcu_jtag_tap_ctl_msff_ctl_macro__width_1 bypass_reg
500 (
501 .scan_in (bypass_reg_scanin),
502 .scan_out (bypass_reg_scanout),
503 .l1clk (l1tck),
504 .din (next_tdi_bypass),
505 .dout (bypass_tdo),
506 .siclk(siclk),
507 .soclk(soclk)
508 );
509 // shift for bypass register
510 assign next_tdi_bypass = (bypass_sel & shift_dr_state) ? io_tdi
511 : (bypass_sel & capture_dr_state) ? 1'b0 : bypass_tdo;
512 // muxing for ireg, bypass reg, or other jtag internal data registers through tdo path
513 assign next_tdo = shift_ir_state ? ireg_tdo
514 : bypass_sel ? bypass_tdo : jtag_dr_tdo;
515
516 // lockup latch for bypass register
517 // - does not need trst_l, but can use it
518 // - this is not needed since we use non-overlapping a/b clocks
519 tcu_jtag_tap_ctl_msff_ctl_macro__width_1 bypass_ll_reg
520 (
521 .scan_in (bypass_ll_reg_scanin),
522 .scan_out (bypass_ll_reg_scanout_unused),
523 .l1clk (tck_l),
524 .din (next_tdo),
525 .dout (int_dr_tdo),
526 .siclk(siclk),
527 .soclk(soclk)
528 );
529 assign tap_tdo = (ext_jtag_instr & shift_exit1_dr_state) ? ext_dr_tdo : int_dr_tdo;
530
531 //assign tap_tdo = next_tdo;
532
533 // lockup latch for tdo enable signal to I/O frame
534 // - does not need trst_l, but can use it
535 tcu_jtag_tap_ctl_msff_ctl_macro__jtag_1__width_1 tdo_enable_reg
536 (
537 .scan_in (tdo_enable_reg_scanin),
538 .scan_out (tdo_enable_reg_scanout_unused),
539 .l1clk (tck_l),
540 .updateclk (tck_l),
541 .reset (~io_trst_l),
542 .din (next_tdo_en),
543 .dout (tdo_en),
544 .siclk(siclk),
545 .soclk(soclk)
546 );
547 // TLR ECO
548 //assign next_tdo_en = tlr_state ? 1'b0 : (shift_dr_state | shift_ir_state);
549 assign next_tdo_en = shift_dr_state | shift_ir_state;
550 assign tap_tdo_en = tdo_en & ~tlr_state;
551
552 ////////////////////////////////////////////////////////////////////////
553 // Extra State-Machine Flop for TEST_LOGIC_RESET State
554 // TLR ECO
555 ////////////////////////////////////////////////////////////////////////
556
557 //This flop serves as a single-bit source for the tlr_state signal
558 tcu_jtag_tap_ctl_msff_ctl_macro__jtag_1__width_1 tlr_state_reg
559 (
560 .scan_in (tlr_state_reg_scanin),
561 .scan_out (tlr_state_reg_scanout),
562 .l1clk (l1tck),
563 .updateclk (l1tck),
564 .reset (~io_trst_l),
565 .din (tap_next_tlr_l),
566 .dout (tlr_out_l),
567 .siclk(siclk),
568 .soclk(soclk)
569 );
570 //inverting because of reset value, to allow flush of zeros
571 assign tap_next_tlr_l = tap_next_state_l[3] | tap_next_state_l[2]
572 | tap_next_state_l[1] | tap_next_state_l[0];
573 assign tlr_state = ~tlr_out_l;
574
575 // fixscan start
576 assign tlr_state_reg_scanin = tap_scan_in ;
577 assign tap_state_reg_scanin = tlr_state_reg_scanout ;
578 //assign tap_state_reg_scanin = tap_scan_in ;
579 assign tap_instr_reg_scanin[7] = tap_state_reg_scanout;
580 assign tap_instr_reg_scanin[6] = tap_instr_reg_scanout[7];
581 assign tap_instr_reg_scanin[5] = tap_instr_reg_scanout[6];
582 assign tap_instr_reg_scanin[4] = tap_instr_reg_scanout[5];
583 assign tap_instr_reg_scanin[3] = tap_instr_reg_scanout[4];
584 assign tap_instr_reg_scanin[2] = tap_instr_reg_scanout[3];
585 assign tap_instr_reg_scanin[1] = tap_instr_reg_scanout[2];
586 assign tap_instr_reg_scanin[0] = tap_instr_reg_scanout[1];
587 assign bypass_reg_scanin = tap_instr_reg_scanout[0];
588 assign bypass_ll_reg_scanin = 1'b0; //bypass_reg_scanout;
589 assign tdo_enable_reg_scanin = 1'b0; //bypass_ll_reg_scanout;
590 assign tap_scan_out = bypass_reg_scanout;
591 // fixscan end
592
593endmodule
594
595
596
597
598
599
600// any PARAMS parms go into naming of macro
601
602module tcu_jtag_tap_ctl_l1clkhdr_ctl_macro (
603 l2clk,
604 l1en,
605 pce_ov,
606 stop,
607 se,
608 l1clk);
609
610
611 input l2clk;
612 input l1en;
613 input pce_ov;
614 input stop;
615 input se;
616 output l1clk;
617
618
619
620
621
622cl_sc1_l1hdr_8x c_0 (
623
624
625 .l2clk(l2clk),
626 .pce(l1en),
627 .l1clk(l1clk),
628 .se(se),
629 .pce_ov(pce_ov),
630 .stop(stop)
631);
632
633
634
635endmodule
636
637
638
639
640
641
642
643
644
645
646
647
648
649// any PARAMS parms go into naming of macro
650
651module tcu_jtag_tap_ctl_msff_ctl_macro__jtag_1__width_4 (
652 din,
653 reset,
654 updateclk,
655 l1clk,
656 scan_in,
657 siclk,
658 soclk,
659 dout,
660 scan_out);
661wire [3:0] fdin;
662wire [2:0] so;
663
664 input [3:0] din;
665 input reset;
666 input updateclk;
667 input l1clk;
668 input scan_in;
669
670
671 input siclk;
672 input soclk;
673
674 output [3:0] dout;
675 output scan_out;
676assign fdin[3:0] = din[3:0];
677
678
679
680
681
682
683dff_jtag #(4) d0_0 (
684.l1clk(l1clk),
685.siclk(siclk),
686.soclk(soclk),
687.d(fdin[3:0]),
688.si({scan_in,so[2:0]}),
689.so({so[2:0],scan_out}),
690.q(dout[3:0]),
691 .reset(reset),
692 .updateclk(updateclk)
693);
694
695
696
697
698
699
700
701
702
703
704
705
706endmodule
707
708
709
710
711
712
713
714
715
716
717
718
719
720// any PARAMS parms go into naming of macro
721
722module tcu_jtag_tap_ctl_msff_ctl_macro__fs_1__jtag_1__width_8 (
723 din,
724 reset,
725 updateclk,
726 l1clk,
727 scan_in,
728 siclk,
729 soclk,
730 dout,
731 scan_out);
732wire [7:0] fdin;
733
734 input [7:0] din;
735 input reset;
736 input updateclk;
737 input l1clk;
738 input [7:0] scan_in;
739
740
741 input siclk;
742 input soclk;
743
744 output [7:0] dout;
745 output [7:0] scan_out;
746assign fdin[7:0] = din[7:0];
747
748
749
750
751
752
753dff_jtag #(8) d0_0 (
754.l1clk(l1clk),
755.siclk(siclk),
756.soclk(soclk),
757.d(fdin[7:0]),
758.si(scan_in[7:0]),
759.so(scan_out[7:0]),
760.q(dout[7:0]),
761 .reset(reset),
762 .updateclk(updateclk)
763);
764
765
766
767
768
769
770
771
772
773
774
775
776endmodule
777
778
779
780
781
782
783
784
785
786
787
788
789
790// any PARAMS parms go into naming of macro
791
792module tcu_jtag_tap_ctl_msff_ctl_macro__width_1 (
793 din,
794 l1clk,
795 scan_in,
796 siclk,
797 soclk,
798 dout,
799 scan_out);
800wire [0:0] fdin;
801
802 input [0:0] din;
803 input l1clk;
804 input scan_in;
805
806
807 input siclk;
808 input soclk;
809
810 output [0:0] dout;
811 output scan_out;
812assign fdin[0:0] = din[0:0];
813
814
815
816
817
818
819dff #(1) d0_0 (
820.l1clk(l1clk),
821.siclk(siclk),
822.soclk(soclk),
823.d(fdin[0:0]),
824.si(scan_in),
825.so(scan_out),
826.q(dout[0:0])
827);
828
829
830
831
832
833
834
835
836
837
838
839
840endmodule
841
842
843
844
845
846
847
848
849
850
851
852
853
854// any PARAMS parms go into naming of macro
855
856module tcu_jtag_tap_ctl_msff_ctl_macro__jtag_1__width_1 (
857 din,
858 reset,
859 updateclk,
860 l1clk,
861 scan_in,
862 siclk,
863 soclk,
864 dout,
865 scan_out);
866wire [0:0] fdin;
867
868 input [0:0] din;
869 input reset;
870 input updateclk;
871 input l1clk;
872 input scan_in;
873
874
875 input siclk;
876 input soclk;
877
878 output [0:0] dout;
879 output scan_out;
880assign fdin[0:0] = din[0:0];
881
882
883
884
885
886
887dff_jtag #(1) d0_0 (
888.l1clk(l1clk),
889.siclk(siclk),
890.soclk(soclk),
891.d(fdin[0:0]),
892.si(scan_in),
893.so(scan_out),
894.q(dout[0:0]),
895 .reset(reset),
896 .updateclk(updateclk)
897);
898
899
900
901
902
903
904
905
906
907
908
909
910endmodule
911
912
913
914
915
916
917
918