Line Coverage for Module :
prim_sync_reqack
| Line No. | Total | Covered | Percent |
TOTAL | | 36 | 36 | 100.00 |
CONT_ASSIGN | 55 | 0 | 0 | |
CONT_ASSIGN | 194 | 1 | 1 | 100.00 |
CONT_ASSIGN | 195 | 1 | 1 | 100.00 |
ALWAYS | 219 | 12 | 12 | 100.00 |
ALWAYS | 263 | 12 | 12 | 100.00 |
ALWAYS | 307 | 5 | 5 | 100.00 |
ALWAYS | 316 | 5 | 5 | 100.00 |
CONT_ASSIGN | 335 | 0 | 0 | |
ALWAYS | 339 | 0 | 0 | |
54 logic unused_req_chk;
55 unreachable assign unused_req_chk = req_chk_i;
56
57 if (EnRzHs) begin : gen_rz_hs_protocol
58 //////////////////
59 // RZ protocol //
60 //////////////////
61
62 // Types
63 typedef enum logic {
64 LoSt, HiSt
65 } rz_fsm_e;
66
67 // Signals
68 rz_fsm_e src_fsm_d, src_fsm_q;
69 rz_fsm_e dst_fsm_d, dst_fsm_q;
70 logic src_ack, dst_ack;
71 logic src_req, dst_req;
72
73 // REQ-side FSM (SRC domain)
74 always_comb begin : src_fsm
75 src_fsm_d = src_fsm_q;
76 src_ack_o = 1'b0;
77 src_req = 1'b0;
78
79 unique case (src_fsm_q)
80 LoSt: begin
81 // Wait for the ack to go back to zero before starting
82 // a new transaction.
83 if (!src_ack && src_req_i) begin
84 src_fsm_d = HiSt;
85 end
86 end
87 HiSt: begin
88 src_req = 1'b1;
89 // Forward the acknowledgement.
90 src_ack_o = src_ack;
91 // If request drops out, we go back to LoSt.
92 // If DST side asserts ack, we also go back to LoSt.
93 if (!src_req_i || src_ack) begin
94 src_fsm_d = LoSt;
95 end
96 end
97 //VCS coverage off
98 // pragma coverage off
99 default: ;
100 //VCS coverage on
101 // pragma coverage on
102 endcase
103 end
104
105 // Move ACK over to SRC domain.
106 prim_flop_2sync #(
107 .Width(1)
108 ) ack_sync (
109 .clk_i (clk_src_i),
110 .rst_ni (rst_src_ni),
111 .d_i (dst_ack),
112 .q_o (src_ack)
113 );
114
115 // Registers
116 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
117 if (!rst_src_ni) begin
118 src_fsm_q <= LoSt;
119 end else begin
120 src_fsm_q <= src_fsm_d;
121 end
122 end
123
124 // ACK-side FSM (DST domain)
125 always_comb begin : dst_fsm
126 dst_fsm_d = dst_fsm_q;
127 dst_req_o = 1'b0;
128 dst_ack = 1'b0;
129
130 unique case (dst_fsm_q)
131 LoSt: begin
132 if (dst_req) begin
133 // Forward the request.
134 dst_req_o = 1'b1;
135 // Wait for the request and acknowledge to be asserted
136 // before responding to the SRC side.
137 if (dst_ack_i) begin
138 dst_fsm_d = HiSt;
139 end
140 end
141 end
142 HiSt: begin
143 dst_ack = 1'b1;
144 // Wait for the request to drop back to zero.
145 if (!dst_req) begin
146 dst_fsm_d = LoSt;
147 end
148 end
149 //VCS coverage off
150 // pragma coverage off
151 default: ;
152 //VCS coverage on
153 // pragma coverage on
154 endcase
155 end
156
157 // Move REQ over to DST domain.
158 prim_flop_2sync #(
159 .Width(1)
160 ) req_sync (
161 .clk_i (clk_dst_i),
162 .rst_ni (rst_dst_ni),
163 .d_i (src_req),
164 .q_o (dst_req)
165 );
166
167 // Registers
168 always_ff @(posedge clk_dst_i or negedge rst_dst_ni) begin
169 if (!rst_dst_ni) begin
170 dst_fsm_q <= LoSt;
171 end else begin
172 dst_fsm_q <= dst_fsm_d;
173 end
174 end
175
176 end else begin : gen_nrz_hs_protocol
177 //////////////////
178 // NRZ protocol //
179 //////////////////
180
181 // Types
182 typedef enum logic {
183 EVEN, ODD
184 } sync_reqack_fsm_e;
185
186 // Signals
187 sync_reqack_fsm_e src_fsm_ns, src_fsm_cs;
188 sync_reqack_fsm_e dst_fsm_ns, dst_fsm_cs;
189
190 logic src_req_d, src_req_q, src_ack;
191 logic dst_ack_d, dst_ack_q, dst_req;
192 logic src_handshake, dst_handshake;
193
194 1/1 assign src_handshake = src_req_i & src_ack_o;
Tests: T4 T5 T6
195 1/1 assign dst_handshake = dst_req_o & dst_ack_i;
Tests: T4 T5 T6
196
197 // Move REQ over to DST domain.
198 prim_flop_2sync #(
199 .Width(1)
200 ) req_sync (
201 .clk_i (clk_dst_i),
202 .rst_ni (rst_dst_ni),
203 .d_i (src_req_q),
204 .q_o (dst_req)
205 );
206
207 // Move ACK over to SRC domain.
208 prim_flop_2sync #(
209 .Width(1)
210 ) ack_sync (
211 .clk_i (clk_src_i),
212 .rst_ni (rst_src_ni),
213 .d_i (dst_ack_q),
214 .q_o (src_ack)
215 );
216
217 // REQ-side FSM (SRC domain)
218 always_comb begin : src_fsm
219 1/1 src_fsm_ns = src_fsm_cs;
Tests: T4 T5 T6
220
221 // By default, we keep the internal REQ value and don't ACK.
222 1/1 src_req_d = src_req_q;
Tests: T4 T5 T6
223 1/1 src_ack_o = 1'b0;
Tests: T4 T5 T6
224
225 1/1 unique case (src_fsm_cs)
Tests: T4 T5 T6
226
227 EVEN: begin
228 // Simply forward REQ and ACK.
229 1/1 src_req_d = src_req_i;
Tests: T4 T5 T6
230 1/1 src_ack_o = src_ack;
Tests: T4 T5 T6
231
232 // The handshake is done for exactly 1 clock cycle.
233 1/1 if (src_handshake) begin
Tests: T4 T5 T6
234 1/1 src_fsm_ns = ODD;
Tests: T4 T5 T6
235 end
MISSING_ELSE
236 end
237
238 ODD: begin
239 // Internal REQ and ACK have inverted meaning now. If src_req_i is high again, this
240 // signals a new transaction.
241 1/1 src_req_d = ~src_req_i;
Tests: T4 T5 T6
242 1/1 src_ack_o = ~src_ack;
Tests: T4 T5 T6
243
244 // The handshake is done for exactly 1 clock cycle.
245 1/1 if (src_handshake) begin
Tests: T4 T5 T6
246 1/1 src_fsm_ns = EVEN;
Tests: T4 T5 T6
247 end
MISSING_ELSE
248 end
249
250 //VCS coverage off
251 // pragma coverage off
252
253 default: ;
254
255 //VCS coverage on
256 // pragma coverage on
257
258 endcase
259 end
260
261 // ACK-side FSM (DST domain)
262 always_comb begin : dst_fsm
263 1/1 dst_fsm_ns = dst_fsm_cs;
Tests: T4 T5 T6
264
265 // By default, we don't REQ and keep the internal ACK.
266 1/1 dst_req_o = 1'b0;
Tests: T4 T5 T6
267 1/1 dst_ack_d = dst_ack_q;
Tests: T4 T5 T6
268
269 1/1 unique case (dst_fsm_cs)
Tests: T4 T5 T6
270
271 EVEN: begin
272 // Simply forward REQ and ACK.
273 1/1 dst_req_o = dst_req;
Tests: T4 T5 T6
274 1/1 dst_ack_d = dst_ack_i;
Tests: T4 T5 T6
275
276 // The handshake is done for exactly 1 clock cycle.
277 1/1 if (dst_handshake) begin
Tests: T4 T5 T6
278 1/1 dst_fsm_ns = ODD;
Tests: T4 T5 T6
279 end
MISSING_ELSE
280 end
281
282 ODD: begin
283 // Internal REQ and ACK have inverted meaning now. If dst_req goes low, this signals a new
284 // transaction.
285 1/1 dst_req_o = ~dst_req;
Tests: T4 T5 T6
286 1/1 dst_ack_d = ~dst_ack_i;
Tests: T4 T5 T6
287
288 // The handshake is done for exactly 1 clock cycle.
289 1/1 if (dst_handshake) begin
Tests: T4 T5 T6
290 1/1 dst_fsm_ns = EVEN;
Tests: T4 T5 T6
291 end
MISSING_ELSE
292 end
293
294 //VCS coverage off
295 // pragma coverage off
296
297 default: ;
298
299 //VCS coverage on
300 // pragma coverage on
301
302 endcase
303 end
304
305 // Registers
306 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
307 1/1 if (!rst_src_ni) begin
Tests: T4 T5 T6
308 1/1 src_fsm_cs <= EVEN;
Tests: T4 T5 T6
309 1/1 src_req_q <= 1'b0;
Tests: T4 T5 T6
310 end else begin
311 1/1 src_fsm_cs <= src_fsm_ns;
Tests: T4 T5 T6
312 1/1 src_req_q <= src_req_d;
Tests: T4 T5 T6
313 end
314 end
315 always_ff @(posedge clk_dst_i or negedge rst_dst_ni) begin
316 1/1 if (!rst_dst_ni) begin
Tests: T4 T5 T6
317 1/1 dst_fsm_cs <= EVEN;
Tests: T4 T5 T6
318 1/1 dst_ack_q <= 1'b0;
Tests: T4 T5 T6
319 end else begin
320 1/1 dst_fsm_cs <= dst_fsm_ns;
Tests: T4 T5 T6
321 1/1 dst_ack_q <= dst_ack_d;
Tests: T4 T5 T6
322 end
323 end
324 end
325
326 ////////////////
327 // Assertions //
328 ////////////////
329
330 `ifdef INC_ASSERT
331 //VCS coverage off
332 // pragma coverage off
333
334 logic effective_rst_n;
335 unreachable assign effective_rst_n = rst_src_ni && rst_dst_ni;
336
337 logic chk_flag;
338 always_ff @(posedge clk_src_i or negedge effective_rst_n) begin
339 unreachable if (!effective_rst_n) begin
340 unreachable chk_flag <= '0;
341 unreachable end else if (src_req_i && !chk_flag) begin
342 unreachable chk_flag <= 1'b1;
343 end
==> MISSING_ELSE
Cond Coverage for Module :
prim_sync_reqack
| Total | Covered | Percent |
Conditions | 6 | 3 | 50.00 |
Logical | 6 | 3 | 50.00 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 194
EXPRESSION (src_req_i & src_ack_o)
----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T4,T5,T6 |
1 | 1 | Covered | T4,T5,T6 |
LINE 195
EXPRESSION (dst_req_o & dst_ack_i)
----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Not Covered | |
1 | 1 | Covered | T4,T5,T6 |
Branch Coverage for Module :
prim_sync_reqack
| Line No. | Total | Covered | Percent |
Branches |
|
12 |
12 |
100.00 |
CASE |
225 |
4 |
4 |
100.00 |
CASE |
269 |
4 |
4 |
100.00 |
IF |
307 |
2 |
2 |
100.00 |
IF |
316 |
2 |
2 |
100.00 |
225 unique case (src_fsm_cs)
-1-
226
227 EVEN: begin
228 // Simply forward REQ and ACK.
229 src_req_d = src_req_i;
230 src_ack_o = src_ack;
231
232 // The handshake is done for exactly 1 clock cycle.
233 if (src_handshake) begin
-2-
234 src_fsm_ns = ODD;
==>
235 end
MISSING_ELSE
==>
236 end
237
238 ODD: begin
239 // Internal REQ and ACK have inverted meaning now. If src_req_i is high again, this
240 // signals a new transaction.
241 src_req_d = ~src_req_i;
242 src_ack_o = ~src_ack;
243
244 // The handshake is done for exactly 1 clock cycle.
245 if (src_handshake) begin
-3-
246 src_fsm_ns = EVEN;
==>
247 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
EVEN |
1 |
- |
Covered |
T4,T5,T6 |
EVEN |
0 |
- |
Covered |
T4,T5,T6 |
ODD |
- |
1 |
Covered |
T4,T5,T6 |
ODD |
- |
0 |
Covered |
T4,T5,T6 |
269 unique case (dst_fsm_cs)
-1-
270
271 EVEN: begin
272 // Simply forward REQ and ACK.
273 dst_req_o = dst_req;
274 dst_ack_d = dst_ack_i;
275
276 // The handshake is done for exactly 1 clock cycle.
277 if (dst_handshake) begin
-2-
278 dst_fsm_ns = ODD;
==>
279 end
MISSING_ELSE
==>
280 end
281
282 ODD: begin
283 // Internal REQ and ACK have inverted meaning now. If dst_req goes low, this signals a new
284 // transaction.
285 dst_req_o = ~dst_req;
286 dst_ack_d = ~dst_ack_i;
287
288 // The handshake is done for exactly 1 clock cycle.
289 if (dst_handshake) begin
-3-
290 dst_fsm_ns = EVEN;
==>
291 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
EVEN |
1 |
- |
Covered |
T4,T5,T6 |
EVEN |
0 |
- |
Covered |
T4,T5,T6 |
ODD |
- |
1 |
Covered |
T4,T5,T6 |
ODD |
- |
0 |
Covered |
T4,T5,T6 |
307 if (!rst_src_ni) begin
-1-
308 src_fsm_cs <= EVEN;
==>
309 src_req_q <= 1'b0;
310 end else begin
311 src_fsm_cs <= src_fsm_ns;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T4,T5,T6 |
0 |
Covered |
T4,T5,T6 |
316 if (!rst_dst_ni) begin
-1-
317 dst_fsm_cs <= EVEN;
==>
318 dst_ack_q <= 1'b0;
319 end else begin
320 dst_fsm_cs <= dst_fsm_ns;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T4,T5,T6 |
0 |
Covered |
T4,T5,T6 |
Assert Coverage for Module :
prim_sync_reqack
Assertion Details
SyncReqAckAckNeedsReq
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
628972889 |
1556602 |
0 |
0 |
T2 |
16761 |
7 |
0 |
0 |
T4 |
1326 |
38 |
0 |
0 |
T5 |
515 |
15 |
0 |
0 |
T6 |
738 |
23 |
0 |
0 |
T10 |
22369 |
28 |
0 |
0 |
T12 |
0 |
15 |
0 |
0 |
T15 |
0 |
4 |
0 |
0 |
T16 |
0 |
23 |
0 |
0 |
T17 |
0 |
4 |
0 |
0 |
T18 |
0 |
8 |
0 |
0 |
T19 |
0 |
18 |
0 |
0 |
T20 |
0 |
54 |
0 |
0 |
T21 |
1794 |
0 |
0 |
0 |
T22 |
1124 |
0 |
0 |
0 |
T23 |
3381 |
0 |
0 |
0 |
T24 |
1393 |
0 |
0 |
0 |
T25 |
31366 |
0 |
0 |
0 |
T26 |
1766 |
0 |
0 |
0 |
T27 |
1644 |
0 |
0 |
0 |
T28 |
1321 |
0 |
0 |
0 |
T29 |
60334 |
0 |
0 |
0 |
T30 |
2666 |
84 |
0 |
0 |
T31 |
1407 |
44 |
0 |
0 |
T32 |
732 |
23 |
0 |
0 |
T33 |
1028 |
33 |
0 |
0 |
T34 |
1630 |
48 |
0 |
0 |
T35 |
899 |
29 |
0 |
0 |
T36 |
2775 |
88 |
0 |
0 |
T37 |
0 |
12 |
0 |
0 |
T38 |
0 |
11 |
0 |
0 |
SyncReqAckHoldReq
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
553079025 |
64315 |
0 |
0 |
T1 |
15308 |
6 |
0 |
0 |
T2 |
117248 |
23 |
0 |
0 |
T3 |
69126 |
16 |
0 |
0 |
T10 |
367788 |
88 |
0 |
0 |
T11 |
0 |
47 |
0 |
0 |
T12 |
0 |
41 |
0 |
0 |
T13 |
181887 |
40 |
0 |
0 |
T14 |
0 |
20 |
0 |
0 |
T15 |
0 |
28 |
0 |
0 |
T16 |
0 |
34 |
0 |
0 |
T17 |
0 |
13 |
0 |
0 |
T18 |
0 |
11 |
0 |
0 |
T19 |
0 |
36 |
0 |
0 |
T20 |
0 |
93 |
0 |
0 |
T21 |
2616 |
0 |
0 |
0 |
T22 |
2953 |
0 |
0 |
0 |
T23 |
5098 |
0 |
0 |
0 |
T24 |
2029 |
0 |
0 |
0 |
T25 |
175617 |
22 |
0 |
0 |
T26 |
3373 |
0 |
0 |
0 |
T27 |
2978 |
0 |
0 |
0 |
T28 |
7688 |
0 |
0 |
0 |
T29 |
83819 |
22 |
0 |
0 |
T37 |
0 |
19 |
0 |
0 |
T38 |
0 |
41 |
0 |
0 |
T39 |
0 |
20 |
0 |
0 |
T40 |
0 |
2 |
0 |
0 |
T41 |
0 |
8 |
0 |
0 |
T42 |
3414 |
0 |
0 |
0 |
T43 |
3761 |
0 |
0 |
0 |
T44 |
2530 |
0 |
0 |
0 |
T45 |
3155 |
0 |
0 |
0 |
T46 |
4486 |
0 |
0 |
0 |
T47 |
3011 |
0 |
0 |
0 |
T48 |
10063 |
0 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_io_meas.u_meas.gen_clk_timeout_chk.u_timeout_ref_to_clk.u_ref_timeout
| Line No. | Total | Covered | Percent |
TOTAL | | 36 | 36 | 100.00 |
CONT_ASSIGN | 55 | 0 | 0 | |
CONT_ASSIGN | 194 | 1 | 1 | 100.00 |
CONT_ASSIGN | 195 | 1 | 1 | 100.00 |
ALWAYS | 219 | 12 | 12 | 100.00 |
ALWAYS | 263 | 12 | 12 | 100.00 |
ALWAYS | 307 | 5 | 5 | 100.00 |
ALWAYS | 316 | 5 | 5 | 100.00 |
CONT_ASSIGN | 335 | 0 | 0 | |
ALWAYS | 339 | 0 | 0 | |
54 logic unused_req_chk;
55 unreachable assign unused_req_chk = req_chk_i;
56
57 if (EnRzHs) begin : gen_rz_hs_protocol
58 //////////////////
59 // RZ protocol //
60 //////////////////
61
62 // Types
63 typedef enum logic {
64 LoSt, HiSt
65 } rz_fsm_e;
66
67 // Signals
68 rz_fsm_e src_fsm_d, src_fsm_q;
69 rz_fsm_e dst_fsm_d, dst_fsm_q;
70 logic src_ack, dst_ack;
71 logic src_req, dst_req;
72
73 // REQ-side FSM (SRC domain)
74 always_comb begin : src_fsm
75 src_fsm_d = src_fsm_q;
76 src_ack_o = 1'b0;
77 src_req = 1'b0;
78
79 unique case (src_fsm_q)
80 LoSt: begin
81 // Wait for the ack to go back to zero before starting
82 // a new transaction.
83 if (!src_ack && src_req_i) begin
84 src_fsm_d = HiSt;
85 end
86 end
87 HiSt: begin
88 src_req = 1'b1;
89 // Forward the acknowledgement.
90 src_ack_o = src_ack;
91 // If request drops out, we go back to LoSt.
92 // If DST side asserts ack, we also go back to LoSt.
93 if (!src_req_i || src_ack) begin
94 src_fsm_d = LoSt;
95 end
96 end
97 //VCS coverage off
98 // pragma coverage off
99 default: ;
100 //VCS coverage on
101 // pragma coverage on
102 endcase
103 end
104
105 // Move ACK over to SRC domain.
106 prim_flop_2sync #(
107 .Width(1)
108 ) ack_sync (
109 .clk_i (clk_src_i),
110 .rst_ni (rst_src_ni),
111 .d_i (dst_ack),
112 .q_o (src_ack)
113 );
114
115 // Registers
116 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
117 if (!rst_src_ni) begin
118 src_fsm_q <= LoSt;
119 end else begin
120 src_fsm_q <= src_fsm_d;
121 end
122 end
123
124 // ACK-side FSM (DST domain)
125 always_comb begin : dst_fsm
126 dst_fsm_d = dst_fsm_q;
127 dst_req_o = 1'b0;
128 dst_ack = 1'b0;
129
130 unique case (dst_fsm_q)
131 LoSt: begin
132 if (dst_req) begin
133 // Forward the request.
134 dst_req_o = 1'b1;
135 // Wait for the request and acknowledge to be asserted
136 // before responding to the SRC side.
137 if (dst_ack_i) begin
138 dst_fsm_d = HiSt;
139 end
140 end
141 end
142 HiSt: begin
143 dst_ack = 1'b1;
144 // Wait for the request to drop back to zero.
145 if (!dst_req) begin
146 dst_fsm_d = LoSt;
147 end
148 end
149 //VCS coverage off
150 // pragma coverage off
151 default: ;
152 //VCS coverage on
153 // pragma coverage on
154 endcase
155 end
156
157 // Move REQ over to DST domain.
158 prim_flop_2sync #(
159 .Width(1)
160 ) req_sync (
161 .clk_i (clk_dst_i),
162 .rst_ni (rst_dst_ni),
163 .d_i (src_req),
164 .q_o (dst_req)
165 );
166
167 // Registers
168 always_ff @(posedge clk_dst_i or negedge rst_dst_ni) begin
169 if (!rst_dst_ni) begin
170 dst_fsm_q <= LoSt;
171 end else begin
172 dst_fsm_q <= dst_fsm_d;
173 end
174 end
175
176 end else begin : gen_nrz_hs_protocol
177 //////////////////
178 // NRZ protocol //
179 //////////////////
180
181 // Types
182 typedef enum logic {
183 EVEN, ODD
184 } sync_reqack_fsm_e;
185
186 // Signals
187 sync_reqack_fsm_e src_fsm_ns, src_fsm_cs;
188 sync_reqack_fsm_e dst_fsm_ns, dst_fsm_cs;
189
190 logic src_req_d, src_req_q, src_ack;
191 logic dst_ack_d, dst_ack_q, dst_req;
192 logic src_handshake, dst_handshake;
193
194 1/1 assign src_handshake = src_req_i & src_ack_o;
Tests: T4 T5 T6
195 1/1 assign dst_handshake = dst_req_o & dst_ack_i;
Tests: T4 T5 T6
196
197 // Move REQ over to DST domain.
198 prim_flop_2sync #(
199 .Width(1)
200 ) req_sync (
201 .clk_i (clk_dst_i),
202 .rst_ni (rst_dst_ni),
203 .d_i (src_req_q),
204 .q_o (dst_req)
205 );
206
207 // Move ACK over to SRC domain.
208 prim_flop_2sync #(
209 .Width(1)
210 ) ack_sync (
211 .clk_i (clk_src_i),
212 .rst_ni (rst_src_ni),
213 .d_i (dst_ack_q),
214 .q_o (src_ack)
215 );
216
217 // REQ-side FSM (SRC domain)
218 always_comb begin : src_fsm
219 1/1 src_fsm_ns = src_fsm_cs;
Tests: T4 T5 T6
220
221 // By default, we keep the internal REQ value and don't ACK.
222 1/1 src_req_d = src_req_q;
Tests: T4 T5 T6
223 1/1 src_ack_o = 1'b0;
Tests: T4 T5 T6
224
225 1/1 unique case (src_fsm_cs)
Tests: T4 T5 T6
226
227 EVEN: begin
228 // Simply forward REQ and ACK.
229 1/1 src_req_d = src_req_i;
Tests: T4 T5 T6
230 1/1 src_ack_o = src_ack;
Tests: T4 T5 T6
231
232 // The handshake is done for exactly 1 clock cycle.
233 1/1 if (src_handshake) begin
Tests: T4 T5 T6
234 1/1 src_fsm_ns = ODD;
Tests: T4 T5 T6
235 end
MISSING_ELSE
236 end
237
238 ODD: begin
239 // Internal REQ and ACK have inverted meaning now. If src_req_i is high again, this
240 // signals a new transaction.
241 1/1 src_req_d = ~src_req_i;
Tests: T4 T5 T6
242 1/1 src_ack_o = ~src_ack;
Tests: T4 T5 T6
243
244 // The handshake is done for exactly 1 clock cycle.
245 1/1 if (src_handshake) begin
Tests: T4 T5 T6
246 1/1 src_fsm_ns = EVEN;
Tests: T4 T5 T6
247 end
MISSING_ELSE
248 end
249
250 //VCS coverage off
251 // pragma coverage off
252
253 default: ;
254
255 //VCS coverage on
256 // pragma coverage on
257
258 endcase
259 end
260
261 // ACK-side FSM (DST domain)
262 always_comb begin : dst_fsm
263 1/1 dst_fsm_ns = dst_fsm_cs;
Tests: T4 T5 T6
264
265 // By default, we don't REQ and keep the internal ACK.
266 1/1 dst_req_o = 1'b0;
Tests: T4 T5 T6
267 1/1 dst_ack_d = dst_ack_q;
Tests: T4 T5 T6
268
269 1/1 unique case (dst_fsm_cs)
Tests: T4 T5 T6
270
271 EVEN: begin
272 // Simply forward REQ and ACK.
273 1/1 dst_req_o = dst_req;
Tests: T4 T5 T6
274 1/1 dst_ack_d = dst_ack_i;
Tests: T4 T5 T6
275
276 // The handshake is done for exactly 1 clock cycle.
277 1/1 if (dst_handshake) begin
Tests: T4 T5 T6
278 1/1 dst_fsm_ns = ODD;
Tests: T4 T5 T6
279 end
MISSING_ELSE
280 end
281
282 ODD: begin
283 // Internal REQ and ACK have inverted meaning now. If dst_req goes low, this signals a new
284 // transaction.
285 1/1 dst_req_o = ~dst_req;
Tests: T4 T5 T6
286 1/1 dst_ack_d = ~dst_ack_i;
Tests: T4 T5 T6
287
288 // The handshake is done for exactly 1 clock cycle.
289 1/1 if (dst_handshake) begin
Tests: T4 T5 T6
290 1/1 dst_fsm_ns = EVEN;
Tests: T4 T5 T6
291 end
MISSING_ELSE
292 end
293
294 //VCS coverage off
295 // pragma coverage off
296
297 default: ;
298
299 //VCS coverage on
300 // pragma coverage on
301
302 endcase
303 end
304
305 // Registers
306 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
307 1/1 if (!rst_src_ni) begin
Tests: T4 T5 T6
308 1/1 src_fsm_cs <= EVEN;
Tests: T4 T5 T6
309 1/1 src_req_q <= 1'b0;
Tests: T4 T5 T6
310 end else begin
311 1/1 src_fsm_cs <= src_fsm_ns;
Tests: T4 T5 T6
312 1/1 src_req_q <= src_req_d;
Tests: T4 T5 T6
313 end
314 end
315 always_ff @(posedge clk_dst_i or negedge rst_dst_ni) begin
316 1/1 if (!rst_dst_ni) begin
Tests: T4 T5 T6
317 1/1 dst_fsm_cs <= EVEN;
Tests: T4 T5 T6
318 1/1 dst_ack_q <= 1'b0;
Tests: T4 T5 T6
319 end else begin
320 1/1 dst_fsm_cs <= dst_fsm_ns;
Tests: T4 T5 T6
321 1/1 dst_ack_q <= dst_ack_d;
Tests: T4 T5 T6
322 end
323 end
324 end
325
326 ////////////////
327 // Assertions //
328 ////////////////
329
330 `ifdef INC_ASSERT
331 //VCS coverage off
332 // pragma coverage off
333
334 logic effective_rst_n;
335 unreachable assign effective_rst_n = rst_src_ni && rst_dst_ni;
336
337 logic chk_flag;
338 always_ff @(posedge clk_src_i or negedge effective_rst_n) begin
339 unreachable if (!effective_rst_n) begin
340 unreachable chk_flag <= '0;
341 unreachable end else if (src_req_i && !chk_flag) begin
342 unreachable chk_flag <= 1'b1;
343 end
==> MISSING_ELSE
Cond Coverage for Instance : tb.dut.u_io_meas.u_meas.gen_clk_timeout_chk.u_timeout_ref_to_clk.u_ref_timeout
| Total | Covered | Percent |
Conditions | 3 | 3 | 100.00 |
Logical | 3 | 3 | 100.00 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 194
EXPRESSION (src_req_i & src_ack_o)
----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Unreachable | |
1 | 0 | Covered | T4,T5,T6 |
1 | 1 | Covered | T4,T5,T6 |
LINE 195
EXPRESSION (dst_req_o & dst_ack_i)
----1---- ----2----
-1- | -2- | Status | Tests | Exclude Annotation |
0 | 1 | Excluded | |
VC_COV_UNR |
1 | 0 | Excluded | |
VC_COV_UNR |
1 | 1 | Covered | T4,T5,T6 |
Branch Coverage for Instance : tb.dut.u_io_meas.u_meas.gen_clk_timeout_chk.u_timeout_ref_to_clk.u_ref_timeout
| Line No. | Total | Covered | Percent |
Branches |
|
12 |
12 |
100.00 |
CASE |
225 |
4 |
4 |
100.00 |
CASE |
269 |
4 |
4 |
100.00 |
IF |
307 |
2 |
2 |
100.00 |
IF |
316 |
2 |
2 |
100.00 |
225 unique case (src_fsm_cs)
-1-
226
227 EVEN: begin
228 // Simply forward REQ and ACK.
229 src_req_d = src_req_i;
230 src_ack_o = src_ack;
231
232 // The handshake is done for exactly 1 clock cycle.
233 if (src_handshake) begin
-2-
234 src_fsm_ns = ODD;
==>
235 end
MISSING_ELSE
==>
236 end
237
238 ODD: begin
239 // Internal REQ and ACK have inverted meaning now. If src_req_i is high again, this
240 // signals a new transaction.
241 src_req_d = ~src_req_i;
242 src_ack_o = ~src_ack;
243
244 // The handshake is done for exactly 1 clock cycle.
245 if (src_handshake) begin
-3-
246 src_fsm_ns = EVEN;
==>
247 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
EVEN |
1 |
- |
Covered |
T4,T5,T6 |
EVEN |
0 |
- |
Covered |
T4,T5,T6 |
ODD |
- |
1 |
Covered |
T4,T5,T6 |
ODD |
- |
0 |
Covered |
T4,T5,T6 |
269 unique case (dst_fsm_cs)
-1-
270
271 EVEN: begin
272 // Simply forward REQ and ACK.
273 dst_req_o = dst_req;
274 dst_ack_d = dst_ack_i;
275
276 // The handshake is done for exactly 1 clock cycle.
277 if (dst_handshake) begin
-2-
278 dst_fsm_ns = ODD;
==>
279 end
MISSING_ELSE
==>
280 end
281
282 ODD: begin
283 // Internal REQ and ACK have inverted meaning now. If dst_req goes low, this signals a new
284 // transaction.
285 dst_req_o = ~dst_req;
286 dst_ack_d = ~dst_ack_i;
287
288 // The handshake is done for exactly 1 clock cycle.
289 if (dst_handshake) begin
-3-
290 dst_fsm_ns = EVEN;
==>
291 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
EVEN |
1 |
- |
Covered |
T4,T5,T6 |
EVEN |
0 |
- |
Covered |
T4,T5,T6 |
ODD |
- |
1 |
Covered |
T4,T5,T6 |
ODD |
- |
0 |
Covered |
T4,T5,T6 |
307 if (!rst_src_ni) begin
-1-
308 src_fsm_cs <= EVEN;
==>
309 src_req_q <= 1'b0;
310 end else begin
311 src_fsm_cs <= src_fsm_ns;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T4,T5,T6 |
0 |
Covered |
T4,T5,T6 |
316 if (!rst_dst_ni) begin
-1-
317 dst_fsm_cs <= EVEN;
==>
318 dst_ack_q <= 1'b0;
319 end else begin
320 dst_fsm_cs <= dst_fsm_ns;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T4,T5,T6 |
0 |
Covered |
T4,T5,T6 |
Assert Coverage for Instance : tb.dut.u_io_meas.u_meas.gen_clk_timeout_chk.u_timeout_ref_to_clk.u_ref_timeout
Assertion Details
SyncReqAckAckNeedsReq
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
79636599 |
299751 |
0 |
0 |
T4 |
2407 |
38 |
0 |
0 |
T5 |
1137 |
15 |
0 |
0 |
T6 |
1583 |
23 |
0 |
0 |
T30 |
5426 |
84 |
0 |
0 |
T31 |
2866 |
44 |
0 |
0 |
T32 |
1491 |
23 |
0 |
0 |
T33 |
2162 |
34 |
0 |
0 |
T34 |
3178 |
48 |
0 |
0 |
T35 |
1864 |
29 |
0 |
0 |
T36 |
5657 |
88 |
0 |
0 |
SyncReqAckHoldReq
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1387694 |
0 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_io_div2_meas.u_meas.gen_clk_timeout_chk.u_timeout_ref_to_clk.u_ref_timeout
| Line No. | Total | Covered | Percent |
TOTAL | | 36 | 36 | 100.00 |
CONT_ASSIGN | 55 | 0 | 0 | |
CONT_ASSIGN | 194 | 1 | 1 | 100.00 |
CONT_ASSIGN | 195 | 1 | 1 | 100.00 |
ALWAYS | 219 | 12 | 12 | 100.00 |
ALWAYS | 263 | 12 | 12 | 100.00 |
ALWAYS | 307 | 5 | 5 | 100.00 |
ALWAYS | 316 | 5 | 5 | 100.00 |
CONT_ASSIGN | 335 | 0 | 0 | |
ALWAYS | 339 | 0 | 0 | |
54 logic unused_req_chk;
55 unreachable assign unused_req_chk = req_chk_i;
56
57 if (EnRzHs) begin : gen_rz_hs_protocol
58 //////////////////
59 // RZ protocol //
60 //////////////////
61
62 // Types
63 typedef enum logic {
64 LoSt, HiSt
65 } rz_fsm_e;
66
67 // Signals
68 rz_fsm_e src_fsm_d, src_fsm_q;
69 rz_fsm_e dst_fsm_d, dst_fsm_q;
70 logic src_ack, dst_ack;
71 logic src_req, dst_req;
72
73 // REQ-side FSM (SRC domain)
74 always_comb begin : src_fsm
75 src_fsm_d = src_fsm_q;
76 src_ack_o = 1'b0;
77 src_req = 1'b0;
78
79 unique case (src_fsm_q)
80 LoSt: begin
81 // Wait for the ack to go back to zero before starting
82 // a new transaction.
83 if (!src_ack && src_req_i) begin
84 src_fsm_d = HiSt;
85 end
86 end
87 HiSt: begin
88 src_req = 1'b1;
89 // Forward the acknowledgement.
90 src_ack_o = src_ack;
91 // If request drops out, we go back to LoSt.
92 // If DST side asserts ack, we also go back to LoSt.
93 if (!src_req_i || src_ack) begin
94 src_fsm_d = LoSt;
95 end
96 end
97 //VCS coverage off
98 // pragma coverage off
99 default: ;
100 //VCS coverage on
101 // pragma coverage on
102 endcase
103 end
104
105 // Move ACK over to SRC domain.
106 prim_flop_2sync #(
107 .Width(1)
108 ) ack_sync (
109 .clk_i (clk_src_i),
110 .rst_ni (rst_src_ni),
111 .d_i (dst_ack),
112 .q_o (src_ack)
113 );
114
115 // Registers
116 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
117 if (!rst_src_ni) begin
118 src_fsm_q <= LoSt;
119 end else begin
120 src_fsm_q <= src_fsm_d;
121 end
122 end
123
124 // ACK-side FSM (DST domain)
125 always_comb begin : dst_fsm
126 dst_fsm_d = dst_fsm_q;
127 dst_req_o = 1'b0;
128 dst_ack = 1'b0;
129
130 unique case (dst_fsm_q)
131 LoSt: begin
132 if (dst_req) begin
133 // Forward the request.
134 dst_req_o = 1'b1;
135 // Wait for the request and acknowledge to be asserted
136 // before responding to the SRC side.
137 if (dst_ack_i) begin
138 dst_fsm_d = HiSt;
139 end
140 end
141 end
142 HiSt: begin
143 dst_ack = 1'b1;
144 // Wait for the request to drop back to zero.
145 if (!dst_req) begin
146 dst_fsm_d = LoSt;
147 end
148 end
149 //VCS coverage off
150 // pragma coverage off
151 default: ;
152 //VCS coverage on
153 // pragma coverage on
154 endcase
155 end
156
157 // Move REQ over to DST domain.
158 prim_flop_2sync #(
159 .Width(1)
160 ) req_sync (
161 .clk_i (clk_dst_i),
162 .rst_ni (rst_dst_ni),
163 .d_i (src_req),
164 .q_o (dst_req)
165 );
166
167 // Registers
168 always_ff @(posedge clk_dst_i or negedge rst_dst_ni) begin
169 if (!rst_dst_ni) begin
170 dst_fsm_q <= LoSt;
171 end else begin
172 dst_fsm_q <= dst_fsm_d;
173 end
174 end
175
176 end else begin : gen_nrz_hs_protocol
177 //////////////////
178 // NRZ protocol //
179 //////////////////
180
181 // Types
182 typedef enum logic {
183 EVEN, ODD
184 } sync_reqack_fsm_e;
185
186 // Signals
187 sync_reqack_fsm_e src_fsm_ns, src_fsm_cs;
188 sync_reqack_fsm_e dst_fsm_ns, dst_fsm_cs;
189
190 logic src_req_d, src_req_q, src_ack;
191 logic dst_ack_d, dst_ack_q, dst_req;
192 logic src_handshake, dst_handshake;
193
194 1/1 assign src_handshake = src_req_i & src_ack_o;
Tests: T4 T5 T6
195 1/1 assign dst_handshake = dst_req_o & dst_ack_i;
Tests: T4 T5 T6
196
197 // Move REQ over to DST domain.
198 prim_flop_2sync #(
199 .Width(1)
200 ) req_sync (
201 .clk_i (clk_dst_i),
202 .rst_ni (rst_dst_ni),
203 .d_i (src_req_q),
204 .q_o (dst_req)
205 );
206
207 // Move ACK over to SRC domain.
208 prim_flop_2sync #(
209 .Width(1)
210 ) ack_sync (
211 .clk_i (clk_src_i),
212 .rst_ni (rst_src_ni),
213 .d_i (dst_ack_q),
214 .q_o (src_ack)
215 );
216
217 // REQ-side FSM (SRC domain)
218 always_comb begin : src_fsm
219 1/1 src_fsm_ns = src_fsm_cs;
Tests: T4 T5 T6
220
221 // By default, we keep the internal REQ value and don't ACK.
222 1/1 src_req_d = src_req_q;
Tests: T4 T5 T6
223 1/1 src_ack_o = 1'b0;
Tests: T4 T5 T6
224
225 1/1 unique case (src_fsm_cs)
Tests: T4 T5 T6
226
227 EVEN: begin
228 // Simply forward REQ and ACK.
229 1/1 src_req_d = src_req_i;
Tests: T4 T5 T6
230 1/1 src_ack_o = src_ack;
Tests: T4 T5 T6
231
232 // The handshake is done for exactly 1 clock cycle.
233 1/1 if (src_handshake) begin
Tests: T4 T5 T6
234 1/1 src_fsm_ns = ODD;
Tests: T4 T5 T6
235 end
MISSING_ELSE
236 end
237
238 ODD: begin
239 // Internal REQ and ACK have inverted meaning now. If src_req_i is high again, this
240 // signals a new transaction.
241 1/1 src_req_d = ~src_req_i;
Tests: T4 T5 T6
242 1/1 src_ack_o = ~src_ack;
Tests: T4 T5 T6
243
244 // The handshake is done for exactly 1 clock cycle.
245 1/1 if (src_handshake) begin
Tests: T4 T5 T6
246 1/1 src_fsm_ns = EVEN;
Tests: T4 T5 T6
247 end
MISSING_ELSE
248 end
249
250 //VCS coverage off
251 // pragma coverage off
252
253 default: ;
254
255 //VCS coverage on
256 // pragma coverage on
257
258 endcase
259 end
260
261 // ACK-side FSM (DST domain)
262 always_comb begin : dst_fsm
263 1/1 dst_fsm_ns = dst_fsm_cs;
Tests: T4 T5 T6
264
265 // By default, we don't REQ and keep the internal ACK.
266 1/1 dst_req_o = 1'b0;
Tests: T4 T5 T6
267 1/1 dst_ack_d = dst_ack_q;
Tests: T4 T5 T6
268
269 1/1 unique case (dst_fsm_cs)
Tests: T4 T5 T6
270
271 EVEN: begin
272 // Simply forward REQ and ACK.
273 1/1 dst_req_o = dst_req;
Tests: T4 T5 T6
274 1/1 dst_ack_d = dst_ack_i;
Tests: T4 T5 T6
275
276 // The handshake is done for exactly 1 clock cycle.
277 1/1 if (dst_handshake) begin
Tests: T4 T5 T6
278 1/1 dst_fsm_ns = ODD;
Tests: T4 T5 T6
279 end
MISSING_ELSE
280 end
281
282 ODD: begin
283 // Internal REQ and ACK have inverted meaning now. If dst_req goes low, this signals a new
284 // transaction.
285 1/1 dst_req_o = ~dst_req;
Tests: T4 T5 T6
286 1/1 dst_ack_d = ~dst_ack_i;
Tests: T4 T5 T6
287
288 // The handshake is done for exactly 1 clock cycle.
289 1/1 if (dst_handshake) begin
Tests: T4 T5 T6
290 1/1 dst_fsm_ns = EVEN;
Tests: T4 T5 T6
291 end
MISSING_ELSE
292 end
293
294 //VCS coverage off
295 // pragma coverage off
296
297 default: ;
298
299 //VCS coverage on
300 // pragma coverage on
301
302 endcase
303 end
304
305 // Registers
306 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
307 1/1 if (!rst_src_ni) begin
Tests: T4 T5 T6
308 1/1 src_fsm_cs <= EVEN;
Tests: T4 T5 T6
309 1/1 src_req_q <= 1'b0;
Tests: T4 T5 T6
310 end else begin
311 1/1 src_fsm_cs <= src_fsm_ns;
Tests: T4 T5 T6
312 1/1 src_req_q <= src_req_d;
Tests: T4 T5 T6
313 end
314 end
315 always_ff @(posedge clk_dst_i or negedge rst_dst_ni) begin
316 1/1 if (!rst_dst_ni) begin
Tests: T4 T5 T6
317 1/1 dst_fsm_cs <= EVEN;
Tests: T4 T5 T6
318 1/1 dst_ack_q <= 1'b0;
Tests: T4 T5 T6
319 end else begin
320 1/1 dst_fsm_cs <= dst_fsm_ns;
Tests: T4 T5 T6
321 1/1 dst_ack_q <= dst_ack_d;
Tests: T4 T5 T6
322 end
323 end
324 end
325
326 ////////////////
327 // Assertions //
328 ////////////////
329
330 `ifdef INC_ASSERT
331 //VCS coverage off
332 // pragma coverage off
333
334 logic effective_rst_n;
335 unreachable assign effective_rst_n = rst_src_ni && rst_dst_ni;
336
337 logic chk_flag;
338 always_ff @(posedge clk_src_i or negedge effective_rst_n) begin
339 unreachable if (!effective_rst_n) begin
340 unreachable chk_flag <= '0;
341 unreachable end else if (src_req_i && !chk_flag) begin
342 unreachable chk_flag <= 1'b1;
343 end
==> MISSING_ELSE
Cond Coverage for Instance : tb.dut.u_io_div2_meas.u_meas.gen_clk_timeout_chk.u_timeout_ref_to_clk.u_ref_timeout
| Total | Covered | Percent |
Conditions | 3 | 3 | 100.00 |
Logical | 3 | 3 | 100.00 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 194
EXPRESSION (src_req_i & src_ack_o)
----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Unreachable | |
1 | 0 | Covered | T4,T5,T6 |
1 | 1 | Covered | T4,T5,T6 |
LINE 195
EXPRESSION (dst_req_o & dst_ack_i)
----1---- ----2----
-1- | -2- | Status | Tests | Exclude Annotation |
0 | 1 | Excluded | |
VC_COV_UNR |
1 | 0 | Excluded | |
VC_COV_UNR |
1 | 1 | Covered | T4,T5,T6 |
Branch Coverage for Instance : tb.dut.u_io_div2_meas.u_meas.gen_clk_timeout_chk.u_timeout_ref_to_clk.u_ref_timeout
| Line No. | Total | Covered | Percent |
Branches |
|
12 |
12 |
100.00 |
CASE |
225 |
4 |
4 |
100.00 |
CASE |
269 |
4 |
4 |
100.00 |
IF |
307 |
2 |
2 |
100.00 |
IF |
316 |
2 |
2 |
100.00 |
225 unique case (src_fsm_cs)
-1-
226
227 EVEN: begin
228 // Simply forward REQ and ACK.
229 src_req_d = src_req_i;
230 src_ack_o = src_ack;
231
232 // The handshake is done for exactly 1 clock cycle.
233 if (src_handshake) begin
-2-
234 src_fsm_ns = ODD;
==>
235 end
MISSING_ELSE
==>
236 end
237
238 ODD: begin
239 // Internal REQ and ACK have inverted meaning now. If src_req_i is high again, this
240 // signals a new transaction.
241 src_req_d = ~src_req_i;
242 src_ack_o = ~src_ack;
243
244 // The handshake is done for exactly 1 clock cycle.
245 if (src_handshake) begin
-3-
246 src_fsm_ns = EVEN;
==>
247 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
EVEN |
1 |
- |
Covered |
T4,T5,T6 |
EVEN |
0 |
- |
Covered |
T4,T5,T6 |
ODD |
- |
1 |
Covered |
T4,T5,T6 |
ODD |
- |
0 |
Covered |
T4,T5,T6 |
269 unique case (dst_fsm_cs)
-1-
270
271 EVEN: begin
272 // Simply forward REQ and ACK.
273 dst_req_o = dst_req;
274 dst_ack_d = dst_ack_i;
275
276 // The handshake is done for exactly 1 clock cycle.
277 if (dst_handshake) begin
-2-
278 dst_fsm_ns = ODD;
==>
279 end
MISSING_ELSE
==>
280 end
281
282 ODD: begin
283 // Internal REQ and ACK have inverted meaning now. If dst_req goes low, this signals a new
284 // transaction.
285 dst_req_o = ~dst_req;
286 dst_ack_d = ~dst_ack_i;
287
288 // The handshake is done for exactly 1 clock cycle.
289 if (dst_handshake) begin
-3-
290 dst_fsm_ns = EVEN;
==>
291 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
EVEN |
1 |
- |
Covered |
T4,T5,T6 |
EVEN |
0 |
- |
Covered |
T4,T5,T6 |
ODD |
- |
1 |
Covered |
T4,T5,T6 |
ODD |
- |
0 |
Covered |
T4,T5,T6 |
307 if (!rst_src_ni) begin
-1-
308 src_fsm_cs <= EVEN;
==>
309 src_req_q <= 1'b0;
310 end else begin
311 src_fsm_cs <= src_fsm_ns;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T4,T5,T6 |
0 |
Covered |
T4,T5,T6 |
316 if (!rst_dst_ni) begin
-1-
317 dst_fsm_cs <= EVEN;
==>
318 dst_ack_q <= 1'b0;
319 end else begin
320 dst_fsm_cs <= dst_fsm_ns;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T4,T5,T6 |
0 |
Covered |
T4,T5,T6 |
Assert Coverage for Instance : tb.dut.u_io_div2_meas.u_meas.gen_clk_timeout_chk.u_timeout_ref_to_clk.u_ref_timeout
Assertion Details
SyncReqAckAckNeedsReq
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
38935348 |
299646 |
0 |
0 |
T4 |
1326 |
38 |
0 |
0 |
T5 |
515 |
15 |
0 |
0 |
T6 |
738 |
23 |
0 |
0 |
T30 |
2666 |
84 |
0 |
0 |
T31 |
1407 |
44 |
0 |
0 |
T32 |
732 |
23 |
0 |
0 |
T33 |
1028 |
33 |
0 |
0 |
T34 |
1630 |
48 |
0 |
0 |
T35 |
899 |
29 |
0 |
0 |
T36 |
2775 |
88 |
0 |
0 |
SyncReqAckHoldReq
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1387694 |
0 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_io_div4_meas.u_meas.gen_clk_timeout_chk.u_timeout_ref_to_clk.u_ref_timeout
| Line No. | Total | Covered | Percent |
TOTAL | | 36 | 36 | 100.00 |
CONT_ASSIGN | 55 | 0 | 0 | |
CONT_ASSIGN | 194 | 1 | 1 | 100.00 |
CONT_ASSIGN | 195 | 1 | 1 | 100.00 |
ALWAYS | 219 | 12 | 12 | 100.00 |
ALWAYS | 263 | 12 | 12 | 100.00 |
ALWAYS | 307 | 5 | 5 | 100.00 |
ALWAYS | 316 | 5 | 5 | 100.00 |
CONT_ASSIGN | 335 | 0 | 0 | |
ALWAYS | 339 | 0 | 0 | |
54 logic unused_req_chk;
55 unreachable assign unused_req_chk = req_chk_i;
56
57 if (EnRzHs) begin : gen_rz_hs_protocol
58 //////////////////
59 // RZ protocol //
60 //////////////////
61
62 // Types
63 typedef enum logic {
64 LoSt, HiSt
65 } rz_fsm_e;
66
67 // Signals
68 rz_fsm_e src_fsm_d, src_fsm_q;
69 rz_fsm_e dst_fsm_d, dst_fsm_q;
70 logic src_ack, dst_ack;
71 logic src_req, dst_req;
72
73 // REQ-side FSM (SRC domain)
74 always_comb begin : src_fsm
75 src_fsm_d = src_fsm_q;
76 src_ack_o = 1'b0;
77 src_req = 1'b0;
78
79 unique case (src_fsm_q)
80 LoSt: begin
81 // Wait for the ack to go back to zero before starting
82 // a new transaction.
83 if (!src_ack && src_req_i) begin
84 src_fsm_d = HiSt;
85 end
86 end
87 HiSt: begin
88 src_req = 1'b1;
89 // Forward the acknowledgement.
90 src_ack_o = src_ack;
91 // If request drops out, we go back to LoSt.
92 // If DST side asserts ack, we also go back to LoSt.
93 if (!src_req_i || src_ack) begin
94 src_fsm_d = LoSt;
95 end
96 end
97 //VCS coverage off
98 // pragma coverage off
99 default: ;
100 //VCS coverage on
101 // pragma coverage on
102 endcase
103 end
104
105 // Move ACK over to SRC domain.
106 prim_flop_2sync #(
107 .Width(1)
108 ) ack_sync (
109 .clk_i (clk_src_i),
110 .rst_ni (rst_src_ni),
111 .d_i (dst_ack),
112 .q_o (src_ack)
113 );
114
115 // Registers
116 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
117 if (!rst_src_ni) begin
118 src_fsm_q <= LoSt;
119 end else begin
120 src_fsm_q <= src_fsm_d;
121 end
122 end
123
124 // ACK-side FSM (DST domain)
125 always_comb begin : dst_fsm
126 dst_fsm_d = dst_fsm_q;
127 dst_req_o = 1'b0;
128 dst_ack = 1'b0;
129
130 unique case (dst_fsm_q)
131 LoSt: begin
132 if (dst_req) begin
133 // Forward the request.
134 dst_req_o = 1'b1;
135 // Wait for the request and acknowledge to be asserted
136 // before responding to the SRC side.
137 if (dst_ack_i) begin
138 dst_fsm_d = HiSt;
139 end
140 end
141 end
142 HiSt: begin
143 dst_ack = 1'b1;
144 // Wait for the request to drop back to zero.
145 if (!dst_req) begin
146 dst_fsm_d = LoSt;
147 end
148 end
149 //VCS coverage off
150 // pragma coverage off
151 default: ;
152 //VCS coverage on
153 // pragma coverage on
154 endcase
155 end
156
157 // Move REQ over to DST domain.
158 prim_flop_2sync #(
159 .Width(1)
160 ) req_sync (
161 .clk_i (clk_dst_i),
162 .rst_ni (rst_dst_ni),
163 .d_i (src_req),
164 .q_o (dst_req)
165 );
166
167 // Registers
168 always_ff @(posedge clk_dst_i or negedge rst_dst_ni) begin
169 if (!rst_dst_ni) begin
170 dst_fsm_q <= LoSt;
171 end else begin
172 dst_fsm_q <= dst_fsm_d;
173 end
174 end
175
176 end else begin : gen_nrz_hs_protocol
177 //////////////////
178 // NRZ protocol //
179 //////////////////
180
181 // Types
182 typedef enum logic {
183 EVEN, ODD
184 } sync_reqack_fsm_e;
185
186 // Signals
187 sync_reqack_fsm_e src_fsm_ns, src_fsm_cs;
188 sync_reqack_fsm_e dst_fsm_ns, dst_fsm_cs;
189
190 logic src_req_d, src_req_q, src_ack;
191 logic dst_ack_d, dst_ack_q, dst_req;
192 logic src_handshake, dst_handshake;
193
194 1/1 assign src_handshake = src_req_i & src_ack_o;
Tests: T4 T5 T6
195 1/1 assign dst_handshake = dst_req_o & dst_ack_i;
Tests: T4 T5 T6
196
197 // Move REQ over to DST domain.
198 prim_flop_2sync #(
199 .Width(1)
200 ) req_sync (
201 .clk_i (clk_dst_i),
202 .rst_ni (rst_dst_ni),
203 .d_i (src_req_q),
204 .q_o (dst_req)
205 );
206
207 // Move ACK over to SRC domain.
208 prim_flop_2sync #(
209 .Width(1)
210 ) ack_sync (
211 .clk_i (clk_src_i),
212 .rst_ni (rst_src_ni),
213 .d_i (dst_ack_q),
214 .q_o (src_ack)
215 );
216
217 // REQ-side FSM (SRC domain)
218 always_comb begin : src_fsm
219 1/1 src_fsm_ns = src_fsm_cs;
Tests: T4 T5 T6
220
221 // By default, we keep the internal REQ value and don't ACK.
222 1/1 src_req_d = src_req_q;
Tests: T4 T5 T6
223 1/1 src_ack_o = 1'b0;
Tests: T4 T5 T6
224
225 1/1 unique case (src_fsm_cs)
Tests: T4 T5 T6
226
227 EVEN: begin
228 // Simply forward REQ and ACK.
229 1/1 src_req_d = src_req_i;
Tests: T4 T5 T6
230 1/1 src_ack_o = src_ack;
Tests: T4 T5 T6
231
232 // The handshake is done for exactly 1 clock cycle.
233 1/1 if (src_handshake) begin
Tests: T4 T5 T6
234 1/1 src_fsm_ns = ODD;
Tests: T4 T5 T6
235 end
MISSING_ELSE
236 end
237
238 ODD: begin
239 // Internal REQ and ACK have inverted meaning now. If src_req_i is high again, this
240 // signals a new transaction.
241 1/1 src_req_d = ~src_req_i;
Tests: T4 T5 T6
242 1/1 src_ack_o = ~src_ack;
Tests: T4 T5 T6
243
244 // The handshake is done for exactly 1 clock cycle.
245 1/1 if (src_handshake) begin
Tests: T4 T5 T6
246 1/1 src_fsm_ns = EVEN;
Tests: T4 T5 T6
247 end
MISSING_ELSE
248 end
249
250 //VCS coverage off
251 // pragma coverage off
252
253 default: ;
254
255 //VCS coverage on
256 // pragma coverage on
257
258 endcase
259 end
260
261 // ACK-side FSM (DST domain)
262 always_comb begin : dst_fsm
263 1/1 dst_fsm_ns = dst_fsm_cs;
Tests: T4 T5 T6
264
265 // By default, we don't REQ and keep the internal ACK.
266 1/1 dst_req_o = 1'b0;
Tests: T4 T5 T6
267 1/1 dst_ack_d = dst_ack_q;
Tests: T4 T5 T6
268
269 1/1 unique case (dst_fsm_cs)
Tests: T4 T5 T6
270
271 EVEN: begin
272 // Simply forward REQ and ACK.
273 1/1 dst_req_o = dst_req;
Tests: T4 T5 T6
274 1/1 dst_ack_d = dst_ack_i;
Tests: T4 T5 T6
275
276 // The handshake is done for exactly 1 clock cycle.
277 1/1 if (dst_handshake) begin
Tests: T4 T5 T6
278 1/1 dst_fsm_ns = ODD;
Tests: T4 T5 T6
279 end
MISSING_ELSE
280 end
281
282 ODD: begin
283 // Internal REQ and ACK have inverted meaning now. If dst_req goes low, this signals a new
284 // transaction.
285 1/1 dst_req_o = ~dst_req;
Tests: T4 T5 T6
286 1/1 dst_ack_d = ~dst_ack_i;
Tests: T4 T5 T6
287
288 // The handshake is done for exactly 1 clock cycle.
289 1/1 if (dst_handshake) begin
Tests: T4 T5 T6
290 1/1 dst_fsm_ns = EVEN;
Tests: T4 T5 T6
291 end
MISSING_ELSE
292 end
293
294 //VCS coverage off
295 // pragma coverage off
296
297 default: ;
298
299 //VCS coverage on
300 // pragma coverage on
301
302 endcase
303 end
304
305 // Registers
306 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
307 1/1 if (!rst_src_ni) begin
Tests: T4 T5 T6
308 1/1 src_fsm_cs <= EVEN;
Tests: T4 T5 T6
309 1/1 src_req_q <= 1'b0;
Tests: T4 T5 T6
310 end else begin
311 1/1 src_fsm_cs <= src_fsm_ns;
Tests: T4 T5 T6
312 1/1 src_req_q <= src_req_d;
Tests: T4 T5 T6
313 end
314 end
315 always_ff @(posedge clk_dst_i or negedge rst_dst_ni) begin
316 1/1 if (!rst_dst_ni) begin
Tests: T4 T5 T6
317 1/1 dst_fsm_cs <= EVEN;
Tests: T4 T5 T6
318 1/1 dst_ack_q <= 1'b0;
Tests: T4 T5 T6
319 end else begin
320 1/1 dst_fsm_cs <= dst_fsm_ns;
Tests: T4 T5 T6
321 1/1 dst_ack_q <= dst_ack_d;
Tests: T4 T5 T6
322 end
323 end
324 end
325
326 ////////////////
327 // Assertions //
328 ////////////////
329
330 `ifdef INC_ASSERT
331 //VCS coverage off
332 // pragma coverage off
333
334 logic effective_rst_n;
335 unreachable assign effective_rst_n = rst_src_ni && rst_dst_ni;
336
337 logic chk_flag;
338 always_ff @(posedge clk_src_i or negedge effective_rst_n) begin
339 unreachable if (!effective_rst_n) begin
340 unreachable chk_flag <= '0;
341 unreachable end else if (src_req_i && !chk_flag) begin
342 unreachable chk_flag <= 1'b1;
343 end
==> MISSING_ELSE
Cond Coverage for Instance : tb.dut.u_io_div4_meas.u_meas.gen_clk_timeout_chk.u_timeout_ref_to_clk.u_ref_timeout
| Total | Covered | Percent |
Conditions | 3 | 3 | 100.00 |
Logical | 3 | 3 | 100.00 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 194
EXPRESSION (src_req_i & src_ack_o)
----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Unreachable | |
1 | 0 | Covered | T4,T5,T6 |
1 | 1 | Covered | T4,T5,T6 |
LINE 195
EXPRESSION (dst_req_o & dst_ack_i)
----1---- ----2----
-1- | -2- | Status | Tests | Exclude Annotation |
0 | 1 | Excluded | |
VC_COV_UNR |
1 | 0 | Excluded | |
VC_COV_UNR |
1 | 1 | Covered | T4,T5,T6 |
Branch Coverage for Instance : tb.dut.u_io_div4_meas.u_meas.gen_clk_timeout_chk.u_timeout_ref_to_clk.u_ref_timeout
| Line No. | Total | Covered | Percent |
Branches |
|
12 |
12 |
100.00 |
CASE |
225 |
4 |
4 |
100.00 |
CASE |
269 |
4 |
4 |
100.00 |
IF |
307 |
2 |
2 |
100.00 |
IF |
316 |
2 |
2 |
100.00 |
225 unique case (src_fsm_cs)
-1-
226
227 EVEN: begin
228 // Simply forward REQ and ACK.
229 src_req_d = src_req_i;
230 src_ack_o = src_ack;
231
232 // The handshake is done for exactly 1 clock cycle.
233 if (src_handshake) begin
-2-
234 src_fsm_ns = ODD;
==>
235 end
MISSING_ELSE
==>
236 end
237
238 ODD: begin
239 // Internal REQ and ACK have inverted meaning now. If src_req_i is high again, this
240 // signals a new transaction.
241 src_req_d = ~src_req_i;
242 src_ack_o = ~src_ack;
243
244 // The handshake is done for exactly 1 clock cycle.
245 if (src_handshake) begin
-3-
246 src_fsm_ns = EVEN;
==>
247 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
EVEN |
1 |
- |
Covered |
T4,T5,T6 |
EVEN |
0 |
- |
Covered |
T4,T5,T6 |
ODD |
- |
1 |
Covered |
T4,T5,T6 |
ODD |
- |
0 |
Covered |
T4,T5,T6 |
269 unique case (dst_fsm_cs)
-1-
270
271 EVEN: begin
272 // Simply forward REQ and ACK.
273 dst_req_o = dst_req;
274 dst_ack_d = dst_ack_i;
275
276 // The handshake is done for exactly 1 clock cycle.
277 if (dst_handshake) begin
-2-
278 dst_fsm_ns = ODD;
==>
279 end
MISSING_ELSE
==>
280 end
281
282 ODD: begin
283 // Internal REQ and ACK have inverted meaning now. If dst_req goes low, this signals a new
284 // transaction.
285 dst_req_o = ~dst_req;
286 dst_ack_d = ~dst_ack_i;
287
288 // The handshake is done for exactly 1 clock cycle.
289 if (dst_handshake) begin
-3-
290 dst_fsm_ns = EVEN;
==>
291 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
EVEN |
1 |
- |
Covered |
T4,T5,T6 |
EVEN |
0 |
- |
Covered |
T4,T5,T6 |
ODD |
- |
1 |
Covered |
T4,T5,T6 |
ODD |
- |
0 |
Covered |
T4,T5,T6 |
307 if (!rst_src_ni) begin
-1-
308 src_fsm_cs <= EVEN;
==>
309 src_req_q <= 1'b0;
310 end else begin
311 src_fsm_cs <= src_fsm_ns;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T4,T5,T6 |
0 |
Covered |
T4,T5,T6 |
316 if (!rst_dst_ni) begin
-1-
317 dst_fsm_cs <= EVEN;
==>
318 dst_ack_q <= 1'b0;
319 end else begin
320 dst_fsm_cs <= dst_fsm_ns;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T4,T5,T6 |
0 |
Covered |
T4,T5,T6 |
Assert Coverage for Instance : tb.dut.u_io_div4_meas.u_meas.gen_clk_timeout_chk.u_timeout_ref_to_clk.u_ref_timeout
Assertion Details
SyncReqAckAckNeedsReq
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
19467275 |
287177 |
0 |
0 |
T4 |
663 |
37 |
0 |
0 |
T5 |
258 |
14 |
0 |
0 |
T6 |
369 |
23 |
0 |
0 |
T30 |
1333 |
80 |
0 |
0 |
T31 |
704 |
43 |
0 |
0 |
T32 |
366 |
22 |
0 |
0 |
T33 |
514 |
32 |
0 |
0 |
T34 |
815 |
46 |
0 |
0 |
T35 |
450 |
28 |
0 |
0 |
T36 |
1388 |
83 |
0 |
0 |
SyncReqAckHoldReq
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1387694 |
0 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_main_meas.u_meas.gen_clk_timeout_chk.u_timeout_ref_to_clk.u_ref_timeout
| Line No. | Total | Covered | Percent |
TOTAL | | 36 | 36 | 100.00 |
CONT_ASSIGN | 55 | 0 | 0 | |
CONT_ASSIGN | 194 | 1 | 1 | 100.00 |
CONT_ASSIGN | 195 | 1 | 1 | 100.00 |
ALWAYS | 219 | 12 | 12 | 100.00 |
ALWAYS | 263 | 12 | 12 | 100.00 |
ALWAYS | 307 | 5 | 5 | 100.00 |
ALWAYS | 316 | 5 | 5 | 100.00 |
CONT_ASSIGN | 335 | 0 | 0 | |
ALWAYS | 339 | 0 | 0 | |
54 logic unused_req_chk;
55 unreachable assign unused_req_chk = req_chk_i;
56
57 if (EnRzHs) begin : gen_rz_hs_protocol
58 //////////////////
59 // RZ protocol //
60 //////////////////
61
62 // Types
63 typedef enum logic {
64 LoSt, HiSt
65 } rz_fsm_e;
66
67 // Signals
68 rz_fsm_e src_fsm_d, src_fsm_q;
69 rz_fsm_e dst_fsm_d, dst_fsm_q;
70 logic src_ack, dst_ack;
71 logic src_req, dst_req;
72
73 // REQ-side FSM (SRC domain)
74 always_comb begin : src_fsm
75 src_fsm_d = src_fsm_q;
76 src_ack_o = 1'b0;
77 src_req = 1'b0;
78
79 unique case (src_fsm_q)
80 LoSt: begin
81 // Wait for the ack to go back to zero before starting
82 // a new transaction.
83 if (!src_ack && src_req_i) begin
84 src_fsm_d = HiSt;
85 end
86 end
87 HiSt: begin
88 src_req = 1'b1;
89 // Forward the acknowledgement.
90 src_ack_o = src_ack;
91 // If request drops out, we go back to LoSt.
92 // If DST side asserts ack, we also go back to LoSt.
93 if (!src_req_i || src_ack) begin
94 src_fsm_d = LoSt;
95 end
96 end
97 //VCS coverage off
98 // pragma coverage off
99 default: ;
100 //VCS coverage on
101 // pragma coverage on
102 endcase
103 end
104
105 // Move ACK over to SRC domain.
106 prim_flop_2sync #(
107 .Width(1)
108 ) ack_sync (
109 .clk_i (clk_src_i),
110 .rst_ni (rst_src_ni),
111 .d_i (dst_ack),
112 .q_o (src_ack)
113 );
114
115 // Registers
116 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
117 if (!rst_src_ni) begin
118 src_fsm_q <= LoSt;
119 end else begin
120 src_fsm_q <= src_fsm_d;
121 end
122 end
123
124 // ACK-side FSM (DST domain)
125 always_comb begin : dst_fsm
126 dst_fsm_d = dst_fsm_q;
127 dst_req_o = 1'b0;
128 dst_ack = 1'b0;
129
130 unique case (dst_fsm_q)
131 LoSt: begin
132 if (dst_req) begin
133 // Forward the request.
134 dst_req_o = 1'b1;
135 // Wait for the request and acknowledge to be asserted
136 // before responding to the SRC side.
137 if (dst_ack_i) begin
138 dst_fsm_d = HiSt;
139 end
140 end
141 end
142 HiSt: begin
143 dst_ack = 1'b1;
144 // Wait for the request to drop back to zero.
145 if (!dst_req) begin
146 dst_fsm_d = LoSt;
147 end
148 end
149 //VCS coverage off
150 // pragma coverage off
151 default: ;
152 //VCS coverage on
153 // pragma coverage on
154 endcase
155 end
156
157 // Move REQ over to DST domain.
158 prim_flop_2sync #(
159 .Width(1)
160 ) req_sync (
161 .clk_i (clk_dst_i),
162 .rst_ni (rst_dst_ni),
163 .d_i (src_req),
164 .q_o (dst_req)
165 );
166
167 // Registers
168 always_ff @(posedge clk_dst_i or negedge rst_dst_ni) begin
169 if (!rst_dst_ni) begin
170 dst_fsm_q <= LoSt;
171 end else begin
172 dst_fsm_q <= dst_fsm_d;
173 end
174 end
175
176 end else begin : gen_nrz_hs_protocol
177 //////////////////
178 // NRZ protocol //
179 //////////////////
180
181 // Types
182 typedef enum logic {
183 EVEN, ODD
184 } sync_reqack_fsm_e;
185
186 // Signals
187 sync_reqack_fsm_e src_fsm_ns, src_fsm_cs;
188 sync_reqack_fsm_e dst_fsm_ns, dst_fsm_cs;
189
190 logic src_req_d, src_req_q, src_ack;
191 logic dst_ack_d, dst_ack_q, dst_req;
192 logic src_handshake, dst_handshake;
193
194 1/1 assign src_handshake = src_req_i & src_ack_o;
Tests: T4 T5 T6
195 1/1 assign dst_handshake = dst_req_o & dst_ack_i;
Tests: T4 T5 T6
196
197 // Move REQ over to DST domain.
198 prim_flop_2sync #(
199 .Width(1)
200 ) req_sync (
201 .clk_i (clk_dst_i),
202 .rst_ni (rst_dst_ni),
203 .d_i (src_req_q),
204 .q_o (dst_req)
205 );
206
207 // Move ACK over to SRC domain.
208 prim_flop_2sync #(
209 .Width(1)
210 ) ack_sync (
211 .clk_i (clk_src_i),
212 .rst_ni (rst_src_ni),
213 .d_i (dst_ack_q),
214 .q_o (src_ack)
215 );
216
217 // REQ-side FSM (SRC domain)
218 always_comb begin : src_fsm
219 1/1 src_fsm_ns = src_fsm_cs;
Tests: T4 T5 T6
220
221 // By default, we keep the internal REQ value and don't ACK.
222 1/1 src_req_d = src_req_q;
Tests: T4 T5 T6
223 1/1 src_ack_o = 1'b0;
Tests: T4 T5 T6
224
225 1/1 unique case (src_fsm_cs)
Tests: T4 T5 T6
226
227 EVEN: begin
228 // Simply forward REQ and ACK.
229 1/1 src_req_d = src_req_i;
Tests: T4 T5 T6
230 1/1 src_ack_o = src_ack;
Tests: T4 T5 T6
231
232 // The handshake is done for exactly 1 clock cycle.
233 1/1 if (src_handshake) begin
Tests: T4 T5 T6
234 1/1 src_fsm_ns = ODD;
Tests: T4 T5 T6
235 end
MISSING_ELSE
236 end
237
238 ODD: begin
239 // Internal REQ and ACK have inverted meaning now. If src_req_i is high again, this
240 // signals a new transaction.
241 1/1 src_req_d = ~src_req_i;
Tests: T4 T5 T6
242 1/1 src_ack_o = ~src_ack;
Tests: T4 T5 T6
243
244 // The handshake is done for exactly 1 clock cycle.
245 1/1 if (src_handshake) begin
Tests: T4 T5 T6
246 1/1 src_fsm_ns = EVEN;
Tests: T4 T5 T6
247 end
MISSING_ELSE
248 end
249
250 //VCS coverage off
251 // pragma coverage off
252
253 default: ;
254
255 //VCS coverage on
256 // pragma coverage on
257
258 endcase
259 end
260
261 // ACK-side FSM (DST domain)
262 always_comb begin : dst_fsm
263 1/1 dst_fsm_ns = dst_fsm_cs;
Tests: T4 T5 T6
264
265 // By default, we don't REQ and keep the internal ACK.
266 1/1 dst_req_o = 1'b0;
Tests: T4 T5 T6
267 1/1 dst_ack_d = dst_ack_q;
Tests: T4 T5 T6
268
269 1/1 unique case (dst_fsm_cs)
Tests: T4 T5 T6
270
271 EVEN: begin
272 // Simply forward REQ and ACK.
273 1/1 dst_req_o = dst_req;
Tests: T4 T5 T6
274 1/1 dst_ack_d = dst_ack_i;
Tests: T4 T5 T6
275
276 // The handshake is done for exactly 1 clock cycle.
277 1/1 if (dst_handshake) begin
Tests: T4 T5 T6
278 1/1 dst_fsm_ns = ODD;
Tests: T4 T5 T6
279 end
MISSING_ELSE
280 end
281
282 ODD: begin
283 // Internal REQ and ACK have inverted meaning now. If dst_req goes low, this signals a new
284 // transaction.
285 1/1 dst_req_o = ~dst_req;
Tests: T4 T5 T6
286 1/1 dst_ack_d = ~dst_ack_i;
Tests: T4 T5 T6
287
288 // The handshake is done for exactly 1 clock cycle.
289 1/1 if (dst_handshake) begin
Tests: T4 T5 T6
290 1/1 dst_fsm_ns = EVEN;
Tests: T4 T5 T6
291 end
MISSING_ELSE
292 end
293
294 //VCS coverage off
295 // pragma coverage off
296
297 default: ;
298
299 //VCS coverage on
300 // pragma coverage on
301
302 endcase
303 end
304
305 // Registers
306 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
307 1/1 if (!rst_src_ni) begin
Tests: T4 T5 T6
308 1/1 src_fsm_cs <= EVEN;
Tests: T4 T5 T6
309 1/1 src_req_q <= 1'b0;
Tests: T4 T5 T6
310 end else begin
311 1/1 src_fsm_cs <= src_fsm_ns;
Tests: T4 T5 T6
312 1/1 src_req_q <= src_req_d;
Tests: T4 T5 T6
313 end
314 end
315 always_ff @(posedge clk_dst_i or negedge rst_dst_ni) begin
316 1/1 if (!rst_dst_ni) begin
Tests: T4 T5 T6
317 1/1 dst_fsm_cs <= EVEN;
Tests: T4 T5 T6
318 1/1 dst_ack_q <= 1'b0;
Tests: T4 T5 T6
319 end else begin
320 1/1 dst_fsm_cs <= dst_fsm_ns;
Tests: T4 T5 T6
321 1/1 dst_ack_q <= dst_ack_d;
Tests: T4 T5 T6
322 end
323 end
324 end
325
326 ////////////////
327 // Assertions //
328 ////////////////
329
330 `ifdef INC_ASSERT
331 //VCS coverage off
332 // pragma coverage off
333
334 logic effective_rst_n;
335 unreachable assign effective_rst_n = rst_src_ni && rst_dst_ni;
336
337 logic chk_flag;
338 always_ff @(posedge clk_src_i or negedge effective_rst_n) begin
339 unreachable if (!effective_rst_n) begin
340 unreachable chk_flag <= '0;
341 unreachable end else if (src_req_i && !chk_flag) begin
342 unreachable chk_flag <= 1'b1;
343 end
==> MISSING_ELSE
Cond Coverage for Instance : tb.dut.u_main_meas.u_meas.gen_clk_timeout_chk.u_timeout_ref_to_clk.u_ref_timeout
| Total | Covered | Percent |
Conditions | 3 | 3 | 100.00 |
Logical | 3 | 3 | 100.00 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 194
EXPRESSION (src_req_i & src_ack_o)
----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Unreachable | |
1 | 0 | Covered | T4,T5,T6 |
1 | 1 | Covered | T4,T5,T6 |
LINE 195
EXPRESSION (dst_req_o & dst_ack_i)
----1---- ----2----
-1- | -2- | Status | Tests | Exclude Annotation |
0 | 1 | Excluded | |
VC_COV_UNR |
1 | 0 | Excluded | |
VC_COV_UNR |
1 | 1 | Covered | T4,T5,T6 |
Branch Coverage for Instance : tb.dut.u_main_meas.u_meas.gen_clk_timeout_chk.u_timeout_ref_to_clk.u_ref_timeout
| Line No. | Total | Covered | Percent |
Branches |
|
12 |
12 |
100.00 |
CASE |
225 |
4 |
4 |
100.00 |
CASE |
269 |
4 |
4 |
100.00 |
IF |
307 |
2 |
2 |
100.00 |
IF |
316 |
2 |
2 |
100.00 |
225 unique case (src_fsm_cs)
-1-
226
227 EVEN: begin
228 // Simply forward REQ and ACK.
229 src_req_d = src_req_i;
230 src_ack_o = src_ack;
231
232 // The handshake is done for exactly 1 clock cycle.
233 if (src_handshake) begin
-2-
234 src_fsm_ns = ODD;
==>
235 end
MISSING_ELSE
==>
236 end
237
238 ODD: begin
239 // Internal REQ and ACK have inverted meaning now. If src_req_i is high again, this
240 // signals a new transaction.
241 src_req_d = ~src_req_i;
242 src_ack_o = ~src_ack;
243
244 // The handshake is done for exactly 1 clock cycle.
245 if (src_handshake) begin
-3-
246 src_fsm_ns = EVEN;
==>
247 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
EVEN |
1 |
- |
Covered |
T4,T5,T6 |
EVEN |
0 |
- |
Covered |
T4,T5,T6 |
ODD |
- |
1 |
Covered |
T4,T5,T6 |
ODD |
- |
0 |
Covered |
T4,T5,T6 |
269 unique case (dst_fsm_cs)
-1-
270
271 EVEN: begin
272 // Simply forward REQ and ACK.
273 dst_req_o = dst_req;
274 dst_ack_d = dst_ack_i;
275
276 // The handshake is done for exactly 1 clock cycle.
277 if (dst_handshake) begin
-2-
278 dst_fsm_ns = ODD;
==>
279 end
MISSING_ELSE
==>
280 end
281
282 ODD: begin
283 // Internal REQ and ACK have inverted meaning now. If dst_req goes low, this signals a new
284 // transaction.
285 dst_req_o = ~dst_req;
286 dst_ack_d = ~dst_ack_i;
287
288 // The handshake is done for exactly 1 clock cycle.
289 if (dst_handshake) begin
-3-
290 dst_fsm_ns = EVEN;
==>
291 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
EVEN |
1 |
- |
Covered |
T4,T5,T6 |
EVEN |
0 |
- |
Covered |
T4,T5,T6 |
ODD |
- |
1 |
Covered |
T4,T5,T6 |
ODD |
- |
0 |
Covered |
T4,T5,T6 |
307 if (!rst_src_ni) begin
-1-
308 src_fsm_cs <= EVEN;
==>
309 src_req_q <= 1'b0;
310 end else begin
311 src_fsm_cs <= src_fsm_ns;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T4,T5,T6 |
0 |
Covered |
T4,T5,T6 |
316 if (!rst_dst_ni) begin
-1-
317 dst_fsm_cs <= EVEN;
==>
318 dst_ack_q <= 1'b0;
319 end else begin
320 dst_fsm_cs <= dst_fsm_ns;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T4,T5,T6 |
0 |
Covered |
T4,T5,T6 |
Assert Coverage for Instance : tb.dut.u_main_meas.u_meas.gen_clk_timeout_chk.u_timeout_ref_to_clk.u_ref_timeout
Assertion Details
SyncReqAckAckNeedsReq
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
88248330 |
301736 |
0 |
0 |
T4 |
2507 |
38 |
0 |
0 |
T5 |
1175 |
15 |
0 |
0 |
T6 |
1648 |
23 |
0 |
0 |
T30 |
5652 |
84 |
0 |
0 |
T31 |
2986 |
44 |
0 |
0 |
T32 |
1553 |
23 |
0 |
0 |
T33 |
2253 |
34 |
0 |
0 |
T34 |
3311 |
48 |
0 |
0 |
T35 |
1941 |
29 |
0 |
0 |
T36 |
5893 |
88 |
0 |
0 |
SyncReqAckHoldReq
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1387694 |
0 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_usb_meas.u_meas.gen_clk_timeout_chk.u_timeout_ref_to_clk.u_ref_timeout
| Line No. | Total | Covered | Percent |
TOTAL | | 36 | 36 | 100.00 |
CONT_ASSIGN | 55 | 0 | 0 | |
CONT_ASSIGN | 194 | 1 | 1 | 100.00 |
CONT_ASSIGN | 195 | 1 | 1 | 100.00 |
ALWAYS | 219 | 12 | 12 | 100.00 |
ALWAYS | 263 | 12 | 12 | 100.00 |
ALWAYS | 307 | 5 | 5 | 100.00 |
ALWAYS | 316 | 5 | 5 | 100.00 |
CONT_ASSIGN | 335 | 0 | 0 | |
ALWAYS | 339 | 0 | 0 | |
54 logic unused_req_chk;
55 unreachable assign unused_req_chk = req_chk_i;
56
57 if (EnRzHs) begin : gen_rz_hs_protocol
58 //////////////////
59 // RZ protocol //
60 //////////////////
61
62 // Types
63 typedef enum logic {
64 LoSt, HiSt
65 } rz_fsm_e;
66
67 // Signals
68 rz_fsm_e src_fsm_d, src_fsm_q;
69 rz_fsm_e dst_fsm_d, dst_fsm_q;
70 logic src_ack, dst_ack;
71 logic src_req, dst_req;
72
73 // REQ-side FSM (SRC domain)
74 always_comb begin : src_fsm
75 src_fsm_d = src_fsm_q;
76 src_ack_o = 1'b0;
77 src_req = 1'b0;
78
79 unique case (src_fsm_q)
80 LoSt: begin
81 // Wait for the ack to go back to zero before starting
82 // a new transaction.
83 if (!src_ack && src_req_i) begin
84 src_fsm_d = HiSt;
85 end
86 end
87 HiSt: begin
88 src_req = 1'b1;
89 // Forward the acknowledgement.
90 src_ack_o = src_ack;
91 // If request drops out, we go back to LoSt.
92 // If DST side asserts ack, we also go back to LoSt.
93 if (!src_req_i || src_ack) begin
94 src_fsm_d = LoSt;
95 end
96 end
97 //VCS coverage off
98 // pragma coverage off
99 default: ;
100 //VCS coverage on
101 // pragma coverage on
102 endcase
103 end
104
105 // Move ACK over to SRC domain.
106 prim_flop_2sync #(
107 .Width(1)
108 ) ack_sync (
109 .clk_i (clk_src_i),
110 .rst_ni (rst_src_ni),
111 .d_i (dst_ack),
112 .q_o (src_ack)
113 );
114
115 // Registers
116 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
117 if (!rst_src_ni) begin
118 src_fsm_q <= LoSt;
119 end else begin
120 src_fsm_q <= src_fsm_d;
121 end
122 end
123
124 // ACK-side FSM (DST domain)
125 always_comb begin : dst_fsm
126 dst_fsm_d = dst_fsm_q;
127 dst_req_o = 1'b0;
128 dst_ack = 1'b0;
129
130 unique case (dst_fsm_q)
131 LoSt: begin
132 if (dst_req) begin
133 // Forward the request.
134 dst_req_o = 1'b1;
135 // Wait for the request and acknowledge to be asserted
136 // before responding to the SRC side.
137 if (dst_ack_i) begin
138 dst_fsm_d = HiSt;
139 end
140 end
141 end
142 HiSt: begin
143 dst_ack = 1'b1;
144 // Wait for the request to drop back to zero.
145 if (!dst_req) begin
146 dst_fsm_d = LoSt;
147 end
148 end
149 //VCS coverage off
150 // pragma coverage off
151 default: ;
152 //VCS coverage on
153 // pragma coverage on
154 endcase
155 end
156
157 // Move REQ over to DST domain.
158 prim_flop_2sync #(
159 .Width(1)
160 ) req_sync (
161 .clk_i (clk_dst_i),
162 .rst_ni (rst_dst_ni),
163 .d_i (src_req),
164 .q_o (dst_req)
165 );
166
167 // Registers
168 always_ff @(posedge clk_dst_i or negedge rst_dst_ni) begin
169 if (!rst_dst_ni) begin
170 dst_fsm_q <= LoSt;
171 end else begin
172 dst_fsm_q <= dst_fsm_d;
173 end
174 end
175
176 end else begin : gen_nrz_hs_protocol
177 //////////////////
178 // NRZ protocol //
179 //////////////////
180
181 // Types
182 typedef enum logic {
183 EVEN, ODD
184 } sync_reqack_fsm_e;
185
186 // Signals
187 sync_reqack_fsm_e src_fsm_ns, src_fsm_cs;
188 sync_reqack_fsm_e dst_fsm_ns, dst_fsm_cs;
189
190 logic src_req_d, src_req_q, src_ack;
191 logic dst_ack_d, dst_ack_q, dst_req;
192 logic src_handshake, dst_handshake;
193
194 1/1 assign src_handshake = src_req_i & src_ack_o;
Tests: T4 T5 T6
195 1/1 assign dst_handshake = dst_req_o & dst_ack_i;
Tests: T4 T5 T6
196
197 // Move REQ over to DST domain.
198 prim_flop_2sync #(
199 .Width(1)
200 ) req_sync (
201 .clk_i (clk_dst_i),
202 .rst_ni (rst_dst_ni),
203 .d_i (src_req_q),
204 .q_o (dst_req)
205 );
206
207 // Move ACK over to SRC domain.
208 prim_flop_2sync #(
209 .Width(1)
210 ) ack_sync (
211 .clk_i (clk_src_i),
212 .rst_ni (rst_src_ni),
213 .d_i (dst_ack_q),
214 .q_o (src_ack)
215 );
216
217 // REQ-side FSM (SRC domain)
218 always_comb begin : src_fsm
219 1/1 src_fsm_ns = src_fsm_cs;
Tests: T4 T5 T6
220
221 // By default, we keep the internal REQ value and don't ACK.
222 1/1 src_req_d = src_req_q;
Tests: T4 T5 T6
223 1/1 src_ack_o = 1'b0;
Tests: T4 T5 T6
224
225 1/1 unique case (src_fsm_cs)
Tests: T4 T5 T6
226
227 EVEN: begin
228 // Simply forward REQ and ACK.
229 1/1 src_req_d = src_req_i;
Tests: T4 T5 T6
230 1/1 src_ack_o = src_ack;
Tests: T4 T5 T6
231
232 // The handshake is done for exactly 1 clock cycle.
233 1/1 if (src_handshake) begin
Tests: T4 T5 T6
234 1/1 src_fsm_ns = ODD;
Tests: T4 T5 T6
235 end
MISSING_ELSE
236 end
237
238 ODD: begin
239 // Internal REQ and ACK have inverted meaning now. If src_req_i is high again, this
240 // signals a new transaction.
241 1/1 src_req_d = ~src_req_i;
Tests: T4 T5 T6
242 1/1 src_ack_o = ~src_ack;
Tests: T4 T5 T6
243
244 // The handshake is done for exactly 1 clock cycle.
245 1/1 if (src_handshake) begin
Tests: T4 T5 T6
246 1/1 src_fsm_ns = EVEN;
Tests: T4 T5 T6
247 end
MISSING_ELSE
248 end
249
250 //VCS coverage off
251 // pragma coverage off
252
253 default: ;
254
255 //VCS coverage on
256 // pragma coverage on
257
258 endcase
259 end
260
261 // ACK-side FSM (DST domain)
262 always_comb begin : dst_fsm
263 1/1 dst_fsm_ns = dst_fsm_cs;
Tests: T4 T5 T6
264
265 // By default, we don't REQ and keep the internal ACK.
266 1/1 dst_req_o = 1'b0;
Tests: T4 T5 T6
267 1/1 dst_ack_d = dst_ack_q;
Tests: T4 T5 T6
268
269 1/1 unique case (dst_fsm_cs)
Tests: T4 T5 T6
270
271 EVEN: begin
272 // Simply forward REQ and ACK.
273 1/1 dst_req_o = dst_req;
Tests: T4 T5 T6
274 1/1 dst_ack_d = dst_ack_i;
Tests: T4 T5 T6
275
276 // The handshake is done for exactly 1 clock cycle.
277 1/1 if (dst_handshake) begin
Tests: T4 T5 T6
278 1/1 dst_fsm_ns = ODD;
Tests: T4 T5 T6
279 end
MISSING_ELSE
280 end
281
282 ODD: begin
283 // Internal REQ and ACK have inverted meaning now. If dst_req goes low, this signals a new
284 // transaction.
285 1/1 dst_req_o = ~dst_req;
Tests: T4 T5 T6
286 1/1 dst_ack_d = ~dst_ack_i;
Tests: T4 T5 T6
287
288 // The handshake is done for exactly 1 clock cycle.
289 1/1 if (dst_handshake) begin
Tests: T4 T5 T6
290 1/1 dst_fsm_ns = EVEN;
Tests: T4 T5 T6
291 end
MISSING_ELSE
292 end
293
294 //VCS coverage off
295 // pragma coverage off
296
297 default: ;
298
299 //VCS coverage on
300 // pragma coverage on
301
302 endcase
303 end
304
305 // Registers
306 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
307 1/1 if (!rst_src_ni) begin
Tests: T4 T5 T6
308 1/1 src_fsm_cs <= EVEN;
Tests: T4 T5 T6
309 1/1 src_req_q <= 1'b0;
Tests: T4 T5 T6
310 end else begin
311 1/1 src_fsm_cs <= src_fsm_ns;
Tests: T4 T5 T6
312 1/1 src_req_q <= src_req_d;
Tests: T4 T5 T6
313 end
314 end
315 always_ff @(posedge clk_dst_i or negedge rst_dst_ni) begin
316 1/1 if (!rst_dst_ni) begin
Tests: T4 T5 T6
317 1/1 dst_fsm_cs <= EVEN;
Tests: T4 T5 T6
318 1/1 dst_ack_q <= 1'b0;
Tests: T4 T5 T6
319 end else begin
320 1/1 dst_fsm_cs <= dst_fsm_ns;
Tests: T4 T5 T6
321 1/1 dst_ack_q <= dst_ack_d;
Tests: T4 T5 T6
322 end
323 end
324 end
325
326 ////////////////
327 // Assertions //
328 ////////////////
329
330 `ifdef INC_ASSERT
331 //VCS coverage off
332 // pragma coverage off
333
334 logic effective_rst_n;
335 unreachable assign effective_rst_n = rst_src_ni && rst_dst_ni;
336
337 logic chk_flag;
338 always_ff @(posedge clk_src_i or negedge effective_rst_n) begin
339 unreachable if (!effective_rst_n) begin
340 unreachable chk_flag <= '0;
341 unreachable end else if (src_req_i && !chk_flag) begin
342 unreachable chk_flag <= 1'b1;
343 end
==> MISSING_ELSE
Cond Coverage for Instance : tb.dut.u_usb_meas.u_meas.gen_clk_timeout_chk.u_timeout_ref_to_clk.u_ref_timeout
| Total | Covered | Percent |
Conditions | 3 | 3 | 100.00 |
Logical | 3 | 3 | 100.00 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 194
EXPRESSION (src_req_i & src_ack_o)
----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Unreachable | |
1 | 0 | Covered | T4,T5,T6 |
1 | 1 | Covered | T4,T5,T6 |
LINE 195
EXPRESSION (dst_req_o & dst_ack_i)
----1---- ----2----
-1- | -2- | Status | Tests | Exclude Annotation |
0 | 1 | Excluded | |
VC_COV_UNR |
1 | 0 | Excluded | |
VC_COV_UNR |
1 | 1 | Covered | T4,T5,T6 |
Branch Coverage for Instance : tb.dut.u_usb_meas.u_meas.gen_clk_timeout_chk.u_timeout_ref_to_clk.u_ref_timeout
| Line No. | Total | Covered | Percent |
Branches |
|
12 |
12 |
100.00 |
CASE |
225 |
4 |
4 |
100.00 |
CASE |
269 |
4 |
4 |
100.00 |
IF |
307 |
2 |
2 |
100.00 |
IF |
316 |
2 |
2 |
100.00 |
225 unique case (src_fsm_cs)
-1-
226
227 EVEN: begin
228 // Simply forward REQ and ACK.
229 src_req_d = src_req_i;
230 src_ack_o = src_ack;
231
232 // The handshake is done for exactly 1 clock cycle.
233 if (src_handshake) begin
-2-
234 src_fsm_ns = ODD;
==>
235 end
MISSING_ELSE
==>
236 end
237
238 ODD: begin
239 // Internal REQ and ACK have inverted meaning now. If src_req_i is high again, this
240 // signals a new transaction.
241 src_req_d = ~src_req_i;
242 src_ack_o = ~src_ack;
243
244 // The handshake is done for exactly 1 clock cycle.
245 if (src_handshake) begin
-3-
246 src_fsm_ns = EVEN;
==>
247 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
EVEN |
1 |
- |
Covered |
T4,T5,T6 |
EVEN |
0 |
- |
Covered |
T4,T5,T6 |
ODD |
- |
1 |
Covered |
T4,T5,T6 |
ODD |
- |
0 |
Covered |
T4,T5,T6 |
269 unique case (dst_fsm_cs)
-1-
270
271 EVEN: begin
272 // Simply forward REQ and ACK.
273 dst_req_o = dst_req;
274 dst_ack_d = dst_ack_i;
275
276 // The handshake is done for exactly 1 clock cycle.
277 if (dst_handshake) begin
-2-
278 dst_fsm_ns = ODD;
==>
279 end
MISSING_ELSE
==>
280 end
281
282 ODD: begin
283 // Internal REQ and ACK have inverted meaning now. If dst_req goes low, this signals a new
284 // transaction.
285 dst_req_o = ~dst_req;
286 dst_ack_d = ~dst_ack_i;
287
288 // The handshake is done for exactly 1 clock cycle.
289 if (dst_handshake) begin
-3-
290 dst_fsm_ns = EVEN;
==>
291 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
EVEN |
1 |
- |
Covered |
T4,T5,T6 |
EVEN |
0 |
- |
Covered |
T4,T5,T6 |
ODD |
- |
1 |
Covered |
T4,T5,T6 |
ODD |
- |
0 |
Covered |
T4,T5,T6 |
307 if (!rst_src_ni) begin
-1-
308 src_fsm_cs <= EVEN;
==>
309 src_req_q <= 1'b0;
310 end else begin
311 src_fsm_cs <= src_fsm_ns;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T4,T5,T6 |
0 |
Covered |
T4,T5,T6 |
316 if (!rst_dst_ni) begin
-1-
317 dst_fsm_cs <= EVEN;
==>
318 dst_ack_q <= 1'b0;
319 end else begin
320 dst_fsm_cs <= dst_fsm_ns;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T4,T5,T6 |
0 |
Covered |
T4,T5,T6 |
Assert Coverage for Instance : tb.dut.u_usb_meas.u_meas.gen_clk_timeout_chk.u_timeout_ref_to_clk.u_ref_timeout
Assertion Details
SyncReqAckAckNeedsReq
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
42193362 |
301543 |
0 |
0 |
T4 |
1203 |
38 |
0 |
0 |
T5 |
568 |
15 |
0 |
0 |
T6 |
791 |
23 |
0 |
0 |
T30 |
2713 |
84 |
0 |
0 |
T31 |
1433 |
44 |
0 |
0 |
T32 |
745 |
23 |
0 |
0 |
T33 |
1081 |
33 |
0 |
0 |
T34 |
1589 |
48 |
0 |
0 |
T35 |
932 |
29 |
0 |
0 |
T36 |
2828 |
88 |
0 |
0 |
SyncReqAckHoldReq
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1387694 |
0 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_reg.u_io_meas_ctrl_en_cdc.u_arb.gen_wr_req.u_dst_update_sync
| Line No. | Total | Covered | Percent |
TOTAL | | 36 | 36 | 100.00 |
CONT_ASSIGN | 55 | 0 | 0 | |
CONT_ASSIGN | 194 | 1 | 1 | 100.00 |
CONT_ASSIGN | 195 | 1 | 1 | 100.00 |
ALWAYS | 219 | 12 | 12 | 100.00 |
ALWAYS | 263 | 12 | 12 | 100.00 |
ALWAYS | 307 | 5 | 5 | 100.00 |
ALWAYS | 316 | 5 | 5 | 100.00 |
CONT_ASSIGN | 335 | 0 | 0 | |
ALWAYS | 339 | 0 | 0 | |
54 logic unused_req_chk;
55 unreachable assign unused_req_chk = req_chk_i;
56
57 if (EnRzHs) begin : gen_rz_hs_protocol
58 //////////////////
59 // RZ protocol //
60 //////////////////
61
62 // Types
63 typedef enum logic {
64 LoSt, HiSt
65 } rz_fsm_e;
66
67 // Signals
68 rz_fsm_e src_fsm_d, src_fsm_q;
69 rz_fsm_e dst_fsm_d, dst_fsm_q;
70 logic src_ack, dst_ack;
71 logic src_req, dst_req;
72
73 // REQ-side FSM (SRC domain)
74 always_comb begin : src_fsm
75 src_fsm_d = src_fsm_q;
76 src_ack_o = 1'b0;
77 src_req = 1'b0;
78
79 unique case (src_fsm_q)
80 LoSt: begin
81 // Wait for the ack to go back to zero before starting
82 // a new transaction.
83 if (!src_ack && src_req_i) begin
84 src_fsm_d = HiSt;
85 end
86 end
87 HiSt: begin
88 src_req = 1'b1;
89 // Forward the acknowledgement.
90 src_ack_o = src_ack;
91 // If request drops out, we go back to LoSt.
92 // If DST side asserts ack, we also go back to LoSt.
93 if (!src_req_i || src_ack) begin
94 src_fsm_d = LoSt;
95 end
96 end
97 //VCS coverage off
98 // pragma coverage off
99 default: ;
100 //VCS coverage on
101 // pragma coverage on
102 endcase
103 end
104
105 // Move ACK over to SRC domain.
106 prim_flop_2sync #(
107 .Width(1)
108 ) ack_sync (
109 .clk_i (clk_src_i),
110 .rst_ni (rst_src_ni),
111 .d_i (dst_ack),
112 .q_o (src_ack)
113 );
114
115 // Registers
116 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
117 if (!rst_src_ni) begin
118 src_fsm_q <= LoSt;
119 end else begin
120 src_fsm_q <= src_fsm_d;
121 end
122 end
123
124 // ACK-side FSM (DST domain)
125 always_comb begin : dst_fsm
126 dst_fsm_d = dst_fsm_q;
127 dst_req_o = 1'b0;
128 dst_ack = 1'b0;
129
130 unique case (dst_fsm_q)
131 LoSt: begin
132 if (dst_req) begin
133 // Forward the request.
134 dst_req_o = 1'b1;
135 // Wait for the request and acknowledge to be asserted
136 // before responding to the SRC side.
137 if (dst_ack_i) begin
138 dst_fsm_d = HiSt;
139 end
140 end
141 end
142 HiSt: begin
143 dst_ack = 1'b1;
144 // Wait for the request to drop back to zero.
145 if (!dst_req) begin
146 dst_fsm_d = LoSt;
147 end
148 end
149 //VCS coverage off
150 // pragma coverage off
151 default: ;
152 //VCS coverage on
153 // pragma coverage on
154 endcase
155 end
156
157 // Move REQ over to DST domain.
158 prim_flop_2sync #(
159 .Width(1)
160 ) req_sync (
161 .clk_i (clk_dst_i),
162 .rst_ni (rst_dst_ni),
163 .d_i (src_req),
164 .q_o (dst_req)
165 );
166
167 // Registers
168 always_ff @(posedge clk_dst_i or negedge rst_dst_ni) begin
169 if (!rst_dst_ni) begin
170 dst_fsm_q <= LoSt;
171 end else begin
172 dst_fsm_q <= dst_fsm_d;
173 end
174 end
175
176 end else begin : gen_nrz_hs_protocol
177 //////////////////
178 // NRZ protocol //
179 //////////////////
180
181 // Types
182 typedef enum logic {
183 EVEN, ODD
184 } sync_reqack_fsm_e;
185
186 // Signals
187 sync_reqack_fsm_e src_fsm_ns, src_fsm_cs;
188 sync_reqack_fsm_e dst_fsm_ns, dst_fsm_cs;
189
190 logic src_req_d, src_req_q, src_ack;
191 logic dst_ack_d, dst_ack_q, dst_req;
192 logic src_handshake, dst_handshake;
193
194 1/1 assign src_handshake = src_req_i & src_ack_o;
Tests: T1 T2 T3
195 1/1 assign dst_handshake = dst_req_o & dst_ack_i;
Tests: T1 T2 T3
196
197 // Move REQ over to DST domain.
198 prim_flop_2sync #(
199 .Width(1)
200 ) req_sync (
201 .clk_i (clk_dst_i),
202 .rst_ni (rst_dst_ni),
203 .d_i (src_req_q),
204 .q_o (dst_req)
205 );
206
207 // Move ACK over to SRC domain.
208 prim_flop_2sync #(
209 .Width(1)
210 ) ack_sync (
211 .clk_i (clk_src_i),
212 .rst_ni (rst_src_ni),
213 .d_i (dst_ack_q),
214 .q_o (src_ack)
215 );
216
217 // REQ-side FSM (SRC domain)
218 always_comb begin : src_fsm
219 1/1 src_fsm_ns = src_fsm_cs;
Tests: T1 T2 T3
220
221 // By default, we keep the internal REQ value and don't ACK.
222 1/1 src_req_d = src_req_q;
Tests: T1 T2 T3
223 1/1 src_ack_o = 1'b0;
Tests: T1 T2 T3
224
225 1/1 unique case (src_fsm_cs)
Tests: T1 T2 T3
226
227 EVEN: begin
228 // Simply forward REQ and ACK.
229 1/1 src_req_d = src_req_i;
Tests: T1 T2 T3
230 1/1 src_ack_o = src_ack;
Tests: T1 T2 T3
231
232 // The handshake is done for exactly 1 clock cycle.
233 1/1 if (src_handshake) begin
Tests: T1 T2 T3
234 1/1 src_fsm_ns = ODD;
Tests: T1 T2 T3
235 end
MISSING_ELSE
236 end
237
238 ODD: begin
239 // Internal REQ and ACK have inverted meaning now. If src_req_i is high again, this
240 // signals a new transaction.
241 1/1 src_req_d = ~src_req_i;
Tests: T1 T2 T3
242 1/1 src_ack_o = ~src_ack;
Tests: T1 T2 T3
243
244 // The handshake is done for exactly 1 clock cycle.
245 1/1 if (src_handshake) begin
Tests: T1 T2 T3
246 1/1 src_fsm_ns = EVEN;
Tests: T1 T2 T3
247 end
MISSING_ELSE
248 end
249
250 //VCS coverage off
251 // pragma coverage off
252
253 default: ;
254
255 //VCS coverage on
256 // pragma coverage on
257
258 endcase
259 end
260
261 // ACK-side FSM (DST domain)
262 always_comb begin : dst_fsm
263 1/1 dst_fsm_ns = dst_fsm_cs;
Tests: T1 T2 T3
264
265 // By default, we don't REQ and keep the internal ACK.
266 1/1 dst_req_o = 1'b0;
Tests: T1 T2 T3
267 1/1 dst_ack_d = dst_ack_q;
Tests: T1 T2 T3
268
269 1/1 unique case (dst_fsm_cs)
Tests: T1 T2 T3
270
271 EVEN: begin
272 // Simply forward REQ and ACK.
273 1/1 dst_req_o = dst_req;
Tests: T1 T2 T3
274 1/1 dst_ack_d = dst_ack_i;
Tests: T1 T2 T3
275
276 // The handshake is done for exactly 1 clock cycle.
277 1/1 if (dst_handshake) begin
Tests: T1 T2 T3
278 1/1 dst_fsm_ns = ODD;
Tests: T1 T2 T3
279 end
MISSING_ELSE
280 end
281
282 ODD: begin
283 // Internal REQ and ACK have inverted meaning now. If dst_req goes low, this signals a new
284 // transaction.
285 1/1 dst_req_o = ~dst_req;
Tests: T1 T2 T3
286 1/1 dst_ack_d = ~dst_ack_i;
Tests: T1 T2 T3
287
288 // The handshake is done for exactly 1 clock cycle.
289 1/1 if (dst_handshake) begin
Tests: T1 T2 T3
290 1/1 dst_fsm_ns = EVEN;
Tests: T1 T2 T3
291 end
MISSING_ELSE
292 end
293
294 //VCS coverage off
295 // pragma coverage off
296
297 default: ;
298
299 //VCS coverage on
300 // pragma coverage on
301
302 endcase
303 end
304
305 // Registers
306 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
307 1/1 if (!rst_src_ni) begin
Tests: T4 T5 T6
308 1/1 src_fsm_cs <= EVEN;
Tests: T4 T5 T6
309 1/1 src_req_q <= 1'b0;
Tests: T4 T5 T6
310 end else begin
311 1/1 src_fsm_cs <= src_fsm_ns;
Tests: T4 T5 T6
312 1/1 src_req_q <= src_req_d;
Tests: T4 T5 T6
313 end
314 end
315 always_ff @(posedge clk_dst_i or negedge rst_dst_ni) begin
316 1/1 if (!rst_dst_ni) begin
Tests: T4 T5 T6
317 1/1 dst_fsm_cs <= EVEN;
Tests: T4 T5 T6
318 1/1 dst_ack_q <= 1'b0;
Tests: T4 T5 T6
319 end else begin
320 1/1 dst_fsm_cs <= dst_fsm_ns;
Tests: T4 T5 T6
321 1/1 dst_ack_q <= dst_ack_d;
Tests: T4 T5 T6
322 end
323 end
324 end
325
326 ////////////////
327 // Assertions //
328 ////////////////
329
330 `ifdef INC_ASSERT
331 //VCS coverage off
332 // pragma coverage off
333
334 logic effective_rst_n;
335 unreachable assign effective_rst_n = rst_src_ni && rst_dst_ni;
336
337 logic chk_flag;
338 always_ff @(posedge clk_src_i or negedge effective_rst_n) begin
339 unreachable if (!effective_rst_n) begin
340 unreachable chk_flag <= '0;
341 unreachable end else if (src_req_i && !chk_flag) begin
342 unreachable chk_flag <= 1'b1;
343 end
==> MISSING_ELSE
Cond Coverage for Instance : tb.dut.u_reg.u_io_meas_ctrl_en_cdc.u_arb.gen_wr_req.u_dst_update_sync
| Total | Covered | Percent |
Conditions | 4 | 3 | 75.00 |
Logical | 4 | 3 | 75.00 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 194
EXPRESSION (src_req_i & src_ack_o)
----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T1,T2,T3 |
1 | 1 | Covered | T1,T2,T3 |
LINE 195
EXPRESSION (dst_req_o & dst_ack_i)
----1---- ----2----
-1- | -2- | Status | Tests | Exclude Annotation |
0 | 1 | Excluded | |
VC_COV_UNR |
1 | 0 | Excluded | |
VC_COV_UNR |
1 | 1 | Covered | T1,T2,T3 |
Branch Coverage for Instance : tb.dut.u_reg.u_io_meas_ctrl_en_cdc.u_arb.gen_wr_req.u_dst_update_sync
| Line No. | Total | Covered | Percent |
Branches |
|
12 |
12 |
100.00 |
CASE |
225 |
4 |
4 |
100.00 |
CASE |
269 |
4 |
4 |
100.00 |
IF |
307 |
2 |
2 |
100.00 |
IF |
316 |
2 |
2 |
100.00 |
225 unique case (src_fsm_cs)
-1-
226
227 EVEN: begin
228 // Simply forward REQ and ACK.
229 src_req_d = src_req_i;
230 src_ack_o = src_ack;
231
232 // The handshake is done for exactly 1 clock cycle.
233 if (src_handshake) begin
-2-
234 src_fsm_ns = ODD;
==>
235 end
MISSING_ELSE
==>
236 end
237
238 ODD: begin
239 // Internal REQ and ACK have inverted meaning now. If src_req_i is high again, this
240 // signals a new transaction.
241 src_req_d = ~src_req_i;
242 src_ack_o = ~src_ack;
243
244 // The handshake is done for exactly 1 clock cycle.
245 if (src_handshake) begin
-3-
246 src_fsm_ns = EVEN;
==>
247 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
EVEN |
1 |
- |
Covered |
T1,T2,T3 |
EVEN |
0 |
- |
Covered |
T1,T2,T3 |
ODD |
- |
1 |
Covered |
T1,T2,T3 |
ODD |
- |
0 |
Covered |
T1,T2,T3 |
269 unique case (dst_fsm_cs)
-1-
270
271 EVEN: begin
272 // Simply forward REQ and ACK.
273 dst_req_o = dst_req;
274 dst_ack_d = dst_ack_i;
275
276 // The handshake is done for exactly 1 clock cycle.
277 if (dst_handshake) begin
-2-
278 dst_fsm_ns = ODD;
==>
279 end
MISSING_ELSE
==>
280 end
281
282 ODD: begin
283 // Internal REQ and ACK have inverted meaning now. If dst_req goes low, this signals a new
284 // transaction.
285 dst_req_o = ~dst_req;
286 dst_ack_d = ~dst_ack_i;
287
288 // The handshake is done for exactly 1 clock cycle.
289 if (dst_handshake) begin
-3-
290 dst_fsm_ns = EVEN;
==>
291 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
EVEN |
1 |
- |
Covered |
T1,T2,T3 |
EVEN |
0 |
- |
Covered |
T1,T2,T3 |
ODD |
- |
1 |
Covered |
T1,T2,T3 |
ODD |
- |
0 |
Covered |
T1,T2,T3 |
307 if (!rst_src_ni) begin
-1-
308 src_fsm_cs <= EVEN;
==>
309 src_req_q <= 1'b0;
310 end else begin
311 src_fsm_cs <= src_fsm_ns;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T4,T5,T6 |
0 |
Covered |
T4,T5,T6 |
316 if (!rst_dst_ni) begin
-1-
317 dst_fsm_cs <= EVEN;
==>
318 dst_ack_q <= 1'b0;
319 end else begin
320 dst_fsm_cs <= dst_fsm_ns;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T4,T5,T6 |
0 |
Covered |
T4,T5,T6 |
Assert Coverage for Instance : tb.dut.u_reg.u_io_meas_ctrl_en_cdc.u_arb.gen_wr_req.u_dst_update_sync
Assertion Details
SyncReqAckAckNeedsReq
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
36456208 |
12116 |
0 |
0 |
T1 |
37611 |
6 |
0 |
0 |
T2 |
16761 |
12 |
0 |
0 |
T3 |
24792 |
16 |
0 |
0 |
T10 |
0 |
43 |
0 |
0 |
T11 |
0 |
36 |
0 |
0 |
T13 |
0 |
40 |
0 |
0 |
T25 |
0 |
22 |
0 |
0 |
T29 |
0 |
22 |
0 |
0 |
T39 |
0 |
20 |
0 |
0 |
T40 |
0 |
2 |
0 |
0 |
T42 |
1956 |
0 |
0 |
0 |
T43 |
2175 |
0 |
0 |
0 |
T44 |
1508 |
0 |
0 |
0 |
T45 |
1876 |
0 |
0 |
0 |
T46 |
1399 |
0 |
0 |
0 |
T49 |
10120 |
0 |
0 |
0 |
T50 |
2203 |
0 |
0 |
0 |
SyncReqAckHoldReq
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
82444438 |
11663 |
0 |
0 |
T1 |
30710 |
6 |
0 |
0 |
T2 |
67045 |
12 |
0 |
0 |
T3 |
50640 |
16 |
0 |
0 |
T10 |
0 |
40 |
0 |
0 |
T11 |
0 |
30 |
0 |
0 |
T13 |
0 |
40 |
0 |
0 |
T25 |
0 |
22 |
0 |
0 |
T29 |
0 |
22 |
0 |
0 |
T39 |
0 |
20 |
0 |
0 |
T40 |
0 |
2 |
0 |
0 |
T42 |
1997 |
0 |
0 |
0 |
T43 |
2088 |
0 |
0 |
0 |
T44 |
1462 |
0 |
0 |
0 |
T45 |
1837 |
0 |
0 |
0 |
T46 |
2580 |
0 |
0 |
0 |
T49 |
19431 |
0 |
0 |
0 |
T50 |
2157 |
0 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_reg.u_io_div2_meas_ctrl_en_cdc.u_arb.gen_wr_req.u_dst_update_sync
| Line No. | Total | Covered | Percent |
TOTAL | | 36 | 36 | 100.00 |
CONT_ASSIGN | 55 | 0 | 0 | |
CONT_ASSIGN | 194 | 1 | 1 | 100.00 |
CONT_ASSIGN | 195 | 1 | 1 | 100.00 |
ALWAYS | 219 | 12 | 12 | 100.00 |
ALWAYS | 263 | 12 | 12 | 100.00 |
ALWAYS | 307 | 5 | 5 | 100.00 |
ALWAYS | 316 | 5 | 5 | 100.00 |
CONT_ASSIGN | 335 | 0 | 0 | |
ALWAYS | 339 | 0 | 0 | |
54 logic unused_req_chk;
55 unreachable assign unused_req_chk = req_chk_i;
56
57 if (EnRzHs) begin : gen_rz_hs_protocol
58 //////////////////
59 // RZ protocol //
60 //////////////////
61
62 // Types
63 typedef enum logic {
64 LoSt, HiSt
65 } rz_fsm_e;
66
67 // Signals
68 rz_fsm_e src_fsm_d, src_fsm_q;
69 rz_fsm_e dst_fsm_d, dst_fsm_q;
70 logic src_ack, dst_ack;
71 logic src_req, dst_req;
72
73 // REQ-side FSM (SRC domain)
74 always_comb begin : src_fsm
75 src_fsm_d = src_fsm_q;
76 src_ack_o = 1'b0;
77 src_req = 1'b0;
78
79 unique case (src_fsm_q)
80 LoSt: begin
81 // Wait for the ack to go back to zero before starting
82 // a new transaction.
83 if (!src_ack && src_req_i) begin
84 src_fsm_d = HiSt;
85 end
86 end
87 HiSt: begin
88 src_req = 1'b1;
89 // Forward the acknowledgement.
90 src_ack_o = src_ack;
91 // If request drops out, we go back to LoSt.
92 // If DST side asserts ack, we also go back to LoSt.
93 if (!src_req_i || src_ack) begin
94 src_fsm_d = LoSt;
95 end
96 end
97 //VCS coverage off
98 // pragma coverage off
99 default: ;
100 //VCS coverage on
101 // pragma coverage on
102 endcase
103 end
104
105 // Move ACK over to SRC domain.
106 prim_flop_2sync #(
107 .Width(1)
108 ) ack_sync (
109 .clk_i (clk_src_i),
110 .rst_ni (rst_src_ni),
111 .d_i (dst_ack),
112 .q_o (src_ack)
113 );
114
115 // Registers
116 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
117 if (!rst_src_ni) begin
118 src_fsm_q <= LoSt;
119 end else begin
120 src_fsm_q <= src_fsm_d;
121 end
122 end
123
124 // ACK-side FSM (DST domain)
125 always_comb begin : dst_fsm
126 dst_fsm_d = dst_fsm_q;
127 dst_req_o = 1'b0;
128 dst_ack = 1'b0;
129
130 unique case (dst_fsm_q)
131 LoSt: begin
132 if (dst_req) begin
133 // Forward the request.
134 dst_req_o = 1'b1;
135 // Wait for the request and acknowledge to be asserted
136 // before responding to the SRC side.
137 if (dst_ack_i) begin
138 dst_fsm_d = HiSt;
139 end
140 end
141 end
142 HiSt: begin
143 dst_ack = 1'b1;
144 // Wait for the request to drop back to zero.
145 if (!dst_req) begin
146 dst_fsm_d = LoSt;
147 end
148 end
149 //VCS coverage off
150 // pragma coverage off
151 default: ;
152 //VCS coverage on
153 // pragma coverage on
154 endcase
155 end
156
157 // Move REQ over to DST domain.
158 prim_flop_2sync #(
159 .Width(1)
160 ) req_sync (
161 .clk_i (clk_dst_i),
162 .rst_ni (rst_dst_ni),
163 .d_i (src_req),
164 .q_o (dst_req)
165 );
166
167 // Registers
168 always_ff @(posedge clk_dst_i or negedge rst_dst_ni) begin
169 if (!rst_dst_ni) begin
170 dst_fsm_q <= LoSt;
171 end else begin
172 dst_fsm_q <= dst_fsm_d;
173 end
174 end
175
176 end else begin : gen_nrz_hs_protocol
177 //////////////////
178 // NRZ protocol //
179 //////////////////
180
181 // Types
182 typedef enum logic {
183 EVEN, ODD
184 } sync_reqack_fsm_e;
185
186 // Signals
187 sync_reqack_fsm_e src_fsm_ns, src_fsm_cs;
188 sync_reqack_fsm_e dst_fsm_ns, dst_fsm_cs;
189
190 logic src_req_d, src_req_q, src_ack;
191 logic dst_ack_d, dst_ack_q, dst_req;
192 logic src_handshake, dst_handshake;
193
194 1/1 assign src_handshake = src_req_i & src_ack_o;
Tests: T1 T2 T3
195 1/1 assign dst_handshake = dst_req_o & dst_ack_i;
Tests: T1 T2 T3
196
197 // Move REQ over to DST domain.
198 prim_flop_2sync #(
199 .Width(1)
200 ) req_sync (
201 .clk_i (clk_dst_i),
202 .rst_ni (rst_dst_ni),
203 .d_i (src_req_q),
204 .q_o (dst_req)
205 );
206
207 // Move ACK over to SRC domain.
208 prim_flop_2sync #(
209 .Width(1)
210 ) ack_sync (
211 .clk_i (clk_src_i),
212 .rst_ni (rst_src_ni),
213 .d_i (dst_ack_q),
214 .q_o (src_ack)
215 );
216
217 // REQ-side FSM (SRC domain)
218 always_comb begin : src_fsm
219 1/1 src_fsm_ns = src_fsm_cs;
Tests: T1 T2 T3
220
221 // By default, we keep the internal REQ value and don't ACK.
222 1/1 src_req_d = src_req_q;
Tests: T1 T2 T3
223 1/1 src_ack_o = 1'b0;
Tests: T1 T2 T3
224
225 1/1 unique case (src_fsm_cs)
Tests: T1 T2 T3
226
227 EVEN: begin
228 // Simply forward REQ and ACK.
229 1/1 src_req_d = src_req_i;
Tests: T1 T2 T3
230 1/1 src_ack_o = src_ack;
Tests: T1 T2 T3
231
232 // The handshake is done for exactly 1 clock cycle.
233 1/1 if (src_handshake) begin
Tests: T1 T2 T3
234 1/1 src_fsm_ns = ODD;
Tests: T1 T2 T3
235 end
MISSING_ELSE
236 end
237
238 ODD: begin
239 // Internal REQ and ACK have inverted meaning now. If src_req_i is high again, this
240 // signals a new transaction.
241 1/1 src_req_d = ~src_req_i;
Tests: T1 T2 T3
242 1/1 src_ack_o = ~src_ack;
Tests: T1 T2 T3
243
244 // The handshake is done for exactly 1 clock cycle.
245 1/1 if (src_handshake) begin
Tests: T1 T2 T3
246 1/1 src_fsm_ns = EVEN;
Tests: T1 T2 T3
247 end
MISSING_ELSE
248 end
249
250 //VCS coverage off
251 // pragma coverage off
252
253 default: ;
254
255 //VCS coverage on
256 // pragma coverage on
257
258 endcase
259 end
260
261 // ACK-side FSM (DST domain)
262 always_comb begin : dst_fsm
263 1/1 dst_fsm_ns = dst_fsm_cs;
Tests: T1 T2 T3
264
265 // By default, we don't REQ and keep the internal ACK.
266 1/1 dst_req_o = 1'b0;
Tests: T1 T2 T3
267 1/1 dst_ack_d = dst_ack_q;
Tests: T1 T2 T3
268
269 1/1 unique case (dst_fsm_cs)
Tests: T1 T2 T3
270
271 EVEN: begin
272 // Simply forward REQ and ACK.
273 1/1 dst_req_o = dst_req;
Tests: T1 T2 T3
274 1/1 dst_ack_d = dst_ack_i;
Tests: T1 T2 T3
275
276 // The handshake is done for exactly 1 clock cycle.
277 1/1 if (dst_handshake) begin
Tests: T1 T2 T3
278 1/1 dst_fsm_ns = ODD;
Tests: T1 T2 T3
279 end
MISSING_ELSE
280 end
281
282 ODD: begin
283 // Internal REQ and ACK have inverted meaning now. If dst_req goes low, this signals a new
284 // transaction.
285 1/1 dst_req_o = ~dst_req;
Tests: T1 T2 T3
286 1/1 dst_ack_d = ~dst_ack_i;
Tests: T1 T2 T3
287
288 // The handshake is done for exactly 1 clock cycle.
289 1/1 if (dst_handshake) begin
Tests: T1 T2 T3
290 1/1 dst_fsm_ns = EVEN;
Tests: T1 T2 T3
291 end
MISSING_ELSE
292 end
293
294 //VCS coverage off
295 // pragma coverage off
296
297 default: ;
298
299 //VCS coverage on
300 // pragma coverage on
301
302 endcase
303 end
304
305 // Registers
306 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
307 1/1 if (!rst_src_ni) begin
Tests: T4 T5 T6
308 1/1 src_fsm_cs <= EVEN;
Tests: T4 T5 T6
309 1/1 src_req_q <= 1'b0;
Tests: T4 T5 T6
310 end else begin
311 1/1 src_fsm_cs <= src_fsm_ns;
Tests: T4 T5 T6
312 1/1 src_req_q <= src_req_d;
Tests: T4 T5 T6
313 end
314 end
315 always_ff @(posedge clk_dst_i or negedge rst_dst_ni) begin
316 1/1 if (!rst_dst_ni) begin
Tests: T4 T5 T6
317 1/1 dst_fsm_cs <= EVEN;
Tests: T4 T5 T6
318 1/1 dst_ack_q <= 1'b0;
Tests: T4 T5 T6
319 end else begin
320 1/1 dst_fsm_cs <= dst_fsm_ns;
Tests: T4 T5 T6
321 1/1 dst_ack_q <= dst_ack_d;
Tests: T4 T5 T6
322 end
323 end
324 end
325
326 ////////////////
327 // Assertions //
328 ////////////////
329
330 `ifdef INC_ASSERT
331 //VCS coverage off
332 // pragma coverage off
333
334 logic effective_rst_n;
335 unreachable assign effective_rst_n = rst_src_ni && rst_dst_ni;
336
337 logic chk_flag;
338 always_ff @(posedge clk_src_i or negedge effective_rst_n) begin
339 unreachable if (!effective_rst_n) begin
340 unreachable chk_flag <= '0;
341 unreachable end else if (src_req_i && !chk_flag) begin
342 unreachable chk_flag <= 1'b1;
343 end
==> MISSING_ELSE
Cond Coverage for Instance : tb.dut.u_reg.u_io_div2_meas_ctrl_en_cdc.u_arb.gen_wr_req.u_dst_update_sync
| Total | Covered | Percent |
Conditions | 4 | 3 | 75.00 |
Logical | 4 | 3 | 75.00 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 194
EXPRESSION (src_req_i & src_ack_o)
----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T1,T2,T3 |
1 | 1 | Covered | T1,T2,T3 |
LINE 195
EXPRESSION (dst_req_o & dst_ack_i)
----1---- ----2----
-1- | -2- | Status | Tests | Exclude Annotation |
0 | 1 | Excluded | |
VC_COV_UNR |
1 | 0 | Excluded | |
VC_COV_UNR |
1 | 1 | Covered | T1,T2,T3 |
Branch Coverage for Instance : tb.dut.u_reg.u_io_div2_meas_ctrl_en_cdc.u_arb.gen_wr_req.u_dst_update_sync
| Line No. | Total | Covered | Percent |
Branches |
|
12 |
12 |
100.00 |
CASE |
225 |
4 |
4 |
100.00 |
CASE |
269 |
4 |
4 |
100.00 |
IF |
307 |
2 |
2 |
100.00 |
IF |
316 |
2 |
2 |
100.00 |
225 unique case (src_fsm_cs)
-1-
226
227 EVEN: begin
228 // Simply forward REQ and ACK.
229 src_req_d = src_req_i;
230 src_ack_o = src_ack;
231
232 // The handshake is done for exactly 1 clock cycle.
233 if (src_handshake) begin
-2-
234 src_fsm_ns = ODD;
==>
235 end
MISSING_ELSE
==>
236 end
237
238 ODD: begin
239 // Internal REQ and ACK have inverted meaning now. If src_req_i is high again, this
240 // signals a new transaction.
241 src_req_d = ~src_req_i;
242 src_ack_o = ~src_ack;
243
244 // The handshake is done for exactly 1 clock cycle.
245 if (src_handshake) begin
-3-
246 src_fsm_ns = EVEN;
==>
247 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
EVEN |
1 |
- |
Covered |
T1,T2,T3 |
EVEN |
0 |
- |
Covered |
T1,T2,T3 |
ODD |
- |
1 |
Covered |
T1,T2,T3 |
ODD |
- |
0 |
Covered |
T1,T2,T3 |
269 unique case (dst_fsm_cs)
-1-
270
271 EVEN: begin
272 // Simply forward REQ and ACK.
273 dst_req_o = dst_req;
274 dst_ack_d = dst_ack_i;
275
276 // The handshake is done for exactly 1 clock cycle.
277 if (dst_handshake) begin
-2-
278 dst_fsm_ns = ODD;
==>
279 end
MISSING_ELSE
==>
280 end
281
282 ODD: begin
283 // Internal REQ and ACK have inverted meaning now. If dst_req goes low, this signals a new
284 // transaction.
285 dst_req_o = ~dst_req;
286 dst_ack_d = ~dst_ack_i;
287
288 // The handshake is done for exactly 1 clock cycle.
289 if (dst_handshake) begin
-3-
290 dst_fsm_ns = EVEN;
==>
291 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
EVEN |
1 |
- |
Covered |
T1,T2,T3 |
EVEN |
0 |
- |
Covered |
T1,T2,T3 |
ODD |
- |
1 |
Covered |
T1,T2,T3 |
ODD |
- |
0 |
Covered |
T1,T2,T3 |
307 if (!rst_src_ni) begin
-1-
308 src_fsm_cs <= EVEN;
==>
309 src_req_q <= 1'b0;
310 end else begin
311 src_fsm_cs <= src_fsm_ns;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T4,T5,T6 |
0 |
Covered |
T4,T5,T6 |
316 if (!rst_dst_ni) begin
-1-
317 dst_fsm_cs <= EVEN;
==>
318 dst_ack_q <= 1'b0;
319 end else begin
320 dst_fsm_cs <= dst_fsm_ns;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T4,T5,T6 |
0 |
Covered |
T4,T5,T6 |
Assert Coverage for Instance : tb.dut.u_reg.u_io_div2_meas_ctrl_en_cdc.u_arb.gen_wr_req.u_dst_update_sync
Assertion Details
SyncReqAckAckNeedsReq
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
36456208 |
12116 |
0 |
0 |
T1 |
37611 |
6 |
0 |
0 |
T2 |
16761 |
12 |
0 |
0 |
T3 |
24792 |
16 |
0 |
0 |
T10 |
0 |
43 |
0 |
0 |
T11 |
0 |
36 |
0 |
0 |
T13 |
0 |
40 |
0 |
0 |
T25 |
0 |
22 |
0 |
0 |
T29 |
0 |
22 |
0 |
0 |
T39 |
0 |
20 |
0 |
0 |
T40 |
0 |
2 |
0 |
0 |
T42 |
1956 |
0 |
0 |
0 |
T43 |
2175 |
0 |
0 |
0 |
T44 |
1508 |
0 |
0 |
0 |
T45 |
1876 |
0 |
0 |
0 |
T46 |
1399 |
0 |
0 |
0 |
T49 |
10120 |
0 |
0 |
0 |
T50 |
2203 |
0 |
0 |
0 |
SyncReqAckHoldReq
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
40296683 |
11660 |
0 |
0 |
T1 |
15308 |
6 |
0 |
0 |
T2 |
33469 |
12 |
0 |
0 |
T3 |
12322 |
16 |
0 |
0 |
T10 |
0 |
40 |
0 |
0 |
T11 |
0 |
30 |
0 |
0 |
T13 |
0 |
40 |
0 |
0 |
T25 |
0 |
22 |
0 |
0 |
T29 |
0 |
22 |
0 |
0 |
T39 |
0 |
20 |
0 |
0 |
T40 |
0 |
2 |
0 |
0 |
T42 |
945 |
0 |
0 |
0 |
T43 |
1115 |
0 |
0 |
0 |
T44 |
712 |
0 |
0 |
0 |
T45 |
879 |
0 |
0 |
0 |
T46 |
1271 |
0 |
0 |
0 |
T49 |
7510 |
0 |
0 |
0 |
T50 |
1039 |
0 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_reg.u_io_div4_meas_ctrl_en_cdc.u_arb.gen_wr_req.u_dst_update_sync
| Line No. | Total | Covered | Percent |
TOTAL | | 36 | 36 | 100.00 |
CONT_ASSIGN | 55 | 0 | 0 | |
CONT_ASSIGN | 194 | 1 | 1 | 100.00 |
CONT_ASSIGN | 195 | 1 | 1 | 100.00 |
ALWAYS | 219 | 12 | 12 | 100.00 |
ALWAYS | 263 | 12 | 12 | 100.00 |
ALWAYS | 307 | 5 | 5 | 100.00 |
ALWAYS | 316 | 5 | 5 | 100.00 |
CONT_ASSIGN | 335 | 0 | 0 | |
ALWAYS | 339 | 0 | 0 | |
54 logic unused_req_chk;
55 unreachable assign unused_req_chk = req_chk_i;
56
57 if (EnRzHs) begin : gen_rz_hs_protocol
58 //////////////////
59 // RZ protocol //
60 //////////////////
61
62 // Types
63 typedef enum logic {
64 LoSt, HiSt
65 } rz_fsm_e;
66
67 // Signals
68 rz_fsm_e src_fsm_d, src_fsm_q;
69 rz_fsm_e dst_fsm_d, dst_fsm_q;
70 logic src_ack, dst_ack;
71 logic src_req, dst_req;
72
73 // REQ-side FSM (SRC domain)
74 always_comb begin : src_fsm
75 src_fsm_d = src_fsm_q;
76 src_ack_o = 1'b0;
77 src_req = 1'b0;
78
79 unique case (src_fsm_q)
80 LoSt: begin
81 // Wait for the ack to go back to zero before starting
82 // a new transaction.
83 if (!src_ack && src_req_i) begin
84 src_fsm_d = HiSt;
85 end
86 end
87 HiSt: begin
88 src_req = 1'b1;
89 // Forward the acknowledgement.
90 src_ack_o = src_ack;
91 // If request drops out, we go back to LoSt.
92 // If DST side asserts ack, we also go back to LoSt.
93 if (!src_req_i || src_ack) begin
94 src_fsm_d = LoSt;
95 end
96 end
97 //VCS coverage off
98 // pragma coverage off
99 default: ;
100 //VCS coverage on
101 // pragma coverage on
102 endcase
103 end
104
105 // Move ACK over to SRC domain.
106 prim_flop_2sync #(
107 .Width(1)
108 ) ack_sync (
109 .clk_i (clk_src_i),
110 .rst_ni (rst_src_ni),
111 .d_i (dst_ack),
112 .q_o (src_ack)
113 );
114
115 // Registers
116 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
117 if (!rst_src_ni) begin
118 src_fsm_q <= LoSt;
119 end else begin
120 src_fsm_q <= src_fsm_d;
121 end
122 end
123
124 // ACK-side FSM (DST domain)
125 always_comb begin : dst_fsm
126 dst_fsm_d = dst_fsm_q;
127 dst_req_o = 1'b0;
128 dst_ack = 1'b0;
129
130 unique case (dst_fsm_q)
131 LoSt: begin
132 if (dst_req) begin
133 // Forward the request.
134 dst_req_o = 1'b1;
135 // Wait for the request and acknowledge to be asserted
136 // before responding to the SRC side.
137 if (dst_ack_i) begin
138 dst_fsm_d = HiSt;
139 end
140 end
141 end
142 HiSt: begin
143 dst_ack = 1'b1;
144 // Wait for the request to drop back to zero.
145 if (!dst_req) begin
146 dst_fsm_d = LoSt;
147 end
148 end
149 //VCS coverage off
150 // pragma coverage off
151 default: ;
152 //VCS coverage on
153 // pragma coverage on
154 endcase
155 end
156
157 // Move REQ over to DST domain.
158 prim_flop_2sync #(
159 .Width(1)
160 ) req_sync (
161 .clk_i (clk_dst_i),
162 .rst_ni (rst_dst_ni),
163 .d_i (src_req),
164 .q_o (dst_req)
165 );
166
167 // Registers
168 always_ff @(posedge clk_dst_i or negedge rst_dst_ni) begin
169 if (!rst_dst_ni) begin
170 dst_fsm_q <= LoSt;
171 end else begin
172 dst_fsm_q <= dst_fsm_d;
173 end
174 end
175
176 end else begin : gen_nrz_hs_protocol
177 //////////////////
178 // NRZ protocol //
179 //////////////////
180
181 // Types
182 typedef enum logic {
183 EVEN, ODD
184 } sync_reqack_fsm_e;
185
186 // Signals
187 sync_reqack_fsm_e src_fsm_ns, src_fsm_cs;
188 sync_reqack_fsm_e dst_fsm_ns, dst_fsm_cs;
189
190 logic src_req_d, src_req_q, src_ack;
191 logic dst_ack_d, dst_ack_q, dst_req;
192 logic src_handshake, dst_handshake;
193
194 1/1 assign src_handshake = src_req_i & src_ack_o;
Tests: T1 T2 T3
195 1/1 assign dst_handshake = dst_req_o & dst_ack_i;
Tests: T1 T2 T3
196
197 // Move REQ over to DST domain.
198 prim_flop_2sync #(
199 .Width(1)
200 ) req_sync (
201 .clk_i (clk_dst_i),
202 .rst_ni (rst_dst_ni),
203 .d_i (src_req_q),
204 .q_o (dst_req)
205 );
206
207 // Move ACK over to SRC domain.
208 prim_flop_2sync #(
209 .Width(1)
210 ) ack_sync (
211 .clk_i (clk_src_i),
212 .rst_ni (rst_src_ni),
213 .d_i (dst_ack_q),
214 .q_o (src_ack)
215 );
216
217 // REQ-side FSM (SRC domain)
218 always_comb begin : src_fsm
219 1/1 src_fsm_ns = src_fsm_cs;
Tests: T1 T2 T3
220
221 // By default, we keep the internal REQ value and don't ACK.
222 1/1 src_req_d = src_req_q;
Tests: T1 T2 T3
223 1/1 src_ack_o = 1'b0;
Tests: T1 T2 T3
224
225 1/1 unique case (src_fsm_cs)
Tests: T1 T2 T3
226
227 EVEN: begin
228 // Simply forward REQ and ACK.
229 1/1 src_req_d = src_req_i;
Tests: T1 T2 T3
230 1/1 src_ack_o = src_ack;
Tests: T1 T2 T3
231
232 // The handshake is done for exactly 1 clock cycle.
233 1/1 if (src_handshake) begin
Tests: T1 T2 T3
234 1/1 src_fsm_ns = ODD;
Tests: T1 T2 T3
235 end
MISSING_ELSE
236 end
237
238 ODD: begin
239 // Internal REQ and ACK have inverted meaning now. If src_req_i is high again, this
240 // signals a new transaction.
241 1/1 src_req_d = ~src_req_i;
Tests: T1 T2 T3
242 1/1 src_ack_o = ~src_ack;
Tests: T1 T2 T3
243
244 // The handshake is done for exactly 1 clock cycle.
245 1/1 if (src_handshake) begin
Tests: T1 T2 T3
246 1/1 src_fsm_ns = EVEN;
Tests: T1 T2 T3
247 end
MISSING_ELSE
248 end
249
250 //VCS coverage off
251 // pragma coverage off
252
253 default: ;
254
255 //VCS coverage on
256 // pragma coverage on
257
258 endcase
259 end
260
261 // ACK-side FSM (DST domain)
262 always_comb begin : dst_fsm
263 1/1 dst_fsm_ns = dst_fsm_cs;
Tests: T1 T2 T3
264
265 // By default, we don't REQ and keep the internal ACK.
266 1/1 dst_req_o = 1'b0;
Tests: T1 T2 T3
267 1/1 dst_ack_d = dst_ack_q;
Tests: T1 T2 T3
268
269 1/1 unique case (dst_fsm_cs)
Tests: T1 T2 T3
270
271 EVEN: begin
272 // Simply forward REQ and ACK.
273 1/1 dst_req_o = dst_req;
Tests: T1 T2 T3
274 1/1 dst_ack_d = dst_ack_i;
Tests: T1 T2 T3
275
276 // The handshake is done for exactly 1 clock cycle.
277 1/1 if (dst_handshake) begin
Tests: T1 T2 T3
278 1/1 dst_fsm_ns = ODD;
Tests: T1 T2 T3
279 end
MISSING_ELSE
280 end
281
282 ODD: begin
283 // Internal REQ and ACK have inverted meaning now. If dst_req goes low, this signals a new
284 // transaction.
285 1/1 dst_req_o = ~dst_req;
Tests: T1 T2 T3
286 1/1 dst_ack_d = ~dst_ack_i;
Tests: T1 T2 T3
287
288 // The handshake is done for exactly 1 clock cycle.
289 1/1 if (dst_handshake) begin
Tests: T1 T2 T3
290 1/1 dst_fsm_ns = EVEN;
Tests: T1 T2 T3
291 end
MISSING_ELSE
292 end
293
294 //VCS coverage off
295 // pragma coverage off
296
297 default: ;
298
299 //VCS coverage on
300 // pragma coverage on
301
302 endcase
303 end
304
305 // Registers
306 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
307 1/1 if (!rst_src_ni) begin
Tests: T4 T5 T6
308 1/1 src_fsm_cs <= EVEN;
Tests: T4 T5 T6
309 1/1 src_req_q <= 1'b0;
Tests: T4 T5 T6
310 end else begin
311 1/1 src_fsm_cs <= src_fsm_ns;
Tests: T4 T5 T6
312 1/1 src_req_q <= src_req_d;
Tests: T4 T5 T6
313 end
314 end
315 always_ff @(posedge clk_dst_i or negedge rst_dst_ni) begin
316 1/1 if (!rst_dst_ni) begin
Tests: T4 T5 T6
317 1/1 dst_fsm_cs <= EVEN;
Tests: T4 T5 T6
318 1/1 dst_ack_q <= 1'b0;
Tests: T4 T5 T6
319 end else begin
320 1/1 dst_fsm_cs <= dst_fsm_ns;
Tests: T4 T5 T6
321 1/1 dst_ack_q <= dst_ack_d;
Tests: T4 T5 T6
322 end
323 end
324 end
325
326 ////////////////
327 // Assertions //
328 ////////////////
329
330 `ifdef INC_ASSERT
331 //VCS coverage off
332 // pragma coverage off
333
334 logic effective_rst_n;
335 unreachable assign effective_rst_n = rst_src_ni && rst_dst_ni;
336
337 logic chk_flag;
338 always_ff @(posedge clk_src_i or negedge effective_rst_n) begin
339 unreachable if (!effective_rst_n) begin
340 unreachable chk_flag <= '0;
341 unreachable end else if (src_req_i && !chk_flag) begin
342 unreachable chk_flag <= 1'b1;
343 end
==> MISSING_ELSE
Cond Coverage for Instance : tb.dut.u_reg.u_io_div4_meas_ctrl_en_cdc.u_arb.gen_wr_req.u_dst_update_sync
| Total | Covered | Percent |
Conditions | 4 | 3 | 75.00 |
Logical | 4 | 3 | 75.00 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 194
EXPRESSION (src_req_i & src_ack_o)
----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T1,T2,T3 |
1 | 1 | Covered | T1,T2,T3 |
LINE 195
EXPRESSION (dst_req_o & dst_ack_i)
----1---- ----2----
-1- | -2- | Status | Tests | Exclude Annotation |
0 | 1 | Excluded | |
VC_COV_UNR |
1 | 0 | Excluded | |
VC_COV_UNR |
1 | 1 | Covered | T1,T2,T3 |
Branch Coverage for Instance : tb.dut.u_reg.u_io_div4_meas_ctrl_en_cdc.u_arb.gen_wr_req.u_dst_update_sync
| Line No. | Total | Covered | Percent |
Branches |
|
12 |
12 |
100.00 |
CASE |
225 |
4 |
4 |
100.00 |
CASE |
269 |
4 |
4 |
100.00 |
IF |
307 |
2 |
2 |
100.00 |
IF |
316 |
2 |
2 |
100.00 |
225 unique case (src_fsm_cs)
-1-
226
227 EVEN: begin
228 // Simply forward REQ and ACK.
229 src_req_d = src_req_i;
230 src_ack_o = src_ack;
231
232 // The handshake is done for exactly 1 clock cycle.
233 if (src_handshake) begin
-2-
234 src_fsm_ns = ODD;
==>
235 end
MISSING_ELSE
==>
236 end
237
238 ODD: begin
239 // Internal REQ and ACK have inverted meaning now. If src_req_i is high again, this
240 // signals a new transaction.
241 src_req_d = ~src_req_i;
242 src_ack_o = ~src_ack;
243
244 // The handshake is done for exactly 1 clock cycle.
245 if (src_handshake) begin
-3-
246 src_fsm_ns = EVEN;
==>
247 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
EVEN |
1 |
- |
Covered |
T1,T2,T3 |
EVEN |
0 |
- |
Covered |
T1,T2,T3 |
ODD |
- |
1 |
Covered |
T1,T2,T3 |
ODD |
- |
0 |
Covered |
T1,T2,T3 |
269 unique case (dst_fsm_cs)
-1-
270
271 EVEN: begin
272 // Simply forward REQ and ACK.
273 dst_req_o = dst_req;
274 dst_ack_d = dst_ack_i;
275
276 // The handshake is done for exactly 1 clock cycle.
277 if (dst_handshake) begin
-2-
278 dst_fsm_ns = ODD;
==>
279 end
MISSING_ELSE
==>
280 end
281
282 ODD: begin
283 // Internal REQ and ACK have inverted meaning now. If dst_req goes low, this signals a new
284 // transaction.
285 dst_req_o = ~dst_req;
286 dst_ack_d = ~dst_ack_i;
287
288 // The handshake is done for exactly 1 clock cycle.
289 if (dst_handshake) begin
-3-
290 dst_fsm_ns = EVEN;
==>
291 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
EVEN |
1 |
- |
Covered |
T1,T2,T3 |
EVEN |
0 |
- |
Covered |
T1,T2,T3 |
ODD |
- |
1 |
Covered |
T1,T2,T3 |
ODD |
- |
0 |
Covered |
T1,T2,T3 |
307 if (!rst_src_ni) begin
-1-
308 src_fsm_cs <= EVEN;
==>
309 src_req_q <= 1'b0;
310 end else begin
311 src_fsm_cs <= src_fsm_ns;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T4,T5,T6 |
0 |
Covered |
T4,T5,T6 |
316 if (!rst_dst_ni) begin
-1-
317 dst_fsm_cs <= EVEN;
==>
318 dst_ack_q <= 1'b0;
319 end else begin
320 dst_fsm_cs <= dst_fsm_ns;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T4,T5,T6 |
0 |
Covered |
T4,T5,T6 |
Assert Coverage for Instance : tb.dut.u_reg.u_io_div4_meas_ctrl_en_cdc.u_arb.gen_wr_req.u_dst_update_sync
Assertion Details
SyncReqAckAckNeedsReq
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
36456208 |
12116 |
0 |
0 |
T1 |
37611 |
6 |
0 |
0 |
T2 |
16761 |
12 |
0 |
0 |
T3 |
24792 |
16 |
0 |
0 |
T10 |
0 |
43 |
0 |
0 |
T11 |
0 |
36 |
0 |
0 |
T13 |
0 |
40 |
0 |
0 |
T25 |
0 |
22 |
0 |
0 |
T29 |
0 |
22 |
0 |
0 |
T39 |
0 |
20 |
0 |
0 |
T40 |
0 |
2 |
0 |
0 |
T42 |
1956 |
0 |
0 |
0 |
T43 |
2175 |
0 |
0 |
0 |
T44 |
1508 |
0 |
0 |
0 |
T45 |
1876 |
0 |
0 |
0 |
T46 |
1399 |
0 |
0 |
0 |
T49 |
10120 |
0 |
0 |
0 |
T50 |
2203 |
0 |
0 |
0 |
SyncReqAckHoldReq
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
20147922 |
11623 |
0 |
0 |
T1 |
7654 |
6 |
0 |
0 |
T2 |
16734 |
12 |
0 |
0 |
T3 |
6164 |
16 |
0 |
0 |
T10 |
0 |
40 |
0 |
0 |
T11 |
0 |
30 |
0 |
0 |
T13 |
0 |
40 |
0 |
0 |
T25 |
0 |
22 |
0 |
0 |
T29 |
0 |
21 |
0 |
0 |
T39 |
0 |
20 |
0 |
0 |
T40 |
0 |
1 |
0 |
0 |
T42 |
472 |
0 |
0 |
0 |
T43 |
558 |
0 |
0 |
0 |
T44 |
356 |
0 |
0 |
0 |
T45 |
439 |
0 |
0 |
0 |
T46 |
635 |
0 |
0 |
0 |
T49 |
3757 |
0 |
0 |
0 |
T50 |
519 |
0 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_reg.u_main_meas_ctrl_en_cdc.u_arb.gen_wr_req.u_dst_update_sync
| Line No. | Total | Covered | Percent |
TOTAL | | 36 | 36 | 100.00 |
CONT_ASSIGN | 55 | 0 | 0 | |
CONT_ASSIGN | 194 | 1 | 1 | 100.00 |
CONT_ASSIGN | 195 | 1 | 1 | 100.00 |
ALWAYS | 219 | 12 | 12 | 100.00 |
ALWAYS | 263 | 12 | 12 | 100.00 |
ALWAYS | 307 | 5 | 5 | 100.00 |
ALWAYS | 316 | 5 | 5 | 100.00 |
CONT_ASSIGN | 335 | 0 | 0 | |
ALWAYS | 339 | 0 | 0 | |
54 logic unused_req_chk;
55 unreachable assign unused_req_chk = req_chk_i;
56
57 if (EnRzHs) begin : gen_rz_hs_protocol
58 //////////////////
59 // RZ protocol //
60 //////////////////
61
62 // Types
63 typedef enum logic {
64 LoSt, HiSt
65 } rz_fsm_e;
66
67 // Signals
68 rz_fsm_e src_fsm_d, src_fsm_q;
69 rz_fsm_e dst_fsm_d, dst_fsm_q;
70 logic src_ack, dst_ack;
71 logic src_req, dst_req;
72
73 // REQ-side FSM (SRC domain)
74 always_comb begin : src_fsm
75 src_fsm_d = src_fsm_q;
76 src_ack_o = 1'b0;
77 src_req = 1'b0;
78
79 unique case (src_fsm_q)
80 LoSt: begin
81 // Wait for the ack to go back to zero before starting
82 // a new transaction.
83 if (!src_ack && src_req_i) begin
84 src_fsm_d = HiSt;
85 end
86 end
87 HiSt: begin
88 src_req = 1'b1;
89 // Forward the acknowledgement.
90 src_ack_o = src_ack;
91 // If request drops out, we go back to LoSt.
92 // If DST side asserts ack, we also go back to LoSt.
93 if (!src_req_i || src_ack) begin
94 src_fsm_d = LoSt;
95 end
96 end
97 //VCS coverage off
98 // pragma coverage off
99 default: ;
100 //VCS coverage on
101 // pragma coverage on
102 endcase
103 end
104
105 // Move ACK over to SRC domain.
106 prim_flop_2sync #(
107 .Width(1)
108 ) ack_sync (
109 .clk_i (clk_src_i),
110 .rst_ni (rst_src_ni),
111 .d_i (dst_ack),
112 .q_o (src_ack)
113 );
114
115 // Registers
116 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
117 if (!rst_src_ni) begin
118 src_fsm_q <= LoSt;
119 end else begin
120 src_fsm_q <= src_fsm_d;
121 end
122 end
123
124 // ACK-side FSM (DST domain)
125 always_comb begin : dst_fsm
126 dst_fsm_d = dst_fsm_q;
127 dst_req_o = 1'b0;
128 dst_ack = 1'b0;
129
130 unique case (dst_fsm_q)
131 LoSt: begin
132 if (dst_req) begin
133 // Forward the request.
134 dst_req_o = 1'b1;
135 // Wait for the request and acknowledge to be asserted
136 // before responding to the SRC side.
137 if (dst_ack_i) begin
138 dst_fsm_d = HiSt;
139 end
140 end
141 end
142 HiSt: begin
143 dst_ack = 1'b1;
144 // Wait for the request to drop back to zero.
145 if (!dst_req) begin
146 dst_fsm_d = LoSt;
147 end
148 end
149 //VCS coverage off
150 // pragma coverage off
151 default: ;
152 //VCS coverage on
153 // pragma coverage on
154 endcase
155 end
156
157 // Move REQ over to DST domain.
158 prim_flop_2sync #(
159 .Width(1)
160 ) req_sync (
161 .clk_i (clk_dst_i),
162 .rst_ni (rst_dst_ni),
163 .d_i (src_req),
164 .q_o (dst_req)
165 );
166
167 // Registers
168 always_ff @(posedge clk_dst_i or negedge rst_dst_ni) begin
169 if (!rst_dst_ni) begin
170 dst_fsm_q <= LoSt;
171 end else begin
172 dst_fsm_q <= dst_fsm_d;
173 end
174 end
175
176 end else begin : gen_nrz_hs_protocol
177 //////////////////
178 // NRZ protocol //
179 //////////////////
180
181 // Types
182 typedef enum logic {
183 EVEN, ODD
184 } sync_reqack_fsm_e;
185
186 // Signals
187 sync_reqack_fsm_e src_fsm_ns, src_fsm_cs;
188 sync_reqack_fsm_e dst_fsm_ns, dst_fsm_cs;
189
190 logic src_req_d, src_req_q, src_ack;
191 logic dst_ack_d, dst_ack_q, dst_req;
192 logic src_handshake, dst_handshake;
193
194 1/1 assign src_handshake = src_req_i & src_ack_o;
Tests: T1 T2 T3
195 1/1 assign dst_handshake = dst_req_o & dst_ack_i;
Tests: T1 T2 T3
196
197 // Move REQ over to DST domain.
198 prim_flop_2sync #(
199 .Width(1)
200 ) req_sync (
201 .clk_i (clk_dst_i),
202 .rst_ni (rst_dst_ni),
203 .d_i (src_req_q),
204 .q_o (dst_req)
205 );
206
207 // Move ACK over to SRC domain.
208 prim_flop_2sync #(
209 .Width(1)
210 ) ack_sync (
211 .clk_i (clk_src_i),
212 .rst_ni (rst_src_ni),
213 .d_i (dst_ack_q),
214 .q_o (src_ack)
215 );
216
217 // REQ-side FSM (SRC domain)
218 always_comb begin : src_fsm
219 1/1 src_fsm_ns = src_fsm_cs;
Tests: T1 T2 T3
220
221 // By default, we keep the internal REQ value and don't ACK.
222 1/1 src_req_d = src_req_q;
Tests: T1 T2 T3
223 1/1 src_ack_o = 1'b0;
Tests: T1 T2 T3
224
225 1/1 unique case (src_fsm_cs)
Tests: T1 T2 T3
226
227 EVEN: begin
228 // Simply forward REQ and ACK.
229 1/1 src_req_d = src_req_i;
Tests: T1 T2 T3
230 1/1 src_ack_o = src_ack;
Tests: T1 T2 T3
231
232 // The handshake is done for exactly 1 clock cycle.
233 1/1 if (src_handshake) begin
Tests: T1 T2 T3
234 1/1 src_fsm_ns = ODD;
Tests: T1 T2 T3
235 end
MISSING_ELSE
236 end
237
238 ODD: begin
239 // Internal REQ and ACK have inverted meaning now. If src_req_i is high again, this
240 // signals a new transaction.
241 1/1 src_req_d = ~src_req_i;
Tests: T1 T2 T3
242 1/1 src_ack_o = ~src_ack;
Tests: T1 T2 T3
243
244 // The handshake is done for exactly 1 clock cycle.
245 1/1 if (src_handshake) begin
Tests: T1 T2 T3
246 1/1 src_fsm_ns = EVEN;
Tests: T1 T2 T3
247 end
MISSING_ELSE
248 end
249
250 //VCS coverage off
251 // pragma coverage off
252
253 default: ;
254
255 //VCS coverage on
256 // pragma coverage on
257
258 endcase
259 end
260
261 // ACK-side FSM (DST domain)
262 always_comb begin : dst_fsm
263 1/1 dst_fsm_ns = dst_fsm_cs;
Tests: T1 T2 T3
264
265 // By default, we don't REQ and keep the internal ACK.
266 1/1 dst_req_o = 1'b0;
Tests: T1 T2 T3
267 1/1 dst_ack_d = dst_ack_q;
Tests: T1 T2 T3
268
269 1/1 unique case (dst_fsm_cs)
Tests: T1 T2 T3
270
271 EVEN: begin
272 // Simply forward REQ and ACK.
273 1/1 dst_req_o = dst_req;
Tests: T1 T2 T3
274 1/1 dst_ack_d = dst_ack_i;
Tests: T1 T2 T3
275
276 // The handshake is done for exactly 1 clock cycle.
277 1/1 if (dst_handshake) begin
Tests: T1 T2 T3
278 1/1 dst_fsm_ns = ODD;
Tests: T1 T2 T3
279 end
MISSING_ELSE
280 end
281
282 ODD: begin
283 // Internal REQ and ACK have inverted meaning now. If dst_req goes low, this signals a new
284 // transaction.
285 1/1 dst_req_o = ~dst_req;
Tests: T1 T2 T3
286 1/1 dst_ack_d = ~dst_ack_i;
Tests: T1 T2 T3
287
288 // The handshake is done for exactly 1 clock cycle.
289 1/1 if (dst_handshake) begin
Tests: T1 T2 T3
290 1/1 dst_fsm_ns = EVEN;
Tests: T1 T2 T3
291 end
MISSING_ELSE
292 end
293
294 //VCS coverage off
295 // pragma coverage off
296
297 default: ;
298
299 //VCS coverage on
300 // pragma coverage on
301
302 endcase
303 end
304
305 // Registers
306 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
307 1/1 if (!rst_src_ni) begin
Tests: T4 T5 T6
308 1/1 src_fsm_cs <= EVEN;
Tests: T4 T5 T6
309 1/1 src_req_q <= 1'b0;
Tests: T4 T5 T6
310 end else begin
311 1/1 src_fsm_cs <= src_fsm_ns;
Tests: T4 T5 T6
312 1/1 src_req_q <= src_req_d;
Tests: T4 T5 T6
313 end
314 end
315 always_ff @(posedge clk_dst_i or negedge rst_dst_ni) begin
316 1/1 if (!rst_dst_ni) begin
Tests: T4 T5 T6
317 1/1 dst_fsm_cs <= EVEN;
Tests: T4 T5 T6
318 1/1 dst_ack_q <= 1'b0;
Tests: T4 T5 T6
319 end else begin
320 1/1 dst_fsm_cs <= dst_fsm_ns;
Tests: T4 T5 T6
321 1/1 dst_ack_q <= dst_ack_d;
Tests: T4 T5 T6
322 end
323 end
324 end
325
326 ////////////////
327 // Assertions //
328 ////////////////
329
330 `ifdef INC_ASSERT
331 //VCS coverage off
332 // pragma coverage off
333
334 logic effective_rst_n;
335 unreachable assign effective_rst_n = rst_src_ni && rst_dst_ni;
336
337 logic chk_flag;
338 always_ff @(posedge clk_src_i or negedge effective_rst_n) begin
339 unreachable if (!effective_rst_n) begin
340 unreachable chk_flag <= '0;
341 unreachable end else if (src_req_i && !chk_flag) begin
342 unreachable chk_flag <= 1'b1;
343 end
==> MISSING_ELSE
Cond Coverage for Instance : tb.dut.u_reg.u_main_meas_ctrl_en_cdc.u_arb.gen_wr_req.u_dst_update_sync
| Total | Covered | Percent |
Conditions | 4 | 3 | 75.00 |
Logical | 4 | 3 | 75.00 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 194
EXPRESSION (src_req_i & src_ack_o)
----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T1,T2,T3 |
1 | 1 | Covered | T1,T2,T3 |
LINE 195
EXPRESSION (dst_req_o & dst_ack_i)
----1---- ----2----
-1- | -2- | Status | Tests | Exclude Annotation |
0 | 1 | Excluded | |
VC_COV_UNR |
1 | 0 | Excluded | |
VC_COV_UNR |
1 | 1 | Covered | T1,T2,T3 |
Branch Coverage for Instance : tb.dut.u_reg.u_main_meas_ctrl_en_cdc.u_arb.gen_wr_req.u_dst_update_sync
| Line No. | Total | Covered | Percent |
Branches |
|
12 |
12 |
100.00 |
CASE |
225 |
4 |
4 |
100.00 |
CASE |
269 |
4 |
4 |
100.00 |
IF |
307 |
2 |
2 |
100.00 |
IF |
316 |
2 |
2 |
100.00 |
225 unique case (src_fsm_cs)
-1-
226
227 EVEN: begin
228 // Simply forward REQ and ACK.
229 src_req_d = src_req_i;
230 src_ack_o = src_ack;
231
232 // The handshake is done for exactly 1 clock cycle.
233 if (src_handshake) begin
-2-
234 src_fsm_ns = ODD;
==>
235 end
MISSING_ELSE
==>
236 end
237
238 ODD: begin
239 // Internal REQ and ACK have inverted meaning now. If src_req_i is high again, this
240 // signals a new transaction.
241 src_req_d = ~src_req_i;
242 src_ack_o = ~src_ack;
243
244 // The handshake is done for exactly 1 clock cycle.
245 if (src_handshake) begin
-3-
246 src_fsm_ns = EVEN;
==>
247 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
EVEN |
1 |
- |
Covered |
T1,T2,T3 |
EVEN |
0 |
- |
Covered |
T1,T2,T3 |
ODD |
- |
1 |
Covered |
T1,T2,T3 |
ODD |
- |
0 |
Covered |
T1,T2,T3 |
269 unique case (dst_fsm_cs)
-1-
270
271 EVEN: begin
272 // Simply forward REQ and ACK.
273 dst_req_o = dst_req;
274 dst_ack_d = dst_ack_i;
275
276 // The handshake is done for exactly 1 clock cycle.
277 if (dst_handshake) begin
-2-
278 dst_fsm_ns = ODD;
==>
279 end
MISSING_ELSE
==>
280 end
281
282 ODD: begin
283 // Internal REQ and ACK have inverted meaning now. If dst_req goes low, this signals a new
284 // transaction.
285 dst_req_o = ~dst_req;
286 dst_ack_d = ~dst_ack_i;
287
288 // The handshake is done for exactly 1 clock cycle.
289 if (dst_handshake) begin
-3-
290 dst_fsm_ns = EVEN;
==>
291 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
EVEN |
1 |
- |
Covered |
T1,T2,T3 |
EVEN |
0 |
- |
Covered |
T1,T2,T3 |
ODD |
- |
1 |
Covered |
T1,T2,T3 |
ODD |
- |
0 |
Covered |
T1,T2,T3 |
307 if (!rst_src_ni) begin
-1-
308 src_fsm_cs <= EVEN;
==>
309 src_req_q <= 1'b0;
310 end else begin
311 src_fsm_cs <= src_fsm_ns;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T4,T5,T6 |
0 |
Covered |
T4,T5,T6 |
316 if (!rst_dst_ni) begin
-1-
317 dst_fsm_cs <= EVEN;
==>
318 dst_ack_q <= 1'b0;
319 end else begin
320 dst_fsm_cs <= dst_fsm_ns;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T4,T5,T6 |
0 |
Covered |
T4,T5,T6 |
Assert Coverage for Instance : tb.dut.u_reg.u_main_meas_ctrl_en_cdc.u_arb.gen_wr_req.u_dst_update_sync
Assertion Details
SyncReqAckAckNeedsReq
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
36456208 |
12116 |
0 |
0 |
T1 |
37611 |
6 |
0 |
0 |
T2 |
16761 |
12 |
0 |
0 |
T3 |
24792 |
16 |
0 |
0 |
T10 |
0 |
43 |
0 |
0 |
T11 |
0 |
36 |
0 |
0 |
T13 |
0 |
40 |
0 |
0 |
T25 |
0 |
22 |
0 |
0 |
T29 |
0 |
22 |
0 |
0 |
T39 |
0 |
20 |
0 |
0 |
T40 |
0 |
2 |
0 |
0 |
T42 |
1956 |
0 |
0 |
0 |
T43 |
2175 |
0 |
0 |
0 |
T44 |
1508 |
0 |
0 |
0 |
T45 |
1876 |
0 |
0 |
0 |
T46 |
1399 |
0 |
0 |
0 |
T49 |
10120 |
0 |
0 |
0 |
T50 |
2203 |
0 |
0 |
0 |
SyncReqAckHoldReq
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
91173275 |
11663 |
0 |
0 |
T1 |
37990 |
6 |
0 |
0 |
T2 |
69840 |
12 |
0 |
0 |
T3 |
52751 |
16 |
0 |
0 |
T10 |
0 |
40 |
0 |
0 |
T11 |
0 |
30 |
0 |
0 |
T13 |
0 |
40 |
0 |
0 |
T25 |
0 |
22 |
0 |
0 |
T29 |
0 |
22 |
0 |
0 |
T39 |
0 |
20 |
0 |
0 |
T40 |
0 |
2 |
0 |
0 |
T42 |
2080 |
0 |
0 |
0 |
T43 |
2175 |
0 |
0 |
0 |
T44 |
1522 |
0 |
0 |
0 |
T45 |
1913 |
0 |
0 |
0 |
T46 |
2614 |
0 |
0 |
0 |
T49 |
20242 |
0 |
0 |
0 |
T50 |
2247 |
0 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_reg.u_usb_meas_ctrl_en_cdc.u_arb.gen_wr_req.u_dst_update_sync
| Line No. | Total | Covered | Percent |
TOTAL | | 36 | 36 | 100.00 |
CONT_ASSIGN | 55 | 0 | 0 | |
CONT_ASSIGN | 194 | 1 | 1 | 100.00 |
CONT_ASSIGN | 195 | 1 | 1 | 100.00 |
ALWAYS | 219 | 12 | 12 | 100.00 |
ALWAYS | 263 | 12 | 12 | 100.00 |
ALWAYS | 307 | 5 | 5 | 100.00 |
ALWAYS | 316 | 5 | 5 | 100.00 |
CONT_ASSIGN | 335 | 0 | 0 | |
ALWAYS | 339 | 0 | 0 | |
54 logic unused_req_chk;
55 unreachable assign unused_req_chk = req_chk_i;
56
57 if (EnRzHs) begin : gen_rz_hs_protocol
58 //////////////////
59 // RZ protocol //
60 //////////////////
61
62 // Types
63 typedef enum logic {
64 LoSt, HiSt
65 } rz_fsm_e;
66
67 // Signals
68 rz_fsm_e src_fsm_d, src_fsm_q;
69 rz_fsm_e dst_fsm_d, dst_fsm_q;
70 logic src_ack, dst_ack;
71 logic src_req, dst_req;
72
73 // REQ-side FSM (SRC domain)
74 always_comb begin : src_fsm
75 src_fsm_d = src_fsm_q;
76 src_ack_o = 1'b0;
77 src_req = 1'b0;
78
79 unique case (src_fsm_q)
80 LoSt: begin
81 // Wait for the ack to go back to zero before starting
82 // a new transaction.
83 if (!src_ack && src_req_i) begin
84 src_fsm_d = HiSt;
85 end
86 end
87 HiSt: begin
88 src_req = 1'b1;
89 // Forward the acknowledgement.
90 src_ack_o = src_ack;
91 // If request drops out, we go back to LoSt.
92 // If DST side asserts ack, we also go back to LoSt.
93 if (!src_req_i || src_ack) begin
94 src_fsm_d = LoSt;
95 end
96 end
97 //VCS coverage off
98 // pragma coverage off
99 default: ;
100 //VCS coverage on
101 // pragma coverage on
102 endcase
103 end
104
105 // Move ACK over to SRC domain.
106 prim_flop_2sync #(
107 .Width(1)
108 ) ack_sync (
109 .clk_i (clk_src_i),
110 .rst_ni (rst_src_ni),
111 .d_i (dst_ack),
112 .q_o (src_ack)
113 );
114
115 // Registers
116 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
117 if (!rst_src_ni) begin
118 src_fsm_q <= LoSt;
119 end else begin
120 src_fsm_q <= src_fsm_d;
121 end
122 end
123
124 // ACK-side FSM (DST domain)
125 always_comb begin : dst_fsm
126 dst_fsm_d = dst_fsm_q;
127 dst_req_o = 1'b0;
128 dst_ack = 1'b0;
129
130 unique case (dst_fsm_q)
131 LoSt: begin
132 if (dst_req) begin
133 // Forward the request.
134 dst_req_o = 1'b1;
135 // Wait for the request and acknowledge to be asserted
136 // before responding to the SRC side.
137 if (dst_ack_i) begin
138 dst_fsm_d = HiSt;
139 end
140 end
141 end
142 HiSt: begin
143 dst_ack = 1'b1;
144 // Wait for the request to drop back to zero.
145 if (!dst_req) begin
146 dst_fsm_d = LoSt;
147 end
148 end
149 //VCS coverage off
150 // pragma coverage off
151 default: ;
152 //VCS coverage on
153 // pragma coverage on
154 endcase
155 end
156
157 // Move REQ over to DST domain.
158 prim_flop_2sync #(
159 .Width(1)
160 ) req_sync (
161 .clk_i (clk_dst_i),
162 .rst_ni (rst_dst_ni),
163 .d_i (src_req),
164 .q_o (dst_req)
165 );
166
167 // Registers
168 always_ff @(posedge clk_dst_i or negedge rst_dst_ni) begin
169 if (!rst_dst_ni) begin
170 dst_fsm_q <= LoSt;
171 end else begin
172 dst_fsm_q <= dst_fsm_d;
173 end
174 end
175
176 end else begin : gen_nrz_hs_protocol
177 //////////////////
178 // NRZ protocol //
179 //////////////////
180
181 // Types
182 typedef enum logic {
183 EVEN, ODD
184 } sync_reqack_fsm_e;
185
186 // Signals
187 sync_reqack_fsm_e src_fsm_ns, src_fsm_cs;
188 sync_reqack_fsm_e dst_fsm_ns, dst_fsm_cs;
189
190 logic src_req_d, src_req_q, src_ack;
191 logic dst_ack_d, dst_ack_q, dst_req;
192 logic src_handshake, dst_handshake;
193
194 1/1 assign src_handshake = src_req_i & src_ack_o;
Tests: T1 T2 T3
195 1/1 assign dst_handshake = dst_req_o & dst_ack_i;
Tests: T1 T2 T3
196
197 // Move REQ over to DST domain.
198 prim_flop_2sync #(
199 .Width(1)
200 ) req_sync (
201 .clk_i (clk_dst_i),
202 .rst_ni (rst_dst_ni),
203 .d_i (src_req_q),
204 .q_o (dst_req)
205 );
206
207 // Move ACK over to SRC domain.
208 prim_flop_2sync #(
209 .Width(1)
210 ) ack_sync (
211 .clk_i (clk_src_i),
212 .rst_ni (rst_src_ni),
213 .d_i (dst_ack_q),
214 .q_o (src_ack)
215 );
216
217 // REQ-side FSM (SRC domain)
218 always_comb begin : src_fsm
219 1/1 src_fsm_ns = src_fsm_cs;
Tests: T1 T2 T3
220
221 // By default, we keep the internal REQ value and don't ACK.
222 1/1 src_req_d = src_req_q;
Tests: T1 T2 T3
223 1/1 src_ack_o = 1'b0;
Tests: T1 T2 T3
224
225 1/1 unique case (src_fsm_cs)
Tests: T1 T2 T3
226
227 EVEN: begin
228 // Simply forward REQ and ACK.
229 1/1 src_req_d = src_req_i;
Tests: T1 T2 T3
230 1/1 src_ack_o = src_ack;
Tests: T1 T2 T3
231
232 // The handshake is done for exactly 1 clock cycle.
233 1/1 if (src_handshake) begin
Tests: T1 T2 T3
234 1/1 src_fsm_ns = ODD;
Tests: T1 T2 T3
235 end
MISSING_ELSE
236 end
237
238 ODD: begin
239 // Internal REQ and ACK have inverted meaning now. If src_req_i is high again, this
240 // signals a new transaction.
241 1/1 src_req_d = ~src_req_i;
Tests: T1 T2 T3
242 1/1 src_ack_o = ~src_ack;
Tests: T1 T2 T3
243
244 // The handshake is done for exactly 1 clock cycle.
245 1/1 if (src_handshake) begin
Tests: T1 T2 T3
246 1/1 src_fsm_ns = EVEN;
Tests: T1 T2 T13
247 end
MISSING_ELSE
248 end
249
250 //VCS coverage off
251 // pragma coverage off
252
253 default: ;
254
255 //VCS coverage on
256 // pragma coverage on
257
258 endcase
259 end
260
261 // ACK-side FSM (DST domain)
262 always_comb begin : dst_fsm
263 1/1 dst_fsm_ns = dst_fsm_cs;
Tests: T1 T2 T3
264
265 // By default, we don't REQ and keep the internal ACK.
266 1/1 dst_req_o = 1'b0;
Tests: T1 T2 T3
267 1/1 dst_ack_d = dst_ack_q;
Tests: T1 T2 T3
268
269 1/1 unique case (dst_fsm_cs)
Tests: T1 T2 T3
270
271 EVEN: begin
272 // Simply forward REQ and ACK.
273 1/1 dst_req_o = dst_req;
Tests: T1 T2 T3
274 1/1 dst_ack_d = dst_ack_i;
Tests: T1 T2 T3
275
276 // The handshake is done for exactly 1 clock cycle.
277 1/1 if (dst_handshake) begin
Tests: T1 T2 T3
278 1/1 dst_fsm_ns = ODD;
Tests: T1 T2 T3
279 end
MISSING_ELSE
280 end
281
282 ODD: begin
283 // Internal REQ and ACK have inverted meaning now. If dst_req goes low, this signals a new
284 // transaction.
285 1/1 dst_req_o = ~dst_req;
Tests: T1 T2 T3
286 1/1 dst_ack_d = ~dst_ack_i;
Tests: T1 T2 T3
287
288 // The handshake is done for exactly 1 clock cycle.
289 1/1 if (dst_handshake) begin
Tests: T1 T2 T3
290 1/1 dst_fsm_ns = EVEN;
Tests: T1 T2 T13
291 end
MISSING_ELSE
292 end
293
294 //VCS coverage off
295 // pragma coverage off
296
297 default: ;
298
299 //VCS coverage on
300 // pragma coverage on
301
302 endcase
303 end
304
305 // Registers
306 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
307 1/1 if (!rst_src_ni) begin
Tests: T4 T5 T6
308 1/1 src_fsm_cs <= EVEN;
Tests: T4 T5 T6
309 1/1 src_req_q <= 1'b0;
Tests: T4 T5 T6
310 end else begin
311 1/1 src_fsm_cs <= src_fsm_ns;
Tests: T4 T5 T6
312 1/1 src_req_q <= src_req_d;
Tests: T4 T5 T6
313 end
314 end
315 always_ff @(posedge clk_dst_i or negedge rst_dst_ni) begin
316 1/1 if (!rst_dst_ni) begin
Tests: T4 T5 T6
317 1/1 dst_fsm_cs <= EVEN;
Tests: T4 T5 T6
318 1/1 dst_ack_q <= 1'b0;
Tests: T4 T5 T6
319 end else begin
320 1/1 dst_fsm_cs <= dst_fsm_ns;
Tests: T4 T5 T6
321 1/1 dst_ack_q <= dst_ack_d;
Tests: T4 T5 T6
322 end
323 end
324 end
325
326 ////////////////
327 // Assertions //
328 ////////////////
329
330 `ifdef INC_ASSERT
331 //VCS coverage off
332 // pragma coverage off
333
334 logic effective_rst_n;
335 unreachable assign effective_rst_n = rst_src_ni && rst_dst_ni;
336
337 logic chk_flag;
338 always_ff @(posedge clk_src_i or negedge effective_rst_n) begin
339 unreachable if (!effective_rst_n) begin
340 unreachable chk_flag <= '0;
341 unreachable end else if (src_req_i && !chk_flag) begin
342 unreachable chk_flag <= 1'b1;
343 end
==> MISSING_ELSE
Cond Coverage for Instance : tb.dut.u_reg.u_usb_meas_ctrl_en_cdc.u_arb.gen_wr_req.u_dst_update_sync
| Total | Covered | Percent |
Conditions | 4 | 3 | 75.00 |
Logical | 4 | 3 | 75.00 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 194
EXPRESSION (src_req_i & src_ack_o)
----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T1,T2,T3 |
1 | 1 | Covered | T1,T2,T3 |
LINE 195
EXPRESSION (dst_req_o & dst_ack_i)
----1---- ----2----
-1- | -2- | Status | Tests | Exclude Annotation |
0 | 1 | Excluded | |
VC_COV_UNR |
1 | 0 | Excluded | |
VC_COV_UNR |
1 | 1 | Covered | T1,T2,T3 |
Branch Coverage for Instance : tb.dut.u_reg.u_usb_meas_ctrl_en_cdc.u_arb.gen_wr_req.u_dst_update_sync
| Line No. | Total | Covered | Percent |
Branches |
|
12 |
12 |
100.00 |
CASE |
225 |
4 |
4 |
100.00 |
CASE |
269 |
4 |
4 |
100.00 |
IF |
307 |
2 |
2 |
100.00 |
IF |
316 |
2 |
2 |
100.00 |
225 unique case (src_fsm_cs)
-1-
226
227 EVEN: begin
228 // Simply forward REQ and ACK.
229 src_req_d = src_req_i;
230 src_ack_o = src_ack;
231
232 // The handshake is done for exactly 1 clock cycle.
233 if (src_handshake) begin
-2-
234 src_fsm_ns = ODD;
==>
235 end
MISSING_ELSE
==>
236 end
237
238 ODD: begin
239 // Internal REQ and ACK have inverted meaning now. If src_req_i is high again, this
240 // signals a new transaction.
241 src_req_d = ~src_req_i;
242 src_ack_o = ~src_ack;
243
244 // The handshake is done for exactly 1 clock cycle.
245 if (src_handshake) begin
-3-
246 src_fsm_ns = EVEN;
==>
247 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
EVEN |
1 |
- |
Covered |
T1,T2,T3 |
EVEN |
0 |
- |
Covered |
T1,T2,T3 |
ODD |
- |
1 |
Covered |
T1,T2,T13 |
ODD |
- |
0 |
Covered |
T1,T2,T3 |
269 unique case (dst_fsm_cs)
-1-
270
271 EVEN: begin
272 // Simply forward REQ and ACK.
273 dst_req_o = dst_req;
274 dst_ack_d = dst_ack_i;
275
276 // The handshake is done for exactly 1 clock cycle.
277 if (dst_handshake) begin
-2-
278 dst_fsm_ns = ODD;
==>
279 end
MISSING_ELSE
==>
280 end
281
282 ODD: begin
283 // Internal REQ and ACK have inverted meaning now. If dst_req goes low, this signals a new
284 // transaction.
285 dst_req_o = ~dst_req;
286 dst_ack_d = ~dst_ack_i;
287
288 // The handshake is done for exactly 1 clock cycle.
289 if (dst_handshake) begin
-3-
290 dst_fsm_ns = EVEN;
==>
291 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
EVEN |
1 |
- |
Covered |
T1,T2,T3 |
EVEN |
0 |
- |
Covered |
T1,T2,T3 |
ODD |
- |
1 |
Covered |
T1,T2,T13 |
ODD |
- |
0 |
Covered |
T1,T2,T3 |
307 if (!rst_src_ni) begin
-1-
308 src_fsm_cs <= EVEN;
==>
309 src_req_q <= 1'b0;
310 end else begin
311 src_fsm_cs <= src_fsm_ns;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T4,T5,T6 |
0 |
Covered |
T4,T5,T6 |
316 if (!rst_dst_ni) begin
-1-
317 dst_fsm_cs <= EVEN;
==>
318 dst_ack_q <= 1'b0;
319 end else begin
320 dst_fsm_cs <= dst_fsm_ns;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T4,T5,T6 |
0 |
Covered |
T4,T5,T6 |
Assert Coverage for Instance : tb.dut.u_reg.u_usb_meas_ctrl_en_cdc.u_arb.gen_wr_req.u_dst_update_sync
Assertion Details
SyncReqAckAckNeedsReq
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
36456208 |
11629 |
0 |
0 |
T1 |
37611 |
6 |
0 |
0 |
T2 |
16761 |
12 |
0 |
0 |
T3 |
24792 |
8 |
0 |
0 |
T10 |
0 |
43 |
0 |
0 |
T11 |
0 |
36 |
0 |
0 |
T13 |
0 |
32 |
0 |
0 |
T25 |
0 |
22 |
0 |
0 |
T29 |
0 |
11 |
0 |
0 |
T39 |
0 |
20 |
0 |
0 |
T40 |
0 |
1 |
0 |
0 |
T42 |
1956 |
0 |
0 |
0 |
T43 |
2175 |
0 |
0 |
0 |
T44 |
1508 |
0 |
0 |
0 |
T45 |
1876 |
0 |
0 |
0 |
T46 |
1399 |
0 |
0 |
0 |
T49 |
10120 |
0 |
0 |
0 |
T50 |
2203 |
0 |
0 |
0 |
SyncReqAckHoldReq
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
43597323 |
11050 |
0 |
0 |
T1 |
15356 |
6 |
0 |
0 |
T2 |
33524 |
12 |
0 |
0 |
T3 |
25320 |
8 |
0 |
0 |
T10 |
0 |
40 |
0 |
0 |
T11 |
0 |
30 |
0 |
0 |
T13 |
0 |
27 |
0 |
0 |
T25 |
0 |
22 |
0 |
0 |
T39 |
0 |
20 |
0 |
0 |
T42 |
998 |
0 |
0 |
0 |
T43 |
1043 |
0 |
0 |
0 |
T44 |
730 |
0 |
0 |
0 |
T45 |
919 |
0 |
0 |
0 |
T46 |
1278 |
0 |
0 |
0 |
T49 |
9716 |
0 |
0 |
0 |
T50 |
1078 |
0 |
0 |
0 |
T51 |
0 |
4 |
0 |
0 |
T52 |
0 |
11 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_io_meas.u_err_sync
| Line No. | Total | Covered | Percent |
TOTAL | | 36 | 36 | 100.00 |
CONT_ASSIGN | 55 | 0 | 0 | |
CONT_ASSIGN | 194 | 1 | 1 | 100.00 |
CONT_ASSIGN | 195 | 1 | 1 | 100.00 |
ALWAYS | 219 | 12 | 12 | 100.00 |
ALWAYS | 263 | 12 | 12 | 100.00 |
ALWAYS | 307 | 5 | 5 | 100.00 |
ALWAYS | 316 | 5 | 5 | 100.00 |
CONT_ASSIGN | 335 | 0 | 0 | |
ALWAYS | 339 | 0 | 0 | |
54 logic unused_req_chk;
55 unreachable assign unused_req_chk = req_chk_i;
56
57 if (EnRzHs) begin : gen_rz_hs_protocol
58 //////////////////
59 // RZ protocol //
60 //////////////////
61
62 // Types
63 typedef enum logic {
64 LoSt, HiSt
65 } rz_fsm_e;
66
67 // Signals
68 rz_fsm_e src_fsm_d, src_fsm_q;
69 rz_fsm_e dst_fsm_d, dst_fsm_q;
70 logic src_ack, dst_ack;
71 logic src_req, dst_req;
72
73 // REQ-side FSM (SRC domain)
74 always_comb begin : src_fsm
75 src_fsm_d = src_fsm_q;
76 src_ack_o = 1'b0;
77 src_req = 1'b0;
78
79 unique case (src_fsm_q)
80 LoSt: begin
81 // Wait for the ack to go back to zero before starting
82 // a new transaction.
83 if (!src_ack && src_req_i) begin
84 src_fsm_d = HiSt;
85 end
86 end
87 HiSt: begin
88 src_req = 1'b1;
89 // Forward the acknowledgement.
90 src_ack_o = src_ack;
91 // If request drops out, we go back to LoSt.
92 // If DST side asserts ack, we also go back to LoSt.
93 if (!src_req_i || src_ack) begin
94 src_fsm_d = LoSt;
95 end
96 end
97 //VCS coverage off
98 // pragma coverage off
99 default: ;
100 //VCS coverage on
101 // pragma coverage on
102 endcase
103 end
104
105 // Move ACK over to SRC domain.
106 prim_flop_2sync #(
107 .Width(1)
108 ) ack_sync (
109 .clk_i (clk_src_i),
110 .rst_ni (rst_src_ni),
111 .d_i (dst_ack),
112 .q_o (src_ack)
113 );
114
115 // Registers
116 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
117 if (!rst_src_ni) begin
118 src_fsm_q <= LoSt;
119 end else begin
120 src_fsm_q <= src_fsm_d;
121 end
122 end
123
124 // ACK-side FSM (DST domain)
125 always_comb begin : dst_fsm
126 dst_fsm_d = dst_fsm_q;
127 dst_req_o = 1'b0;
128 dst_ack = 1'b0;
129
130 unique case (dst_fsm_q)
131 LoSt: begin
132 if (dst_req) begin
133 // Forward the request.
134 dst_req_o = 1'b1;
135 // Wait for the request and acknowledge to be asserted
136 // before responding to the SRC side.
137 if (dst_ack_i) begin
138 dst_fsm_d = HiSt;
139 end
140 end
141 end
142 HiSt: begin
143 dst_ack = 1'b1;
144 // Wait for the request to drop back to zero.
145 if (!dst_req) begin
146 dst_fsm_d = LoSt;
147 end
148 end
149 //VCS coverage off
150 // pragma coverage off
151 default: ;
152 //VCS coverage on
153 // pragma coverage on
154 endcase
155 end
156
157 // Move REQ over to DST domain.
158 prim_flop_2sync #(
159 .Width(1)
160 ) req_sync (
161 .clk_i (clk_dst_i),
162 .rst_ni (rst_dst_ni),
163 .d_i (src_req),
164 .q_o (dst_req)
165 );
166
167 // Registers
168 always_ff @(posedge clk_dst_i or negedge rst_dst_ni) begin
169 if (!rst_dst_ni) begin
170 dst_fsm_q <= LoSt;
171 end else begin
172 dst_fsm_q <= dst_fsm_d;
173 end
174 end
175
176 end else begin : gen_nrz_hs_protocol
177 //////////////////
178 // NRZ protocol //
179 //////////////////
180
181 // Types
182 typedef enum logic {
183 EVEN, ODD
184 } sync_reqack_fsm_e;
185
186 // Signals
187 sync_reqack_fsm_e src_fsm_ns, src_fsm_cs;
188 sync_reqack_fsm_e dst_fsm_ns, dst_fsm_cs;
189
190 logic src_req_d, src_req_q, src_ack;
191 logic dst_ack_d, dst_ack_q, dst_req;
192 logic src_handshake, dst_handshake;
193
194 1/1 assign src_handshake = src_req_i & src_ack_o;
Tests: T2 T10 T11
195 1/1 assign dst_handshake = dst_req_o & dst_ack_i;
Tests: T2 T10 T11
196
197 // Move REQ over to DST domain.
198 prim_flop_2sync #(
199 .Width(1)
200 ) req_sync (
201 .clk_i (clk_dst_i),
202 .rst_ni (rst_dst_ni),
203 .d_i (src_req_q),
204 .q_o (dst_req)
205 );
206
207 // Move ACK over to SRC domain.
208 prim_flop_2sync #(
209 .Width(1)
210 ) ack_sync (
211 .clk_i (clk_src_i),
212 .rst_ni (rst_src_ni),
213 .d_i (dst_ack_q),
214 .q_o (src_ack)
215 );
216
217 // REQ-side FSM (SRC domain)
218 always_comb begin : src_fsm
219 1/1 src_fsm_ns = src_fsm_cs;
Tests: T2 T10 T11
220
221 // By default, we keep the internal REQ value and don't ACK.
222 1/1 src_req_d = src_req_q;
Tests: T2 T10 T11
223 1/1 src_ack_o = 1'b0;
Tests: T2 T10 T11
224
225 1/1 unique case (src_fsm_cs)
Tests: T2 T10 T11
226
227 EVEN: begin
228 // Simply forward REQ and ACK.
229 1/1 src_req_d = src_req_i;
Tests: T2 T10 T11
230 1/1 src_ack_o = src_ack;
Tests: T2 T10 T11
231
232 // The handshake is done for exactly 1 clock cycle.
233 1/1 if (src_handshake) begin
Tests: T2 T10 T11
234 1/1 src_fsm_ns = ODD;
Tests: T2 T10 T11
235 end
MISSING_ELSE
236 end
237
238 ODD: begin
239 // Internal REQ and ACK have inverted meaning now. If src_req_i is high again, this
240 // signals a new transaction.
241 1/1 src_req_d = ~src_req_i;
Tests: T2 T10 T11
242 1/1 src_ack_o = ~src_ack;
Tests: T2 T10 T11
243
244 // The handshake is done for exactly 1 clock cycle.
245 1/1 if (src_handshake) begin
Tests: T2 T10 T11
246 1/1 src_fsm_ns = EVEN;
Tests: T2 T10 T11
247 end
MISSING_ELSE
248 end
249
250 //VCS coverage off
251 // pragma coverage off
252
253 default: ;
254
255 //VCS coverage on
256 // pragma coverage on
257
258 endcase
259 end
260
261 // ACK-side FSM (DST domain)
262 always_comb begin : dst_fsm
263 1/1 dst_fsm_ns = dst_fsm_cs;
Tests: T2 T10 T11
264
265 // By default, we don't REQ and keep the internal ACK.
266 1/1 dst_req_o = 1'b0;
Tests: T2 T10 T11
267 1/1 dst_ack_d = dst_ack_q;
Tests: T2 T10 T11
268
269 1/1 unique case (dst_fsm_cs)
Tests: T2 T10 T11
270
271 EVEN: begin
272 // Simply forward REQ and ACK.
273 1/1 dst_req_o = dst_req;
Tests: T2 T10 T11
274 1/1 dst_ack_d = dst_ack_i;
Tests: T2 T10 T11
275
276 // The handshake is done for exactly 1 clock cycle.
277 1/1 if (dst_handshake) begin
Tests: T2 T10 T11
278 1/1 dst_fsm_ns = ODD;
Tests: T2 T10 T11
279 end
MISSING_ELSE
280 end
281
282 ODD: begin
283 // Internal REQ and ACK have inverted meaning now. If dst_req goes low, this signals a new
284 // transaction.
285 1/1 dst_req_o = ~dst_req;
Tests: T2 T10 T11
286 1/1 dst_ack_d = ~dst_ack_i;
Tests: T2 T10 T11
287
288 // The handshake is done for exactly 1 clock cycle.
289 1/1 if (dst_handshake) begin
Tests: T2 T10 T11
290 1/1 dst_fsm_ns = EVEN;
Tests: T2 T10 T11
291 end
MISSING_ELSE
292 end
293
294 //VCS coverage off
295 // pragma coverage off
296
297 default: ;
298
299 //VCS coverage on
300 // pragma coverage on
301
302 endcase
303 end
304
305 // Registers
306 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
307 1/1 if (!rst_src_ni) begin
Tests: T4 T5 T6
308 1/1 src_fsm_cs <= EVEN;
Tests: T4 T5 T6
309 1/1 src_req_q <= 1'b0;
Tests: T4 T5 T6
310 end else begin
311 1/1 src_fsm_cs <= src_fsm_ns;
Tests: T4 T5 T6
312 1/1 src_req_q <= src_req_d;
Tests: T4 T5 T6
313 end
314 end
315 always_ff @(posedge clk_dst_i or negedge rst_dst_ni) begin
316 1/1 if (!rst_dst_ni) begin
Tests: T4 T5 T6
317 1/1 dst_fsm_cs <= EVEN;
Tests: T4 T5 T6
318 1/1 dst_ack_q <= 1'b0;
Tests: T4 T5 T6
319 end else begin
320 1/1 dst_fsm_cs <= dst_fsm_ns;
Tests: T4 T5 T6
321 1/1 dst_ack_q <= dst_ack_d;
Tests: T4 T5 T6
322 end
323 end
324 end
325
326 ////////////////
327 // Assertions //
328 ////////////////
329
330 `ifdef INC_ASSERT
331 //VCS coverage off
332 // pragma coverage off
333
334 logic effective_rst_n;
335 unreachable assign effective_rst_n = rst_src_ni && rst_dst_ni;
336
337 logic chk_flag;
338 always_ff @(posedge clk_src_i or negedge effective_rst_n) begin
339 unreachable if (!effective_rst_n) begin
340 unreachable chk_flag <= '0;
341 unreachable end else if (src_req_i && !chk_flag) begin
342 unreachable chk_flag <= 1'b1;
343 end
==> MISSING_ELSE
Cond Coverage for Instance : tb.dut.u_io_meas.u_err_sync
| Total | Covered | Percent |
Conditions | 4 | 3 | 75.00 |
Logical | 4 | 3 | 75.00 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 194
EXPRESSION (src_req_i & src_ack_o)
----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T2,T10,T11 |
1 | 1 | Covered | T2,T10,T11 |
LINE 195
EXPRESSION (dst_req_o & dst_ack_i)
----1---- ----2----
-1- | -2- | Status | Tests | Exclude Annotation |
0 | 1 | Excluded | |
VC_COV_UNR |
1 | 0 | Excluded | |
VC_COV_UNR |
1 | 1 | Covered | T2,T10,T11 |
Branch Coverage for Instance : tb.dut.u_io_meas.u_err_sync
| Line No. | Total | Covered | Percent |
Branches |
|
12 |
12 |
100.00 |
CASE |
225 |
4 |
4 |
100.00 |
CASE |
269 |
4 |
4 |
100.00 |
IF |
307 |
2 |
2 |
100.00 |
IF |
316 |
2 |
2 |
100.00 |
225 unique case (src_fsm_cs)
-1-
226
227 EVEN: begin
228 // Simply forward REQ and ACK.
229 src_req_d = src_req_i;
230 src_ack_o = src_ack;
231
232 // The handshake is done for exactly 1 clock cycle.
233 if (src_handshake) begin
-2-
234 src_fsm_ns = ODD;
==>
235 end
MISSING_ELSE
==>
236 end
237
238 ODD: begin
239 // Internal REQ and ACK have inverted meaning now. If src_req_i is high again, this
240 // signals a new transaction.
241 src_req_d = ~src_req_i;
242 src_ack_o = ~src_ack;
243
244 // The handshake is done for exactly 1 clock cycle.
245 if (src_handshake) begin
-3-
246 src_fsm_ns = EVEN;
==>
247 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
EVEN |
1 |
- |
Covered |
T2,T10,T11 |
EVEN |
0 |
- |
Covered |
T2,T10,T11 |
ODD |
- |
1 |
Covered |
T2,T10,T11 |
ODD |
- |
0 |
Covered |
T2,T10,T11 |
269 unique case (dst_fsm_cs)
-1-
270
271 EVEN: begin
272 // Simply forward REQ and ACK.
273 dst_req_o = dst_req;
274 dst_ack_d = dst_ack_i;
275
276 // The handshake is done for exactly 1 clock cycle.
277 if (dst_handshake) begin
-2-
278 dst_fsm_ns = ODD;
==>
279 end
MISSING_ELSE
==>
280 end
281
282 ODD: begin
283 // Internal REQ and ACK have inverted meaning now. If dst_req goes low, this signals a new
284 // transaction.
285 dst_req_o = ~dst_req;
286 dst_ack_d = ~dst_ack_i;
287
288 // The handshake is done for exactly 1 clock cycle.
289 if (dst_handshake) begin
-3-
290 dst_fsm_ns = EVEN;
==>
291 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
EVEN |
1 |
- |
Covered |
T2,T10,T11 |
EVEN |
0 |
- |
Covered |
T2,T10,T11 |
ODD |
- |
1 |
Covered |
T2,T10,T11 |
ODD |
- |
0 |
Covered |
T2,T10,T11 |
307 if (!rst_src_ni) begin
-1-
308 src_fsm_cs <= EVEN;
==>
309 src_req_q <= 1'b0;
310 end else begin
311 src_fsm_cs <= src_fsm_ns;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T4,T5,T6 |
0 |
Covered |
T4,T5,T6 |
316 if (!rst_dst_ni) begin
-1-
317 dst_fsm_cs <= EVEN;
==>
318 dst_ack_q <= 1'b0;
319 end else begin
320 dst_fsm_cs <= dst_fsm_ns;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T4,T5,T6 |
0 |
Covered |
T4,T5,T6 |
Assert Coverage for Instance : tb.dut.u_io_meas.u_err_sync
Assertion Details
SyncReqAckAckNeedsReq
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
35642187 |
1657 |
0 |
0 |
T2 |
16761 |
4 |
0 |
0 |
T3 |
24792 |
0 |
0 |
0 |
T10 |
0 |
8 |
0 |
0 |
T11 |
0 |
10 |
0 |
0 |
T12 |
0 |
19 |
0 |
0 |
T13 |
39212 |
0 |
0 |
0 |
T14 |
0 |
10 |
0 |
0 |
T15 |
0 |
21 |
0 |
0 |
T16 |
0 |
11 |
0 |
0 |
T17 |
0 |
6 |
0 |
0 |
T19 |
0 |
18 |
0 |
0 |
T20 |
0 |
30 |
0 |
0 |
T42 |
1956 |
0 |
0 |
0 |
T43 |
2175 |
0 |
0 |
0 |
T44 |
1508 |
0 |
0 |
0 |
T45 |
1876 |
0 |
0 |
0 |
T46 |
1399 |
0 |
0 |
0 |
T47 |
2476 |
0 |
0 |
0 |
T48 |
1763 |
0 |
0 |
0 |
SyncReqAckHoldReq
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
79636599 |
1657 |
0 |
0 |
T2 |
67045 |
4 |
0 |
0 |
T3 |
50640 |
0 |
0 |
0 |
T10 |
0 |
8 |
0 |
0 |
T11 |
0 |
10 |
0 |
0 |
T12 |
0 |
19 |
0 |
0 |
T13 |
156850 |
0 |
0 |
0 |
T14 |
0 |
10 |
0 |
0 |
T15 |
0 |
21 |
0 |
0 |
T16 |
0 |
11 |
0 |
0 |
T17 |
0 |
6 |
0 |
0 |
T19 |
0 |
18 |
0 |
0 |
T20 |
0 |
30 |
0 |
0 |
T42 |
1997 |
0 |
0 |
0 |
T43 |
2088 |
0 |
0 |
0 |
T44 |
1462 |
0 |
0 |
0 |
T45 |
1837 |
0 |
0 |
0 |
T46 |
2580 |
0 |
0 |
0 |
T47 |
2377 |
0 |
0 |
0 |
T48 |
8058 |
0 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_io_div2_meas.u_err_sync
| Line No. | Total | Covered | Percent |
TOTAL | | 36 | 36 | 100.00 |
CONT_ASSIGN | 55 | 0 | 0 | |
CONT_ASSIGN | 194 | 1 | 1 | 100.00 |
CONT_ASSIGN | 195 | 1 | 1 | 100.00 |
ALWAYS | 219 | 12 | 12 | 100.00 |
ALWAYS | 263 | 12 | 12 | 100.00 |
ALWAYS | 307 | 5 | 5 | 100.00 |
ALWAYS | 316 | 5 | 5 | 100.00 |
CONT_ASSIGN | 335 | 0 | 0 | |
ALWAYS | 339 | 0 | 0 | |
54 logic unused_req_chk;
55 unreachable assign unused_req_chk = req_chk_i;
56
57 if (EnRzHs) begin : gen_rz_hs_protocol
58 //////////////////
59 // RZ protocol //
60 //////////////////
61
62 // Types
63 typedef enum logic {
64 LoSt, HiSt
65 } rz_fsm_e;
66
67 // Signals
68 rz_fsm_e src_fsm_d, src_fsm_q;
69 rz_fsm_e dst_fsm_d, dst_fsm_q;
70 logic src_ack, dst_ack;
71 logic src_req, dst_req;
72
73 // REQ-side FSM (SRC domain)
74 always_comb begin : src_fsm
75 src_fsm_d = src_fsm_q;
76 src_ack_o = 1'b0;
77 src_req = 1'b0;
78
79 unique case (src_fsm_q)
80 LoSt: begin
81 // Wait for the ack to go back to zero before starting
82 // a new transaction.
83 if (!src_ack && src_req_i) begin
84 src_fsm_d = HiSt;
85 end
86 end
87 HiSt: begin
88 src_req = 1'b1;
89 // Forward the acknowledgement.
90 src_ack_o = src_ack;
91 // If request drops out, we go back to LoSt.
92 // If DST side asserts ack, we also go back to LoSt.
93 if (!src_req_i || src_ack) begin
94 src_fsm_d = LoSt;
95 end
96 end
97 //VCS coverage off
98 // pragma coverage off
99 default: ;
100 //VCS coverage on
101 // pragma coverage on
102 endcase
103 end
104
105 // Move ACK over to SRC domain.
106 prim_flop_2sync #(
107 .Width(1)
108 ) ack_sync (
109 .clk_i (clk_src_i),
110 .rst_ni (rst_src_ni),
111 .d_i (dst_ack),
112 .q_o (src_ack)
113 );
114
115 // Registers
116 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
117 if (!rst_src_ni) begin
118 src_fsm_q <= LoSt;
119 end else begin
120 src_fsm_q <= src_fsm_d;
121 end
122 end
123
124 // ACK-side FSM (DST domain)
125 always_comb begin : dst_fsm
126 dst_fsm_d = dst_fsm_q;
127 dst_req_o = 1'b0;
128 dst_ack = 1'b0;
129
130 unique case (dst_fsm_q)
131 LoSt: begin
132 if (dst_req) begin
133 // Forward the request.
134 dst_req_o = 1'b1;
135 // Wait for the request and acknowledge to be asserted
136 // before responding to the SRC side.
137 if (dst_ack_i) begin
138 dst_fsm_d = HiSt;
139 end
140 end
141 end
142 HiSt: begin
143 dst_ack = 1'b1;
144 // Wait for the request to drop back to zero.
145 if (!dst_req) begin
146 dst_fsm_d = LoSt;
147 end
148 end
149 //VCS coverage off
150 // pragma coverage off
151 default: ;
152 //VCS coverage on
153 // pragma coverage on
154 endcase
155 end
156
157 // Move REQ over to DST domain.
158 prim_flop_2sync #(
159 .Width(1)
160 ) req_sync (
161 .clk_i (clk_dst_i),
162 .rst_ni (rst_dst_ni),
163 .d_i (src_req),
164 .q_o (dst_req)
165 );
166
167 // Registers
168 always_ff @(posedge clk_dst_i or negedge rst_dst_ni) begin
169 if (!rst_dst_ni) begin
170 dst_fsm_q <= LoSt;
171 end else begin
172 dst_fsm_q <= dst_fsm_d;
173 end
174 end
175
176 end else begin : gen_nrz_hs_protocol
177 //////////////////
178 // NRZ protocol //
179 //////////////////
180
181 // Types
182 typedef enum logic {
183 EVEN, ODD
184 } sync_reqack_fsm_e;
185
186 // Signals
187 sync_reqack_fsm_e src_fsm_ns, src_fsm_cs;
188 sync_reqack_fsm_e dst_fsm_ns, dst_fsm_cs;
189
190 logic src_req_d, src_req_q, src_ack;
191 logic dst_ack_d, dst_ack_q, dst_req;
192 logic src_handshake, dst_handshake;
193
194 1/1 assign src_handshake = src_req_i & src_ack_o;
Tests: T10 T12 T15
195 1/1 assign dst_handshake = dst_req_o & dst_ack_i;
Tests: T10 T12 T15
196
197 // Move REQ over to DST domain.
198 prim_flop_2sync #(
199 .Width(1)
200 ) req_sync (
201 .clk_i (clk_dst_i),
202 .rst_ni (rst_dst_ni),
203 .d_i (src_req_q),
204 .q_o (dst_req)
205 );
206
207 // Move ACK over to SRC domain.
208 prim_flop_2sync #(
209 .Width(1)
210 ) ack_sync (
211 .clk_i (clk_src_i),
212 .rst_ni (rst_src_ni),
213 .d_i (dst_ack_q),
214 .q_o (src_ack)
215 );
216
217 // REQ-side FSM (SRC domain)
218 always_comb begin : src_fsm
219 1/1 src_fsm_ns = src_fsm_cs;
Tests: T10 T12 T15
220
221 // By default, we keep the internal REQ value and don't ACK.
222 1/1 src_req_d = src_req_q;
Tests: T10 T12 T15
223 1/1 src_ack_o = 1'b0;
Tests: T10 T12 T15
224
225 1/1 unique case (src_fsm_cs)
Tests: T10 T12 T15
226
227 EVEN: begin
228 // Simply forward REQ and ACK.
229 1/1 src_req_d = src_req_i;
Tests: T10 T12 T15
230 1/1 src_ack_o = src_ack;
Tests: T10 T12 T15
231
232 // The handshake is done for exactly 1 clock cycle.
233 1/1 if (src_handshake) begin
Tests: T10 T12 T15
234 1/1 src_fsm_ns = ODD;
Tests: T10 T12 T15
235 end
MISSING_ELSE
236 end
237
238 ODD: begin
239 // Internal REQ and ACK have inverted meaning now. If src_req_i is high again, this
240 // signals a new transaction.
241 1/1 src_req_d = ~src_req_i;
Tests: T10 T12 T15
242 1/1 src_ack_o = ~src_ack;
Tests: T10 T12 T15
243
244 // The handshake is done for exactly 1 clock cycle.
245 1/1 if (src_handshake) begin
Tests: T10 T12 T15
246 1/1 src_fsm_ns = EVEN;
Tests: T10 T12 T15
247 end
MISSING_ELSE
248 end
249
250 //VCS coverage off
251 // pragma coverage off
252
253 default: ;
254
255 //VCS coverage on
256 // pragma coverage on
257
258 endcase
259 end
260
261 // ACK-side FSM (DST domain)
262 always_comb begin : dst_fsm
263 1/1 dst_fsm_ns = dst_fsm_cs;
Tests: T10 T12 T15
264
265 // By default, we don't REQ and keep the internal ACK.
266 1/1 dst_req_o = 1'b0;
Tests: T10 T12 T15
267 1/1 dst_ack_d = dst_ack_q;
Tests: T10 T12 T15
268
269 1/1 unique case (dst_fsm_cs)
Tests: T10 T12 T15
270
271 EVEN: begin
272 // Simply forward REQ and ACK.
273 1/1 dst_req_o = dst_req;
Tests: T10 T12 T15
274 1/1 dst_ack_d = dst_ack_i;
Tests: T10 T12 T15
275
276 // The handshake is done for exactly 1 clock cycle.
277 1/1 if (dst_handshake) begin
Tests: T10 T12 T15
278 1/1 dst_fsm_ns = ODD;
Tests: T10 T12 T15
279 end
MISSING_ELSE
280 end
281
282 ODD: begin
283 // Internal REQ and ACK have inverted meaning now. If dst_req goes low, this signals a new
284 // transaction.
285 1/1 dst_req_o = ~dst_req;
Tests: T10 T12 T15
286 1/1 dst_ack_d = ~dst_ack_i;
Tests: T10 T12 T15
287
288 // The handshake is done for exactly 1 clock cycle.
289 1/1 if (dst_handshake) begin
Tests: T10 T12 T15
290 1/1 dst_fsm_ns = EVEN;
Tests: T10 T12 T15
291 end
MISSING_ELSE
292 end
293
294 //VCS coverage off
295 // pragma coverage off
296
297 default: ;
298
299 //VCS coverage on
300 // pragma coverage on
301
302 endcase
303 end
304
305 // Registers
306 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
307 1/1 if (!rst_src_ni) begin
Tests: T4 T5 T6
308 1/1 src_fsm_cs <= EVEN;
Tests: T4 T5 T6
309 1/1 src_req_q <= 1'b0;
Tests: T4 T5 T6
310 end else begin
311 1/1 src_fsm_cs <= src_fsm_ns;
Tests: T4 T5 T6
312 1/1 src_req_q <= src_req_d;
Tests: T4 T5 T6
313 end
314 end
315 always_ff @(posedge clk_dst_i or negedge rst_dst_ni) begin
316 1/1 if (!rst_dst_ni) begin
Tests: T4 T5 T6
317 1/1 dst_fsm_cs <= EVEN;
Tests: T4 T5 T6
318 1/1 dst_ack_q <= 1'b0;
Tests: T4 T5 T6
319 end else begin
320 1/1 dst_fsm_cs <= dst_fsm_ns;
Tests: T4 T5 T6
321 1/1 dst_ack_q <= dst_ack_d;
Tests: T4 T5 T6
322 end
323 end
324 end
325
326 ////////////////
327 // Assertions //
328 ////////////////
329
330 `ifdef INC_ASSERT
331 //VCS coverage off
332 // pragma coverage off
333
334 logic effective_rst_n;
335 unreachable assign effective_rst_n = rst_src_ni && rst_dst_ni;
336
337 logic chk_flag;
338 always_ff @(posedge clk_src_i or negedge effective_rst_n) begin
339 unreachable if (!effective_rst_n) begin
340 unreachable chk_flag <= '0;
341 unreachable end else if (src_req_i && !chk_flag) begin
342 unreachable chk_flag <= 1'b1;
343 end
==> MISSING_ELSE
Cond Coverage for Instance : tb.dut.u_io_div2_meas.u_err_sync
| Total | Covered | Percent |
Conditions | 4 | 3 | 75.00 |
Logical | 4 | 3 | 75.00 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 194
EXPRESSION (src_req_i & src_ack_o)
----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T10,T12,T15 |
1 | 1 | Covered | T10,T12,T15 |
LINE 195
EXPRESSION (dst_req_o & dst_ack_i)
----1---- ----2----
-1- | -2- | Status | Tests | Exclude Annotation |
0 | 1 | Excluded | |
VC_COV_UNR |
1 | 0 | Excluded | |
VC_COV_UNR |
1 | 1 | Covered | T10,T12,T15 |
Branch Coverage for Instance : tb.dut.u_io_div2_meas.u_err_sync
| Line No. | Total | Covered | Percent |
Branches |
|
12 |
12 |
100.00 |
CASE |
225 |
4 |
4 |
100.00 |
CASE |
269 |
4 |
4 |
100.00 |
IF |
307 |
2 |
2 |
100.00 |
IF |
316 |
2 |
2 |
100.00 |
225 unique case (src_fsm_cs)
-1-
226
227 EVEN: begin
228 // Simply forward REQ and ACK.
229 src_req_d = src_req_i;
230 src_ack_o = src_ack;
231
232 // The handshake is done for exactly 1 clock cycle.
233 if (src_handshake) begin
-2-
234 src_fsm_ns = ODD;
==>
235 end
MISSING_ELSE
==>
236 end
237
238 ODD: begin
239 // Internal REQ and ACK have inverted meaning now. If src_req_i is high again, this
240 // signals a new transaction.
241 src_req_d = ~src_req_i;
242 src_ack_o = ~src_ack;
243
244 // The handshake is done for exactly 1 clock cycle.
245 if (src_handshake) begin
-3-
246 src_fsm_ns = EVEN;
==>
247 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
EVEN |
1 |
- |
Covered |
T10,T12,T15 |
EVEN |
0 |
- |
Covered |
T10,T12,T15 |
ODD |
- |
1 |
Covered |
T10,T12,T15 |
ODD |
- |
0 |
Covered |
T10,T12,T15 |
269 unique case (dst_fsm_cs)
-1-
270
271 EVEN: begin
272 // Simply forward REQ and ACK.
273 dst_req_o = dst_req;
274 dst_ack_d = dst_ack_i;
275
276 // The handshake is done for exactly 1 clock cycle.
277 if (dst_handshake) begin
-2-
278 dst_fsm_ns = ODD;
==>
279 end
MISSING_ELSE
==>
280 end
281
282 ODD: begin
283 // Internal REQ and ACK have inverted meaning now. If dst_req goes low, this signals a new
284 // transaction.
285 dst_req_o = ~dst_req;
286 dst_ack_d = ~dst_ack_i;
287
288 // The handshake is done for exactly 1 clock cycle.
289 if (dst_handshake) begin
-3-
290 dst_fsm_ns = EVEN;
==>
291 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
EVEN |
1 |
- |
Covered |
T10,T12,T15 |
EVEN |
0 |
- |
Covered |
T10,T12,T15 |
ODD |
- |
1 |
Covered |
T10,T12,T15 |
ODD |
- |
0 |
Covered |
T10,T12,T15 |
307 if (!rst_src_ni) begin
-1-
308 src_fsm_cs <= EVEN;
==>
309 src_req_q <= 1'b0;
310 end else begin
311 src_fsm_cs <= src_fsm_ns;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T4,T5,T6 |
0 |
Covered |
T4,T5,T6 |
316 if (!rst_dst_ni) begin
-1-
317 dst_fsm_cs <= EVEN;
==>
318 dst_ack_q <= 1'b0;
319 end else begin
320 dst_fsm_cs <= dst_fsm_ns;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T4,T5,T6 |
0 |
Covered |
T4,T5,T6 |
Assert Coverage for Instance : tb.dut.u_io_div2_meas.u_err_sync
Assertion Details
SyncReqAckAckNeedsReq
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
35642187 |
1393 |
0 |
0 |
T10 |
22369 |
8 |
0 |
0 |
T12 |
0 |
8 |
0 |
0 |
T15 |
0 |
4 |
0 |
0 |
T16 |
0 |
17 |
0 |
0 |
T17 |
0 |
4 |
0 |
0 |
T18 |
0 |
4 |
0 |
0 |
T19 |
0 |
3 |
0 |
0 |
T20 |
0 |
33 |
0 |
0 |
T21 |
1794 |
0 |
0 |
0 |
T22 |
1124 |
0 |
0 |
0 |
T23 |
3381 |
0 |
0 |
0 |
T24 |
1393 |
0 |
0 |
0 |
T25 |
31366 |
0 |
0 |
0 |
T26 |
1766 |
0 |
0 |
0 |
T27 |
1644 |
0 |
0 |
0 |
T28 |
1321 |
0 |
0 |
0 |
T29 |
60334 |
0 |
0 |
0 |
T37 |
0 |
6 |
0 |
0 |
T38 |
0 |
11 |
0 |
0 |
SyncReqAckHoldReq
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
38935348 |
1393 |
0 |
0 |
T10 |
119244 |
8 |
0 |
0 |
T12 |
0 |
8 |
0 |
0 |
T15 |
0 |
4 |
0 |
0 |
T16 |
0 |
17 |
0 |
0 |
T17 |
0 |
4 |
0 |
0 |
T18 |
0 |
4 |
0 |
0 |
T19 |
0 |
3 |
0 |
0 |
T20 |
0 |
33 |
0 |
0 |
T21 |
822 |
0 |
0 |
0 |
T22 |
946 |
0 |
0 |
0 |
T23 |
1612 |
0 |
0 |
0 |
T24 |
622 |
0 |
0 |
0 |
T25 |
45244 |
0 |
0 |
0 |
T26 |
1533 |
0 |
0 |
0 |
T27 |
1301 |
0 |
0 |
0 |
T28 |
2604 |
0 |
0 |
0 |
T29 |
16782 |
0 |
0 |
0 |
T37 |
0 |
6 |
0 |
0 |
T38 |
0 |
11 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_io_div4_meas.u_err_sync
| Line No. | Total | Covered | Percent |
TOTAL | | 36 | 36 | 100.00 |
CONT_ASSIGN | 55 | 0 | 0 | |
CONT_ASSIGN | 194 | 1 | 1 | 100.00 |
CONT_ASSIGN | 195 | 1 | 1 | 100.00 |
ALWAYS | 219 | 12 | 12 | 100.00 |
ALWAYS | 263 | 12 | 12 | 100.00 |
ALWAYS | 307 | 5 | 5 | 100.00 |
ALWAYS | 316 | 5 | 5 | 100.00 |
CONT_ASSIGN | 335 | 0 | 0 | |
ALWAYS | 339 | 0 | 0 | |
54 logic unused_req_chk;
55 unreachable assign unused_req_chk = req_chk_i;
56
57 if (EnRzHs) begin : gen_rz_hs_protocol
58 //////////////////
59 // RZ protocol //
60 //////////////////
61
62 // Types
63 typedef enum logic {
64 LoSt, HiSt
65 } rz_fsm_e;
66
67 // Signals
68 rz_fsm_e src_fsm_d, src_fsm_q;
69 rz_fsm_e dst_fsm_d, dst_fsm_q;
70 logic src_ack, dst_ack;
71 logic src_req, dst_req;
72
73 // REQ-side FSM (SRC domain)
74 always_comb begin : src_fsm
75 src_fsm_d = src_fsm_q;
76 src_ack_o = 1'b0;
77 src_req = 1'b0;
78
79 unique case (src_fsm_q)
80 LoSt: begin
81 // Wait for the ack to go back to zero before starting
82 // a new transaction.
83 if (!src_ack && src_req_i) begin
84 src_fsm_d = HiSt;
85 end
86 end
87 HiSt: begin
88 src_req = 1'b1;
89 // Forward the acknowledgement.
90 src_ack_o = src_ack;
91 // If request drops out, we go back to LoSt.
92 // If DST side asserts ack, we also go back to LoSt.
93 if (!src_req_i || src_ack) begin
94 src_fsm_d = LoSt;
95 end
96 end
97 //VCS coverage off
98 // pragma coverage off
99 default: ;
100 //VCS coverage on
101 // pragma coverage on
102 endcase
103 end
104
105 // Move ACK over to SRC domain.
106 prim_flop_2sync #(
107 .Width(1)
108 ) ack_sync (
109 .clk_i (clk_src_i),
110 .rst_ni (rst_src_ni),
111 .d_i (dst_ack),
112 .q_o (src_ack)
113 );
114
115 // Registers
116 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
117 if (!rst_src_ni) begin
118 src_fsm_q <= LoSt;
119 end else begin
120 src_fsm_q <= src_fsm_d;
121 end
122 end
123
124 // ACK-side FSM (DST domain)
125 always_comb begin : dst_fsm
126 dst_fsm_d = dst_fsm_q;
127 dst_req_o = 1'b0;
128 dst_ack = 1'b0;
129
130 unique case (dst_fsm_q)
131 LoSt: begin
132 if (dst_req) begin
133 // Forward the request.
134 dst_req_o = 1'b1;
135 // Wait for the request and acknowledge to be asserted
136 // before responding to the SRC side.
137 if (dst_ack_i) begin
138 dst_fsm_d = HiSt;
139 end
140 end
141 end
142 HiSt: begin
143 dst_ack = 1'b1;
144 // Wait for the request to drop back to zero.
145 if (!dst_req) begin
146 dst_fsm_d = LoSt;
147 end
148 end
149 //VCS coverage off
150 // pragma coverage off
151 default: ;
152 //VCS coverage on
153 // pragma coverage on
154 endcase
155 end
156
157 // Move REQ over to DST domain.
158 prim_flop_2sync #(
159 .Width(1)
160 ) req_sync (
161 .clk_i (clk_dst_i),
162 .rst_ni (rst_dst_ni),
163 .d_i (src_req),
164 .q_o (dst_req)
165 );
166
167 // Registers
168 always_ff @(posedge clk_dst_i or negedge rst_dst_ni) begin
169 if (!rst_dst_ni) begin
170 dst_fsm_q <= LoSt;
171 end else begin
172 dst_fsm_q <= dst_fsm_d;
173 end
174 end
175
176 end else begin : gen_nrz_hs_protocol
177 //////////////////
178 // NRZ protocol //
179 //////////////////
180
181 // Types
182 typedef enum logic {
183 EVEN, ODD
184 } sync_reqack_fsm_e;
185
186 // Signals
187 sync_reqack_fsm_e src_fsm_ns, src_fsm_cs;
188 sync_reqack_fsm_e dst_fsm_ns, dst_fsm_cs;
189
190 logic src_req_d, src_req_q, src_ack;
191 logic dst_ack_d, dst_ack_q, dst_req;
192 logic src_handshake, dst_handshake;
193
194 1/1 assign src_handshake = src_req_i & src_ack_o;
Tests: T2 T10 T11
195 1/1 assign dst_handshake = dst_req_o & dst_ack_i;
Tests: T2 T10 T11
196
197 // Move REQ over to DST domain.
198 prim_flop_2sync #(
199 .Width(1)
200 ) req_sync (
201 .clk_i (clk_dst_i),
202 .rst_ni (rst_dst_ni),
203 .d_i (src_req_q),
204 .q_o (dst_req)
205 );
206
207 // Move ACK over to SRC domain.
208 prim_flop_2sync #(
209 .Width(1)
210 ) ack_sync (
211 .clk_i (clk_src_i),
212 .rst_ni (rst_src_ni),
213 .d_i (dst_ack_q),
214 .q_o (src_ack)
215 );
216
217 // REQ-side FSM (SRC domain)
218 always_comb begin : src_fsm
219 1/1 src_fsm_ns = src_fsm_cs;
Tests: T2 T10 T11
220
221 // By default, we keep the internal REQ value and don't ACK.
222 1/1 src_req_d = src_req_q;
Tests: T2 T10 T11
223 1/1 src_ack_o = 1'b0;
Tests: T2 T10 T11
224
225 1/1 unique case (src_fsm_cs)
Tests: T2 T10 T11
226
227 EVEN: begin
228 // Simply forward REQ and ACK.
229 1/1 src_req_d = src_req_i;
Tests: T2 T10 T11
230 1/1 src_ack_o = src_ack;
Tests: T2 T10 T11
231
232 // The handshake is done for exactly 1 clock cycle.
233 1/1 if (src_handshake) begin
Tests: T2 T10 T11
234 1/1 src_fsm_ns = ODD;
Tests: T2 T10 T11
235 end
MISSING_ELSE
236 end
237
238 ODD: begin
239 // Internal REQ and ACK have inverted meaning now. If src_req_i is high again, this
240 // signals a new transaction.
241 1/1 src_req_d = ~src_req_i;
Tests: T2 T10 T11
242 1/1 src_ack_o = ~src_ack;
Tests: T2 T10 T11
243
244 // The handshake is done for exactly 1 clock cycle.
245 1/1 if (src_handshake) begin
Tests: T2 T10 T11
246 1/1 src_fsm_ns = EVEN;
Tests: T2 T10 T11
247 end
MISSING_ELSE
248 end
249
250 //VCS coverage off
251 // pragma coverage off
252
253 default: ;
254
255 //VCS coverage on
256 // pragma coverage on
257
258 endcase
259 end
260
261 // ACK-side FSM (DST domain)
262 always_comb begin : dst_fsm
263 1/1 dst_fsm_ns = dst_fsm_cs;
Tests: T2 T10 T11
264
265 // By default, we don't REQ and keep the internal ACK.
266 1/1 dst_req_o = 1'b0;
Tests: T2 T10 T11
267 1/1 dst_ack_d = dst_ack_q;
Tests: T2 T10 T11
268
269 1/1 unique case (dst_fsm_cs)
Tests: T2 T10 T11
270
271 EVEN: begin
272 // Simply forward REQ and ACK.
273 1/1 dst_req_o = dst_req;
Tests: T2 T10 T11
274 1/1 dst_ack_d = dst_ack_i;
Tests: T2 T10 T11
275
276 // The handshake is done for exactly 1 clock cycle.
277 1/1 if (dst_handshake) begin
Tests: T2 T10 T11
278 1/1 dst_fsm_ns = ODD;
Tests: T2 T10 T11
279 end
MISSING_ELSE
280 end
281
282 ODD: begin
283 // Internal REQ and ACK have inverted meaning now. If dst_req goes low, this signals a new
284 // transaction.
285 1/1 dst_req_o = ~dst_req;
Tests: T2 T10 T11
286 1/1 dst_ack_d = ~dst_ack_i;
Tests: T2 T10 T11
287
288 // The handshake is done for exactly 1 clock cycle.
289 1/1 if (dst_handshake) begin
Tests: T2 T10 T11
290 1/1 dst_fsm_ns = EVEN;
Tests: T2 T10 T11
291 end
MISSING_ELSE
292 end
293
294 //VCS coverage off
295 // pragma coverage off
296
297 default: ;
298
299 //VCS coverage on
300 // pragma coverage on
301
302 endcase
303 end
304
305 // Registers
306 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
307 1/1 if (!rst_src_ni) begin
Tests: T4 T5 T6
308 1/1 src_fsm_cs <= EVEN;
Tests: T4 T5 T6
309 1/1 src_req_q <= 1'b0;
Tests: T4 T5 T6
310 end else begin
311 1/1 src_fsm_cs <= src_fsm_ns;
Tests: T4 T5 T6
312 1/1 src_req_q <= src_req_d;
Tests: T4 T5 T6
313 end
314 end
315 always_ff @(posedge clk_dst_i or negedge rst_dst_ni) begin
316 1/1 if (!rst_dst_ni) begin
Tests: T4 T5 T6
317 1/1 dst_fsm_cs <= EVEN;
Tests: T4 T5 T6
318 1/1 dst_ack_q <= 1'b0;
Tests: T4 T5 T6
319 end else begin
320 1/1 dst_fsm_cs <= dst_fsm_ns;
Tests: T4 T5 T6
321 1/1 dst_ack_q <= dst_ack_d;
Tests: T4 T5 T6
322 end
323 end
324 end
325
326 ////////////////
327 // Assertions //
328 ////////////////
329
330 `ifdef INC_ASSERT
331 //VCS coverage off
332 // pragma coverage off
333
334 logic effective_rst_n;
335 unreachable assign effective_rst_n = rst_src_ni && rst_dst_ni;
336
337 logic chk_flag;
338 always_ff @(posedge clk_src_i or negedge effective_rst_n) begin
339 unreachable if (!effective_rst_n) begin
340 unreachable chk_flag <= '0;
341 unreachable end else if (src_req_i && !chk_flag) begin
342 unreachable chk_flag <= 1'b1;
343 end
==> MISSING_ELSE
Cond Coverage for Instance : tb.dut.u_io_div4_meas.u_err_sync
| Total | Covered | Percent |
Conditions | 4 | 3 | 75.00 |
Logical | 4 | 3 | 75.00 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 194
EXPRESSION (src_req_i & src_ack_o)
----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T2,T10,T11 |
1 | 1 | Covered | T2,T10,T11 |
LINE 195
EXPRESSION (dst_req_o & dst_ack_i)
----1---- ----2----
-1- | -2- | Status | Tests | Exclude Annotation |
0 | 1 | Excluded | |
VC_COV_UNR |
1 | 0 | Excluded | |
VC_COV_UNR |
1 | 1 | Covered | T2,T10,T11 |
Branch Coverage for Instance : tb.dut.u_io_div4_meas.u_err_sync
| Line No. | Total | Covered | Percent |
Branches |
|
12 |
12 |
100.00 |
CASE |
225 |
4 |
4 |
100.00 |
CASE |
269 |
4 |
4 |
100.00 |
IF |
307 |
2 |
2 |
100.00 |
IF |
316 |
2 |
2 |
100.00 |
225 unique case (src_fsm_cs)
-1-
226
227 EVEN: begin
228 // Simply forward REQ and ACK.
229 src_req_d = src_req_i;
230 src_ack_o = src_ack;
231
232 // The handshake is done for exactly 1 clock cycle.
233 if (src_handshake) begin
-2-
234 src_fsm_ns = ODD;
==>
235 end
MISSING_ELSE
==>
236 end
237
238 ODD: begin
239 // Internal REQ and ACK have inverted meaning now. If src_req_i is high again, this
240 // signals a new transaction.
241 src_req_d = ~src_req_i;
242 src_ack_o = ~src_ack;
243
244 // The handshake is done for exactly 1 clock cycle.
245 if (src_handshake) begin
-3-
246 src_fsm_ns = EVEN;
==>
247 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
EVEN |
1 |
- |
Covered |
T2,T10,T11 |
EVEN |
0 |
- |
Covered |
T2,T10,T11 |
ODD |
- |
1 |
Covered |
T2,T10,T11 |
ODD |
- |
0 |
Covered |
T2,T10,T11 |
269 unique case (dst_fsm_cs)
-1-
270
271 EVEN: begin
272 // Simply forward REQ and ACK.
273 dst_req_o = dst_req;
274 dst_ack_d = dst_ack_i;
275
276 // The handshake is done for exactly 1 clock cycle.
277 if (dst_handshake) begin
-2-
278 dst_fsm_ns = ODD;
==>
279 end
MISSING_ELSE
==>
280 end
281
282 ODD: begin
283 // Internal REQ and ACK have inverted meaning now. If dst_req goes low, this signals a new
284 // transaction.
285 dst_req_o = ~dst_req;
286 dst_ack_d = ~dst_ack_i;
287
288 // The handshake is done for exactly 1 clock cycle.
289 if (dst_handshake) begin
-3-
290 dst_fsm_ns = EVEN;
==>
291 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
EVEN |
1 |
- |
Covered |
T2,T10,T11 |
EVEN |
0 |
- |
Covered |
T2,T10,T11 |
ODD |
- |
1 |
Covered |
T2,T10,T11 |
ODD |
- |
0 |
Covered |
T2,T10,T11 |
307 if (!rst_src_ni) begin
-1-
308 src_fsm_cs <= EVEN;
==>
309 src_req_q <= 1'b0;
310 end else begin
311 src_fsm_cs <= src_fsm_ns;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T4,T5,T6 |
0 |
Covered |
T4,T5,T6 |
316 if (!rst_dst_ni) begin
-1-
317 dst_fsm_cs <= EVEN;
==>
318 dst_ack_q <= 1'b0;
319 end else begin
320 dst_fsm_cs <= dst_fsm_ns;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T4,T5,T6 |
0 |
Covered |
T4,T5,T6 |
Assert Coverage for Instance : tb.dut.u_io_div4_meas.u_err_sync
Assertion Details
SyncReqAckAckNeedsReq
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
35642187 |
1299 |
0 |
0 |
T2 |
16761 |
7 |
0 |
0 |
T3 |
24792 |
0 |
0 |
0 |
T10 |
0 |
20 |
0 |
0 |
T11 |
0 |
7 |
0 |
0 |
T12 |
0 |
7 |
0 |
0 |
T13 |
39212 |
0 |
0 |
0 |
T14 |
0 |
4 |
0 |
0 |
T16 |
0 |
6 |
0 |
0 |
T18 |
0 |
4 |
0 |
0 |
T19 |
0 |
15 |
0 |
0 |
T20 |
0 |
21 |
0 |
0 |
T37 |
0 |
6 |
0 |
0 |
T42 |
1956 |
0 |
0 |
0 |
T43 |
2175 |
0 |
0 |
0 |
T44 |
1508 |
0 |
0 |
0 |
T45 |
1876 |
0 |
0 |
0 |
T46 |
1399 |
0 |
0 |
0 |
T47 |
2476 |
0 |
0 |
0 |
T48 |
1763 |
0 |
0 |
0 |
SyncReqAckHoldReq
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
19467275 |
1299 |
0 |
0 |
T2 |
16734 |
7 |
0 |
0 |
T3 |
6164 |
0 |
0 |
0 |
T10 |
0 |
20 |
0 |
0 |
T11 |
0 |
7 |
0 |
0 |
T12 |
0 |
7 |
0 |
0 |
T13 |
25037 |
0 |
0 |
0 |
T14 |
0 |
4 |
0 |
0 |
T16 |
0 |
6 |
0 |
0 |
T18 |
0 |
4 |
0 |
0 |
T19 |
0 |
15 |
0 |
0 |
T20 |
0 |
21 |
0 |
0 |
T37 |
0 |
6 |
0 |
0 |
T42 |
472 |
0 |
0 |
0 |
T43 |
558 |
0 |
0 |
0 |
T44 |
356 |
0 |
0 |
0 |
T45 |
439 |
0 |
0 |
0 |
T46 |
635 |
0 |
0 |
0 |
T47 |
634 |
0 |
0 |
0 |
T48 |
2005 |
0 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_main_meas.u_err_sync
| Line No. | Total | Covered | Percent |
TOTAL | | 36 | 36 | 100.00 |
CONT_ASSIGN | 55 | 0 | 0 | |
CONT_ASSIGN | 194 | 1 | 1 | 100.00 |
CONT_ASSIGN | 195 | 1 | 1 | 100.00 |
ALWAYS | 219 | 12 | 12 | 100.00 |
ALWAYS | 263 | 12 | 12 | 100.00 |
ALWAYS | 307 | 5 | 5 | 100.00 |
ALWAYS | 316 | 5 | 5 | 100.00 |
CONT_ASSIGN | 335 | 0 | 0 | |
ALWAYS | 339 | 0 | 0 | |
54 logic unused_req_chk;
55 unreachable assign unused_req_chk = req_chk_i;
56
57 if (EnRzHs) begin : gen_rz_hs_protocol
58 //////////////////
59 // RZ protocol //
60 //////////////////
61
62 // Types
63 typedef enum logic {
64 LoSt, HiSt
65 } rz_fsm_e;
66
67 // Signals
68 rz_fsm_e src_fsm_d, src_fsm_q;
69 rz_fsm_e dst_fsm_d, dst_fsm_q;
70 logic src_ack, dst_ack;
71 logic src_req, dst_req;
72
73 // REQ-side FSM (SRC domain)
74 always_comb begin : src_fsm
75 src_fsm_d = src_fsm_q;
76 src_ack_o = 1'b0;
77 src_req = 1'b0;
78
79 unique case (src_fsm_q)
80 LoSt: begin
81 // Wait for the ack to go back to zero before starting
82 // a new transaction.
83 if (!src_ack && src_req_i) begin
84 src_fsm_d = HiSt;
85 end
86 end
87 HiSt: begin
88 src_req = 1'b1;
89 // Forward the acknowledgement.
90 src_ack_o = src_ack;
91 // If request drops out, we go back to LoSt.
92 // If DST side asserts ack, we also go back to LoSt.
93 if (!src_req_i || src_ack) begin
94 src_fsm_d = LoSt;
95 end
96 end
97 //VCS coverage off
98 // pragma coverage off
99 default: ;
100 //VCS coverage on
101 // pragma coverage on
102 endcase
103 end
104
105 // Move ACK over to SRC domain.
106 prim_flop_2sync #(
107 .Width(1)
108 ) ack_sync (
109 .clk_i (clk_src_i),
110 .rst_ni (rst_src_ni),
111 .d_i (dst_ack),
112 .q_o (src_ack)
113 );
114
115 // Registers
116 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
117 if (!rst_src_ni) begin
118 src_fsm_q <= LoSt;
119 end else begin
120 src_fsm_q <= src_fsm_d;
121 end
122 end
123
124 // ACK-side FSM (DST domain)
125 always_comb begin : dst_fsm
126 dst_fsm_d = dst_fsm_q;
127 dst_req_o = 1'b0;
128 dst_ack = 1'b0;
129
130 unique case (dst_fsm_q)
131 LoSt: begin
132 if (dst_req) begin
133 // Forward the request.
134 dst_req_o = 1'b1;
135 // Wait for the request and acknowledge to be asserted
136 // before responding to the SRC side.
137 if (dst_ack_i) begin
138 dst_fsm_d = HiSt;
139 end
140 end
141 end
142 HiSt: begin
143 dst_ack = 1'b1;
144 // Wait for the request to drop back to zero.
145 if (!dst_req) begin
146 dst_fsm_d = LoSt;
147 end
148 end
149 //VCS coverage off
150 // pragma coverage off
151 default: ;
152 //VCS coverage on
153 // pragma coverage on
154 endcase
155 end
156
157 // Move REQ over to DST domain.
158 prim_flop_2sync #(
159 .Width(1)
160 ) req_sync (
161 .clk_i (clk_dst_i),
162 .rst_ni (rst_dst_ni),
163 .d_i (src_req),
164 .q_o (dst_req)
165 );
166
167 // Registers
168 always_ff @(posedge clk_dst_i or negedge rst_dst_ni) begin
169 if (!rst_dst_ni) begin
170 dst_fsm_q <= LoSt;
171 end else begin
172 dst_fsm_q <= dst_fsm_d;
173 end
174 end
175
176 end else begin : gen_nrz_hs_protocol
177 //////////////////
178 // NRZ protocol //
179 //////////////////
180
181 // Types
182 typedef enum logic {
183 EVEN, ODD
184 } sync_reqack_fsm_e;
185
186 // Signals
187 sync_reqack_fsm_e src_fsm_ns, src_fsm_cs;
188 sync_reqack_fsm_e dst_fsm_ns, dst_fsm_cs;
189
190 logic src_req_d, src_req_q, src_ack;
191 logic dst_ack_d, dst_ack_q, dst_req;
192 logic src_handshake, dst_handshake;
193
194 1/1 assign src_handshake = src_req_i & src_ack_o;
Tests: T10 T12 T14
195 1/1 assign dst_handshake = dst_req_o & dst_ack_i;
Tests: T10 T12 T14
196
197 // Move REQ over to DST domain.
198 prim_flop_2sync #(
199 .Width(1)
200 ) req_sync (
201 .clk_i (clk_dst_i),
202 .rst_ni (rst_dst_ni),
203 .d_i (src_req_q),
204 .q_o (dst_req)
205 );
206
207 // Move ACK over to SRC domain.
208 prim_flop_2sync #(
209 .Width(1)
210 ) ack_sync (
211 .clk_i (clk_src_i),
212 .rst_ni (rst_src_ni),
213 .d_i (dst_ack_q),
214 .q_o (src_ack)
215 );
216
217 // REQ-side FSM (SRC domain)
218 always_comb begin : src_fsm
219 1/1 src_fsm_ns = src_fsm_cs;
Tests: T10 T12 T14
220
221 // By default, we keep the internal REQ value and don't ACK.
222 1/1 src_req_d = src_req_q;
Tests: T10 T12 T14
223 1/1 src_ack_o = 1'b0;
Tests: T10 T12 T14
224
225 1/1 unique case (src_fsm_cs)
Tests: T10 T12 T14
226
227 EVEN: begin
228 // Simply forward REQ and ACK.
229 1/1 src_req_d = src_req_i;
Tests: T10 T12 T14
230 1/1 src_ack_o = src_ack;
Tests: T10 T12 T14
231
232 // The handshake is done for exactly 1 clock cycle.
233 1/1 if (src_handshake) begin
Tests: T10 T12 T14
234 1/1 src_fsm_ns = ODD;
Tests: T10 T12 T14
235 end
MISSING_ELSE
236 end
237
238 ODD: begin
239 // Internal REQ and ACK have inverted meaning now. If src_req_i is high again, this
240 // signals a new transaction.
241 1/1 src_req_d = ~src_req_i;
Tests: T10 T12 T14
242 1/1 src_ack_o = ~src_ack;
Tests: T10 T12 T14
243
244 // The handshake is done for exactly 1 clock cycle.
245 1/1 if (src_handshake) begin
Tests: T10 T12 T14
246 1/1 src_fsm_ns = EVEN;
Tests: T10 T12 T14
247 end
MISSING_ELSE
248 end
249
250 //VCS coverage off
251 // pragma coverage off
252
253 default: ;
254
255 //VCS coverage on
256 // pragma coverage on
257
258 endcase
259 end
260
261 // ACK-side FSM (DST domain)
262 always_comb begin : dst_fsm
263 1/1 dst_fsm_ns = dst_fsm_cs;
Tests: T10 T12 T14
264
265 // By default, we don't REQ and keep the internal ACK.
266 1/1 dst_req_o = 1'b0;
Tests: T10 T12 T14
267 1/1 dst_ack_d = dst_ack_q;
Tests: T10 T12 T14
268
269 1/1 unique case (dst_fsm_cs)
Tests: T10 T12 T14
270
271 EVEN: begin
272 // Simply forward REQ and ACK.
273 1/1 dst_req_o = dst_req;
Tests: T10 T12 T14
274 1/1 dst_ack_d = dst_ack_i;
Tests: T10 T12 T14
275
276 // The handshake is done for exactly 1 clock cycle.
277 1/1 if (dst_handshake) begin
Tests: T10 T12 T14
278 1/1 dst_fsm_ns = ODD;
Tests: T10 T12 T14
279 end
MISSING_ELSE
280 end
281
282 ODD: begin
283 // Internal REQ and ACK have inverted meaning now. If dst_req goes low, this signals a new
284 // transaction.
285 1/1 dst_req_o = ~dst_req;
Tests: T10 T12 T14
286 1/1 dst_ack_d = ~dst_ack_i;
Tests: T10 T12 T14
287
288 // The handshake is done for exactly 1 clock cycle.
289 1/1 if (dst_handshake) begin
Tests: T10 T12 T14
290 1/1 dst_fsm_ns = EVEN;
Tests: T10 T12 T14
291 end
MISSING_ELSE
292 end
293
294 //VCS coverage off
295 // pragma coverage off
296
297 default: ;
298
299 //VCS coverage on
300 // pragma coverage on
301
302 endcase
303 end
304
305 // Registers
306 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
307 1/1 if (!rst_src_ni) begin
Tests: T4 T5 T6
308 1/1 src_fsm_cs <= EVEN;
Tests: T4 T5 T6
309 1/1 src_req_q <= 1'b0;
Tests: T4 T5 T6
310 end else begin
311 1/1 src_fsm_cs <= src_fsm_ns;
Tests: T4 T5 T6
312 1/1 src_req_q <= src_req_d;
Tests: T4 T5 T6
313 end
314 end
315 always_ff @(posedge clk_dst_i or negedge rst_dst_ni) begin
316 1/1 if (!rst_dst_ni) begin
Tests: T4 T5 T6
317 1/1 dst_fsm_cs <= EVEN;
Tests: T4 T5 T6
318 1/1 dst_ack_q <= 1'b0;
Tests: T4 T5 T6
319 end else begin
320 1/1 dst_fsm_cs <= dst_fsm_ns;
Tests: T4 T5 T6
321 1/1 dst_ack_q <= dst_ack_d;
Tests: T4 T5 T6
322 end
323 end
324 end
325
326 ////////////////
327 // Assertions //
328 ////////////////
329
330 `ifdef INC_ASSERT
331 //VCS coverage off
332 // pragma coverage off
333
334 logic effective_rst_n;
335 unreachable assign effective_rst_n = rst_src_ni && rst_dst_ni;
336
337 logic chk_flag;
338 always_ff @(posedge clk_src_i or negedge effective_rst_n) begin
339 unreachable if (!effective_rst_n) begin
340 unreachable chk_flag <= '0;
341 unreachable end else if (src_req_i && !chk_flag) begin
342 unreachable chk_flag <= 1'b1;
343 end
==> MISSING_ELSE
Cond Coverage for Instance : tb.dut.u_main_meas.u_err_sync
| Total | Covered | Percent |
Conditions | 4 | 3 | 75.00 |
Logical | 4 | 3 | 75.00 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 194
EXPRESSION (src_req_i & src_ack_o)
----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T10,T12,T14 |
1 | 1 | Covered | T10,T12,T14 |
LINE 195
EXPRESSION (dst_req_o & dst_ack_i)
----1---- ----2----
-1- | -2- | Status | Tests | Exclude Annotation |
0 | 1 | Excluded | |
VC_COV_UNR |
1 | 0 | Excluded | |
VC_COV_UNR |
1 | 1 | Covered | T10,T12,T14 |
Branch Coverage for Instance : tb.dut.u_main_meas.u_err_sync
| Line No. | Total | Covered | Percent |
Branches |
|
12 |
12 |
100.00 |
CASE |
225 |
4 |
4 |
100.00 |
CASE |
269 |
4 |
4 |
100.00 |
IF |
307 |
2 |
2 |
100.00 |
IF |
316 |
2 |
2 |
100.00 |
225 unique case (src_fsm_cs)
-1-
226
227 EVEN: begin
228 // Simply forward REQ and ACK.
229 src_req_d = src_req_i;
230 src_ack_o = src_ack;
231
232 // The handshake is done for exactly 1 clock cycle.
233 if (src_handshake) begin
-2-
234 src_fsm_ns = ODD;
==>
235 end
MISSING_ELSE
==>
236 end
237
238 ODD: begin
239 // Internal REQ and ACK have inverted meaning now. If src_req_i is high again, this
240 // signals a new transaction.
241 src_req_d = ~src_req_i;
242 src_ack_o = ~src_ack;
243
244 // The handshake is done for exactly 1 clock cycle.
245 if (src_handshake) begin
-3-
246 src_fsm_ns = EVEN;
==>
247 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
EVEN |
1 |
- |
Covered |
T10,T12,T14 |
EVEN |
0 |
- |
Covered |
T10,T12,T14 |
ODD |
- |
1 |
Covered |
T10,T12,T14 |
ODD |
- |
0 |
Covered |
T10,T12,T14 |
269 unique case (dst_fsm_cs)
-1-
270
271 EVEN: begin
272 // Simply forward REQ and ACK.
273 dst_req_o = dst_req;
274 dst_ack_d = dst_ack_i;
275
276 // The handshake is done for exactly 1 clock cycle.
277 if (dst_handshake) begin
-2-
278 dst_fsm_ns = ODD;
==>
279 end
MISSING_ELSE
==>
280 end
281
282 ODD: begin
283 // Internal REQ and ACK have inverted meaning now. If dst_req goes low, this signals a new
284 // transaction.
285 dst_req_o = ~dst_req;
286 dst_ack_d = ~dst_ack_i;
287
288 // The handshake is done for exactly 1 clock cycle.
289 if (dst_handshake) begin
-3-
290 dst_fsm_ns = EVEN;
==>
291 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
EVEN |
1 |
- |
Covered |
T10,T12,T14 |
EVEN |
0 |
- |
Covered |
T10,T12,T14 |
ODD |
- |
1 |
Covered |
T10,T12,T14 |
ODD |
- |
0 |
Covered |
T10,T12,T14 |
307 if (!rst_src_ni) begin
-1-
308 src_fsm_cs <= EVEN;
==>
309 src_req_q <= 1'b0;
310 end else begin
311 src_fsm_cs <= src_fsm_ns;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T4,T5,T6 |
0 |
Covered |
T4,T5,T6 |
316 if (!rst_dst_ni) begin
-1-
317 dst_fsm_cs <= EVEN;
==>
318 dst_ack_q <= 1'b0;
319 end else begin
320 dst_fsm_cs <= dst_fsm_ns;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T4,T5,T6 |
0 |
Covered |
T4,T5,T6 |
Assert Coverage for Instance : tb.dut.u_main_meas.u_err_sync
Assertion Details
SyncReqAckAckNeedsReq
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
35642187 |
1236 |
0 |
0 |
T10 |
22369 |
12 |
0 |
0 |
T12 |
0 |
7 |
0 |
0 |
T14 |
0 |
6 |
0 |
0 |
T15 |
0 |
3 |
0 |
0 |
T17 |
0 |
3 |
0 |
0 |
T18 |
0 |
3 |
0 |
0 |
T20 |
0 |
9 |
0 |
0 |
T21 |
1794 |
0 |
0 |
0 |
T22 |
1124 |
0 |
0 |
0 |
T23 |
3381 |
0 |
0 |
0 |
T24 |
1393 |
0 |
0 |
0 |
T25 |
31366 |
0 |
0 |
0 |
T26 |
1766 |
0 |
0 |
0 |
T27 |
1644 |
0 |
0 |
0 |
T28 |
1321 |
0 |
0 |
0 |
T29 |
60334 |
0 |
0 |
0 |
T37 |
0 |
7 |
0 |
0 |
T38 |
0 |
30 |
0 |
0 |
T41 |
0 |
8 |
0 |
0 |
SyncReqAckHoldReq
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
88248330 |
1236 |
0 |
0 |
T10 |
248544 |
12 |
0 |
0 |
T12 |
0 |
7 |
0 |
0 |
T14 |
0 |
6 |
0 |
0 |
T15 |
0 |
3 |
0 |
0 |
T17 |
0 |
3 |
0 |
0 |
T18 |
0 |
3 |
0 |
0 |
T20 |
0 |
9 |
0 |
0 |
T21 |
1794 |
0 |
0 |
0 |
T22 |
2007 |
0 |
0 |
0 |
T23 |
3486 |
0 |
0 |
0 |
T24 |
1407 |
0 |
0 |
0 |
T25 |
130373 |
0 |
0 |
0 |
T26 |
1840 |
0 |
0 |
0 |
T27 |
1677 |
0 |
0 |
0 |
T28 |
5084 |
0 |
0 |
0 |
T29 |
67037 |
0 |
0 |
0 |
T37 |
0 |
7 |
0 |
0 |
T38 |
0 |
30 |
0 |
0 |
T41 |
0 |
8 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_usb_meas.u_err_sync
| Line No. | Total | Covered | Percent |
TOTAL | | 36 | 36 | 100.00 |
CONT_ASSIGN | 55 | 0 | 0 | |
CONT_ASSIGN | 194 | 1 | 1 | 100.00 |
CONT_ASSIGN | 195 | 1 | 1 | 100.00 |
ALWAYS | 219 | 12 | 12 | 100.00 |
ALWAYS | 263 | 12 | 12 | 100.00 |
ALWAYS | 307 | 5 | 5 | 100.00 |
ALWAYS | 316 | 5 | 5 | 100.00 |
CONT_ASSIGN | 335 | 0 | 0 | |
ALWAYS | 339 | 0 | 0 | |
54 logic unused_req_chk;
55 unreachable assign unused_req_chk = req_chk_i;
56
57 if (EnRzHs) begin : gen_rz_hs_protocol
58 //////////////////
59 // RZ protocol //
60 //////////////////
61
62 // Types
63 typedef enum logic {
64 LoSt, HiSt
65 } rz_fsm_e;
66
67 // Signals
68 rz_fsm_e src_fsm_d, src_fsm_q;
69 rz_fsm_e dst_fsm_d, dst_fsm_q;
70 logic src_ack, dst_ack;
71 logic src_req, dst_req;
72
73 // REQ-side FSM (SRC domain)
74 always_comb begin : src_fsm
75 src_fsm_d = src_fsm_q;
76 src_ack_o = 1'b0;
77 src_req = 1'b0;
78
79 unique case (src_fsm_q)
80 LoSt: begin
81 // Wait for the ack to go back to zero before starting
82 // a new transaction.
83 if (!src_ack && src_req_i) begin
84 src_fsm_d = HiSt;
85 end
86 end
87 HiSt: begin
88 src_req = 1'b1;
89 // Forward the acknowledgement.
90 src_ack_o = src_ack;
91 // If request drops out, we go back to LoSt.
92 // If DST side asserts ack, we also go back to LoSt.
93 if (!src_req_i || src_ack) begin
94 src_fsm_d = LoSt;
95 end
96 end
97 //VCS coverage off
98 // pragma coverage off
99 default: ;
100 //VCS coverage on
101 // pragma coverage on
102 endcase
103 end
104
105 // Move ACK over to SRC domain.
106 prim_flop_2sync #(
107 .Width(1)
108 ) ack_sync (
109 .clk_i (clk_src_i),
110 .rst_ni (rst_src_ni),
111 .d_i (dst_ack),
112 .q_o (src_ack)
113 );
114
115 // Registers
116 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
117 if (!rst_src_ni) begin
118 src_fsm_q <= LoSt;
119 end else begin
120 src_fsm_q <= src_fsm_d;
121 end
122 end
123
124 // ACK-side FSM (DST domain)
125 always_comb begin : dst_fsm
126 dst_fsm_d = dst_fsm_q;
127 dst_req_o = 1'b0;
128 dst_ack = 1'b0;
129
130 unique case (dst_fsm_q)
131 LoSt: begin
132 if (dst_req) begin
133 // Forward the request.
134 dst_req_o = 1'b1;
135 // Wait for the request and acknowledge to be asserted
136 // before responding to the SRC side.
137 if (dst_ack_i) begin
138 dst_fsm_d = HiSt;
139 end
140 end
141 end
142 HiSt: begin
143 dst_ack = 1'b1;
144 // Wait for the request to drop back to zero.
145 if (!dst_req) begin
146 dst_fsm_d = LoSt;
147 end
148 end
149 //VCS coverage off
150 // pragma coverage off
151 default: ;
152 //VCS coverage on
153 // pragma coverage on
154 endcase
155 end
156
157 // Move REQ over to DST domain.
158 prim_flop_2sync #(
159 .Width(1)
160 ) req_sync (
161 .clk_i (clk_dst_i),
162 .rst_ni (rst_dst_ni),
163 .d_i (src_req),
164 .q_o (dst_req)
165 );
166
167 // Registers
168 always_ff @(posedge clk_dst_i or negedge rst_dst_ni) begin
169 if (!rst_dst_ni) begin
170 dst_fsm_q <= LoSt;
171 end else begin
172 dst_fsm_q <= dst_fsm_d;
173 end
174 end
175
176 end else begin : gen_nrz_hs_protocol
177 //////////////////
178 // NRZ protocol //
179 //////////////////
180
181 // Types
182 typedef enum logic {
183 EVEN, ODD
184 } sync_reqack_fsm_e;
185
186 // Signals
187 sync_reqack_fsm_e src_fsm_ns, src_fsm_cs;
188 sync_reqack_fsm_e dst_fsm_ns, dst_fsm_cs;
189
190 logic src_req_d, src_req_q, src_ack;
191 logic dst_ack_d, dst_ack_q, dst_req;
192 logic src_handshake, dst_handshake;
193
194 1/1 assign src_handshake = src_req_i & src_ack_o;
Tests: T2 T10 T11
195 1/1 assign dst_handshake = dst_req_o & dst_ack_i;
Tests: T2 T10 T11
196
197 // Move REQ over to DST domain.
198 prim_flop_2sync #(
199 .Width(1)
200 ) req_sync (
201 .clk_i (clk_dst_i),
202 .rst_ni (rst_dst_ni),
203 .d_i (src_req_q),
204 .q_o (dst_req)
205 );
206
207 // Move ACK over to SRC domain.
208 prim_flop_2sync #(
209 .Width(1)
210 ) ack_sync (
211 .clk_i (clk_src_i),
212 .rst_ni (rst_src_ni),
213 .d_i (dst_ack_q),
214 .q_o (src_ack)
215 );
216
217 // REQ-side FSM (SRC domain)
218 always_comb begin : src_fsm
219 1/1 src_fsm_ns = src_fsm_cs;
Tests: T2 T10 T11
220
221 // By default, we keep the internal REQ value and don't ACK.
222 1/1 src_req_d = src_req_q;
Tests: T2 T10 T11
223 1/1 src_ack_o = 1'b0;
Tests: T2 T10 T11
224
225 1/1 unique case (src_fsm_cs)
Tests: T2 T10 T11
226
227 EVEN: begin
228 // Simply forward REQ and ACK.
229 1/1 src_req_d = src_req_i;
Tests: T2 T10 T11
230 1/1 src_ack_o = src_ack;
Tests: T2 T10 T11
231
232 // The handshake is done for exactly 1 clock cycle.
233 1/1 if (src_handshake) begin
Tests: T2 T10 T11
234 1/1 src_fsm_ns = ODD;
Tests: T2 T10 T11
235 end
MISSING_ELSE
236 end
237
238 ODD: begin
239 // Internal REQ and ACK have inverted meaning now. If src_req_i is high again, this
240 // signals a new transaction.
241 1/1 src_req_d = ~src_req_i;
Tests: T2 T10 T11
242 1/1 src_ack_o = ~src_ack;
Tests: T2 T10 T11
243
244 // The handshake is done for exactly 1 clock cycle.
245 1/1 if (src_handshake) begin
Tests: T2 T10 T11
246 1/1 src_fsm_ns = EVEN;
Tests: T2 T10 T11
247 end
MISSING_ELSE
248 end
249
250 //VCS coverage off
251 // pragma coverage off
252
253 default: ;
254
255 //VCS coverage on
256 // pragma coverage on
257
258 endcase
259 end
260
261 // ACK-side FSM (DST domain)
262 always_comb begin : dst_fsm
263 1/1 dst_fsm_ns = dst_fsm_cs;
Tests: T2 T10 T11
264
265 // By default, we don't REQ and keep the internal ACK.
266 1/1 dst_req_o = 1'b0;
Tests: T2 T10 T11
267 1/1 dst_ack_d = dst_ack_q;
Tests: T2 T10 T11
268
269 1/1 unique case (dst_fsm_cs)
Tests: T2 T10 T11
270
271 EVEN: begin
272 // Simply forward REQ and ACK.
273 1/1 dst_req_o = dst_req;
Tests: T2 T10 T11
274 1/1 dst_ack_d = dst_ack_i;
Tests: T2 T10 T11
275
276 // The handshake is done for exactly 1 clock cycle.
277 1/1 if (dst_handshake) begin
Tests: T2 T10 T11
278 1/1 dst_fsm_ns = ODD;
Tests: T2 T10 T11
279 end
MISSING_ELSE
280 end
281
282 ODD: begin
283 // Internal REQ and ACK have inverted meaning now. If dst_req goes low, this signals a new
284 // transaction.
285 1/1 dst_req_o = ~dst_req;
Tests: T2 T10 T11
286 1/1 dst_ack_d = ~dst_ack_i;
Tests: T2 T10 T11
287
288 // The handshake is done for exactly 1 clock cycle.
289 1/1 if (dst_handshake) begin
Tests: T2 T10 T11
290 1/1 dst_fsm_ns = EVEN;
Tests: T2 T10 T11
291 end
MISSING_ELSE
292 end
293
294 //VCS coverage off
295 // pragma coverage off
296
297 default: ;
298
299 //VCS coverage on
300 // pragma coverage on
301
302 endcase
303 end
304
305 // Registers
306 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
307 1/1 if (!rst_src_ni) begin
Tests: T4 T5 T6
308 1/1 src_fsm_cs <= EVEN;
Tests: T4 T5 T6
309 1/1 src_req_q <= 1'b0;
Tests: T4 T5 T6
310 end else begin
311 1/1 src_fsm_cs <= src_fsm_ns;
Tests: T4 T5 T6
312 1/1 src_req_q <= src_req_d;
Tests: T4 T5 T6
313 end
314 end
315 always_ff @(posedge clk_dst_i or negedge rst_dst_ni) begin
316 1/1 if (!rst_dst_ni) begin
Tests: T4 T5 T6
317 1/1 dst_fsm_cs <= EVEN;
Tests: T4 T5 T6
318 1/1 dst_ack_q <= 1'b0;
Tests: T4 T5 T6
319 end else begin
320 1/1 dst_fsm_cs <= dst_fsm_ns;
Tests: T4 T5 T6
321 1/1 dst_ack_q <= dst_ack_d;
Tests: T4 T5 T6
322 end
323 end
324 end
325
326 ////////////////
327 // Assertions //
328 ////////////////
329
330 `ifdef INC_ASSERT
331 //VCS coverage off
332 // pragma coverage off
333
334 logic effective_rst_n;
335 unreachable assign effective_rst_n = rst_src_ni && rst_dst_ni;
336
337 logic chk_flag;
338 always_ff @(posedge clk_src_i or negedge effective_rst_n) begin
339 unreachable if (!effective_rst_n) begin
340 unreachable chk_flag <= '0;
341 unreachable end else if (src_req_i && !chk_flag) begin
342 unreachable chk_flag <= 1'b1;
343 end
==> MISSING_ELSE
Cond Coverage for Instance : tb.dut.u_usb_meas.u_err_sync
| Total | Covered | Percent |
Conditions | 4 | 3 | 75.00 |
Logical | 4 | 3 | 75.00 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 194
EXPRESSION (src_req_i & src_ack_o)
----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T2,T10,T11 |
1 | 1 | Covered | T2,T10,T11 |
LINE 195
EXPRESSION (dst_req_o & dst_ack_i)
----1---- ----2----
-1- | -2- | Status | Tests | Exclude Annotation |
0 | 1 | Excluded | |
VC_COV_UNR |
1 | 0 | Excluded | |
VC_COV_UNR |
1 | 1 | Covered | T2,T10,T11 |
Branch Coverage for Instance : tb.dut.u_usb_meas.u_err_sync
| Line No. | Total | Covered | Percent |
Branches |
|
12 |
12 |
100.00 |
CASE |
225 |
4 |
4 |
100.00 |
CASE |
269 |
4 |
4 |
100.00 |
IF |
307 |
2 |
2 |
100.00 |
IF |
316 |
2 |
2 |
100.00 |
225 unique case (src_fsm_cs)
-1-
226
227 EVEN: begin
228 // Simply forward REQ and ACK.
229 src_req_d = src_req_i;
230 src_ack_o = src_ack;
231
232 // The handshake is done for exactly 1 clock cycle.
233 if (src_handshake) begin
-2-
234 src_fsm_ns = ODD;
==>
235 end
MISSING_ELSE
==>
236 end
237
238 ODD: begin
239 // Internal REQ and ACK have inverted meaning now. If src_req_i is high again, this
240 // signals a new transaction.
241 src_req_d = ~src_req_i;
242 src_ack_o = ~src_ack;
243
244 // The handshake is done for exactly 1 clock cycle.
245 if (src_handshake) begin
-3-
246 src_fsm_ns = EVEN;
==>
247 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
EVEN |
1 |
- |
Covered |
T2,T10,T11 |
EVEN |
0 |
- |
Covered |
T2,T10,T11 |
ODD |
- |
1 |
Covered |
T2,T10,T11 |
ODD |
- |
0 |
Covered |
T2,T10,T11 |
269 unique case (dst_fsm_cs)
-1-
270
271 EVEN: begin
272 // Simply forward REQ and ACK.
273 dst_req_o = dst_req;
274 dst_ack_d = dst_ack_i;
275
276 // The handshake is done for exactly 1 clock cycle.
277 if (dst_handshake) begin
-2-
278 dst_fsm_ns = ODD;
==>
279 end
MISSING_ELSE
==>
280 end
281
282 ODD: begin
283 // Internal REQ and ACK have inverted meaning now. If dst_req goes low, this signals a new
284 // transaction.
285 dst_req_o = ~dst_req;
286 dst_ack_d = ~dst_ack_i;
287
288 // The handshake is done for exactly 1 clock cycle.
289 if (dst_handshake) begin
-3-
290 dst_fsm_ns = EVEN;
==>
291 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
EVEN |
1 |
- |
Covered |
T2,T10,T11 |
EVEN |
0 |
- |
Covered |
T2,T10,T11 |
ODD |
- |
1 |
Covered |
T2,T10,T11 |
ODD |
- |
0 |
Covered |
T2,T10,T11 |
307 if (!rst_src_ni) begin
-1-
308 src_fsm_cs <= EVEN;
==>
309 src_req_q <= 1'b0;
310 end else begin
311 src_fsm_cs <= src_fsm_ns;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T4,T5,T6 |
0 |
Covered |
T4,T5,T6 |
316 if (!rst_dst_ni) begin
-1-
317 dst_fsm_cs <= EVEN;
==>
318 dst_ack_q <= 1'b0;
319 end else begin
320 dst_fsm_cs <= dst_fsm_ns;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T4,T5,T6 |
0 |
Covered |
T4,T5,T6 |
Assert Coverage for Instance : tb.dut.u_usb_meas.u_err_sync
Assertion Details
SyncReqAckAckNeedsReq
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
35642187 |
1071 |
0 |
0 |
T2 |
16761 |
4 |
0 |
0 |
T3 |
24792 |
0 |
0 |
0 |
T10 |
0 |
11 |
0 |
0 |
T11 |
0 |
4 |
0 |
0 |
T12 |
0 |
4 |
0 |
0 |
T13 |
39212 |
0 |
0 |
0 |
T14 |
0 |
3 |
0 |
0 |
T15 |
0 |
7 |
0 |
0 |
T16 |
0 |
9 |
0 |
0 |
T17 |
0 |
3 |
0 |
0 |
T19 |
0 |
11 |
0 |
0 |
T37 |
0 |
4 |
0 |
0 |
T42 |
1956 |
0 |
0 |
0 |
T43 |
2175 |
0 |
0 |
0 |
T44 |
1508 |
0 |
0 |
0 |
T45 |
1876 |
0 |
0 |
0 |
T46 |
1399 |
0 |
0 |
0 |
T47 |
2476 |
0 |
0 |
0 |
T48 |
1763 |
0 |
0 |
0 |
SyncReqAckHoldReq
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
42193362 |
1071 |
0 |
0 |
T2 |
33524 |
4 |
0 |
0 |
T3 |
25320 |
0 |
0 |
0 |
T10 |
0 |
11 |
0 |
0 |
T11 |
0 |
4 |
0 |
0 |
T12 |
0 |
4 |
0 |
0 |
T13 |
78428 |
0 |
0 |
0 |
T14 |
0 |
3 |
0 |
0 |
T15 |
0 |
7 |
0 |
0 |
T16 |
0 |
9 |
0 |
0 |
T17 |
0 |
3 |
0 |
0 |
T19 |
0 |
11 |
0 |
0 |
T37 |
0 |
4 |
0 |
0 |
T42 |
998 |
0 |
0 |
0 |
T43 |
1043 |
0 |
0 |
0 |
T44 |
730 |
0 |
0 |
0 |
T45 |
919 |
0 |
0 |
0 |
T46 |
1278 |
0 |
0 |
0 |
T47 |
1189 |
0 |
0 |
0 |
T48 |
4029 |
0 |
0 |
0 |