Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / design / sys / iop / ccu / rtl / ccu_hm_align_det.v
CommitLineData
86530b38
AT
1// ========== Copyright Header Begin ==========================================
2//
3// OpenSPARC T2 Processor File: ccu_hm_align_det.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`timescale 1 ns / 1ps
36
37module ccu_hm_align_det (
38 ref_clk,
39 fast_clk,
40 rst_n,
41 aligned
42);
43
44
45input ref_clk;
46input fast_clk;
47input rst_n;
48output aligned;
49
50wire ref_clk;
51wire fast_clk;
52wire rst_n;
53wire aligned;
54
55
56// inferred flops
57/*
58reg ref_q1_n;
59reg ref_q2_n;
60reg ref_q3;
61reg ref_q4;
62reg ref_q5;
63*/
64
65wire ref_q1_n;
66wire ref_q2_n;
67wire ref_q3;
68wire ref_q4;
69wire ref_q5;
70
71wire rst;
72wire fast_clk_n;
73wire ref_q5_in;
74
75
76// inferred flops
77/*
78always @ (negedge fast_clk or negedge rst_n) begin
79 if (!rst_n) begin
80 ref_q1_n <= 1'b0;
81 ref_q2_n <= 1'b0;
82 end else begin
83 ref_q1_n <= ref_clk;
84 ref_q2_n <= ref_q1_n;
85 end
86end
87*/
88
89// BEGIN_ECO
90// POST TAPEOUT ECO - N2 BUG ....
91wire ref_clk_n;
92wire rst_n_synced;
93
94assign ref_clk_n = ~ref_clk;
95cl_a1_clksyncff_4x bf_arst_sync (
96 .l1clk (ref_clk_n), .d (rst_n), .q (rst_n_synced),
97 .siclk( 1'b0 ), .soclk( 1'b0 ), .si (1'b0), .so ()
98);
99assign rst = ~(rst_n_synced & rst_n);
100// END_ECO
101
102assign fast_clk_n = ~fast_clk;
103
104my_msff_arst_4x stg1_n (
105 .l1clk (fast_clk_n),
106 .reset (rst),
107 .d (ref_clk),
108 .q (ref_q1_n),
109 .siclk (1'b0),
110 .soclk (1'b0),
111 .si (1'b0),
112 .so ()
113);
114
115my_msff_arst_4x stg2_n (
116 .l1clk (fast_clk_n),
117 .reset (rst),
118 .d (ref_q1_n),
119 .q (ref_q2_n),
120 .siclk (1'b0),
121 .soclk (1'b0),
122 .si (1'b0),
123 .so ()
124);
125
126
127
128/*
129always @ (posedge fast_clk or negedge rst_n) begin
130 if (!rst_n) begin
131 ref_q3 <= 1'b0;
132 ref_q4 <= 1'b0;
133 ref_q5 <= 1'b0;
134 end else begin // one half-cycle path
135 ref_q3 <= ref_q2_n;
136 ref_q4 <= ref_q3;
137 ref_q5 <= ~ref_q4 & ref_q3;
138 end
139end
140*/
141
142my_msff_arst_4x stg3 (
143 .l1clk (fast_clk),
144 .reset (rst),
145 .d (ref_q2_n),
146 .q (ref_q3),
147 .siclk (1'b0),
148 .soclk (1'b0),
149 .si (1'b0),
150 .so ()
151);
152
153my_msff_arst_4x stg4 (
154 .l1clk (fast_clk),
155 .reset (rst),
156 .d (ref_q3),
157 .q (ref_q4),
158 .siclk (1'b0),
159 .soclk (1'b0),
160 .si (1'b0),
161 .so ()
162);
163
164
165assign ref_q5_in = ~ref_q4 & ref_q3;
166
167/*
168my_msff_arst_4x stg5 (
169 .l1clk (fast_clk),
170 .reset (rst),
171 .d (ref_q5_in),
172 .q (ref_q5),
173 .siclk (1'b0),
174 .soclk (1'b0),
175 .si (1'b0),
176 .so ()
177);
178*/
179
180assign aligned = ref_q5_in;
181
182
183
184endmodule
185