-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathctu_clsp_clkgn_clksel.v
More file actions
142 lines (123 loc) · 4.69 KB
/
ctu_clsp_clkgn_clksel.v
File metadata and controls
142 lines (123 loc) · 4.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
// ========== Copyright Header Begin ==========================================
//
// OpenSPARC T1 Processor File: ctu_clsp_clkgn_clksel.v
// Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
//
// The above named program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License version 2 as published by the Free Software Foundation.
//
// The above named program is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public
// License along with this work; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
//
// ========== Copyright Header End ============================================
//
// Cluster Name: CTU
// Unit Name: ctu_clsp_clkgn_clksel
//
//-----------------------------------------------------------------------------
`include "sys.h"
module ctu_clsp_clkgn_clksel(/*AUTOARG*/
// Outputs
clkout, sysclk_sel,
// Inputs
io_pwron_rst_l, sel, testmode_l, sysclk, divbypclk, byp_mult_sel_l,
nstepsel, jtag_clock_dr, capture_l, bypmode
);
input io_pwron_rst_l;
input [2:0] sel;
input testmode_l;
input sysclk;
input divbypclk;
input byp_mult_sel_l;
input nstepsel;
input jtag_clock_dr;
input capture_l;
input bypmode;
output clkout;
output sysclk_sel;
wire force_altclk_l;
wire altclk_sync_l;
wire tck_sync;
wire bypclk_sync_pre;
wire bypclk_sync;
wire tck_sync_pre;
wire force_alt_clk_sync;
wire mult_sel;
wire nstep_clock_dr;
wire clock_dr;
wire altclk_sync_l_bar;
wire sysclk_sel_bar;
// -----------------------------------------------
//
// N-step and jtag_clock_dr mode
// When dft_clsp_capture_l is asserted, nstep goes through,
// otherwise jtag_clock_dr goes through.
// jtag_clock_dr can be dft_jtag_clock_dr (from dft) or j_clk/io_tck2
// if dft_clsp_parallel_scan is asserted
//
// -----------------------------------------------
// Clock gating
// capture cycle:
// capture_l is low, let nstep clock through
// assign nstep_clock_dr = jtag_clock_dr & capture_l;
// capture_l changes value on neg edge of tck
ctu_and2 u_capture_l_gated (.a (jtag_clock_dr), .b(capture_l), .z(nstep_clock_dr));
// nstep_clock_dr is undefined in ctu pin base parallel scan mode
ctu_mux21 u_jtag_clock_mux_gated( .z(clock_dr), .s(testmode_l), .d0(jtag_clock_dr),
.d1(nstep_clock_dr));
// Work around Reading macro
ctu_clksel_async_synchronizer u_mult_sel_clk(
.presyncdata(mult_sel),
.syncdata (force_alt_clk_sync),
.arst_l(io_pwron_rst_l),
.aset_l(1'b1),
.clk (sysclk)
);
ctu_clksel_async_synchronizer u_byp_mult_sel_sync(
.presyncdata(altclk_sync_pre),
.syncdata (altclk_sync_l),
.arst_l(io_pwron_rst_l),
.aset_l(1'b1),
.clk (divbypclk)
);
ctu_clksel_async_synchronizer u_bypclk_sync(
.presyncdata(bypclk_sync_pre),
.syncdata (bypclk_sync),
.aset_l(io_pwron_rst_l),
.arst_l(1'b1),
.clk(divbypclk)
);
ctu_clksel_async_synchronizer u_tck_sync(
.presyncdata(tck_sync_pre),
.syncdata (tck_sync),
.arst_l(io_pwron_rst_l),
.aset_l(1'b1),
.clk(jtag_clock_dr)
);
assign mult_sel = bypmode | nstepsel;
assign force_altclk_l = sel[0];
assign altclk_sync_pre = byp_mult_sel_l;
assign bypclk_sync_pre = sel[2] ;
assign tck_sync_pre = sel[1];
bw_u1_aoi22_4x u_clkout_gated ( .a1(bypclk_sync), .a2(divbypclk),
.b1(tck_sync),.b2(clock_dr), .z(clkout));
ctu_inv u_altclk_sync_l_gated (.z(altclk_sync_l_bar), .a(altclk_sync_l));
bw_u1_oai21_4x u_sysclk_sel_bar_gated (.a (altclk_sync_l_bar),
.b1 (force_altclk_l),
.b2 (force_alt_clk_sync),
.z (sysclk_sel_bar));
ctu_inv u_sysclk_sel_gated (.z(sysclk_sel), .a(sysclk_sel_bar));
endmodule
// Local Variables:
// verilog-library-directories:("." "../../common/rtl")
// verilog-library-files: ("../../common/rtl/swrvr_clib.v")
// verilog-auto-sense-defines-constant:t
// End: