Line Coverage for Module :
prim_pulse_sync
| Line No. | Total | Covered | Percent |
TOTAL | | 7 | 7 | 100.00 |
ALWAYS | 31 | 3 | 3 | 100.00 |
CONT_ASSIGN | 49 | 0 | 0 | |
CONT_ASSIGN | 52 | 0 | 0 | |
ALWAYS | 55 | 0 | 0 | |
ALWAYS | 89 | 3 | 3 | 100.00 |
CONT_ASSIGN | 97 | 1 | 1 | 100.00 |
30 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
31 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
32 1/1 src_level <= 1'b0;
Tests: T1 T2 T3
33 end else begin
34 1/1 src_level <= src_level ^ src_pulse_i;
Tests: T1 T2 T3
35 end
36 end
37
38
39 // source active must come far enough such that the destination domain has time
40 // to create a valid pulse.
41 `ifdef INC_ASSERT
42 //VCS coverage off
43 // pragma coverage off
44
45 // source active flag tracks whether there is an ongoing "toggle" event.
46 // Until this toggle event is accepted by the destination domain (negative edge of
47 // of the pulse output), the source side cannot toggle again.
48 logic effective_rst_n;
49 unreachable assign effective_rst_n = rst_src_ni && dst_pulse_o;
50
51 logic src_active_flag_d, src_active_flag_q;
52 unreachable assign src_active_flag_d = src_pulse_i || src_active_flag_q;
53
54 always_ff @(posedge clk_src_i or negedge effective_rst_n) begin
55 unreachable if (!effective_rst_n) begin
56 unreachable src_active_flag_q <= '0;
57 end else begin
58 unreachable src_active_flag_q <= src_active_flag_d;
59 end
60 end
61
62 //VCS coverage on
63 // pragma coverage on
64
65 `ASSERT(SrcPulseCheck_M, src_pulse_i |-> !src_active_flag_q, clk_src_i, !rst_src_ni)
66 `endif
67
68 //////////////////////////////////////////////////////////
69 // synchronize level signal to destination clock domain //
70 //////////////////////////////////////////////////////////
71 logic dst_level;
72
73 prim_flop_2sync #(.Width(1)) prim_flop_2sync (
74 // source clock domain
75 .d_i (src_level),
76 // destination clock domain
77 .clk_i (clk_dst_i),
78 .rst_ni (rst_dst_ni),
79 .q_o (dst_level)
80 );
81
82 ////////////////////////////////////////
83 // convert level signal back to pulse //
84 ////////////////////////////////////////
85 logic dst_level_q;
86
87 // delay dst_level by 1 cycle
88 always_ff @(posedge clk_dst_i or negedge rst_dst_ni) begin
89 1/1 if (!rst_dst_ni) begin
Tests: T1 T2 T3
90 1/1 dst_level_q <= 1'b0;
Tests: T1 T2 T3
91 end else begin
92 1/1 dst_level_q <= dst_level;
Tests: T1 T2 T3
93 end
94 end
95
96 // edge detection
97 1/1 assign dst_pulse_o = dst_level_q ^ dst_level;
Tests: T4 T13 T24
Cond Coverage for Module :
prim_pulse_sync
| Total | Covered | Percent |
Conditions | 8 | 8 | 100.00 |
Logical | 8 | 8 | 100.00 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 34
EXPRESSION (src_level ^ src_pulse_i)
----1---- -----2-----
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Covered | T4,T13,T24 |
1 | 0 | Covered | T4,T13,T24 |
1 | 1 | Covered | T4,T13,T24 |
LINE 97
EXPRESSION (dst_level_q ^ dst_level)
-----1----- ----2----
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Covered | T4,T13,T24 |
1 | 0 | Covered | T4,T13,T24 |
1 | 1 | Covered | T4,T13,T24 |
Branch Coverage for Module :
prim_pulse_sync
| Line No. | Total | Covered | Percent |
Branches |
|
4 |
4 |
100.00 |
IF |
31 |
2 |
2 |
100.00 |
IF |
89 |
2 |
2 |
100.00 |
31 if (!rst_src_ni) begin
-1-
32 src_level <= 1'b0;
==>
33 end else begin
34 src_level <= src_level ^ src_pulse_i;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T1,T2,T3 |
0 |
Covered |
T1,T2,T3 |
89 if (!rst_dst_ni) begin
-1-
90 dst_level_q <= 1'b0;
==>
91 end else begin
92 dst_level_q <= dst_level;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T1,T2,T3 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Module :
prim_pulse_sync
Assertion Details
DstPulseCheck_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
14504 |
0 |
0 |
T4 |
43744 |
7 |
0 |
0 |
T5 |
73363 |
0 |
0 |
0 |
T13 |
0 |
7 |
0 |
0 |
T24 |
33482 |
1 |
0 |
0 |
T27 |
54455 |
0 |
0 |
0 |
T29 |
19608 |
0 |
0 |
0 |
T30 |
12096 |
0 |
0 |
0 |
T33 |
25619 |
0 |
0 |
0 |
T34 |
17138 |
0 |
0 |
0 |
T38 |
0 |
4 |
0 |
0 |
T59 |
10643 |
0 |
0 |
0 |
T71 |
289568 |
5 |
0 |
0 |
T73 |
0 |
4 |
0 |
0 |
T74 |
0 |
2 |
0 |
0 |
T75 |
0 |
2 |
0 |
0 |
T79 |
0 |
3 |
0 |
0 |
T80 |
0 |
6 |
0 |
0 |
T81 |
0 |
6 |
0 |
0 |
T104 |
16839 |
0 |
0 |
0 |
T117 |
0 |
2 |
0 |
0 |
T118 |
26543 |
0 |
0 |
0 |
T389 |
0 |
5 |
0 |
0 |
T393 |
0 |
5 |
0 |
0 |
T410 |
0 |
5 |
0 |
0 |
T411 |
0 |
3 |
0 |
0 |
T412 |
0 |
3 |
0 |
0 |
T413 |
0 |
3 |
0 |
0 |
T414 |
0 |
6 |
0 |
0 |
T415 |
0 |
3 |
0 |
0 |
T416 |
0 |
2 |
0 |
0 |
T417 |
41512 |
0 |
0 |
0 |
T418 |
48713 |
0 |
0 |
0 |
T419 |
366676 |
0 |
0 |
0 |
T420 |
52264 |
0 |
0 |
0 |
T421 |
56353 |
0 |
0 |
0 |
T422 |
59240 |
0 |
0 |
0 |
T423 |
55070 |
0 |
0 |
0 |
T424 |
136159 |
0 |
0 |
0 |
T425 |
326062 |
0 |
0 |
0 |
SrcPulseCheck_M
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
14519 |
0 |
0 |
T4 |
85361 |
8 |
0 |
0 |
T5 |
144347 |
0 |
0 |
0 |
T13 |
0 |
7 |
0 |
0 |
T24 |
867 |
1 |
0 |
0 |
T27 |
106657 |
0 |
0 |
0 |
T29 |
37818 |
0 |
0 |
0 |
T30 |
23319 |
0 |
0 |
0 |
T33 |
49690 |
0 |
0 |
0 |
T34 |
32905 |
0 |
0 |
0 |
T38 |
0 |
4 |
0 |
0 |
T59 |
20302 |
0 |
0 |
0 |
T71 |
289568 |
5 |
0 |
0 |
T73 |
0 |
5 |
0 |
0 |
T74 |
0 |
2 |
0 |
0 |
T75 |
0 |
2 |
0 |
0 |
T79 |
0 |
4 |
0 |
0 |
T80 |
0 |
7 |
0 |
0 |
T81 |
0 |
7 |
0 |
0 |
T104 |
32685 |
0 |
0 |
0 |
T117 |
0 |
2 |
0 |
0 |
T118 |
51490 |
0 |
0 |
0 |
T389 |
0 |
5 |
0 |
0 |
T393 |
0 |
5 |
0 |
0 |
T410 |
0 |
5 |
0 |
0 |
T411 |
0 |
3 |
0 |
0 |
T412 |
0 |
3 |
0 |
0 |
T413 |
0 |
3 |
0 |
0 |
T414 |
0 |
6 |
0 |
0 |
T415 |
0 |
3 |
0 |
0 |
T416 |
0 |
2 |
0 |
0 |
T417 |
41512 |
0 |
0 |
0 |
T418 |
48713 |
0 |
0 |
0 |
T419 |
366676 |
0 |
0 |
0 |
T420 |
52264 |
0 |
0 |
0 |
T421 |
56353 |
0 |
0 |
0 |
T422 |
59240 |
0 |
0 |
0 |
T423 |
55070 |
0 |
0 |
0 |
T424 |
136159 |
0 |
0 |
0 |
T425 |
326062 |
0 |
0 |
0 |