1 ### Always-active SET/CLR removal.
3 read_verilog -icells <<EOT
14 $dffsr #(.CLK_POLARITY(1'b1), .SET_POLARITY(1'b1), .CLR_POLARITY(1'b1), .WIDTH(6)) ff0 (.CLK(CLK), .CLR({CLR, CLR, CLR, 1'b1, 1'b0, 1'bx}), .SET({1'b1, 1'b0, 1'bx, SET, SET, SET}), .D(D), .Q(Q[5:0]));
15 $dffsre #(.CLK_POLARITY(1'b1), .SET_POLARITY(1'b0), .CLR_POLARITY(1'b0), .EN_POLARITY(1'b1), .WIDTH(6)) ff1 (.CLK(CLK), .EN(EN), .CLR({CLR, CLR, CLR, 1'b1, 1'b0, 1'bx}), .SET({1'b1, 1'b0, 1'bx, SET, SET, SET}), .D(D), .Q(Q[11:6]));
16 $dlatchsr #(.SET_POLARITY(1'b0), .CLR_POLARITY(1'b1), .EN_POLARITY(1'b1), .WIDTH(6)) ff2 (.EN(EN), .CLR({CLR, CLR, CLR, 1'b1, 1'b0, 1'bx}), .SET({1'b1, 1'b0, 1'bx, SET, SET, SET}), .D(D), .Q(Q[17:12]));
17 $sr #(.SET_POLARITY(1'b1), .CLR_POLARITY(1'b0), .WIDTH(6)) ff3 (.CLR({CLR, CLR, CLR, 1'b1, 1'b0, 1'bx}), .SET({1'b1, 1'b0, 1'bx, SET, SET, SET}), .Q(Q[23:18]));
25 equiv_opt -undef -assert -multiclock opt_dff
27 select -assert-count 1 t:$dffsr
28 select -assert-count 1 t:$dffsr r:WIDTH=2 %i
29 select -assert-count 1 t:$dffsre
30 select -assert-count 1 t:$dffsre r:WIDTH=2 %i
31 select -assert-count 1 t:$dlatchsr
32 select -assert-count 1 t:$dlatchsr r:WIDTH=2 %i
33 select -assert-none t:$sr
37 equiv_opt -undef -assert -multiclock opt_dff -keepdc
39 select -assert-count 1 t:$dffsr
40 select -assert-count 1 t:$dffsr r:WIDTH=4 %i
41 select -assert-count 1 t:$dffsre
42 select -assert-count 1 t:$dffsre r:WIDTH=4 %i
43 select -assert-count 1 t:$dlatchsr
44 select -assert-count 1 t:$dlatchsr r:WIDTH=4 %i
45 select -assert-count 1 t:$sr
46 select -assert-count 1 t:$sr r:WIDTH=4 %i
51 equiv_opt -undef -assert -multiclock opt_dff
53 select -assert-count 1 t:$_DFF_PP0_
54 select -assert-count 1 t:$_DFF_PP1_
55 select -assert-count 1 t:$_DFFE_PN0P_
56 select -assert-count 1 t:$_DFFE_PN1P_
57 select -assert-count 1 t:$_DLATCH_PP0_
58 select -assert-count 1 t:$_DLATCH_PN1_
59 select -assert-none t:$_DFF_PP0_ t:$_DFF_PP1_ t:$_DFFE_PN0P_ t:$_DFFE_PN1P_ t:$_DLATCH_PP0_ t:$_DLATCH_PN1_ t:$_NOT_ %% %n t:* %i
64 equiv_opt -undef -assert -multiclock opt_dff -keepdc
66 select -assert-count 1 t:$_DFF_PP0_
67 select -assert-count 1 t:$_DFF_PP1_
68 select -assert-count 2 t:$_DFFSR_PPP_
69 select -assert-count 1 t:$_DFFE_PN0P_
70 select -assert-count 1 t:$_DFFE_PN1P_
71 select -assert-count 2 t:$_DFFSRE_PNNP_
72 select -assert-count 1 t:$_DLATCH_PP0_
73 select -assert-count 1 t:$_DLATCH_PN1_
74 select -assert-count 2 t:$_DLATCHSR_PNP_
75 select -assert-count 1 t:$_DLATCH_P_
76 select -assert-count 1 t:$_DLATCH_N_
77 select -assert-count 2 t:$_SR_PN_
78 select -assert-none t:$_DFF_PP0_ t:$_DFF_PP1_ t:$_DFFSR_PPP_ t:$_DFFE_PN0P_ t:$_DFFE_PN1P_ t:$_DFFSRE_PNNP_ t:$_DLATCH_PP0_ t:$_DLATCH_PN1_ t:$_DLATCHSR_PNP_ t:$_NOT_ t:$_DLATCH_N_ t:$_DLATCH_P_ t:$_SR_PN_ %% %n t:* %i
84 ### Never-active CLR removal.
86 read_verilog -icells <<EOT
97 $dffsr #(.CLK_POLARITY(1'b1), .SET_POLARITY(1'b1), .CLR_POLARITY(1'b1), .WIDTH(6)) ff0 (.CLK(CLK), .CLR(6'h00), .SET({6{SET}}), .D(D), .Q(Q[5:0]));
98 $dffsre #(.CLK_POLARITY(1'b1), .SET_POLARITY(1'b0), .CLR_POLARITY(1'b0), .EN_POLARITY(1'b1), .WIDTH(6)) ff1 (.CLK(CLK), .EN(EN), .D(D), .CLR(6'h3f), .SET({6{SET}}), .Q(Q[11:6]));
99 $dlatchsr #(.SET_POLARITY(1'b0), .CLR_POLARITY(1'b1), .EN_POLARITY(1'b1), .WIDTH(6)) ff2 (.EN(EN), .D(D), .CLR(6'h00), .SET({6{SET}}), .Q(Q[17:12]));
100 $sr #(.SET_POLARITY(1'b1), .CLR_POLARITY(1'b0), .WIDTH(6)) ff3 (.CLR(6'h3f), .SET({6{SET}}), .Q(Q[23:18]));
108 equiv_opt -undef -assert -multiclock opt_dff -keepdc
110 select -assert-count 0 t:$dffsr
111 select -assert-count 0 t:$dffsre
112 select -assert-count 0 t:$dlatchsr
113 select -assert-count 0 t:$sr
114 select -assert-count 1 t:$adff
115 select -assert-count 1 t:$adffe
116 select -assert-count 1 t:$adlatch
117 select -assert-count 1 t:$dlatch
123 ### Never-active CLR removal (not applicable).
125 read_verilog -icells <<EOT
137 $dffsr #(.CLK_POLARITY(1'b1), .SET_POLARITY(1'b1), .CLR_POLARITY(1'b1), .WIDTH(6)) ff0 (.CLK(CLK), .CLR(6'h00), .SET({{5{SET}}, ALT}), .D(D), .Q(Q[5:0]));
138 $dffsre #(.CLK_POLARITY(1'b1), .SET_POLARITY(1'b0), .CLR_POLARITY(1'b0), .EN_POLARITY(1'b1), .WIDTH(6)) ff1 (.CLK(CLK), .EN(EN), .D(D), .CLR(6'h3f), .SET({{5{SET}}, ALT}), .Q(Q[11:6]));
139 $dlatchsr #(.SET_POLARITY(1'b0), .CLR_POLARITY(1'b1), .EN_POLARITY(1'b1), .WIDTH(6)) ff2 (.EN(EN), .D(D), .CLR(6'h00), .SET({{5{SET}}, ALT}), .Q(Q[17:12]));
140 $sr #(.SET_POLARITY(1'b1), .CLR_POLARITY(1'b0), .WIDTH(6)) ff3 (.CLR(6'h3f), .SET({{5{SET}}, ALT}), .Q(Q[23:18]));
148 equiv_opt -undef -assert -multiclock opt_dff -keepdc
150 select -assert-count 1 t:$dffsr
151 select -assert-count 1 t:$dffsre
152 select -assert-count 1 t:$dlatchsr
153 select -assert-count 1 t:$sr
154 select -assert-count 0 t:$adff
155 select -assert-count 0 t:$adffe
156 select -assert-count 0 t:$adlatch
157 select -assert-count 0 t:$dlatch
162 equiv_opt -undef -assert -multiclock opt_dff -keepdc
164 select -assert-count 0 t:$_DFFSR_*
165 select -assert-count 0 t:$_DFFSRE_*
166 select -assert-count 0 t:$_DLATCHSR_*
167 select -assert-count 0 t:$_SR_*
168 select -assert-count 6 t:$_DFF_PP1_
169 select -assert-count 6 t:$_DFFE_PN1P_
170 select -assert-count 6 t:$_DLATCH_PN1_
171 select -assert-count 6 t:$_DLATCH_P_
177 ### Never-active SET removal.
179 read_verilog -icells <<EOT
190 $dffsr #(.CLK_POLARITY(1'b1), .SET_POLARITY(1'b1), .CLR_POLARITY(1'b1), .WIDTH(6)) ff0 (.CLK(CLK), .CLR({6{CLR}}), .SET(6'h00), .D(D), .Q(Q[5:0]));
191 $dffsre #(.CLK_POLARITY(1'b1), .SET_POLARITY(1'b0), .CLR_POLARITY(1'b0), .EN_POLARITY(1'b1), .WIDTH(6)) ff1 (.CLK(CLK), .EN(EN), .D(D), .CLR({6{CLR}}), .SET(6'h3f), .Q(Q[11:6]));
192 $dlatchsr #(.SET_POLARITY(1'b0), .CLR_POLARITY(1'b1), .EN_POLARITY(1'b1), .WIDTH(6)) ff2 (.EN(EN), .D(D), .CLR({6{CLR}}), .SET(6'h3f), .Q(Q[17:12]));
193 $sr #(.SET_POLARITY(1'b1), .CLR_POLARITY(1'b0), .WIDTH(6)) ff3 (.CLR({6{CLR}}), .SET(6'h00), .Q(Q[23:18]));
201 equiv_opt -undef -assert -multiclock opt_dff -keepdc
203 select -assert-count 0 t:$dffsr
204 select -assert-count 0 t:$dffsre
205 select -assert-count 0 t:$dlatchsr
206 select -assert-count 0 t:$sr
207 select -assert-count 1 t:$adff
208 select -assert-count 1 t:$adffe
209 select -assert-count 1 t:$adlatch
210 select -assert-count 1 t:$dlatch
216 ### Never-active CLR removal (not applicable).
218 read_verilog -icells <<EOT
230 $dffsr #(.CLK_POLARITY(1'b1), .SET_POLARITY(1'b1), .CLR_POLARITY(1'b1), .WIDTH(6)) ff0 (.CLK(CLK), .CLR({{5{CLR}}, ALT}), .SET(6'h00), .D(D), .Q(Q[5:0]));
231 $dffsre #(.CLK_POLARITY(1'b1), .SET_POLARITY(1'b0), .CLR_POLARITY(1'b0), .EN_POLARITY(1'b1), .WIDTH(6)) ff1 (.CLK(CLK), .EN(EN), .D(D), .CLR({{5{CLR}}, ALT}), .SET(6'h3f), .Q(Q[11:6]));
232 $dlatchsr #(.SET_POLARITY(1'b0), .CLR_POLARITY(1'b1), .EN_POLARITY(1'b1), .WIDTH(6)) ff2 (.EN(EN), .D(D), .CLR({{5{CLR}}, ALT}), .SET(6'h3f), .Q(Q[17:12]));
233 $sr #(.SET_POLARITY(1'b1), .CLR_POLARITY(1'b0), .WIDTH(6)) ff3 (.CLR({{5{CLR}}, ALT}), .SET(6'h00), .Q(Q[23:18]));
241 equiv_opt -undef -assert -multiclock opt_dff -keepdc
243 select -assert-count 1 t:$dffsr
244 select -assert-count 1 t:$dffsre
245 select -assert-count 1 t:$dlatchsr
246 select -assert-count 1 t:$sr
247 select -assert-count 0 t:$adff
248 select -assert-count 0 t:$adffe
249 select -assert-count 0 t:$adlatch
250 select -assert-count 0 t:$dlatch
255 equiv_opt -undef -assert -multiclock opt_dff -keepdc
257 select -assert-count 0 t:$_DFFSR_*
258 select -assert-count 0 t:$_DFFSRE_*
259 select -assert-count 0 t:$_DLATCHSR_*
260 select -assert-count 0 t:$_SR_*
261 select -assert-count 6 t:$_DFF_PP0_
262 select -assert-count 6 t:$_DFFE_PN0P_
263 select -assert-count 6 t:$_DLATCH_PP0_
264 select -assert-count 6 t:$_DLATCH_N_
270 ### SET/CLR merge into ARST.
272 read_verilog -icells <<EOT
282 $dffsr #(.CLK_POLARITY(1'b1), .SET_POLARITY(1'b1), .CLR_POLARITY(1'b1), .WIDTH(6)) ff0 (.CLK(CLK), .CLR({ARST, 5'h00}), .SET({1'b0, {5{ARST}}}), .D(D), .Q(Q[5:0]));
283 $dffsre #(.CLK_POLARITY(1'b1), .SET_POLARITY(1'b0), .CLR_POLARITY(1'b0), .EN_POLARITY(1'b1), .WIDTH(6)) ff1 (.CLK(CLK), .EN(EN), .D(D), .CLR({ARST, 5'h1f}), .SET({1'b1, {5{ARST}}}), .Q(Q[11:6]));
284 $dlatchsr #(.SET_POLARITY(1'b0), .CLR_POLARITY(1'b1), .EN_POLARITY(1'b1), .WIDTH(6)) ff2 (.EN(EN), .D(D), .CLR({ARST, 5'h00}), .SET({1'b1, {5{ARST}}}), .Q(Q[17:12]));
285 $sr #(.SET_POLARITY(1'b1), .CLR_POLARITY(1'b0), .WIDTH(6)) ff3 (.CLR({ARST, 5'h1f}), .SET({1'b0, {5{ARST}}}), .Q(Q[23:18]));
293 equiv_opt -undef -assert -multiclock opt_dff -keepdc
295 select -assert-count 0 t:$dffsr
296 select -assert-count 0 t:$dffsre
297 select -assert-count 1 t:$dlatchsr
298 select -assert-count 1 t:$sr
299 select -assert-count 1 t:$adff
300 select -assert-count 1 t:$adff r:ARST_VALUE=6'h1f %i
301 select -assert-count 1 t:$adffe
302 select -assert-count 1 t:$adffe r:ARST_VALUE=6'h1f %i
303 select -assert-count 0 t:$adlatch
304 select -assert-count 0 t:$dlatch