Line Coverage for Module :
prim_reg_cdc
| Line No. | Total | Covered | Percent |
TOTAL | | 22 | 22 | 100.00 |
CONT_ASSIGN | 65 | 1 | 1 | 100.00 |
ALWAYS | 71 | 6 | 6 | 100.00 |
CONT_ASSIGN | 85 | 1 | 1 | 100.00 |
CONT_ASSIGN | 109 | 1 | 1 | 100.00 |
ALWAYS | 115 | 9 | 9 | 100.00 |
CONT_ASSIGN | 150 | 1 | 1 | 100.00 |
CONT_ASSIGN | 155 | 1 | 1 | 100.00 |
CONT_ASSIGN | 156 | 1 | 1 | 100.00 |
CONT_ASSIGN | 200 | 1 | 1 | 100.00 |
64
65 1/1 assign src_req = src_we_i | src_re_i;
Tests: T1 T2 T3
66
67 // busy indication back-pressures upstream if the register is accessed
68 // again. The busy indication is also used as a "commit" indication for
69 // resolving software and hardware write conflicts
70 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
71 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
72 1/1 src_busy_q <= '0;
Tests: T1 T2 T3
73 1/1 end else if (src_req) begin
Tests: T1 T2 T3
74 1/1 src_busy_q <= 1'b1;
Tests: T1 T2 T3
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T1 T2 T3
77 end
MISSING_ELSE
78 end
79
80 // A src_ack should only be sent if there was a src_req.
81 // src_busy_q asserts whenever there is a src_req. By association,
82 // whenever src_ack is seen, then src_busy must be high.
83 `ASSERT(SrcAckBusyChk_A, src_ack |-> src_busy_q, clk_src_i, !rst_src_ni)
84
85 1/1 assign src_busy_o = src_busy_q;
Tests: T1 T2 T3
86
87 // src_q acts as both the write holding register and the software read back
88 // register.
89 // When software performs a write, the write data is captured in src_q for
90 // CDC purposes. When not performing a write, the src_q reflects the most recent
91 // hardware value. For registers with no hardware access, this is simply the
92 // the value programmed by software (or in the case R1C, W1C etc) the value after
93 // the operation. For registers with hardware access, this reflects a potentially
94 // delayed version of the real value, as the software facing updates lag real
95 // time updates.
96 //
97 // To resolve software and hardware conflicts, the process is as follows:
98 // When software issues a write, this module asserts "busy". While busy,
99 // src_q does not take on destination value updates. Since the
100 // logic has committed to updating based on software command, there is an irreversible
101 // window from which hardware writes are ignored. Once the busy window completes,
102 // the cdc portion then begins sampling once more.
103 //
104 // This is consistent with prim_subreg_arb where during software / hardware conflicts,
105 // software is always prioritized. The main difference is the conflict resolution window
106 // is now larger instead of just one destination clock cycle.
107
108 logic busy;
109 1/1 assign busy = src_busy_q & !src_ack;
Tests: T1 T2 T3
110
111 // This is the current destination value
112 logic [DataWidth-1:0] dst_qs;
113 logic src_update;
114 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
115 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
116 1/1 src_q <= ResetVal;
Tests: T1 T2 T3
117 1/1 txn_bits_q <= '0;
Tests: T1 T2 T3
118 1/1 end else if (src_req) begin
Tests: T1 T2 T3
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 1/1 src_q <= src_wd_i & BitMask;
Tests: T1 T2 T3
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T1 T2 T3
125 1/1 end else if (src_busy_q && src_ack || src_update && !busy) begin
Tests: T1 T2 T3
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 1/1 src_q <= dst_qs;
Tests: T1 T2 T3
135 1/1 txn_bits_q <= '0;
Tests: T1 T2 T3
136 end
MISSING_ELSE
137 end
138
139 // The current design (tlul_adapter_reg) does not spit out a request if the destination it chooses
140 // (decoded from address) is busy. So this creates a situation in the current design where
141 // src_req_i and busy can never be high at the same time.
142 // While the code above could be coded directly to be expressed as `src_req & !busy`, which makes
143 // the intent clearer, it ends up causing coverage holes from the tool's perspective since that
144 // condition cannot be met.
145 // Thus we add an assertion here to ensure the condition is always satisfied.
146 `ASSERT(BusySrcReqChk_A, busy |-> !src_req, clk_src_i, !rst_src_ni)
147
148 // reserved bits are not used
149 logic unused_wd;
150 1/1 assign unused_wd = ^src_wd_i;
Tests: T1 T2 T3
151
152 // src_q is always updated in the clk_src domain.
153 // when performing an update to the destination domain, it is guaranteed
154 // to not change by protocol.
155 1/1 assign src_qs_o = src_q;
Tests: T1 T2 T3
156 1/1 assign dst_wd_o = src_q;
Tests: T1 T2 T3
157
158 ////////////////////////////
159 // CDC handling
160 ////////////////////////////
161
162 logic dst_req_from_src;
163 logic dst_req;
164
165
166 // the software transaction is pulse synced across the domain.
167 // the prim_reg_cdc_arb module handles conflicts with ongoing hardware updates.
168 prim_pulse_sync u_src_to_dst_req (
169 .clk_src_i,
170 .rst_src_ni,
171 .clk_dst_i,
172 .rst_dst_ni,
173 .src_pulse_i(src_req),
174 .dst_pulse_o(dst_req_from_src)
175 );
176
177 prim_reg_cdc_arb #(
178 .DataWidth(DataWidth),
179 .ResetVal(ResetVal),
180 .DstWrReq(DstWrReq)
181 ) u_arb (
182 .clk_src_i,
183 .rst_src_ni,
184 .clk_dst_i,
185 .rst_dst_ni,
186 .src_ack_o(src_ack),
187 .src_update_o(src_update),
188 .dst_req_i(dst_req_from_src),
189 .dst_req_o(dst_req),
190 .dst_update_i,
191 .dst_ds_i,
192 .dst_qs_i,
193 .dst_qs_o(dst_qs)
194 );
195
196
197 // Each is valid only when destination request pulse is high; this is important in not propagating
198 // the internal assertion of 'dst_req' by the 'prim_pulse_sync' channel when just one domain is
199 // reset.
200 1/1 assign {dst_we_o, dst_re_o, dst_regwen_o} = txn_bits_q & {TxnWidth{dst_req}};
Tests: T1 T2 T3
Cond Coverage for Module :
prim_reg_cdc ( parameter DataWidth=2,ResetVal=0,BitMask=3,DstWrReq=0,TxnWidth=3 + DataWidth=32,ResetVal,BitMask,DstWrReq=0,TxnWidth=3 + DataWidth=8,ResetVal=4,BitMask=255,DstWrReq=0,TxnWidth=3 + DataWidth=16,ResetVal=155,BitMask=65535,DstWrReq=0,TxnWidth=3 + DataWidth=28,ResetVal=0,BitMask=268374015,DstWrReq=1,TxnWidth=3 + DataWidth=9,ResetVal=0,BitMask=511,DstWrReq=0,TxnWidth=3 + DataWidth=9,ResetVal=0,BitMask=511,DstWrReq=1,TxnWidth=3 + DataWidth=5,ResetVal=0,BitMask=31,DstWrReq=1,TxnWidth=3 )
Cond Coverage for Module self-instances :
| Total | Covered | Percent |
Conditions | 15 | 13 | 86.67 |
Logical | 15 | 13 | 86.67 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 65
EXPRESSION (src_we_i | src_re_i)
----1--- ----2---
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Covered | T5,T11,T12 |
1 | 0 | Covered | T1,T2,T3 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T1,T2,T3 |
1 | 1 | Covered | T1,T2,T3 |
LINE 125
EXPRESSION ((src_busy_q && src_ack) || (src_update && ((!busy))))
-----------1----------- ------------2------------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Covered | T1,T3,T4 |
1 | 0 | Covered | T1,T2,T3 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T1,T2,T3 |
1 | 1 | Covered | T1,T2,T3 |
LINE 125
SUB-EXPRESSION (src_update && ((!busy)))
-----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Not Covered | |
1 | 1 | Covered | T1,T3,T4 |
Cond Coverage for Module :
prim_reg_cdc ( parameter DataWidth=1,ResetVal=0,BitMask=1,DstWrReq=0,TxnWidth=3 )
Cond Coverage for Module self-instances :
| Total | Covered | Percent |
Conditions | 13 | 12 | 92.31 |
Logical | 13 | 12 | 92.31 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 65
EXPRESSION (src_we_i | src_re_i)
----1--- ----2---
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T12,T13,T14 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T12,T13,T14 |
1 | 1 | Covered | T12,T13,T14 |
LINE 123
EXPRESSION (src_wd_i & BitMask)
----1--- ---2---
-1- | -2- | Status | Tests |
0 | - | Covered | T12,T13,T14 |
1 | - | Covered | T13,T14,T15 |
LINE 125
EXPRESSION ((src_busy_q && src_ack) || (src_update && ((!busy))))
-----------1----------- ------------2------------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T12,T13,T14 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T12,T13,T14 |
1 | 1 | Covered | T12,T13,T14 |
LINE 125
SUB-EXPRESSION (src_update && ((!busy)))
-----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Unreachable | |
1 | 1 | Unreachable | |
Branch Coverage for Module :
prim_reg_cdc
| Line No. | Total | Covered | Percent |
Branches |
|
8 |
8 |
100.00 |
IF |
71 |
4 |
4 |
100.00 |
IF |
115 |
4 |
4 |
100.00 |
71 if (!rst_src_ni) begin
-1-
72 src_busy_q <= '0;
==>
73 end else if (src_req) begin
-2-
74 src_busy_q <= 1'b1;
==>
75 end else if (src_ack) begin
-3-
76 src_busy_q <= 1'b0;
==>
77 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T1,T2,T3 |
0 |
0 |
1 |
Covered |
T1,T2,T3 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
115 if (!rst_src_ni) begin
-1-
116 src_q <= ResetVal;
==>
117 txn_bits_q <= '0;
118 end else if (src_req) begin
-2-
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 src_q <= src_wd_i & BitMask;
==>
124 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
125 end else if (src_busy_q && src_ack || src_update && !busy) begin
-3-
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 src_q <= dst_qs;
==>
135 txn_bits_q <= '0;
136 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T1,T2,T3 |
0 |
0 |
1 |
Covered |
T1,T2,T3 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Module :
prim_reg_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
173762258 |
0 |
0 |
T1 |
299630 |
36854 |
0 |
0 |
T2 |
25763 |
0 |
0 |
0 |
T3 |
179799 |
25370 |
0 |
0 |
T4 |
0 |
12171 |
0 |
0 |
T5 |
926010 |
16461 |
0 |
0 |
T6 |
982731 |
41600 |
0 |
0 |
T7 |
432858 |
17640 |
0 |
0 |
T8 |
711434 |
5461 |
0 |
0 |
T9 |
471252 |
39869 |
0 |
0 |
T10 |
744456 |
47015 |
0 |
0 |
T11 |
1807184 |
8918 |
0 |
0 |
T12 |
3578176 |
38565 |
0 |
0 |
T13 |
2395848 |
4408 |
0 |
0 |
T14 |
5543846 |
5616 |
0 |
0 |
T15 |
0 |
6583 |
0 |
0 |
T16 |
0 |
6478 |
0 |
0 |
T17 |
0 |
6604 |
0 |
0 |
T18 |
0 |
10931 |
0 |
0 |
T19 |
0 |
29337 |
0 |
0 |
T20 |
0 |
4150 |
0 |
0 |
T22 |
28317 |
0 |
0 |
0 |
T23 |
213240 |
0 |
0 |
0 |
T24 |
203808 |
0 |
0 |
0 |
T25 |
709114 |
0 |
0 |
0 |
T26 |
1539524 |
0 |
0 |
0 |
T27 |
2567838 |
0 |
0 |
0 |
T28 |
2520014 |
0 |
0 |
0 |
T29 |
1352106 |
0 |
0 |
0 |
T40 |
0 |
1233 |
0 |
0 |
T41 |
0 |
733 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
890423950 |
882758552 |
0 |
0 |
T1 |
31122 |
29094 |
0 |
0 |
T2 |
2756 |
156 |
0 |
0 |
T3 |
19058 |
17758 |
0 |
0 |
T4 |
32370 |
29822 |
0 |
0 |
T5 |
16692 |
3848 |
0 |
0 |
T6 |
17524 |
15054 |
0 |
0 |
T7 |
29952 |
28002 |
0 |
0 |
T21 |
23374 |
468 |
0 |
0 |
T22 |
1924 |
234 |
0 |
0 |
T23 |
24596 |
702 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
186623 |
0 |
0 |
T1 |
299630 |
41 |
0 |
0 |
T2 |
25763 |
0 |
0 |
0 |
T3 |
179799 |
29 |
0 |
0 |
T4 |
0 |
41 |
0 |
0 |
T5 |
926010 |
9 |
0 |
0 |
T6 |
982731 |
25 |
0 |
0 |
T7 |
432858 |
41 |
0 |
0 |
T8 |
711434 |
29 |
0 |
0 |
T9 |
471252 |
23 |
0 |
0 |
T10 |
744456 |
29 |
0 |
0 |
T11 |
1807184 |
37 |
0 |
0 |
T12 |
3578176 |
20 |
0 |
0 |
T13 |
2395848 |
36 |
0 |
0 |
T14 |
5543846 |
18 |
0 |
0 |
T15 |
0 |
18 |
0 |
0 |
T16 |
0 |
18 |
0 |
0 |
T17 |
0 |
18 |
0 |
0 |
T18 |
0 |
36 |
0 |
0 |
T19 |
0 |
79 |
0 |
0 |
T20 |
0 |
16 |
0 |
0 |
T22 |
28317 |
0 |
0 |
0 |
T23 |
213240 |
0 |
0 |
0 |
T24 |
203808 |
0 |
0 |
0 |
T25 |
709114 |
0 |
0 |
0 |
T26 |
1539524 |
0 |
0 |
0 |
T27 |
2567838 |
0 |
0 |
0 |
T28 |
2520014 |
0 |
0 |
0 |
T29 |
1352106 |
0 |
0 |
0 |
T40 |
0 |
4 |
0 |
0 |
T41 |
0 |
1 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
2147483647 |
0 |
0 |
T1 |
7790380 |
7788144 |
0 |
0 |
T2 |
669838 |
668538 |
0 |
0 |
T3 |
4674774 |
4672330 |
0 |
0 |
T4 |
2755324 |
2752854 |
0 |
0 |
T5 |
8025420 |
7947628 |
0 |
0 |
T6 |
8517002 |
8515650 |
0 |
0 |
T7 |
3751436 |
3749304 |
0 |
0 |
T21 |
2808650 |
2786368 |
0 |
0 |
T22 |
245414 |
243542 |
0 |
0 |
T23 |
1848080 |
1825824 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_reg.u_adc_chn_val_0_cdc
| Line No. | Total | Covered | Percent |
TOTAL | | 17 | 16 | 94.12 |
CONT_ASSIGN | 65 | 0 | 0 | |
ALWAYS | 71 | 5 | 4 | 80.00 |
CONT_ASSIGN | 85 | 1 | 1 | 100.00 |
CONT_ASSIGN | 109 | 1 | 1 | 100.00 |
ALWAYS | 115 | 7 | 7 | 100.00 |
CONT_ASSIGN | 150 | 0 | 0 | |
CONT_ASSIGN | 155 | 1 | 1 | 100.00 |
CONT_ASSIGN | 156 | 1 | 1 | 100.00 |
CONT_ASSIGN | 200 | 1 | 1 | 100.00 |
64
65 unreachable assign src_req = src_we_i | src_re_i;
66
67 // busy indication back-pressures upstream if the register is accessed
68 // again. The busy indication is also used as a "commit" indication for
69 // resolving software and hardware write conflicts
70 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
71 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
72 1/1 src_busy_q <= '0;
Tests: T1 T2 T3
73 1/1 end else if (src_req) begin
Tests: T1 T2 T3
74 unreachable src_busy_q <= 1'b1;
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 0/1 ==> src_busy_q <= 1'b0;
77 end
MISSING_ELSE
78 end
79
80 // A src_ack should only be sent if there was a src_req.
81 // src_busy_q asserts whenever there is a src_req. By association,
82 // whenever src_ack is seen, then src_busy must be high.
83 `ASSERT(SrcAckBusyChk_A, src_ack |-> src_busy_q, clk_src_i, !rst_src_ni)
84
85 1/1 assign src_busy_o = src_busy_q;
Tests: T1 T2 T3
86
87 // src_q acts as both the write holding register and the software read back
88 // register.
89 // When software performs a write, the write data is captured in src_q for
90 // CDC purposes. When not performing a write, the src_q reflects the most recent
91 // hardware value. For registers with no hardware access, this is simply the
92 // the value programmed by software (or in the case R1C, W1C etc) the value after
93 // the operation. For registers with hardware access, this reflects a potentially
94 // delayed version of the real value, as the software facing updates lag real
95 // time updates.
96 //
97 // To resolve software and hardware conflicts, the process is as follows:
98 // When software issues a write, this module asserts "busy". While busy,
99 // src_q does not take on destination value updates. Since the
100 // logic has committed to updating based on software command, there is an irreversible
101 // window from which hardware writes are ignored. Once the busy window completes,
102 // the cdc portion then begins sampling once more.
103 //
104 // This is consistent with prim_subreg_arb where during software / hardware conflicts,
105 // software is always prioritized. The main difference is the conflict resolution window
106 // is now larger instead of just one destination clock cycle.
107
108 logic busy;
109 1/1 assign busy = src_busy_q & !src_ack;
Tests: T1 T2 T3
110
111 // This is the current destination value
112 logic [DataWidth-1:0] dst_qs;
113 logic src_update;
114 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
115 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
116 1/1 src_q <= ResetVal;
Tests: T1 T2 T3
117 1/1 txn_bits_q <= '0;
Tests: T1 T2 T3
118 1/1 end else if (src_req) begin
Tests: T1 T2 T3
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 unreachable src_q <= src_wd_i & BitMask;
124 unreachable txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
125 1/1 end else if (src_busy_q && src_ack || src_update && !busy) begin
Tests: T1 T2 T3
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 1/1 src_q <= dst_qs;
Tests: T1 T3 T4
135 1/1 txn_bits_q <= '0;
Tests: T1 T3 T4
136 end
MISSING_ELSE
137 end
138
139 // The current design (tlul_adapter_reg) does not spit out a request if the destination it chooses
140 // (decoded from address) is busy. So this creates a situation in the current design where
141 // src_req_i and busy can never be high at the same time.
142 // While the code above could be coded directly to be expressed as `src_req & !busy`, which makes
143 // the intent clearer, it ends up causing coverage holes from the tool's perspective since that
144 // condition cannot be met.
145 // Thus we add an assertion here to ensure the condition is always satisfied.
146 `ASSERT(BusySrcReqChk_A, busy |-> !src_req, clk_src_i, !rst_src_ni)
147
148 // reserved bits are not used
149 logic unused_wd;
150 unreachable assign unused_wd = ^src_wd_i;
151
152 // src_q is always updated in the clk_src domain.
153 // when performing an update to the destination domain, it is guaranteed
154 // to not change by protocol.
155 1/1 assign src_qs_o = src_q;
Tests: T1 T2 T3
156 1/1 assign dst_wd_o = src_q;
Tests: T1 T2 T3
157
158 ////////////////////////////
159 // CDC handling
160 ////////////////////////////
161
162 logic dst_req_from_src;
163 logic dst_req;
164
165
166 // the software transaction is pulse synced across the domain.
167 // the prim_reg_cdc_arb module handles conflicts with ongoing hardware updates.
168 prim_pulse_sync u_src_to_dst_req (
169 .clk_src_i,
170 .rst_src_ni,
171 .clk_dst_i,
172 .rst_dst_ni,
173 .src_pulse_i(src_req),
174 .dst_pulse_o(dst_req_from_src)
175 );
176
177 prim_reg_cdc_arb #(
178 .DataWidth(DataWidth),
179 .ResetVal(ResetVal),
180 .DstWrReq(DstWrReq)
181 ) u_arb (
182 .clk_src_i,
183 .rst_src_ni,
184 .clk_dst_i,
185 .rst_dst_ni,
186 .src_ack_o(src_ack),
187 .src_update_o(src_update),
188 .dst_req_i(dst_req_from_src),
189 .dst_req_o(dst_req),
190 .dst_update_i,
191 .dst_ds_i,
192 .dst_qs_i,
193 .dst_qs_o(dst_qs)
194 );
195
196
197 // Each is valid only when destination request pulse is high; this is important in not propagating
198 // the internal assertion of 'dst_req' by the 'prim_pulse_sync' channel when just one domain is
199 // reset.
200 1/1 assign {dst_we_o, dst_re_o, dst_regwen_o} = txn_bits_q & {TxnWidth{dst_req}};
Tests: T1 T2 T3
Cond Coverage for Instance : tb.dut.u_reg.u_adc_chn_val_0_cdc
| Total | Covered | Percent |
Conditions | 7 | 6 | 85.71 |
Logical | 7 | 6 | 85.71 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 65
EXPRESSION (src_we_i | src_re_i)
----1--- ----2---
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Unreachable | |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests | Exclude Annotation |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Excluded | |
VC_COV_UNR |
1 | 1 | Excluded | |
VC_COV_UNR |
LINE 125
EXPRESSION ((src_busy_q && src_ack) || (src_update && ((!busy))))
-----------1----------- ------------2------------
-1- | -2- | Status | Tests | Exclude Annotation |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Covered | T1,T3,T4 |
1 | 0 | Excluded | |
VC_COV_UNR |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests | Exclude Annotation |
0 | 1 | Not Covered | |
1 | 0 | Excluded | |
VC_COV_UNR |
1 | 1 | Excluded | |
VC_COV_UNR |
LINE 125
SUB-EXPRESSION (src_update && ((!busy)))
-----1---- ----2----
-1- | -2- | Status | Tests | Exclude Annotation |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Excluded | |
VC_COV_UNR |
1 | 1 | Covered | T1,T3,T4 |
Branch Coverage for Instance : tb.dut.u_reg.u_adc_chn_val_0_cdc
| Line No. | Total | Covered | Percent |
Branches |
|
6 |
5 |
83.33 |
IF |
71 |
3 |
2 |
66.67 |
IF |
115 |
3 |
3 |
100.00 |
71 if (!rst_src_ni) begin
-1-
72 src_busy_q <= '0;
==>
73 end else if (src_req) begin
-2-
74 src_busy_q <= 1'b1;
==> (Unreachable)
75 end else if (src_ack) begin
-3-
76 src_busy_q <= 1'b0;
==>
77 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Unreachable |
|
0 |
0 |
1 |
Not Covered |
|
0 |
0 |
0 |
Covered |
T1,T2,T3 |
115 if (!rst_src_ni) begin
-1-
116 src_q <= ResetVal;
==>
117 txn_bits_q <= '0;
118 end else if (src_req) begin
-2-
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 src_q <= src_wd_i & BitMask;
==> (Unreachable)
124 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
125 end else if (src_busy_q && src_ack || src_update && !busy) begin
-3-
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 src_q <= dst_qs;
==>
135 txn_bits_q <= '0;
136 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Unreachable |
|
0 |
0 |
1 |
Covered |
T1,T3,T4 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.u_reg.u_adc_chn_val_0_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
0 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
34247075 |
33952252 |
0 |
0 |
T1 |
1197 |
1119 |
0 |
0 |
T2 |
106 |
6 |
0 |
0 |
T3 |
733 |
683 |
0 |
0 |
T4 |
1245 |
1147 |
0 |
0 |
T5 |
642 |
148 |
0 |
0 |
T6 |
674 |
579 |
0 |
0 |
T7 |
1152 |
1077 |
0 |
0 |
T21 |
899 |
18 |
0 |
0 |
T22 |
74 |
9 |
0 |
0 |
T23 |
946 |
27 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
0 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
2147483647 |
0 |
0 |
T1 |
299630 |
299544 |
0 |
0 |
T2 |
25763 |
25713 |
0 |
0 |
T3 |
179799 |
179705 |
0 |
0 |
T4 |
105974 |
105879 |
0 |
0 |
T5 |
308670 |
305678 |
0 |
0 |
T6 |
327577 |
327525 |
0 |
0 |
T7 |
144286 |
144204 |
0 |
0 |
T21 |
108025 |
107168 |
0 |
0 |
T22 |
9439 |
9367 |
0 |
0 |
T23 |
71080 |
70224 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_reg.u_adc_chn_val_1_cdc
| Line No. | Total | Covered | Percent |
TOTAL | | 17 | 16 | 94.12 |
CONT_ASSIGN | 65 | 0 | 0 | |
ALWAYS | 71 | 5 | 4 | 80.00 |
CONT_ASSIGN | 85 | 1 | 1 | 100.00 |
CONT_ASSIGN | 109 | 1 | 1 | 100.00 |
ALWAYS | 115 | 7 | 7 | 100.00 |
CONT_ASSIGN | 150 | 0 | 0 | |
CONT_ASSIGN | 155 | 1 | 1 | 100.00 |
CONT_ASSIGN | 156 | 1 | 1 | 100.00 |
CONT_ASSIGN | 200 | 1 | 1 | 100.00 |
64
65 unreachable assign src_req = src_we_i | src_re_i;
66
67 // busy indication back-pressures upstream if the register is accessed
68 // again. The busy indication is also used as a "commit" indication for
69 // resolving software and hardware write conflicts
70 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
71 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
72 1/1 src_busy_q <= '0;
Tests: T1 T2 T3
73 1/1 end else if (src_req) begin
Tests: T1 T2 T3
74 unreachable src_busy_q <= 1'b1;
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 0/1 ==> src_busy_q <= 1'b0;
77 end
MISSING_ELSE
78 end
79
80 // A src_ack should only be sent if there was a src_req.
81 // src_busy_q asserts whenever there is a src_req. By association,
82 // whenever src_ack is seen, then src_busy must be high.
83 `ASSERT(SrcAckBusyChk_A, src_ack |-> src_busy_q, clk_src_i, !rst_src_ni)
84
85 1/1 assign src_busy_o = src_busy_q;
Tests: T1 T2 T3
86
87 // src_q acts as both the write holding register and the software read back
88 // register.
89 // When software performs a write, the write data is captured in src_q for
90 // CDC purposes. When not performing a write, the src_q reflects the most recent
91 // hardware value. For registers with no hardware access, this is simply the
92 // the value programmed by software (or in the case R1C, W1C etc) the value after
93 // the operation. For registers with hardware access, this reflects a potentially
94 // delayed version of the real value, as the software facing updates lag real
95 // time updates.
96 //
97 // To resolve software and hardware conflicts, the process is as follows:
98 // When software issues a write, this module asserts "busy". While busy,
99 // src_q does not take on destination value updates. Since the
100 // logic has committed to updating based on software command, there is an irreversible
101 // window from which hardware writes are ignored. Once the busy window completes,
102 // the cdc portion then begins sampling once more.
103 //
104 // This is consistent with prim_subreg_arb where during software / hardware conflicts,
105 // software is always prioritized. The main difference is the conflict resolution window
106 // is now larger instead of just one destination clock cycle.
107
108 logic busy;
109 1/1 assign busy = src_busy_q & !src_ack;
Tests: T1 T2 T3
110
111 // This is the current destination value
112 logic [DataWidth-1:0] dst_qs;
113 logic src_update;
114 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
115 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
116 1/1 src_q <= ResetVal;
Tests: T1 T2 T3
117 1/1 txn_bits_q <= '0;
Tests: T1 T2 T3
118 1/1 end else if (src_req) begin
Tests: T1 T2 T3
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 unreachable src_q <= src_wd_i & BitMask;
124 unreachable txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
125 1/1 end else if (src_busy_q && src_ack || src_update && !busy) begin
Tests: T1 T2 T3
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 1/1 src_q <= dst_qs;
Tests: T1 T3 T4
135 1/1 txn_bits_q <= '0;
Tests: T1 T3 T4
136 end
MISSING_ELSE
137 end
138
139 // The current design (tlul_adapter_reg) does not spit out a request if the destination it chooses
140 // (decoded from address) is busy. So this creates a situation in the current design where
141 // src_req_i and busy can never be high at the same time.
142 // While the code above could be coded directly to be expressed as `src_req & !busy`, which makes
143 // the intent clearer, it ends up causing coverage holes from the tool's perspective since that
144 // condition cannot be met.
145 // Thus we add an assertion here to ensure the condition is always satisfied.
146 `ASSERT(BusySrcReqChk_A, busy |-> !src_req, clk_src_i, !rst_src_ni)
147
148 // reserved bits are not used
149 logic unused_wd;
150 unreachable assign unused_wd = ^src_wd_i;
151
152 // src_q is always updated in the clk_src domain.
153 // when performing an update to the destination domain, it is guaranteed
154 // to not change by protocol.
155 1/1 assign src_qs_o = src_q;
Tests: T1 T2 T3
156 1/1 assign dst_wd_o = src_q;
Tests: T1 T2 T3
157
158 ////////////////////////////
159 // CDC handling
160 ////////////////////////////
161
162 logic dst_req_from_src;
163 logic dst_req;
164
165
166 // the software transaction is pulse synced across the domain.
167 // the prim_reg_cdc_arb module handles conflicts with ongoing hardware updates.
168 prim_pulse_sync u_src_to_dst_req (
169 .clk_src_i,
170 .rst_src_ni,
171 .clk_dst_i,
172 .rst_dst_ni,
173 .src_pulse_i(src_req),
174 .dst_pulse_o(dst_req_from_src)
175 );
176
177 prim_reg_cdc_arb #(
178 .DataWidth(DataWidth),
179 .ResetVal(ResetVal),
180 .DstWrReq(DstWrReq)
181 ) u_arb (
182 .clk_src_i,
183 .rst_src_ni,
184 .clk_dst_i,
185 .rst_dst_ni,
186 .src_ack_o(src_ack),
187 .src_update_o(src_update),
188 .dst_req_i(dst_req_from_src),
189 .dst_req_o(dst_req),
190 .dst_update_i,
191 .dst_ds_i,
192 .dst_qs_i,
193 .dst_qs_o(dst_qs)
194 );
195
196
197 // Each is valid only when destination request pulse is high; this is important in not propagating
198 // the internal assertion of 'dst_req' by the 'prim_pulse_sync' channel when just one domain is
199 // reset.
200 1/1 assign {dst_we_o, dst_re_o, dst_regwen_o} = txn_bits_q & {TxnWidth{dst_req}};
Tests: T1 T2 T3
Cond Coverage for Instance : tb.dut.u_reg.u_adc_chn_val_1_cdc
| Total | Covered | Percent |
Conditions | 7 | 6 | 85.71 |
Logical | 7 | 6 | 85.71 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 65
EXPRESSION (src_we_i | src_re_i)
----1--- ----2---
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Unreachable | |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests | Exclude Annotation |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Excluded | |
VC_COV_UNR |
1 | 1 | Excluded | |
VC_COV_UNR |
LINE 125
EXPRESSION ((src_busy_q && src_ack) || (src_update && ((!busy))))
-----------1----------- ------------2------------
-1- | -2- | Status | Tests | Exclude Annotation |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Covered | T1,T3,T4 |
1 | 0 | Excluded | |
VC_COV_UNR |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests | Exclude Annotation |
0 | 1 | Not Covered | |
1 | 0 | Excluded | |
VC_COV_UNR |
1 | 1 | Excluded | |
VC_COV_UNR |
LINE 125
SUB-EXPRESSION (src_update && ((!busy)))
-----1---- ----2----
-1- | -2- | Status | Tests | Exclude Annotation |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Excluded | |
VC_COV_UNR |
1 | 1 | Covered | T1,T3,T4 |
Branch Coverage for Instance : tb.dut.u_reg.u_adc_chn_val_1_cdc
| Line No. | Total | Covered | Percent |
Branches |
|
6 |
5 |
83.33 |
IF |
71 |
3 |
2 |
66.67 |
IF |
115 |
3 |
3 |
100.00 |
71 if (!rst_src_ni) begin
-1-
72 src_busy_q <= '0;
==>
73 end else if (src_req) begin
-2-
74 src_busy_q <= 1'b1;
==> (Unreachable)
75 end else if (src_ack) begin
-3-
76 src_busy_q <= 1'b0;
==>
77 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Unreachable |
|
0 |
0 |
1 |
Not Covered |
|
0 |
0 |
0 |
Covered |
T1,T2,T3 |
115 if (!rst_src_ni) begin
-1-
116 src_q <= ResetVal;
==>
117 txn_bits_q <= '0;
118 end else if (src_req) begin
-2-
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 src_q <= src_wd_i & BitMask;
==> (Unreachable)
124 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
125 end else if (src_busy_q && src_ack || src_update && !busy) begin
-3-
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 src_q <= dst_qs;
==>
135 txn_bits_q <= '0;
136 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Unreachable |
|
0 |
0 |
1 |
Covered |
T1,T3,T4 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.u_reg.u_adc_chn_val_1_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
0 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
34247075 |
33952252 |
0 |
0 |
T1 |
1197 |
1119 |
0 |
0 |
T2 |
106 |
6 |
0 |
0 |
T3 |
733 |
683 |
0 |
0 |
T4 |
1245 |
1147 |
0 |
0 |
T5 |
642 |
148 |
0 |
0 |
T6 |
674 |
579 |
0 |
0 |
T7 |
1152 |
1077 |
0 |
0 |
T21 |
899 |
18 |
0 |
0 |
T22 |
74 |
9 |
0 |
0 |
T23 |
946 |
27 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
0 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
2147483647 |
0 |
0 |
T1 |
299630 |
299544 |
0 |
0 |
T2 |
25763 |
25713 |
0 |
0 |
T3 |
179799 |
179705 |
0 |
0 |
T4 |
105974 |
105879 |
0 |
0 |
T5 |
308670 |
305678 |
0 |
0 |
T6 |
327577 |
327525 |
0 |
0 |
T7 |
144286 |
144204 |
0 |
0 |
T21 |
108025 |
107168 |
0 |
0 |
T22 |
9439 |
9367 |
0 |
0 |
T23 |
71080 |
70224 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_reg.u_filter_status_cdc
| Line No. | Total | Covered | Percent |
TOTAL | | 22 | 22 | 100.00 |
CONT_ASSIGN | 65 | 1 | 1 | 100.00 |
ALWAYS | 71 | 6 | 6 | 100.00 |
CONT_ASSIGN | 85 | 1 | 1 | 100.00 |
CONT_ASSIGN | 109 | 1 | 1 | 100.00 |
ALWAYS | 115 | 9 | 9 | 100.00 |
CONT_ASSIGN | 150 | 1 | 1 | 100.00 |
CONT_ASSIGN | 155 | 1 | 1 | 100.00 |
CONT_ASSIGN | 156 | 1 | 1 | 100.00 |
CONT_ASSIGN | 200 | 1 | 1 | 100.00 |
64
65 1/1 assign src_req = src_we_i | src_re_i;
Tests: T11 T13 T14
66
67 // busy indication back-pressures upstream if the register is accessed
68 // again. The busy indication is also used as a "commit" indication for
69 // resolving software and hardware write conflicts
70 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
71 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
72 1/1 src_busy_q <= '0;
Tests: T1 T2 T3
73 1/1 end else if (src_req) begin
Tests: T1 T2 T3
74 1/1 src_busy_q <= 1'b1;
Tests: T11 T13 T14
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T11 T13 T14
77 end
MISSING_ELSE
78 end
79
80 // A src_ack should only be sent if there was a src_req.
81 // src_busy_q asserts whenever there is a src_req. By association,
82 // whenever src_ack is seen, then src_busy must be high.
83 `ASSERT(SrcAckBusyChk_A, src_ack |-> src_busy_q, clk_src_i, !rst_src_ni)
84
85 1/1 assign src_busy_o = src_busy_q;
Tests: T1 T2 T3
86
87 // src_q acts as both the write holding register and the software read back
88 // register.
89 // When software performs a write, the write data is captured in src_q for
90 // CDC purposes. When not performing a write, the src_q reflects the most recent
91 // hardware value. For registers with no hardware access, this is simply the
92 // the value programmed by software (or in the case R1C, W1C etc) the value after
93 // the operation. For registers with hardware access, this reflects a potentially
94 // delayed version of the real value, as the software facing updates lag real
95 // time updates.
96 //
97 // To resolve software and hardware conflicts, the process is as follows:
98 // When software issues a write, this module asserts "busy". While busy,
99 // src_q does not take on destination value updates. Since the
100 // logic has committed to updating based on software command, there is an irreversible
101 // window from which hardware writes are ignored. Once the busy window completes,
102 // the cdc portion then begins sampling once more.
103 //
104 // This is consistent with prim_subreg_arb where during software / hardware conflicts,
105 // software is always prioritized. The main difference is the conflict resolution window
106 // is now larger instead of just one destination clock cycle.
107
108 logic busy;
109 1/1 assign busy = src_busy_q & !src_ack;
Tests: T1 T2 T3
110
111 // This is the current destination value
112 logic [DataWidth-1:0] dst_qs;
113 logic src_update;
114 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
115 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
116 1/1 src_q <= ResetVal;
Tests: T1 T2 T3
117 1/1 txn_bits_q <= '0;
Tests: T1 T2 T3
118 1/1 end else if (src_req) begin
Tests: T1 T2 T3
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 1/1 src_q <= src_wd_i & BitMask;
Tests: T11 T13 T14
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T11 T13 T14
125 1/1 end else if (src_busy_q && src_ack || src_update && !busy) begin
Tests: T1 T2 T3
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 1/1 src_q <= dst_qs;
Tests: T11 T12 T13
135 1/1 txn_bits_q <= '0;
Tests: T11 T12 T13
136 end
MISSING_ELSE
137 end
138
139 // The current design (tlul_adapter_reg) does not spit out a request if the destination it chooses
140 // (decoded from address) is busy. So this creates a situation in the current design where
141 // src_req_i and busy can never be high at the same time.
142 // While the code above could be coded directly to be expressed as `src_req & !busy`, which makes
143 // the intent clearer, it ends up causing coverage holes from the tool's perspective since that
144 // condition cannot be met.
145 // Thus we add an assertion here to ensure the condition is always satisfied.
146 `ASSERT(BusySrcReqChk_A, busy |-> !src_req, clk_src_i, !rst_src_ni)
147
148 // reserved bits are not used
149 logic unused_wd;
150 1/1 assign unused_wd = ^src_wd_i;
Tests: T1 T2 T3
151
152 // src_q is always updated in the clk_src domain.
153 // when performing an update to the destination domain, it is guaranteed
154 // to not change by protocol.
155 1/1 assign src_qs_o = src_q;
Tests: T1 T2 T3
156 1/1 assign dst_wd_o = src_q;
Tests: T1 T2 T3
157
158 ////////////////////////////
159 // CDC handling
160 ////////////////////////////
161
162 logic dst_req_from_src;
163 logic dst_req;
164
165
166 // the software transaction is pulse synced across the domain.
167 // the prim_reg_cdc_arb module handles conflicts with ongoing hardware updates.
168 prim_pulse_sync u_src_to_dst_req (
169 .clk_src_i,
170 .rst_src_ni,
171 .clk_dst_i,
172 .rst_dst_ni,
173 .src_pulse_i(src_req),
174 .dst_pulse_o(dst_req_from_src)
175 );
176
177 prim_reg_cdc_arb #(
178 .DataWidth(DataWidth),
179 .ResetVal(ResetVal),
180 .DstWrReq(DstWrReq)
181 ) u_arb (
182 .clk_src_i,
183 .rst_src_ni,
184 .clk_dst_i,
185 .rst_dst_ni,
186 .src_ack_o(src_ack),
187 .src_update_o(src_update),
188 .dst_req_i(dst_req_from_src),
189 .dst_req_o(dst_req),
190 .dst_update_i,
191 .dst_ds_i,
192 .dst_qs_i,
193 .dst_qs_o(dst_qs)
194 );
195
196
197 // Each is valid only when destination request pulse is high; this is important in not propagating
198 // the internal assertion of 'dst_req' by the 'prim_pulse_sync' channel when just one domain is
199 // reset.
200 1/1 assign {dst_we_o, dst_re_o, dst_regwen_o} = txn_bits_q & {TxnWidth{dst_req}};
Tests: T1 T2 T3
Cond Coverage for Instance : tb.dut.u_reg.u_filter_status_cdc
| Total | Covered | Percent |
Conditions | 14 | 12 | 85.71 |
Logical | 14 | 12 | 85.71 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 65
EXPRESSION (src_we_i | src_re_i)
----1--- ----2---
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T11,T13,T14 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T11,T13,T14 |
1 | 1 | Covered | T11,T13,T14 |
LINE 125
EXPRESSION ((src_busy_q && src_ack) || (src_update && ((!busy))))
-----------1----------- ------------2------------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Covered | T11,T12,T13 |
1 | 0 | Covered | T11,T13,T14 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T11,T13,T14 |
1 | 1 | Covered | T11,T13,T14 |
LINE 125
SUB-EXPRESSION (src_update && ((!busy)))
-----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Not Covered | |
1 | 1 | Covered | T11,T12,T13 |
Branch Coverage for Instance : tb.dut.u_reg.u_filter_status_cdc
| Line No. | Total | Covered | Percent |
Branches |
|
8 |
8 |
100.00 |
IF |
71 |
4 |
4 |
100.00 |
IF |
115 |
4 |
4 |
100.00 |
71 if (!rst_src_ni) begin
-1-
72 src_busy_q <= '0;
==>
73 end else if (src_req) begin
-2-
74 src_busy_q <= 1'b1;
==>
75 end else if (src_ack) begin
-3-
76 src_busy_q <= 1'b0;
==>
77 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T11,T13,T14 |
0 |
0 |
1 |
Covered |
T11,T13,T14 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
115 if (!rst_src_ni) begin
-1-
116 src_q <= ResetVal;
==>
117 txn_bits_q <= '0;
118 end else if (src_req) begin
-2-
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 src_q <= src_wd_i & BitMask;
==>
124 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
125 end else if (src_busy_q && src_ack || src_update && !busy) begin
-3-
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 src_q <= dst_qs;
==>
135 txn_bits_q <= '0;
136 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T11,T13,T14 |
0 |
0 |
1 |
Covered |
T11,T12,T13 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.u_reg.u_filter_status_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
62426361 |
0 |
0 |
T11 |
112949 |
238 |
0 |
0 |
T12 |
255584 |
0 |
0 |
0 |
T13 |
171132 |
14005 |
0 |
0 |
T14 |
395989 |
29319 |
0 |
0 |
T15 |
0 |
34150 |
0 |
0 |
T16 |
0 |
33297 |
0 |
0 |
T17 |
0 |
30480 |
0 |
0 |
T18 |
0 |
43448 |
0 |
0 |
T19 |
0 |
359 |
0 |
0 |
T20 |
0 |
19380 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
T25 |
50651 |
0 |
0 |
0 |
T26 |
109966 |
0 |
0 |
0 |
T27 |
183417 |
0 |
0 |
0 |
T28 |
180001 |
0 |
0 |
0 |
T29 |
96579 |
0 |
0 |
0 |
T40 |
0 |
1776 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
34247075 |
33952252 |
0 |
0 |
T1 |
1197 |
1119 |
0 |
0 |
T2 |
106 |
6 |
0 |
0 |
T3 |
733 |
683 |
0 |
0 |
T4 |
1245 |
1147 |
0 |
0 |
T5 |
642 |
148 |
0 |
0 |
T6 |
674 |
579 |
0 |
0 |
T7 |
1152 |
1077 |
0 |
0 |
T21 |
899 |
18 |
0 |
0 |
T22 |
74 |
9 |
0 |
0 |
T23 |
946 |
27 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
68938 |
0 |
0 |
T11 |
112949 |
1 |
0 |
0 |
T12 |
255584 |
0 |
0 |
0 |
T13 |
171132 |
90 |
0 |
0 |
T14 |
395989 |
77 |
0 |
0 |
T15 |
0 |
77 |
0 |
0 |
T16 |
0 |
77 |
0 |
0 |
T17 |
0 |
70 |
0 |
0 |
T18 |
0 |
155 |
0 |
0 |
T19 |
0 |
1 |
0 |
0 |
T20 |
0 |
78 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
T25 |
50651 |
0 |
0 |
0 |
T26 |
109966 |
0 |
0 |
0 |
T27 |
183417 |
0 |
0 |
0 |
T28 |
180001 |
0 |
0 |
0 |
T29 |
96579 |
0 |
0 |
0 |
T40 |
0 |
7 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
2147483647 |
0 |
0 |
T1 |
299630 |
299544 |
0 |
0 |
T2 |
25763 |
25713 |
0 |
0 |
T3 |
179799 |
179705 |
0 |
0 |
T4 |
105974 |
105879 |
0 |
0 |
T5 |
308670 |
305678 |
0 |
0 |
T6 |
327577 |
327525 |
0 |
0 |
T7 |
144286 |
144204 |
0 |
0 |
T21 |
108025 |
107168 |
0 |
0 |
T22 |
9439 |
9367 |
0 |
0 |
T23 |
71080 |
70224 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_reg.u_adc_fsm_state_cdc
| Line No. | Total | Covered | Percent |
TOTAL | | 21 | 21 | 100.00 |
CONT_ASSIGN | 65 | 1 | 1 | 100.00 |
ALWAYS | 71 | 6 | 6 | 100.00 |
CONT_ASSIGN | 85 | 1 | 1 | 100.00 |
CONT_ASSIGN | 109 | 1 | 1 | 100.00 |
ALWAYS | 115 | 9 | 9 | 100.00 |
CONT_ASSIGN | 150 | 0 | 0 | |
CONT_ASSIGN | 155 | 1 | 1 | 100.00 |
CONT_ASSIGN | 156 | 1 | 1 | 100.00 |
CONT_ASSIGN | 200 | 1 | 1 | 100.00 |
64
65 1/1 assign src_req = src_we_i | src_re_i;
Tests: T5 T11 T12
66
67 // busy indication back-pressures upstream if the register is accessed
68 // again. The busy indication is also used as a "commit" indication for
69 // resolving software and hardware write conflicts
70 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
71 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
72 1/1 src_busy_q <= '0;
Tests: T1 T2 T3
73 1/1 end else if (src_req) begin
Tests: T1 T2 T3
74 1/1 src_busy_q <= 1'b1;
Tests: T5 T11 T12
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T5 T11 T12
77 end
MISSING_ELSE
78 end
79
80 // A src_ack should only be sent if there was a src_req.
81 // src_busy_q asserts whenever there is a src_req. By association,
82 // whenever src_ack is seen, then src_busy must be high.
83 `ASSERT(SrcAckBusyChk_A, src_ack |-> src_busy_q, clk_src_i, !rst_src_ni)
84
85 1/1 assign src_busy_o = src_busy_q;
Tests: T1 T2 T3
86
87 // src_q acts as both the write holding register and the software read back
88 // register.
89 // When software performs a write, the write data is captured in src_q for
90 // CDC purposes. When not performing a write, the src_q reflects the most recent
91 // hardware value. For registers with no hardware access, this is simply the
92 // the value programmed by software (or in the case R1C, W1C etc) the value after
93 // the operation. For registers with hardware access, this reflects a potentially
94 // delayed version of the real value, as the software facing updates lag real
95 // time updates.
96 //
97 // To resolve software and hardware conflicts, the process is as follows:
98 // When software issues a write, this module asserts "busy". While busy,
99 // src_q does not take on destination value updates. Since the
100 // logic has committed to updating based on software command, there is an irreversible
101 // window from which hardware writes are ignored. Once the busy window completes,
102 // the cdc portion then begins sampling once more.
103 //
104 // This is consistent with prim_subreg_arb where during software / hardware conflicts,
105 // software is always prioritized. The main difference is the conflict resolution window
106 // is now larger instead of just one destination clock cycle.
107
108 logic busy;
109 1/1 assign busy = src_busy_q & !src_ack;
Tests: T1 T2 T3
110
111 // This is the current destination value
112 logic [DataWidth-1:0] dst_qs;
113 logic src_update;
114 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
115 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
116 1/1 src_q <= ResetVal;
Tests: T1 T2 T3
117 1/1 txn_bits_q <= '0;
Tests: T1 T2 T3
118 1/1 end else if (src_req) begin
Tests: T1 T2 T3
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 1/1 src_q <= src_wd_i & BitMask;
Tests: T5 T11 T12
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T5 T11 T12
125 1/1 end else if (src_busy_q && src_ack || src_update && !busy) begin
Tests: T1 T2 T3
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 1/1 src_q <= dst_qs;
Tests: T1 T3 T4
135 1/1 txn_bits_q <= '0;
Tests: T1 T3 T4
136 end
MISSING_ELSE
137 end
138
139 // The current design (tlul_adapter_reg) does not spit out a request if the destination it chooses
140 // (decoded from address) is busy. So this creates a situation in the current design where
141 // src_req_i and busy can never be high at the same time.
142 // While the code above could be coded directly to be expressed as `src_req & !busy`, which makes
143 // the intent clearer, it ends up causing coverage holes from the tool's perspective since that
144 // condition cannot be met.
145 // Thus we add an assertion here to ensure the condition is always satisfied.
146 `ASSERT(BusySrcReqChk_A, busy |-> !src_req, clk_src_i, !rst_src_ni)
147
148 // reserved bits are not used
149 logic unused_wd;
150 unreachable assign unused_wd = ^src_wd_i;
151
152 // src_q is always updated in the clk_src domain.
153 // when performing an update to the destination domain, it is guaranteed
154 // to not change by protocol.
155 1/1 assign src_qs_o = src_q;
Tests: T1 T2 T3
156 1/1 assign dst_wd_o = src_q;
Tests: T1 T2 T3
157
158 ////////////////////////////
159 // CDC handling
160 ////////////////////////////
161
162 logic dst_req_from_src;
163 logic dst_req;
164
165
166 // the software transaction is pulse synced across the domain.
167 // the prim_reg_cdc_arb module handles conflicts with ongoing hardware updates.
168 prim_pulse_sync u_src_to_dst_req (
169 .clk_src_i,
170 .rst_src_ni,
171 .clk_dst_i,
172 .rst_dst_ni,
173 .src_pulse_i(src_req),
174 .dst_pulse_o(dst_req_from_src)
175 );
176
177 prim_reg_cdc_arb #(
178 .DataWidth(DataWidth),
179 .ResetVal(ResetVal),
180 .DstWrReq(DstWrReq)
181 ) u_arb (
182 .clk_src_i,
183 .rst_src_ni,
184 .clk_dst_i,
185 .rst_dst_ni,
186 .src_ack_o(src_ack),
187 .src_update_o(src_update),
188 .dst_req_i(dst_req_from_src),
189 .dst_req_o(dst_req),
190 .dst_update_i,
191 .dst_ds_i,
192 .dst_qs_i,
193 .dst_qs_o(dst_qs)
194 );
195
196
197 // Each is valid only when destination request pulse is high; this is important in not propagating
198 // the internal assertion of 'dst_req' by the 'prim_pulse_sync' channel when just one domain is
199 // reset.
200 1/1 assign {dst_we_o, dst_re_o, dst_regwen_o} = txn_bits_q & {TxnWidth{dst_req}};
Tests: T1 T2 T3
Cond Coverage for Instance : tb.dut.u_reg.u_adc_fsm_state_cdc
| Total | Covered | Percent |
Conditions | 14 | 12 | 85.71 |
Logical | 14 | 12 | 85.71 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 65
EXPRESSION (src_we_i | src_re_i)
----1--- ----2---
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Covered | T5,T11,T12 |
1 | 0 | Unreachable | |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T5,T11,T12 |
1 | 1 | Covered | T5,T11,T12 |
LINE 125
EXPRESSION ((src_busy_q && src_ack) || (src_update && ((!busy))))
-----------1----------- ------------2------------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Covered | T1,T3,T4 |
1 | 0 | Covered | T5,T11,T12 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T5,T11,T12 |
1 | 1 | Covered | T5,T11,T12 |
LINE 125
SUB-EXPRESSION (src_update && ((!busy)))
-----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Not Covered | |
1 | 1 | Covered | T1,T3,T4 |
Branch Coverage for Instance : tb.dut.u_reg.u_adc_fsm_state_cdc
| Line No. | Total | Covered | Percent |
Branches |
|
8 |
8 |
100.00 |
IF |
71 |
4 |
4 |
100.00 |
IF |
115 |
4 |
4 |
100.00 |
71 if (!rst_src_ni) begin
-1-
72 src_busy_q <= '0;
==>
73 end else if (src_req) begin
-2-
74 src_busy_q <= 1'b1;
==>
75 end else if (src_ack) begin
-3-
76 src_busy_q <= 1'b0;
==>
77 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T5,T11,T12 |
0 |
0 |
1 |
Covered |
T5,T11,T12 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
115 if (!rst_src_ni) begin
-1-
116 src_q <= ResetVal;
==>
117 txn_bits_q <= '0;
118 end else if (src_req) begin
-2-
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 src_q <= src_wd_i & BitMask;
==>
124 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
125 end else if (src_busy_q && src_ack || src_update && !busy) begin
-3-
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 src_q <= dst_qs;
==>
135 txn_bits_q <= '0;
136 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T5,T11,T12 |
0 |
0 |
1 |
Covered |
T1,T3,T4 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.u_reg.u_adc_fsm_state_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
86038 |
0 |
0 |
T5 |
308670 |
1646 |
0 |
0 |
T6 |
327577 |
0 |
0 |
0 |
T7 |
144286 |
0 |
0 |
0 |
T8 |
355717 |
0 |
0 |
0 |
T9 |
235626 |
0 |
0 |
0 |
T10 |
372228 |
0 |
0 |
0 |
T11 |
112949 |
618 |
0 |
0 |
T12 |
0 |
1903 |
0 |
0 |
T19 |
0 |
1457 |
0 |
0 |
T22 |
9439 |
0 |
0 |
0 |
T23 |
71080 |
0 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
T30 |
0 |
1087 |
0 |
0 |
T40 |
0 |
482 |
0 |
0 |
T41 |
0 |
733 |
0 |
0 |
T42 |
0 |
434 |
0 |
0 |
T43 |
0 |
903 |
0 |
0 |
T44 |
0 |
1800 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
34247075 |
33952252 |
0 |
0 |
T1 |
1197 |
1119 |
0 |
0 |
T2 |
106 |
6 |
0 |
0 |
T3 |
733 |
683 |
0 |
0 |
T4 |
1245 |
1147 |
0 |
0 |
T5 |
642 |
148 |
0 |
0 |
T6 |
674 |
579 |
0 |
0 |
T7 |
1152 |
1077 |
0 |
0 |
T21 |
899 |
18 |
0 |
0 |
T22 |
74 |
9 |
0 |
0 |
T23 |
946 |
27 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
92 |
0 |
0 |
T5 |
308670 |
1 |
0 |
0 |
T6 |
327577 |
0 |
0 |
0 |
T7 |
144286 |
0 |
0 |
0 |
T8 |
355717 |
0 |
0 |
0 |
T9 |
235626 |
0 |
0 |
0 |
T10 |
372228 |
0 |
0 |
0 |
T11 |
112949 |
1 |
0 |
0 |
T12 |
0 |
1 |
0 |
0 |
T19 |
0 |
1 |
0 |
0 |
T22 |
9439 |
0 |
0 |
0 |
T23 |
71080 |
0 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
T40 |
0 |
1 |
0 |
0 |
T41 |
0 |
1 |
0 |
0 |
T42 |
0 |
1 |
0 |
0 |
T43 |
0 |
1 |
0 |
0 |
T44 |
0 |
1 |
0 |
0 |
T45 |
0 |
1 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
2147483647 |
0 |
0 |
T1 |
299630 |
299544 |
0 |
0 |
T2 |
25763 |
25713 |
0 |
0 |
T3 |
179799 |
179705 |
0 |
0 |
T4 |
105974 |
105879 |
0 |
0 |
T5 |
308670 |
305678 |
0 |
0 |
T6 |
327577 |
327525 |
0 |
0 |
T7 |
144286 |
144204 |
0 |
0 |
T21 |
108025 |
107168 |
0 |
0 |
T22 |
9439 |
9367 |
0 |
0 |
T23 |
71080 |
70224 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_reg.u_adc_en_ctl_cdc
| Line No. | Total | Covered | Percent |
TOTAL | | 22 | 22 | 100.00 |
CONT_ASSIGN | 65 | 1 | 1 | 100.00 |
ALWAYS | 71 | 6 | 6 | 100.00 |
CONT_ASSIGN | 85 | 1 | 1 | 100.00 |
CONT_ASSIGN | 109 | 1 | 1 | 100.00 |
ALWAYS | 115 | 9 | 9 | 100.00 |
CONT_ASSIGN | 150 | 1 | 1 | 100.00 |
CONT_ASSIGN | 155 | 1 | 1 | 100.00 |
CONT_ASSIGN | 156 | 1 | 1 | 100.00 |
CONT_ASSIGN | 200 | 1 | 1 | 100.00 |
64
65 1/1 assign src_req = src_we_i | src_re_i;
Tests: T1 T3 T4
66
67 // busy indication back-pressures upstream if the register is accessed
68 // again. The busy indication is also used as a "commit" indication for
69 // resolving software and hardware write conflicts
70 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
71 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
72 1/1 src_busy_q <= '0;
Tests: T1 T2 T3
73 1/1 end else if (src_req) begin
Tests: T1 T2 T3
74 1/1 src_busy_q <= 1'b1;
Tests: T1 T3 T4
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T1 T3 T4
77 end
MISSING_ELSE
78 end
79
80 // A src_ack should only be sent if there was a src_req.
81 // src_busy_q asserts whenever there is a src_req. By association,
82 // whenever src_ack is seen, then src_busy must be high.
83 `ASSERT(SrcAckBusyChk_A, src_ack |-> src_busy_q, clk_src_i, !rst_src_ni)
84
85 1/1 assign src_busy_o = src_busy_q;
Tests: T1 T2 T3
86
87 // src_q acts as both the write holding register and the software read back
88 // register.
89 // When software performs a write, the write data is captured in src_q for
90 // CDC purposes. When not performing a write, the src_q reflects the most recent
91 // hardware value. For registers with no hardware access, this is simply the
92 // the value programmed by software (or in the case R1C, W1C etc) the value after
93 // the operation. For registers with hardware access, this reflects a potentially
94 // delayed version of the real value, as the software facing updates lag real
95 // time updates.
96 //
97 // To resolve software and hardware conflicts, the process is as follows:
98 // When software issues a write, this module asserts "busy". While busy,
99 // src_q does not take on destination value updates. Since the
100 // logic has committed to updating based on software command, there is an irreversible
101 // window from which hardware writes are ignored. Once the busy window completes,
102 // the cdc portion then begins sampling once more.
103 //
104 // This is consistent with prim_subreg_arb where during software / hardware conflicts,
105 // software is always prioritized. The main difference is the conflict resolution window
106 // is now larger instead of just one destination clock cycle.
107
108 logic busy;
109 1/1 assign busy = src_busy_q & !src_ack;
Tests: T1 T2 T3
110
111 // This is the current destination value
112 logic [DataWidth-1:0] dst_qs;
113 logic src_update;
114 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
115 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
116 1/1 src_q <= ResetVal;
Tests: T1 T2 T3
117 1/1 txn_bits_q <= '0;
Tests: T1 T2 T3
118 1/1 end else if (src_req) begin
Tests: T1 T2 T3
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 1/1 src_q <= src_wd_i & BitMask;
Tests: T1 T3 T4
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T1 T3 T4
125 1/1 end else if (src_busy_q && src_ack || src_update && !busy) begin
Tests: T1 T2 T3
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 1/1 src_q <= dst_qs;
Tests: T1 T3 T4
135 1/1 txn_bits_q <= '0;
Tests: T1 T3 T4
136 end
MISSING_ELSE
137 end
138
139 // The current design (tlul_adapter_reg) does not spit out a request if the destination it chooses
140 // (decoded from address) is busy. So this creates a situation in the current design where
141 // src_req_i and busy can never be high at the same time.
142 // While the code above could be coded directly to be expressed as `src_req & !busy`, which makes
143 // the intent clearer, it ends up causing coverage holes from the tool's perspective since that
144 // condition cannot be met.
145 // Thus we add an assertion here to ensure the condition is always satisfied.
146 `ASSERT(BusySrcReqChk_A, busy |-> !src_req, clk_src_i, !rst_src_ni)
147
148 // reserved bits are not used
149 logic unused_wd;
150 1/1 assign unused_wd = ^src_wd_i;
Tests: T1 T2 T3
151
152 // src_q is always updated in the clk_src domain.
153 // when performing an update to the destination domain, it is guaranteed
154 // to not change by protocol.
155 1/1 assign src_qs_o = src_q;
Tests: T1 T2 T3
156 1/1 assign dst_wd_o = src_q;
Tests: T1 T2 T3
157
158 ////////////////////////////
159 // CDC handling
160 ////////////////////////////
161
162 logic dst_req_from_src;
163 logic dst_req;
164
165
166 // the software transaction is pulse synced across the domain.
167 // the prim_reg_cdc_arb module handles conflicts with ongoing hardware updates.
168 prim_pulse_sync u_src_to_dst_req (
169 .clk_src_i,
170 .rst_src_ni,
171 .clk_dst_i,
172 .rst_dst_ni,
173 .src_pulse_i(src_req),
174 .dst_pulse_o(dst_req_from_src)
175 );
176
177 prim_reg_cdc_arb #(
178 .DataWidth(DataWidth),
179 .ResetVal(ResetVal),
180 .DstWrReq(DstWrReq)
181 ) u_arb (
182 .clk_src_i,
183 .rst_src_ni,
184 .clk_dst_i,
185 .rst_dst_ni,
186 .src_ack_o(src_ack),
187 .src_update_o(src_update),
188 .dst_req_i(dst_req_from_src),
189 .dst_req_o(dst_req),
190 .dst_update_i,
191 .dst_ds_i,
192 .dst_qs_i,
193 .dst_qs_o(dst_qs)
194 );
195
196
197 // Each is valid only when destination request pulse is high; this is important in not propagating
198 // the internal assertion of 'dst_req' by the 'prim_pulse_sync' channel when just one domain is
199 // reset.
200 1/1 assign {dst_we_o, dst_re_o, dst_regwen_o} = txn_bits_q & {TxnWidth{dst_req}};
Tests: T1 T2 T3
Cond Coverage for Instance : tb.dut.u_reg.u_adc_en_ctl_cdc
| Total | Covered | Percent |
Conditions | 11 | 10 | 90.91 |
Logical | 11 | 10 | 90.91 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 65
EXPRESSION (src_we_i | src_re_i)
----1--- ----2---
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T1,T3,T4 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T1,T3,T4 |
1 | 1 | Covered | T1,T3,T4 |
LINE 125
EXPRESSION ((src_busy_q && src_ack) || (src_update && ((!busy))))
-----------1----------- ------------2------------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T1,T3,T4 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T1,T3,T4 |
1 | 1 | Covered | T1,T3,T4 |
LINE 125
SUB-EXPRESSION (src_update && ((!busy)))
-----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Unreachable | |
1 | 1 | Unreachable | |
Branch Coverage for Instance : tb.dut.u_reg.u_adc_en_ctl_cdc
| Line No. | Total | Covered | Percent |
Branches |
|
8 |
8 |
100.00 |
IF |
71 |
4 |
4 |
100.00 |
IF |
115 |
4 |
4 |
100.00 |
71 if (!rst_src_ni) begin
-1-
72 src_busy_q <= '0;
==>
73 end else if (src_req) begin
-2-
74 src_busy_q <= 1'b1;
==>
75 end else if (src_ack) begin
-3-
76 src_busy_q <= 1'b0;
==>
77 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T1,T3,T4 |
0 |
0 |
1 |
Covered |
T1,T3,T4 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
115 if (!rst_src_ni) begin
-1-
116 src_q <= ResetVal;
==>
117 txn_bits_q <= '0;
118 end else if (src_req) begin
-2-
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 src_q <= src_wd_i & BitMask;
==>
124 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
125 end else if (src_busy_q && src_ack || src_update && !busy) begin
-3-
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 src_q <= dst_qs;
==>
135 txn_bits_q <= '0;
136 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T1,T3,T4 |
0 |
0 |
1 |
Covered |
T1,T3,T4 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.u_reg.u_adc_en_ctl_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
30139231 |
0 |
0 |
T1 |
299630 |
36854 |
0 |
0 |
T2 |
25763 |
0 |
0 |
0 |
T3 |
179799 |
25370 |
0 |
0 |
T4 |
105974 |
12171 |
0 |
0 |
T5 |
308670 |
11016 |
0 |
0 |
T6 |
327577 |
41600 |
0 |
0 |
T7 |
144286 |
17640 |
0 |
0 |
T8 |
0 |
5461 |
0 |
0 |
T9 |
0 |
39869 |
0 |
0 |
T10 |
0 |
47015 |
0 |
0 |
T11 |
0 |
892 |
0 |
0 |
T21 |
108025 |
0 |
0 |
0 |
T22 |
9439 |
0 |
0 |
0 |
T23 |
71080 |
0 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
34247075 |
33952252 |
0 |
0 |
T1 |
1197 |
1119 |
0 |
0 |
T2 |
106 |
6 |
0 |
0 |
T3 |
733 |
683 |
0 |
0 |
T4 |
1245 |
1147 |
0 |
0 |
T5 |
642 |
148 |
0 |
0 |
T6 |
674 |
579 |
0 |
0 |
T7 |
1152 |
1077 |
0 |
0 |
T21 |
899 |
18 |
0 |
0 |
T22 |
74 |
9 |
0 |
0 |
T23 |
946 |
27 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
30844 |
0 |
0 |
T1 |
299630 |
41 |
0 |
0 |
T2 |
25763 |
0 |
0 |
0 |
T3 |
179799 |
29 |
0 |
0 |
T4 |
105974 |
41 |
0 |
0 |
T5 |
308670 |
6 |
0 |
0 |
T6 |
327577 |
25 |
0 |
0 |
T7 |
144286 |
41 |
0 |
0 |
T8 |
0 |
29 |
0 |
0 |
T9 |
0 |
23 |
0 |
0 |
T10 |
0 |
29 |
0 |
0 |
T11 |
0 |
4 |
0 |
0 |
T21 |
108025 |
0 |
0 |
0 |
T22 |
9439 |
0 |
0 |
0 |
T23 |
71080 |
0 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
2147483647 |
0 |
0 |
T1 |
299630 |
299544 |
0 |
0 |
T2 |
25763 |
25713 |
0 |
0 |
T3 |
179799 |
179705 |
0 |
0 |
T4 |
105974 |
105879 |
0 |
0 |
T5 |
308670 |
305678 |
0 |
0 |
T6 |
327577 |
327525 |
0 |
0 |
T7 |
144286 |
144204 |
0 |
0 |
T21 |
108025 |
107168 |
0 |
0 |
T22 |
9439 |
9367 |
0 |
0 |
T23 |
71080 |
70224 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_reg.u_adc_pd_ctl_cdc
| Line No. | Total | Covered | Percent |
TOTAL | | 22 | 22 | 100.00 |
CONT_ASSIGN | 65 | 1 | 1 | 100.00 |
ALWAYS | 71 | 6 | 6 | 100.00 |
CONT_ASSIGN | 85 | 1 | 1 | 100.00 |
CONT_ASSIGN | 109 | 1 | 1 | 100.00 |
ALWAYS | 115 | 9 | 9 | 100.00 |
CONT_ASSIGN | 150 | 1 | 1 | 100.00 |
CONT_ASSIGN | 155 | 1 | 1 | 100.00 |
CONT_ASSIGN | 156 | 1 | 1 | 100.00 |
CONT_ASSIGN | 200 | 1 | 1 | 100.00 |
64
65 1/1 assign src_req = src_we_i | src_re_i;
Tests: T1 T3 T4
66
67 // busy indication back-pressures upstream if the register is accessed
68 // again. The busy indication is also used as a "commit" indication for
69 // resolving software and hardware write conflicts
70 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
71 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
72 1/1 src_busy_q <= '0;
Tests: T1 T2 T3
73 1/1 end else if (src_req) begin
Tests: T1 T2 T3
74 1/1 src_busy_q <= 1'b1;
Tests: T1 T3 T4
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T1 T3 T4
77 end
MISSING_ELSE
78 end
79
80 // A src_ack should only be sent if there was a src_req.
81 // src_busy_q asserts whenever there is a src_req. By association,
82 // whenever src_ack is seen, then src_busy must be high.
83 `ASSERT(SrcAckBusyChk_A, src_ack |-> src_busy_q, clk_src_i, !rst_src_ni)
84
85 1/1 assign src_busy_o = src_busy_q;
Tests: T1 T2 T3
86
87 // src_q acts as both the write holding register and the software read back
88 // register.
89 // When software performs a write, the write data is captured in src_q for
90 // CDC purposes. When not performing a write, the src_q reflects the most recent
91 // hardware value. For registers with no hardware access, this is simply the
92 // the value programmed by software (or in the case R1C, W1C etc) the value after
93 // the operation. For registers with hardware access, this reflects a potentially
94 // delayed version of the real value, as the software facing updates lag real
95 // time updates.
96 //
97 // To resolve software and hardware conflicts, the process is as follows:
98 // When software issues a write, this module asserts "busy". While busy,
99 // src_q does not take on destination value updates. Since the
100 // logic has committed to updating based on software command, there is an irreversible
101 // window from which hardware writes are ignored. Once the busy window completes,
102 // the cdc portion then begins sampling once more.
103 //
104 // This is consistent with prim_subreg_arb where during software / hardware conflicts,
105 // software is always prioritized. The main difference is the conflict resolution window
106 // is now larger instead of just one destination clock cycle.
107
108 logic busy;
109 1/1 assign busy = src_busy_q & !src_ack;
Tests: T1 T2 T3
110
111 // This is the current destination value
112 logic [DataWidth-1:0] dst_qs;
113 logic src_update;
114 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
115 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
116 1/1 src_q <= ResetVal;
Tests: T1 T2 T3
117 1/1 txn_bits_q <= '0;
Tests: T1 T2 T3
118 1/1 end else if (src_req) begin
Tests: T1 T2 T3
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 1/1 src_q <= src_wd_i & BitMask;
Tests: T1 T3 T4
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T1 T3 T4
125 1/1 end else if (src_busy_q && src_ack || src_update && !busy) begin
Tests: T1 T2 T3
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 1/1 src_q <= dst_qs;
Tests: T1 T3 T4
135 1/1 txn_bits_q <= '0;
Tests: T1 T3 T4
136 end
MISSING_ELSE
137 end
138
139 // The current design (tlul_adapter_reg) does not spit out a request if the destination it chooses
140 // (decoded from address) is busy. So this creates a situation in the current design where
141 // src_req_i and busy can never be high at the same time.
142 // While the code above could be coded directly to be expressed as `src_req & !busy`, which makes
143 // the intent clearer, it ends up causing coverage holes from the tool's perspective since that
144 // condition cannot be met.
145 // Thus we add an assertion here to ensure the condition is always satisfied.
146 `ASSERT(BusySrcReqChk_A, busy |-> !src_req, clk_src_i, !rst_src_ni)
147
148 // reserved bits are not used
149 logic unused_wd;
150 1/1 assign unused_wd = ^src_wd_i;
Tests: T1 T2 T3
151
152 // src_q is always updated in the clk_src domain.
153 // when performing an update to the destination domain, it is guaranteed
154 // to not change by protocol.
155 1/1 assign src_qs_o = src_q;
Tests: T1 T2 T3
156 1/1 assign dst_wd_o = src_q;
Tests: T1 T2 T3
157
158 ////////////////////////////
159 // CDC handling
160 ////////////////////////////
161
162 logic dst_req_from_src;
163 logic dst_req;
164
165
166 // the software transaction is pulse synced across the domain.
167 // the prim_reg_cdc_arb module handles conflicts with ongoing hardware updates.
168 prim_pulse_sync u_src_to_dst_req (
169 .clk_src_i,
170 .rst_src_ni,
171 .clk_dst_i,
172 .rst_dst_ni,
173 .src_pulse_i(src_req),
174 .dst_pulse_o(dst_req_from_src)
175 );
176
177 prim_reg_cdc_arb #(
178 .DataWidth(DataWidth),
179 .ResetVal(ResetVal),
180 .DstWrReq(DstWrReq)
181 ) u_arb (
182 .clk_src_i,
183 .rst_src_ni,
184 .clk_dst_i,
185 .rst_dst_ni,
186 .src_ack_o(src_ack),
187 .src_update_o(src_update),
188 .dst_req_i(dst_req_from_src),
189 .dst_req_o(dst_req),
190 .dst_update_i,
191 .dst_ds_i,
192 .dst_qs_i,
193 .dst_qs_o(dst_qs)
194 );
195
196
197 // Each is valid only when destination request pulse is high; this is important in not propagating
198 // the internal assertion of 'dst_req' by the 'prim_pulse_sync' channel when just one domain is
199 // reset.
200 1/1 assign {dst_we_o, dst_re_o, dst_regwen_o} = txn_bits_q & {TxnWidth{dst_req}};
Tests: T1 T2 T3
Cond Coverage for Instance : tb.dut.u_reg.u_adc_pd_ctl_cdc
| Total | Covered | Percent |
Conditions | 11 | 10 | 90.91 |
Logical | 11 | 10 | 90.91 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 65
EXPRESSION (src_we_i | src_re_i)
----1--- ----2---
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T1,T3,T4 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T1,T3,T4 |
1 | 1 | Covered | T1,T3,T4 |
LINE 125
EXPRESSION ((src_busy_q && src_ack) || (src_update && ((!busy))))
-----------1----------- ------------2------------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T1,T3,T4 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T1,T3,T4 |
1 | 1 | Covered | T1,T3,T4 |
LINE 125
SUB-EXPRESSION (src_update && ((!busy)))
-----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Unreachable | |
1 | 1 | Unreachable | |
Branch Coverage for Instance : tb.dut.u_reg.u_adc_pd_ctl_cdc
| Line No. | Total | Covered | Percent |
Branches |
|
8 |
8 |
100.00 |
IF |
71 |
4 |
4 |
100.00 |
IF |
115 |
4 |
4 |
100.00 |
71 if (!rst_src_ni) begin
-1-
72 src_busy_q <= '0;
==>
73 end else if (src_req) begin
-2-
74 src_busy_q <= 1'b1;
==>
75 end else if (src_ack) begin
-3-
76 src_busy_q <= 1'b0;
==>
77 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T1,T3,T4 |
0 |
0 |
1 |
Covered |
T1,T3,T4 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
115 if (!rst_src_ni) begin
-1-
116 src_q <= ResetVal;
==>
117 txn_bits_q <= '0;
118 end else if (src_req) begin
-2-
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 src_q <= src_wd_i & BitMask;
==>
124 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
125 end else if (src_busy_q && src_ack || src_update && !busy) begin
-3-
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 src_q <= dst_qs;
==>
135 txn_bits_q <= '0;
136 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T1,T3,T4 |
0 |
0 |
1 |
Covered |
T1,T3,T4 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.u_reg.u_adc_pd_ctl_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
14162517 |
0 |
0 |
T1 |
299630 |
997 |
0 |
0 |
T2 |
25763 |
0 |
0 |
0 |
T3 |
179799 |
12078 |
0 |
0 |
T4 |
105974 |
251 |
0 |
0 |
T5 |
308670 |
5677 |
0 |
0 |
T6 |
327577 |
20720 |
0 |
0 |
T7 |
144286 |
479 |
0 |
0 |
T8 |
0 |
2463 |
0 |
0 |
T9 |
0 |
18850 |
0 |
0 |
T10 |
0 |
21575 |
0 |
0 |
T11 |
0 |
779 |
0 |
0 |
T21 |
108025 |
0 |
0 |
0 |
T22 |
9439 |
0 |
0 |
0 |
T23 |
71080 |
0 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
34247075 |
33952252 |
0 |
0 |
T1 |
1197 |
1119 |
0 |
0 |
T2 |
106 |
6 |
0 |
0 |
T3 |
733 |
683 |
0 |
0 |
T4 |
1245 |
1147 |
0 |
0 |
T5 |
642 |
148 |
0 |
0 |
T6 |
674 |
579 |
0 |
0 |
T7 |
1152 |
1077 |
0 |
0 |
T21 |
899 |
18 |
0 |
0 |
T22 |
74 |
9 |
0 |
0 |
T23 |
946 |
27 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
14774 |
0 |
0 |
T1 |
299630 |
1 |
0 |
0 |
T2 |
25763 |
0 |
0 |
0 |
T3 |
179799 |
14 |
0 |
0 |
T4 |
105974 |
1 |
0 |
0 |
T5 |
308670 |
3 |
0 |
0 |
T6 |
327577 |
12 |
0 |
0 |
T7 |
144286 |
1 |
0 |
0 |
T8 |
0 |
14 |
0 |
0 |
T9 |
0 |
11 |
0 |
0 |
T10 |
0 |
14 |
0 |
0 |
T11 |
0 |
4 |
0 |
0 |
T21 |
108025 |
0 |
0 |
0 |
T22 |
9439 |
0 |
0 |
0 |
T23 |
71080 |
0 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
2147483647 |
0 |
0 |
T1 |
299630 |
299544 |
0 |
0 |
T2 |
25763 |
25713 |
0 |
0 |
T3 |
179799 |
179705 |
0 |
0 |
T4 |
105974 |
105879 |
0 |
0 |
T5 |
308670 |
305678 |
0 |
0 |
T6 |
327577 |
327525 |
0 |
0 |
T7 |
144286 |
144204 |
0 |
0 |
T21 |
108025 |
107168 |
0 |
0 |
T22 |
9439 |
9367 |
0 |
0 |
T23 |
71080 |
70224 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_reg.u_adc_lp_sample_ctl_cdc
| Line No. | Total | Covered | Percent |
TOTAL | | 22 | 22 | 100.00 |
CONT_ASSIGN | 65 | 1 | 1 | 100.00 |
ALWAYS | 71 | 6 | 6 | 100.00 |
CONT_ASSIGN | 85 | 1 | 1 | 100.00 |
CONT_ASSIGN | 109 | 1 | 1 | 100.00 |
ALWAYS | 115 | 9 | 9 | 100.00 |
CONT_ASSIGN | 150 | 1 | 1 | 100.00 |
CONT_ASSIGN | 155 | 1 | 1 | 100.00 |
CONT_ASSIGN | 156 | 1 | 1 | 100.00 |
CONT_ASSIGN | 200 | 1 | 1 | 100.00 |
64
65 1/1 assign src_req = src_we_i | src_re_i;
Tests: T2 T21 T5
66
67 // busy indication back-pressures upstream if the register is accessed
68 // again. The busy indication is also used as a "commit" indication for
69 // resolving software and hardware write conflicts
70 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
71 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
72 1/1 src_busy_q <= '0;
Tests: T1 T2 T3
73 1/1 end else if (src_req) begin
Tests: T1 T2 T3
74 1/1 src_busy_q <= 1'b1;
Tests: T2 T21 T5
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T2 T21 T5
77 end
MISSING_ELSE
78 end
79
80 // A src_ack should only be sent if there was a src_req.
81 // src_busy_q asserts whenever there is a src_req. By association,
82 // whenever src_ack is seen, then src_busy must be high.
83 `ASSERT(SrcAckBusyChk_A, src_ack |-> src_busy_q, clk_src_i, !rst_src_ni)
84
85 1/1 assign src_busy_o = src_busy_q;
Tests: T1 T2 T3
86
87 // src_q acts as both the write holding register and the software read back
88 // register.
89 // When software performs a write, the write data is captured in src_q for
90 // CDC purposes. When not performing a write, the src_q reflects the most recent
91 // hardware value. For registers with no hardware access, this is simply the
92 // the value programmed by software (or in the case R1C, W1C etc) the value after
93 // the operation. For registers with hardware access, this reflects a potentially
94 // delayed version of the real value, as the software facing updates lag real
95 // time updates.
96 //
97 // To resolve software and hardware conflicts, the process is as follows:
98 // When software issues a write, this module asserts "busy". While busy,
99 // src_q does not take on destination value updates. Since the
100 // logic has committed to updating based on software command, there is an irreversible
101 // window from which hardware writes are ignored. Once the busy window completes,
102 // the cdc portion then begins sampling once more.
103 //
104 // This is consistent with prim_subreg_arb where during software / hardware conflicts,
105 // software is always prioritized. The main difference is the conflict resolution window
106 // is now larger instead of just one destination clock cycle.
107
108 logic busy;
109 1/1 assign busy = src_busy_q & !src_ack;
Tests: T1 T2 T3
110
111 // This is the current destination value
112 logic [DataWidth-1:0] dst_qs;
113 logic src_update;
114 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
115 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
116 1/1 src_q <= ResetVal;
Tests: T1 T2 T3
117 1/1 txn_bits_q <= '0;
Tests: T1 T2 T3
118 1/1 end else if (src_req) begin
Tests: T1 T2 T3
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 1/1 src_q <= src_wd_i & BitMask;
Tests: T2 T21 T5
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T2 T21 T5
125 1/1 end else if (src_busy_q && src_ack || src_update && !busy) begin
Tests: T1 T2 T3
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 1/1 src_q <= dst_qs;
Tests: T2 T21 T5
135 1/1 txn_bits_q <= '0;
Tests: T2 T21 T5
136 end
MISSING_ELSE
137 end
138
139 // The current design (tlul_adapter_reg) does not spit out a request if the destination it chooses
140 // (decoded from address) is busy. So this creates a situation in the current design where
141 // src_req_i and busy can never be high at the same time.
142 // While the code above could be coded directly to be expressed as `src_req & !busy`, which makes
143 // the intent clearer, it ends up causing coverage holes from the tool's perspective since that
144 // condition cannot be met.
145 // Thus we add an assertion here to ensure the condition is always satisfied.
146 `ASSERT(BusySrcReqChk_A, busy |-> !src_req, clk_src_i, !rst_src_ni)
147
148 // reserved bits are not used
149 logic unused_wd;
150 1/1 assign unused_wd = ^src_wd_i;
Tests: T1 T2 T3
151
152 // src_q is always updated in the clk_src domain.
153 // when performing an update to the destination domain, it is guaranteed
154 // to not change by protocol.
155 1/1 assign src_qs_o = src_q;
Tests: T1 T2 T3
156 1/1 assign dst_wd_o = src_q;
Tests: T1 T2 T3
157
158 ////////////////////////////
159 // CDC handling
160 ////////////////////////////
161
162 logic dst_req_from_src;
163 logic dst_req;
164
165
166 // the software transaction is pulse synced across the domain.
167 // the prim_reg_cdc_arb module handles conflicts with ongoing hardware updates.
168 prim_pulse_sync u_src_to_dst_req (
169 .clk_src_i,
170 .rst_src_ni,
171 .clk_dst_i,
172 .rst_dst_ni,
173 .src_pulse_i(src_req),
174 .dst_pulse_o(dst_req_from_src)
175 );
176
177 prim_reg_cdc_arb #(
178 .DataWidth(DataWidth),
179 .ResetVal(ResetVal),
180 .DstWrReq(DstWrReq)
181 ) u_arb (
182 .clk_src_i,
183 .rst_src_ni,
184 .clk_dst_i,
185 .rst_dst_ni,
186 .src_ack_o(src_ack),
187 .src_update_o(src_update),
188 .dst_req_i(dst_req_from_src),
189 .dst_req_o(dst_req),
190 .dst_update_i,
191 .dst_ds_i,
192 .dst_qs_i,
193 .dst_qs_o(dst_qs)
194 );
195
196
197 // Each is valid only when destination request pulse is high; this is important in not propagating
198 // the internal assertion of 'dst_req' by the 'prim_pulse_sync' channel when just one domain is
199 // reset.
200 1/1 assign {dst_we_o, dst_re_o, dst_regwen_o} = txn_bits_q & {TxnWidth{dst_req}};
Tests: T1 T2 T3
Cond Coverage for Instance : tb.dut.u_reg.u_adc_lp_sample_ctl_cdc
| Total | Covered | Percent |
Conditions | 11 | 10 | 90.91 |
Logical | 11 | 10 | 90.91 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 65
EXPRESSION (src_we_i | src_re_i)
----1--- ----2---
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T2,T21,T5 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T2,T21,T5 |
1 | 1 | Covered | T2,T21,T5 |
LINE 125
EXPRESSION ((src_busy_q && src_ack) || (src_update && ((!busy))))
-----------1----------- ------------2------------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T2,T21,T5 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T2,T21,T5 |
1 | 1 | Covered | T2,T21,T5 |
LINE 125
SUB-EXPRESSION (src_update && ((!busy)))
-----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Unreachable | |
1 | 1 | Unreachable | |
Branch Coverage for Instance : tb.dut.u_reg.u_adc_lp_sample_ctl_cdc
| Line No. | Total | Covered | Percent |
Branches |
|
8 |
8 |
100.00 |
IF |
71 |
4 |
4 |
100.00 |
IF |
115 |
4 |
4 |
100.00 |
71 if (!rst_src_ni) begin
-1-
72 src_busy_q <= '0;
==>
73 end else if (src_req) begin
-2-
74 src_busy_q <= 1'b1;
==>
75 end else if (src_ack) begin
-3-
76 src_busy_q <= 1'b0;
==>
77 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T2,T21,T5 |
0 |
0 |
1 |
Covered |
T2,T21,T5 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
115 if (!rst_src_ni) begin
-1-
116 src_q <= ResetVal;
==>
117 txn_bits_q <= '0;
118 end else if (src_req) begin
-2-
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 src_q <= src_wd_i & BitMask;
==>
124 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
125 end else if (src_busy_q && src_ack || src_update && !busy) begin
-3-
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 src_q <= dst_qs;
==>
135 txn_bits_q <= '0;
136 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T2,T21,T5 |
0 |
0 |
1 |
Covered |
T2,T21,T5 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.u_reg.u_adc_lp_sample_ctl_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
11594166 |
0 |
0 |
T2 |
25763 |
679 |
0 |
0 |
T3 |
179799 |
0 |
0 |
0 |
T4 |
105974 |
0 |
0 |
0 |
T5 |
308670 |
4865 |
0 |
0 |
T6 |
327577 |
0 |
0 |
0 |
T7 |
144286 |
0 |
0 |
0 |
T8 |
355717 |
0 |
0 |
0 |
T11 |
0 |
719 |
0 |
0 |
T12 |
0 |
7403 |
0 |
0 |
T13 |
0 |
198 |
0 |
0 |
T21 |
108025 |
358 |
0 |
0 |
T22 |
9439 |
476 |
0 |
0 |
T23 |
71080 |
292 |
0 |
0 |
T24 |
0 |
307 |
0 |
0 |
T25 |
0 |
239 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
34247075 |
33952252 |
0 |
0 |
T1 |
1197 |
1119 |
0 |
0 |
T2 |
106 |
6 |
0 |
0 |
T3 |
733 |
683 |
0 |
0 |
T4 |
1245 |
1147 |
0 |
0 |
T5 |
642 |
148 |
0 |
0 |
T6 |
674 |
579 |
0 |
0 |
T7 |
1152 |
1077 |
0 |
0 |
T21 |
899 |
18 |
0 |
0 |
T22 |
74 |
9 |
0 |
0 |
T23 |
946 |
27 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
11766 |
0 |
0 |
T2 |
25763 |
1 |
0 |
0 |
T3 |
179799 |
0 |
0 |
0 |
T4 |
105974 |
0 |
0 |
0 |
T5 |
308670 |
2 |
0 |
0 |
T6 |
327577 |
0 |
0 |
0 |
T7 |
144286 |
0 |
0 |
0 |
T8 |
355717 |
0 |
0 |
0 |
T11 |
0 |
3 |
0 |
0 |
T12 |
0 |
4 |
0 |
0 |
T13 |
0 |
2 |
0 |
0 |
T21 |
108025 |
1 |
0 |
0 |
T22 |
9439 |
1 |
0 |
0 |
T23 |
71080 |
1 |
0 |
0 |
T24 |
0 |
1 |
0 |
0 |
T25 |
0 |
1 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
2147483647 |
0 |
0 |
T1 |
299630 |
299544 |
0 |
0 |
T2 |
25763 |
25713 |
0 |
0 |
T3 |
179799 |
179705 |
0 |
0 |
T4 |
105974 |
105879 |
0 |
0 |
T5 |
308670 |
305678 |
0 |
0 |
T6 |
327577 |
327525 |
0 |
0 |
T7 |
144286 |
144204 |
0 |
0 |
T21 |
108025 |
107168 |
0 |
0 |
T22 |
9439 |
9367 |
0 |
0 |
T23 |
71080 |
70224 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_reg.u_adc_sample_ctl_cdc
| Line No. | Total | Covered | Percent |
TOTAL | | 22 | 22 | 100.00 |
CONT_ASSIGN | 65 | 1 | 1 | 100.00 |
ALWAYS | 71 | 6 | 6 | 100.00 |
CONT_ASSIGN | 85 | 1 | 1 | 100.00 |
CONT_ASSIGN | 109 | 1 | 1 | 100.00 |
ALWAYS | 115 | 9 | 9 | 100.00 |
CONT_ASSIGN | 150 | 1 | 1 | 100.00 |
CONT_ASSIGN | 155 | 1 | 1 | 100.00 |
CONT_ASSIGN | 156 | 1 | 1 | 100.00 |
CONT_ASSIGN | 200 | 1 | 1 | 100.00 |
64
65 1/1 assign src_req = src_we_i | src_re_i;
Tests: T2 T21 T5
66
67 // busy indication back-pressures upstream if the register is accessed
68 // again. The busy indication is also used as a "commit" indication for
69 // resolving software and hardware write conflicts
70 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
71 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
72 1/1 src_busy_q <= '0;
Tests: T1 T2 T3
73 1/1 end else if (src_req) begin
Tests: T1 T2 T3
74 1/1 src_busy_q <= 1'b1;
Tests: T2 T21 T5
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T2 T21 T5
77 end
MISSING_ELSE
78 end
79
80 // A src_ack should only be sent if there was a src_req.
81 // src_busy_q asserts whenever there is a src_req. By association,
82 // whenever src_ack is seen, then src_busy must be high.
83 `ASSERT(SrcAckBusyChk_A, src_ack |-> src_busy_q, clk_src_i, !rst_src_ni)
84
85 1/1 assign src_busy_o = src_busy_q;
Tests: T1 T2 T3
86
87 // src_q acts as both the write holding register and the software read back
88 // register.
89 // When software performs a write, the write data is captured in src_q for
90 // CDC purposes. When not performing a write, the src_q reflects the most recent
91 // hardware value. For registers with no hardware access, this is simply the
92 // the value programmed by software (or in the case R1C, W1C etc) the value after
93 // the operation. For registers with hardware access, this reflects a potentially
94 // delayed version of the real value, as the software facing updates lag real
95 // time updates.
96 //
97 // To resolve software and hardware conflicts, the process is as follows:
98 // When software issues a write, this module asserts "busy". While busy,
99 // src_q does not take on destination value updates. Since the
100 // logic has committed to updating based on software command, there is an irreversible
101 // window from which hardware writes are ignored. Once the busy window completes,
102 // the cdc portion then begins sampling once more.
103 //
104 // This is consistent with prim_subreg_arb where during software / hardware conflicts,
105 // software is always prioritized. The main difference is the conflict resolution window
106 // is now larger instead of just one destination clock cycle.
107
108 logic busy;
109 1/1 assign busy = src_busy_q & !src_ack;
Tests: T1 T2 T3
110
111 // This is the current destination value
112 logic [DataWidth-1:0] dst_qs;
113 logic src_update;
114 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
115 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
116 1/1 src_q <= ResetVal;
Tests: T1 T2 T3
117 1/1 txn_bits_q <= '0;
Tests: T1 T2 T3
118 1/1 end else if (src_req) begin
Tests: T1 T2 T3
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 1/1 src_q <= src_wd_i & BitMask;
Tests: T2 T21 T5
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T2 T21 T5
125 1/1 end else if (src_busy_q && src_ack || src_update && !busy) begin
Tests: T1 T2 T3
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 1/1 src_q <= dst_qs;
Tests: T2 T21 T5
135 1/1 txn_bits_q <= '0;
Tests: T2 T21 T5
136 end
MISSING_ELSE
137 end
138
139 // The current design (tlul_adapter_reg) does not spit out a request if the destination it chooses
140 // (decoded from address) is busy. So this creates a situation in the current design where
141 // src_req_i and busy can never be high at the same time.
142 // While the code above could be coded directly to be expressed as `src_req & !busy`, which makes
143 // the intent clearer, it ends up causing coverage holes from the tool's perspective since that
144 // condition cannot be met.
145 // Thus we add an assertion here to ensure the condition is always satisfied.
146 `ASSERT(BusySrcReqChk_A, busy |-> !src_req, clk_src_i, !rst_src_ni)
147
148 // reserved bits are not used
149 logic unused_wd;
150 1/1 assign unused_wd = ^src_wd_i;
Tests: T1 T2 T3
151
152 // src_q is always updated in the clk_src domain.
153 // when performing an update to the destination domain, it is guaranteed
154 // to not change by protocol.
155 1/1 assign src_qs_o = src_q;
Tests: T1 T2 T3
156 1/1 assign dst_wd_o = src_q;
Tests: T1 T2 T3
157
158 ////////////////////////////
159 // CDC handling
160 ////////////////////////////
161
162 logic dst_req_from_src;
163 logic dst_req;
164
165
166 // the software transaction is pulse synced across the domain.
167 // the prim_reg_cdc_arb module handles conflicts with ongoing hardware updates.
168 prim_pulse_sync u_src_to_dst_req (
169 .clk_src_i,
170 .rst_src_ni,
171 .clk_dst_i,
172 .rst_dst_ni,
173 .src_pulse_i(src_req),
174 .dst_pulse_o(dst_req_from_src)
175 );
176
177 prim_reg_cdc_arb #(
178 .DataWidth(DataWidth),
179 .ResetVal(ResetVal),
180 .DstWrReq(DstWrReq)
181 ) u_arb (
182 .clk_src_i,
183 .rst_src_ni,
184 .clk_dst_i,
185 .rst_dst_ni,
186 .src_ack_o(src_ack),
187 .src_update_o(src_update),
188 .dst_req_i(dst_req_from_src),
189 .dst_req_o(dst_req),
190 .dst_update_i,
191 .dst_ds_i,
192 .dst_qs_i,
193 .dst_qs_o(dst_qs)
194 );
195
196
197 // Each is valid only when destination request pulse is high; this is important in not propagating
198 // the internal assertion of 'dst_req' by the 'prim_pulse_sync' channel when just one domain is
199 // reset.
200 1/1 assign {dst_we_o, dst_re_o, dst_regwen_o} = txn_bits_q & {TxnWidth{dst_req}};
Tests: T1 T2 T3
Cond Coverage for Instance : tb.dut.u_reg.u_adc_sample_ctl_cdc
| Total | Covered | Percent |
Conditions | 11 | 10 | 90.91 |
Logical | 11 | 10 | 90.91 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 65
EXPRESSION (src_we_i | src_re_i)
----1--- ----2---
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T2,T21,T5 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T2,T21,T5 |
1 | 1 | Covered | T2,T21,T5 |
LINE 125
EXPRESSION ((src_busy_q && src_ack) || (src_update && ((!busy))))
-----------1----------- ------------2------------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T2,T21,T5 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T2,T21,T5 |
1 | 1 | Covered | T2,T21,T5 |
LINE 125
SUB-EXPRESSION (src_update && ((!busy)))
-----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Unreachable | |
1 | 1 | Unreachable | |
Branch Coverage for Instance : tb.dut.u_reg.u_adc_sample_ctl_cdc
| Line No. | Total | Covered | Percent |
Branches |
|
8 |
8 |
100.00 |
IF |
71 |
4 |
4 |
100.00 |
IF |
115 |
4 |
4 |
100.00 |
71 if (!rst_src_ni) begin
-1-
72 src_busy_q <= '0;
==>
73 end else if (src_req) begin
-2-
74 src_busy_q <= 1'b1;
==>
75 end else if (src_ack) begin
-3-
76 src_busy_q <= 1'b0;
==>
77 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T2,T21,T5 |
0 |
0 |
1 |
Covered |
T2,T21,T5 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
115 if (!rst_src_ni) begin
-1-
116 src_q <= ResetVal;
==>
117 txn_bits_q <= '0;
118 end else if (src_req) begin
-2-
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 src_q <= src_wd_i & BitMask;
==>
124 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
125 end else if (src_busy_q && src_ack || src_update && !busy) begin
-3-
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 src_q <= dst_qs;
==>
135 txn_bits_q <= '0;
136 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T2,T21,T5 |
0 |
0 |
1 |
Covered |
T2,T21,T5 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.u_reg.u_adc_sample_ctl_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
11637264 |
0 |
0 |
T2 |
25763 |
681 |
0 |
0 |
T3 |
179799 |
0 |
0 |
0 |
T4 |
105974 |
0 |
0 |
0 |
T5 |
308670 |
4889 |
0 |
0 |
T6 |
327577 |
0 |
0 |
0 |
T7 |
144286 |
0 |
0 |
0 |
T8 |
355717 |
0 |
0 |
0 |
T11 |
0 |
743 |
0 |
0 |
T12 |
0 |
7458 |
0 |
0 |
T13 |
0 |
202 |
0 |
0 |
T21 |
108025 |
360 |
0 |
0 |
T22 |
9439 |
478 |
0 |
0 |
T23 |
71080 |
301 |
0 |
0 |
T24 |
0 |
317 |
0 |
0 |
T25 |
0 |
241 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
34247075 |
33952252 |
0 |
0 |
T1 |
1197 |
1119 |
0 |
0 |
T2 |
106 |
6 |
0 |
0 |
T3 |
733 |
683 |
0 |
0 |
T4 |
1245 |
1147 |
0 |
0 |
T5 |
642 |
148 |
0 |
0 |
T6 |
674 |
579 |
0 |
0 |
T7 |
1152 |
1077 |
0 |
0 |
T21 |
899 |
18 |
0 |
0 |
T22 |
74 |
9 |
0 |
0 |
T23 |
946 |
27 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
11749 |
0 |
0 |
T2 |
25763 |
1 |
0 |
0 |
T3 |
179799 |
0 |
0 |
0 |
T4 |
105974 |
0 |
0 |
0 |
T5 |
308670 |
2 |
0 |
0 |
T6 |
327577 |
0 |
0 |
0 |
T7 |
144286 |
0 |
0 |
0 |
T8 |
355717 |
0 |
0 |
0 |
T11 |
0 |
3 |
0 |
0 |
T12 |
0 |
4 |
0 |
0 |
T13 |
0 |
2 |
0 |
0 |
T21 |
108025 |
1 |
0 |
0 |
T22 |
9439 |
1 |
0 |
0 |
T23 |
71080 |
1 |
0 |
0 |
T24 |
0 |
1 |
0 |
0 |
T25 |
0 |
1 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
2147483647 |
0 |
0 |
T1 |
299630 |
299544 |
0 |
0 |
T2 |
25763 |
25713 |
0 |
0 |
T3 |
179799 |
179705 |
0 |
0 |
T4 |
105974 |
105879 |
0 |
0 |
T5 |
308670 |
305678 |
0 |
0 |
T6 |
327577 |
327525 |
0 |
0 |
T7 |
144286 |
144204 |
0 |
0 |
T21 |
108025 |
107168 |
0 |
0 |
T22 |
9439 |
9367 |
0 |
0 |
T23 |
71080 |
70224 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_reg.u_adc_chn0_filter_ctl_0_cdc
| Line No. | Total | Covered | Percent |
TOTAL | | 22 | 22 | 100.00 |
CONT_ASSIGN | 65 | 1 | 1 | 100.00 |
ALWAYS | 71 | 6 | 6 | 100.00 |
CONT_ASSIGN | 85 | 1 | 1 | 100.00 |
CONT_ASSIGN | 109 | 1 | 1 | 100.00 |
ALWAYS | 115 | 9 | 9 | 100.00 |
CONT_ASSIGN | 150 | 1 | 1 | 100.00 |
CONT_ASSIGN | 155 | 1 | 1 | 100.00 |
CONT_ASSIGN | 156 | 1 | 1 | 100.00 |
CONT_ASSIGN | 200 | 1 | 1 | 100.00 |
64
65 1/1 assign src_req = src_we_i | src_re_i;
Tests: T5 T11 T12
66
67 // busy indication back-pressures upstream if the register is accessed
68 // again. The busy indication is also used as a "commit" indication for
69 // resolving software and hardware write conflicts
70 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
71 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
72 1/1 src_busy_q <= '0;
Tests: T1 T2 T3
73 1/1 end else if (src_req) begin
Tests: T1 T2 T3
74 1/1 src_busy_q <= 1'b1;
Tests: T5 T11 T12
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T5 T11 T12
77 end
MISSING_ELSE
78 end
79
80 // A src_ack should only be sent if there was a src_req.
81 // src_busy_q asserts whenever there is a src_req. By association,
82 // whenever src_ack is seen, then src_busy must be high.
83 `ASSERT(SrcAckBusyChk_A, src_ack |-> src_busy_q, clk_src_i, !rst_src_ni)
84
85 1/1 assign src_busy_o = src_busy_q;
Tests: T1 T2 T3
86
87 // src_q acts as both the write holding register and the software read back
88 // register.
89 // When software performs a write, the write data is captured in src_q for
90 // CDC purposes. When not performing a write, the src_q reflects the most recent
91 // hardware value. For registers with no hardware access, this is simply the
92 // the value programmed by software (or in the case R1C, W1C etc) the value after
93 // the operation. For registers with hardware access, this reflects a potentially
94 // delayed version of the real value, as the software facing updates lag real
95 // time updates.
96 //
97 // To resolve software and hardware conflicts, the process is as follows:
98 // When software issues a write, this module asserts "busy". While busy,
99 // src_q does not take on destination value updates. Since the
100 // logic has committed to updating based on software command, there is an irreversible
101 // window from which hardware writes are ignored. Once the busy window completes,
102 // the cdc portion then begins sampling once more.
103 //
104 // This is consistent with prim_subreg_arb where during software / hardware conflicts,
105 // software is always prioritized. The main difference is the conflict resolution window
106 // is now larger instead of just one destination clock cycle.
107
108 logic busy;
109 1/1 assign busy = src_busy_q & !src_ack;
Tests: T1 T2 T3
110
111 // This is the current destination value
112 logic [DataWidth-1:0] dst_qs;
113 logic src_update;
114 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
115 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
116 1/1 src_q <= ResetVal;
Tests: T1 T2 T3
117 1/1 txn_bits_q <= '0;
Tests: T1 T2 T3
118 1/1 end else if (src_req) begin
Tests: T1 T2 T3
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 1/1 src_q <= src_wd_i & BitMask;
Tests: T5 T11 T12
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T5 T11 T12
125 1/1 end else if (src_busy_q && src_ack || src_update && !busy) begin
Tests: T1 T2 T3
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 1/1 src_q <= dst_qs;
Tests: T5 T11 T12
135 1/1 txn_bits_q <= '0;
Tests: T5 T11 T12
136 end
MISSING_ELSE
137 end
138
139 // The current design (tlul_adapter_reg) does not spit out a request if the destination it chooses
140 // (decoded from address) is busy. So this creates a situation in the current design where
141 // src_req_i and busy can never be high at the same time.
142 // While the code above could be coded directly to be expressed as `src_req & !busy`, which makes
143 // the intent clearer, it ends up causing coverage holes from the tool's perspective since that
144 // condition cannot be met.
145 // Thus we add an assertion here to ensure the condition is always satisfied.
146 `ASSERT(BusySrcReqChk_A, busy |-> !src_req, clk_src_i, !rst_src_ni)
147
148 // reserved bits are not used
149 logic unused_wd;
150 1/1 assign unused_wd = ^src_wd_i;
Tests: T1 T2 T3
151
152 // src_q is always updated in the clk_src domain.
153 // when performing an update to the destination domain, it is guaranteed
154 // to not change by protocol.
155 1/1 assign src_qs_o = src_q;
Tests: T1 T2 T3
156 1/1 assign dst_wd_o = src_q;
Tests: T1 T2 T3
157
158 ////////////////////////////
159 // CDC handling
160 ////////////////////////////
161
162 logic dst_req_from_src;
163 logic dst_req;
164
165
166 // the software transaction is pulse synced across the domain.
167 // the prim_reg_cdc_arb module handles conflicts with ongoing hardware updates.
168 prim_pulse_sync u_src_to_dst_req (
169 .clk_src_i,
170 .rst_src_ni,
171 .clk_dst_i,
172 .rst_dst_ni,
173 .src_pulse_i(src_req),
174 .dst_pulse_o(dst_req_from_src)
175 );
176
177 prim_reg_cdc_arb #(
178 .DataWidth(DataWidth),
179 .ResetVal(ResetVal),
180 .DstWrReq(DstWrReq)
181 ) u_arb (
182 .clk_src_i,
183 .rst_src_ni,
184 .clk_dst_i,
185 .rst_dst_ni,
186 .src_ack_o(src_ack),
187 .src_update_o(src_update),
188 .dst_req_i(dst_req_from_src),
189 .dst_req_o(dst_req),
190 .dst_update_i,
191 .dst_ds_i,
192 .dst_qs_i,
193 .dst_qs_o(dst_qs)
194 );
195
196
197 // Each is valid only when destination request pulse is high; this is important in not propagating
198 // the internal assertion of 'dst_req' by the 'prim_pulse_sync' channel when just one domain is
199 // reset.
200 1/1 assign {dst_we_o, dst_re_o, dst_regwen_o} = txn_bits_q & {TxnWidth{dst_req}};
Tests: T1 T2 T3
Cond Coverage for Instance : tb.dut.u_reg.u_adc_chn0_filter_ctl_0_cdc
| Total | Covered | Percent |
Conditions | 11 | 10 | 90.91 |
Logical | 11 | 10 | 90.91 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 65
EXPRESSION (src_we_i | src_re_i)
----1--- ----2---
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T5,T11,T12 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T5,T11,T12 |
1 | 1 | Covered | T5,T11,T12 |
LINE 125
EXPRESSION ((src_busy_q && src_ack) || (src_update && ((!busy))))
-----------1----------- ------------2------------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T5,T11,T12 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T5,T11,T12 |
1 | 1 | Covered | T5,T11,T12 |
LINE 125
SUB-EXPRESSION (src_update && ((!busy)))
-----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Unreachable | |
1 | 1 | Unreachable | |
Branch Coverage for Instance : tb.dut.u_reg.u_adc_chn0_filter_ctl_0_cdc
| Line No. | Total | Covered | Percent |
Branches |
|
8 |
8 |
100.00 |
IF |
71 |
4 |
4 |
100.00 |
IF |
115 |
4 |
4 |
100.00 |
71 if (!rst_src_ni) begin
-1-
72 src_busy_q <= '0;
==>
73 end else if (src_req) begin
-2-
74 src_busy_q <= 1'b1;
==>
75 end else if (src_ack) begin
-3-
76 src_busy_q <= 1'b0;
==>
77 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T5,T11,T12 |
0 |
0 |
1 |
Covered |
T5,T11,T12 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
115 if (!rst_src_ni) begin
-1-
116 src_q <= ResetVal;
==>
117 txn_bits_q <= '0;
118 end else if (src_req) begin
-2-
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 src_q <= src_wd_i & BitMask;
==>
124 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
125 end else if (src_busy_q && src_ack || src_update && !busy) begin
-3-
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 src_q <= dst_qs;
==>
135 txn_bits_q <= '0;
136 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T5,T11,T12 |
0 |
0 |
1 |
Covered |
T5,T11,T12 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.u_reg.u_adc_chn0_filter_ctl_0_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
1708648 |
0 |
0 |
T5 |
308670 |
1903 |
0 |
0 |
T6 |
327577 |
0 |
0 |
0 |
T7 |
144286 |
0 |
0 |
0 |
T8 |
355717 |
0 |
0 |
0 |
T9 |
235626 |
0 |
0 |
0 |
T10 |
372228 |
0 |
0 |
0 |
T11 |
112949 |
524 |
0 |
0 |
T12 |
0 |
3978 |
0 |
0 |
T13 |
0 |
266 |
0 |
0 |
T14 |
0 |
349 |
0 |
0 |
T15 |
0 |
399 |
0 |
0 |
T16 |
0 |
373 |
0 |
0 |
T17 |
0 |
373 |
0 |
0 |
T18 |
0 |
638 |
0 |
0 |
T19 |
0 |
2436 |
0 |
0 |
T22 |
9439 |
0 |
0 |
0 |
T23 |
71080 |
0 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
34247075 |
33952252 |
0 |
0 |
T1 |
1197 |
1119 |
0 |
0 |
T2 |
106 |
6 |
0 |
0 |
T3 |
733 |
683 |
0 |
0 |
T4 |
1245 |
1147 |
0 |
0 |
T5 |
642 |
148 |
0 |
0 |
T6 |
674 |
579 |
0 |
0 |
T7 |
1152 |
1077 |
0 |
0 |
T21 |
899 |
18 |
0 |
0 |
T22 |
74 |
9 |
0 |
0 |
T23 |
946 |
27 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
1984 |
0 |
0 |
T5 |
308670 |
1 |
0 |
0 |
T6 |
327577 |
0 |
0 |
0 |
T7 |
144286 |
0 |
0 |
0 |
T8 |
355717 |
0 |
0 |
0 |
T9 |
235626 |
0 |
0 |
0 |
T10 |
372228 |
0 |
0 |
0 |
T11 |
112949 |
2 |
0 |
0 |
T12 |
0 |
2 |
0 |
0 |
T13 |
0 |
2 |
0 |
0 |
T14 |
0 |
1 |
0 |
0 |
T15 |
0 |
1 |
0 |
0 |
T16 |
0 |
1 |
0 |
0 |
T17 |
0 |
1 |
0 |
0 |
T18 |
0 |
2 |
0 |
0 |
T19 |
0 |
6 |
0 |
0 |
T22 |
9439 |
0 |
0 |
0 |
T23 |
71080 |
0 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
2147483647 |
0 |
0 |
T1 |
299630 |
299544 |
0 |
0 |
T2 |
25763 |
25713 |
0 |
0 |
T3 |
179799 |
179705 |
0 |
0 |
T4 |
105974 |
105879 |
0 |
0 |
T5 |
308670 |
305678 |
0 |
0 |
T6 |
327577 |
327525 |
0 |
0 |
T7 |
144286 |
144204 |
0 |
0 |
T21 |
108025 |
107168 |
0 |
0 |
T22 |
9439 |
9367 |
0 |
0 |
T23 |
71080 |
70224 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_reg.u_adc_chn0_filter_ctl_1_cdc
| Line No. | Total | Covered | Percent |
TOTAL | | 22 | 22 | 100.00 |
CONT_ASSIGN | 65 | 1 | 1 | 100.00 |
ALWAYS | 71 | 6 | 6 | 100.00 |
CONT_ASSIGN | 85 | 1 | 1 | 100.00 |
CONT_ASSIGN | 109 | 1 | 1 | 100.00 |
ALWAYS | 115 | 9 | 9 | 100.00 |
CONT_ASSIGN | 150 | 1 | 1 | 100.00 |
CONT_ASSIGN | 155 | 1 | 1 | 100.00 |
CONT_ASSIGN | 156 | 1 | 1 | 100.00 |
CONT_ASSIGN | 200 | 1 | 1 | 100.00 |
64
65 1/1 assign src_req = src_we_i | src_re_i;
Tests: T11 T12 T13
66
67 // busy indication back-pressures upstream if the register is accessed
68 // again. The busy indication is also used as a "commit" indication for
69 // resolving software and hardware write conflicts
70 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
71 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
72 1/1 src_busy_q <= '0;
Tests: T1 T2 T3
73 1/1 end else if (src_req) begin
Tests: T1 T2 T3
74 1/1 src_busy_q <= 1'b1;
Tests: T11 T12 T13
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T11 T12 T13
77 end
MISSING_ELSE
78 end
79
80 // A src_ack should only be sent if there was a src_req.
81 // src_busy_q asserts whenever there is a src_req. By association,
82 // whenever src_ack is seen, then src_busy must be high.
83 `ASSERT(SrcAckBusyChk_A, src_ack |-> src_busy_q, clk_src_i, !rst_src_ni)
84
85 1/1 assign src_busy_o = src_busy_q;
Tests: T1 T2 T3
86
87 // src_q acts as both the write holding register and the software read back
88 // register.
89 // When software performs a write, the write data is captured in src_q for
90 // CDC purposes. When not performing a write, the src_q reflects the most recent
91 // hardware value. For registers with no hardware access, this is simply the
92 // the value programmed by software (or in the case R1C, W1C etc) the value after
93 // the operation. For registers with hardware access, this reflects a potentially
94 // delayed version of the real value, as the software facing updates lag real
95 // time updates.
96 //
97 // To resolve software and hardware conflicts, the process is as follows:
98 // When software issues a write, this module asserts "busy". While busy,
99 // src_q does not take on destination value updates. Since the
100 // logic has committed to updating based on software command, there is an irreversible
101 // window from which hardware writes are ignored. Once the busy window completes,
102 // the cdc portion then begins sampling once more.
103 //
104 // This is consistent with prim_subreg_arb where during software / hardware conflicts,
105 // software is always prioritized. The main difference is the conflict resolution window
106 // is now larger instead of just one destination clock cycle.
107
108 logic busy;
109 1/1 assign busy = src_busy_q & !src_ack;
Tests: T1 T2 T3
110
111 // This is the current destination value
112 logic [DataWidth-1:0] dst_qs;
113 logic src_update;
114 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
115 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
116 1/1 src_q <= ResetVal;
Tests: T1 T2 T3
117 1/1 txn_bits_q <= '0;
Tests: T1 T2 T3
118 1/1 end else if (src_req) begin
Tests: T1 T2 T3
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 1/1 src_q <= src_wd_i & BitMask;
Tests: T11 T12 T13
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T11 T12 T13
125 1/1 end else if (src_busy_q && src_ack || src_update && !busy) begin
Tests: T1 T2 T3
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 1/1 src_q <= dst_qs;
Tests: T11 T12 T13
135 1/1 txn_bits_q <= '0;
Tests: T11 T12 T13
136 end
MISSING_ELSE
137 end
138
139 // The current design (tlul_adapter_reg) does not spit out a request if the destination it chooses
140 // (decoded from address) is busy. So this creates a situation in the current design where
141 // src_req_i and busy can never be high at the same time.
142 // While the code above could be coded directly to be expressed as `src_req & !busy`, which makes
143 // the intent clearer, it ends up causing coverage holes from the tool's perspective since that
144 // condition cannot be met.
145 // Thus we add an assertion here to ensure the condition is always satisfied.
146 `ASSERT(BusySrcReqChk_A, busy |-> !src_req, clk_src_i, !rst_src_ni)
147
148 // reserved bits are not used
149 logic unused_wd;
150 1/1 assign unused_wd = ^src_wd_i;
Tests: T1 T2 T3
151
152 // src_q is always updated in the clk_src domain.
153 // when performing an update to the destination domain, it is guaranteed
154 // to not change by protocol.
155 1/1 assign src_qs_o = src_q;
Tests: T1 T2 T3
156 1/1 assign dst_wd_o = src_q;
Tests: T1 T2 T3
157
158 ////////////////////////////
159 // CDC handling
160 ////////////////////////////
161
162 logic dst_req_from_src;
163 logic dst_req;
164
165
166 // the software transaction is pulse synced across the domain.
167 // the prim_reg_cdc_arb module handles conflicts with ongoing hardware updates.
168 prim_pulse_sync u_src_to_dst_req (
169 .clk_src_i,
170 .rst_src_ni,
171 .clk_dst_i,
172 .rst_dst_ni,
173 .src_pulse_i(src_req),
174 .dst_pulse_o(dst_req_from_src)
175 );
176
177 prim_reg_cdc_arb #(
178 .DataWidth(DataWidth),
179 .ResetVal(ResetVal),
180 .DstWrReq(DstWrReq)
181 ) u_arb (
182 .clk_src_i,
183 .rst_src_ni,
184 .clk_dst_i,
185 .rst_dst_ni,
186 .src_ack_o(src_ack),
187 .src_update_o(src_update),
188 .dst_req_i(dst_req_from_src),
189 .dst_req_o(dst_req),
190 .dst_update_i,
191 .dst_ds_i,
192 .dst_qs_i,
193 .dst_qs_o(dst_qs)
194 );
195
196
197 // Each is valid only when destination request pulse is high; this is important in not propagating
198 // the internal assertion of 'dst_req' by the 'prim_pulse_sync' channel when just one domain is
199 // reset.
200 1/1 assign {dst_we_o, dst_re_o, dst_regwen_o} = txn_bits_q & {TxnWidth{dst_req}};
Tests: T1 T2 T3
Cond Coverage for Instance : tb.dut.u_reg.u_adc_chn0_filter_ctl_1_cdc
| Total | Covered | Percent |
Conditions | 11 | 10 | 90.91 |
Logical | 11 | 10 | 90.91 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 65
EXPRESSION (src_we_i | src_re_i)
----1--- ----2---
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T11,T12,T13 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T11,T12,T13 |
1 | 1 | Covered | T11,T12,T13 |
LINE 125
EXPRESSION ((src_busy_q && src_ack) || (src_update && ((!busy))))
-----------1----------- ------------2------------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T11,T12,T13 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T11,T12,T13 |
1 | 1 | Covered | T11,T12,T13 |
LINE 125
SUB-EXPRESSION (src_update && ((!busy)))
-----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Unreachable | |
1 | 1 | Unreachable | |
Branch Coverage for Instance : tb.dut.u_reg.u_adc_chn0_filter_ctl_1_cdc
| Line No. | Total | Covered | Percent |
Branches |
|
8 |
8 |
100.00 |
IF |
71 |
4 |
4 |
100.00 |
IF |
115 |
4 |
4 |
100.00 |
71 if (!rst_src_ni) begin
-1-
72 src_busy_q <= '0;
==>
73 end else if (src_req) begin
-2-
74 src_busy_q <= 1'b1;
==>
75 end else if (src_ack) begin
-3-
76 src_busy_q <= 1'b0;
==>
77 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T11,T12,T13 |
0 |
0 |
1 |
Covered |
T11,T12,T13 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
115 if (!rst_src_ni) begin
-1-
116 src_q <= ResetVal;
==>
117 txn_bits_q <= '0;
118 end else if (src_req) begin
-2-
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 src_q <= src_wd_i & BitMask;
==>
124 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
125 end else if (src_busy_q && src_ack || src_update && !busy) begin
-3-
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 src_q <= dst_qs;
==>
135 txn_bits_q <= '0;
136 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T11,T12,T13 |
0 |
0 |
1 |
Covered |
T11,T12,T13 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.u_reg.u_adc_chn0_filter_ctl_1_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
1617953 |
0 |
0 |
T11 |
112949 |
494 |
0 |
0 |
T12 |
255584 |
1986 |
0 |
0 |
T13 |
171132 |
262 |
0 |
0 |
T14 |
395989 |
334 |
0 |
0 |
T15 |
0 |
387 |
0 |
0 |
T16 |
0 |
371 |
0 |
0 |
T17 |
0 |
371 |
0 |
0 |
T18 |
0 |
634 |
0 |
0 |
T19 |
0 |
1542 |
0 |
0 |
T20 |
0 |
282 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
T25 |
50651 |
0 |
0 |
0 |
T26 |
109966 |
0 |
0 |
0 |
T27 |
183417 |
0 |
0 |
0 |
T28 |
180001 |
0 |
0 |
0 |
T29 |
96579 |
0 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
34247075 |
33952252 |
0 |
0 |
T1 |
1197 |
1119 |
0 |
0 |
T2 |
106 |
6 |
0 |
0 |
T3 |
733 |
683 |
0 |
0 |
T4 |
1245 |
1147 |
0 |
0 |
T5 |
642 |
148 |
0 |
0 |
T6 |
674 |
579 |
0 |
0 |
T7 |
1152 |
1077 |
0 |
0 |
T21 |
899 |
18 |
0 |
0 |
T22 |
74 |
9 |
0 |
0 |
T23 |
946 |
27 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
1885 |
0 |
0 |
T11 |
112949 |
2 |
0 |
0 |
T12 |
255584 |
1 |
0 |
0 |
T13 |
171132 |
2 |
0 |
0 |
T14 |
395989 |
1 |
0 |
0 |
T15 |
0 |
1 |
0 |
0 |
T16 |
0 |
1 |
0 |
0 |
T17 |
0 |
1 |
0 |
0 |
T18 |
0 |
2 |
0 |
0 |
T19 |
0 |
4 |
0 |
0 |
T20 |
0 |
1 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
T25 |
50651 |
0 |
0 |
0 |
T26 |
109966 |
0 |
0 |
0 |
T27 |
183417 |
0 |
0 |
0 |
T28 |
180001 |
0 |
0 |
0 |
T29 |
96579 |
0 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
2147483647 |
0 |
0 |
T1 |
299630 |
299544 |
0 |
0 |
T2 |
25763 |
25713 |
0 |
0 |
T3 |
179799 |
179705 |
0 |
0 |
T4 |
105974 |
105879 |
0 |
0 |
T5 |
308670 |
305678 |
0 |
0 |
T6 |
327577 |
327525 |
0 |
0 |
T7 |
144286 |
144204 |
0 |
0 |
T21 |
108025 |
107168 |
0 |
0 |
T22 |
9439 |
9367 |
0 |
0 |
T23 |
71080 |
70224 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_reg.u_adc_chn0_filter_ctl_2_cdc
| Line No. | Total | Covered | Percent |
TOTAL | | 22 | 22 | 100.00 |
CONT_ASSIGN | 65 | 1 | 1 | 100.00 |
ALWAYS | 71 | 6 | 6 | 100.00 |
CONT_ASSIGN | 85 | 1 | 1 | 100.00 |
CONT_ASSIGN | 109 | 1 | 1 | 100.00 |
ALWAYS | 115 | 9 | 9 | 100.00 |
CONT_ASSIGN | 150 | 1 | 1 | 100.00 |
CONT_ASSIGN | 155 | 1 | 1 | 100.00 |
CONT_ASSIGN | 156 | 1 | 1 | 100.00 |
CONT_ASSIGN | 200 | 1 | 1 | 100.00 |
64
65 1/1 assign src_req = src_we_i | src_re_i;
Tests: T11 T12 T13
66
67 // busy indication back-pressures upstream if the register is accessed
68 // again. The busy indication is also used as a "commit" indication for
69 // resolving software and hardware write conflicts
70 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
71 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
72 1/1 src_busy_q <= '0;
Tests: T1 T2 T3
73 1/1 end else if (src_req) begin
Tests: T1 T2 T3
74 1/1 src_busy_q <= 1'b1;
Tests: T11 T12 T13
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T11 T12 T13
77 end
MISSING_ELSE
78 end
79
80 // A src_ack should only be sent if there was a src_req.
81 // src_busy_q asserts whenever there is a src_req. By association,
82 // whenever src_ack is seen, then src_busy must be high.
83 `ASSERT(SrcAckBusyChk_A, src_ack |-> src_busy_q, clk_src_i, !rst_src_ni)
84
85 1/1 assign src_busy_o = src_busy_q;
Tests: T1 T2 T3
86
87 // src_q acts as both the write holding register and the software read back
88 // register.
89 // When software performs a write, the write data is captured in src_q for
90 // CDC purposes. When not performing a write, the src_q reflects the most recent
91 // hardware value. For registers with no hardware access, this is simply the
92 // the value programmed by software (or in the case R1C, W1C etc) the value after
93 // the operation. For registers with hardware access, this reflects a potentially
94 // delayed version of the real value, as the software facing updates lag real
95 // time updates.
96 //
97 // To resolve software and hardware conflicts, the process is as follows:
98 // When software issues a write, this module asserts "busy". While busy,
99 // src_q does not take on destination value updates. Since the
100 // logic has committed to updating based on software command, there is an irreversible
101 // window from which hardware writes are ignored. Once the busy window completes,
102 // the cdc portion then begins sampling once more.
103 //
104 // This is consistent with prim_subreg_arb where during software / hardware conflicts,
105 // software is always prioritized. The main difference is the conflict resolution window
106 // is now larger instead of just one destination clock cycle.
107
108 logic busy;
109 1/1 assign busy = src_busy_q & !src_ack;
Tests: T1 T2 T3
110
111 // This is the current destination value
112 logic [DataWidth-1:0] dst_qs;
113 logic src_update;
114 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
115 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
116 1/1 src_q <= ResetVal;
Tests: T1 T2 T3
117 1/1 txn_bits_q <= '0;
Tests: T1 T2 T3
118 1/1 end else if (src_req) begin
Tests: T1 T2 T3
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 1/1 src_q <= src_wd_i & BitMask;
Tests: T11 T12 T13
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T11 T12 T13
125 1/1 end else if (src_busy_q && src_ack || src_update && !busy) begin
Tests: T1 T2 T3
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 1/1 src_q <= dst_qs;
Tests: T11 T12 T13
135 1/1 txn_bits_q <= '0;
Tests: T11 T12 T13
136 end
MISSING_ELSE
137 end
138
139 // The current design (tlul_adapter_reg) does not spit out a request if the destination it chooses
140 // (decoded from address) is busy. So this creates a situation in the current design where
141 // src_req_i and busy can never be high at the same time.
142 // While the code above could be coded directly to be expressed as `src_req & !busy`, which makes
143 // the intent clearer, it ends up causing coverage holes from the tool's perspective since that
144 // condition cannot be met.
145 // Thus we add an assertion here to ensure the condition is always satisfied.
146 `ASSERT(BusySrcReqChk_A, busy |-> !src_req, clk_src_i, !rst_src_ni)
147
148 // reserved bits are not used
149 logic unused_wd;
150 1/1 assign unused_wd = ^src_wd_i;
Tests: T1 T2 T3
151
152 // src_q is always updated in the clk_src domain.
153 // when performing an update to the destination domain, it is guaranteed
154 // to not change by protocol.
155 1/1 assign src_qs_o = src_q;
Tests: T1 T2 T3
156 1/1 assign dst_wd_o = src_q;
Tests: T1 T2 T3
157
158 ////////////////////////////
159 // CDC handling
160 ////////////////////////////
161
162 logic dst_req_from_src;
163 logic dst_req;
164
165
166 // the software transaction is pulse synced across the domain.
167 // the prim_reg_cdc_arb module handles conflicts with ongoing hardware updates.
168 prim_pulse_sync u_src_to_dst_req (
169 .clk_src_i,
170 .rst_src_ni,
171 .clk_dst_i,
172 .rst_dst_ni,
173 .src_pulse_i(src_req),
174 .dst_pulse_o(dst_req_from_src)
175 );
176
177 prim_reg_cdc_arb #(
178 .DataWidth(DataWidth),
179 .ResetVal(ResetVal),
180 .DstWrReq(DstWrReq)
181 ) u_arb (
182 .clk_src_i,
183 .rst_src_ni,
184 .clk_dst_i,
185 .rst_dst_ni,
186 .src_ack_o(src_ack),
187 .src_update_o(src_update),
188 .dst_req_i(dst_req_from_src),
189 .dst_req_o(dst_req),
190 .dst_update_i,
191 .dst_ds_i,
192 .dst_qs_i,
193 .dst_qs_o(dst_qs)
194 );
195
196
197 // Each is valid only when destination request pulse is high; this is important in not propagating
198 // the internal assertion of 'dst_req' by the 'prim_pulse_sync' channel when just one domain is
199 // reset.
200 1/1 assign {dst_we_o, dst_re_o, dst_regwen_o} = txn_bits_q & {TxnWidth{dst_req}};
Tests: T1 T2 T3
Cond Coverage for Instance : tb.dut.u_reg.u_adc_chn0_filter_ctl_2_cdc
| Total | Covered | Percent |
Conditions | 11 | 10 | 90.91 |
Logical | 11 | 10 | 90.91 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 65
EXPRESSION (src_we_i | src_re_i)
----1--- ----2---
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T11,T12,T13 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T11,T12,T13 |
1 | 1 | Covered | T11,T12,T13 |
LINE 125
EXPRESSION ((src_busy_q && src_ack) || (src_update && ((!busy))))
-----------1----------- ------------2------------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T11,T12,T13 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T11,T12,T13 |
1 | 1 | Covered | T11,T12,T13 |
LINE 125
SUB-EXPRESSION (src_update && ((!busy)))
-----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Unreachable | |
1 | 1 | Unreachable | |
Branch Coverage for Instance : tb.dut.u_reg.u_adc_chn0_filter_ctl_2_cdc
| Line No. | Total | Covered | Percent |
Branches |
|
8 |
8 |
100.00 |
IF |
71 |
4 |
4 |
100.00 |
IF |
115 |
4 |
4 |
100.00 |
71 if (!rst_src_ni) begin
-1-
72 src_busy_q <= '0;
==>
73 end else if (src_req) begin
-2-
74 src_busy_q <= 1'b1;
==>
75 end else if (src_ack) begin
-3-
76 src_busy_q <= 1'b0;
==>
77 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T11,T12,T13 |
0 |
0 |
1 |
Covered |
T11,T12,T13 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
115 if (!rst_src_ni) begin
-1-
116 src_q <= ResetVal;
==>
117 txn_bits_q <= '0;
118 end else if (src_req) begin
-2-
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 src_q <= src_wd_i & BitMask;
==>
124 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
125 end else if (src_busy_q && src_ack || src_update && !busy) begin
-3-
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 src_q <= dst_qs;
==>
135 txn_bits_q <= '0;
136 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T11,T12,T13 |
0 |
0 |
1 |
Covered |
T11,T12,T13 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.u_reg.u_adc_chn0_filter_ctl_2_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
1616643 |
0 |
0 |
T11 |
112949 |
471 |
0 |
0 |
T12 |
255584 |
1978 |
0 |
0 |
T13 |
171132 |
258 |
0 |
0 |
T14 |
395989 |
320 |
0 |
0 |
T15 |
0 |
384 |
0 |
0 |
T16 |
0 |
369 |
0 |
0 |
T17 |
0 |
369 |
0 |
0 |
T18 |
0 |
630 |
0 |
0 |
T19 |
0 |
1526 |
0 |
0 |
T20 |
0 |
275 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
T25 |
50651 |
0 |
0 |
0 |
T26 |
109966 |
0 |
0 |
0 |
T27 |
183417 |
0 |
0 |
0 |
T28 |
180001 |
0 |
0 |
0 |
T29 |
96579 |
0 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
34247075 |
33952252 |
0 |
0 |
T1 |
1197 |
1119 |
0 |
0 |
T2 |
106 |
6 |
0 |
0 |
T3 |
733 |
683 |
0 |
0 |
T4 |
1245 |
1147 |
0 |
0 |
T5 |
642 |
148 |
0 |
0 |
T6 |
674 |
579 |
0 |
0 |
T7 |
1152 |
1077 |
0 |
0 |
T21 |
899 |
18 |
0 |
0 |
T22 |
74 |
9 |
0 |
0 |
T23 |
946 |
27 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
1898 |
0 |
0 |
T11 |
112949 |
2 |
0 |
0 |
T12 |
255584 |
1 |
0 |
0 |
T13 |
171132 |
2 |
0 |
0 |
T14 |
395989 |
1 |
0 |
0 |
T15 |
0 |
1 |
0 |
0 |
T16 |
0 |
1 |
0 |
0 |
T17 |
0 |
1 |
0 |
0 |
T18 |
0 |
2 |
0 |
0 |
T19 |
0 |
4 |
0 |
0 |
T20 |
0 |
1 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
T25 |
50651 |
0 |
0 |
0 |
T26 |
109966 |
0 |
0 |
0 |
T27 |
183417 |
0 |
0 |
0 |
T28 |
180001 |
0 |
0 |
0 |
T29 |
96579 |
0 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
2147483647 |
0 |
0 |
T1 |
299630 |
299544 |
0 |
0 |
T2 |
25763 |
25713 |
0 |
0 |
T3 |
179799 |
179705 |
0 |
0 |
T4 |
105974 |
105879 |
0 |
0 |
T5 |
308670 |
305678 |
0 |
0 |
T6 |
327577 |
327525 |
0 |
0 |
T7 |
144286 |
144204 |
0 |
0 |
T21 |
108025 |
107168 |
0 |
0 |
T22 |
9439 |
9367 |
0 |
0 |
T23 |
71080 |
70224 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_reg.u_adc_chn0_filter_ctl_3_cdc
| Line No. | Total | Covered | Percent |
TOTAL | | 22 | 22 | 100.00 |
CONT_ASSIGN | 65 | 1 | 1 | 100.00 |
ALWAYS | 71 | 6 | 6 | 100.00 |
CONT_ASSIGN | 85 | 1 | 1 | 100.00 |
CONT_ASSIGN | 109 | 1 | 1 | 100.00 |
ALWAYS | 115 | 9 | 9 | 100.00 |
CONT_ASSIGN | 150 | 1 | 1 | 100.00 |
CONT_ASSIGN | 155 | 1 | 1 | 100.00 |
CONT_ASSIGN | 156 | 1 | 1 | 100.00 |
CONT_ASSIGN | 200 | 1 | 1 | 100.00 |
64
65 1/1 assign src_req = src_we_i | src_re_i;
Tests: T11 T12 T13
66
67 // busy indication back-pressures upstream if the register is accessed
68 // again. The busy indication is also used as a "commit" indication for
69 // resolving software and hardware write conflicts
70 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
71 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
72 1/1 src_busy_q <= '0;
Tests: T1 T2 T3
73 1/1 end else if (src_req) begin
Tests: T1 T2 T3
74 1/1 src_busy_q <= 1'b1;
Tests: T11 T12 T13
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T11 T12 T13
77 end
MISSING_ELSE
78 end
79
80 // A src_ack should only be sent if there was a src_req.
81 // src_busy_q asserts whenever there is a src_req. By association,
82 // whenever src_ack is seen, then src_busy must be high.
83 `ASSERT(SrcAckBusyChk_A, src_ack |-> src_busy_q, clk_src_i, !rst_src_ni)
84
85 1/1 assign src_busy_o = src_busy_q;
Tests: T1 T2 T3
86
87 // src_q acts as both the write holding register and the software read back
88 // register.
89 // When software performs a write, the write data is captured in src_q for
90 // CDC purposes. When not performing a write, the src_q reflects the most recent
91 // hardware value. For registers with no hardware access, this is simply the
92 // the value programmed by software (or in the case R1C, W1C etc) the value after
93 // the operation. For registers with hardware access, this reflects a potentially
94 // delayed version of the real value, as the software facing updates lag real
95 // time updates.
96 //
97 // To resolve software and hardware conflicts, the process is as follows:
98 // When software issues a write, this module asserts "busy". While busy,
99 // src_q does not take on destination value updates. Since the
100 // logic has committed to updating based on software command, there is an irreversible
101 // window from which hardware writes are ignored. Once the busy window completes,
102 // the cdc portion then begins sampling once more.
103 //
104 // This is consistent with prim_subreg_arb where during software / hardware conflicts,
105 // software is always prioritized. The main difference is the conflict resolution window
106 // is now larger instead of just one destination clock cycle.
107
108 logic busy;
109 1/1 assign busy = src_busy_q & !src_ack;
Tests: T1 T2 T3
110
111 // This is the current destination value
112 logic [DataWidth-1:0] dst_qs;
113 logic src_update;
114 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
115 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
116 1/1 src_q <= ResetVal;
Tests: T1 T2 T3
117 1/1 txn_bits_q <= '0;
Tests: T1 T2 T3
118 1/1 end else if (src_req) begin
Tests: T1 T2 T3
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 1/1 src_q <= src_wd_i & BitMask;
Tests: T11 T12 T13
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T11 T12 T13
125 1/1 end else if (src_busy_q && src_ack || src_update && !busy) begin
Tests: T1 T2 T3
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 1/1 src_q <= dst_qs;
Tests: T11 T12 T13
135 1/1 txn_bits_q <= '0;
Tests: T11 T12 T13
136 end
MISSING_ELSE
137 end
138
139 // The current design (tlul_adapter_reg) does not spit out a request if the destination it chooses
140 // (decoded from address) is busy. So this creates a situation in the current design where
141 // src_req_i and busy can never be high at the same time.
142 // While the code above could be coded directly to be expressed as `src_req & !busy`, which makes
143 // the intent clearer, it ends up causing coverage holes from the tool's perspective since that
144 // condition cannot be met.
145 // Thus we add an assertion here to ensure the condition is always satisfied.
146 `ASSERT(BusySrcReqChk_A, busy |-> !src_req, clk_src_i, !rst_src_ni)
147
148 // reserved bits are not used
149 logic unused_wd;
150 1/1 assign unused_wd = ^src_wd_i;
Tests: T1 T2 T3
151
152 // src_q is always updated in the clk_src domain.
153 // when performing an update to the destination domain, it is guaranteed
154 // to not change by protocol.
155 1/1 assign src_qs_o = src_q;
Tests: T1 T2 T3
156 1/1 assign dst_wd_o = src_q;
Tests: T1 T2 T3
157
158 ////////////////////////////
159 // CDC handling
160 ////////////////////////////
161
162 logic dst_req_from_src;
163 logic dst_req;
164
165
166 // the software transaction is pulse synced across the domain.
167 // the prim_reg_cdc_arb module handles conflicts with ongoing hardware updates.
168 prim_pulse_sync u_src_to_dst_req (
169 .clk_src_i,
170 .rst_src_ni,
171 .clk_dst_i,
172 .rst_dst_ni,
173 .src_pulse_i(src_req),
174 .dst_pulse_o(dst_req_from_src)
175 );
176
177 prim_reg_cdc_arb #(
178 .DataWidth(DataWidth),
179 .ResetVal(ResetVal),
180 .DstWrReq(DstWrReq)
181 ) u_arb (
182 .clk_src_i,
183 .rst_src_ni,
184 .clk_dst_i,
185 .rst_dst_ni,
186 .src_ack_o(src_ack),
187 .src_update_o(src_update),
188 .dst_req_i(dst_req_from_src),
189 .dst_req_o(dst_req),
190 .dst_update_i,
191 .dst_ds_i,
192 .dst_qs_i,
193 .dst_qs_o(dst_qs)
194 );
195
196
197 // Each is valid only when destination request pulse is high; this is important in not propagating
198 // the internal assertion of 'dst_req' by the 'prim_pulse_sync' channel when just one domain is
199 // reset.
200 1/1 assign {dst_we_o, dst_re_o, dst_regwen_o} = txn_bits_q & {TxnWidth{dst_req}};
Tests: T1 T2 T3
Cond Coverage for Instance : tb.dut.u_reg.u_adc_chn0_filter_ctl_3_cdc
| Total | Covered | Percent |
Conditions | 11 | 10 | 90.91 |
Logical | 11 | 10 | 90.91 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 65
EXPRESSION (src_we_i | src_re_i)
----1--- ----2---
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T11,T12,T13 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T11,T12,T13 |
1 | 1 | Covered | T11,T12,T13 |
LINE 125
EXPRESSION ((src_busy_q && src_ack) || (src_update && ((!busy))))
-----------1----------- ------------2------------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T11,T12,T13 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T11,T12,T13 |
1 | 1 | Covered | T11,T12,T13 |
LINE 125
SUB-EXPRESSION (src_update && ((!busy)))
-----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Unreachable | |
1 | 1 | Unreachable | |
Branch Coverage for Instance : tb.dut.u_reg.u_adc_chn0_filter_ctl_3_cdc
| Line No. | Total | Covered | Percent |
Branches |
|
8 |
8 |
100.00 |
IF |
71 |
4 |
4 |
100.00 |
IF |
115 |
4 |
4 |
100.00 |
71 if (!rst_src_ni) begin
-1-
72 src_busy_q <= '0;
==>
73 end else if (src_req) begin
-2-
74 src_busy_q <= 1'b1;
==>
75 end else if (src_ack) begin
-3-
76 src_busy_q <= 1'b0;
==>
77 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T11,T12,T13 |
0 |
0 |
1 |
Covered |
T11,T12,T13 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
115 if (!rst_src_ni) begin
-1-
116 src_q <= ResetVal;
==>
117 txn_bits_q <= '0;
118 end else if (src_req) begin
-2-
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 src_q <= src_wd_i & BitMask;
==>
124 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
125 end else if (src_busy_q && src_ack || src_update && !busy) begin
-3-
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 src_q <= dst_qs;
==>
135 txn_bits_q <= '0;
136 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T11,T12,T13 |
0 |
0 |
1 |
Covered |
T11,T12,T13 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.u_reg.u_adc_chn0_filter_ctl_3_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
1644882 |
0 |
0 |
T11 |
112949 |
455 |
0 |
0 |
T12 |
255584 |
1962 |
0 |
0 |
T13 |
171132 |
254 |
0 |
0 |
T14 |
395989 |
316 |
0 |
0 |
T15 |
0 |
382 |
0 |
0 |
T16 |
0 |
367 |
0 |
0 |
T17 |
0 |
367 |
0 |
0 |
T18 |
0 |
626 |
0 |
0 |
T19 |
0 |
1494 |
0 |
0 |
T20 |
0 |
269 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
T25 |
50651 |
0 |
0 |
0 |
T26 |
109966 |
0 |
0 |
0 |
T27 |
183417 |
0 |
0 |
0 |
T28 |
180001 |
0 |
0 |
0 |
T29 |
96579 |
0 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
34247075 |
33952252 |
0 |
0 |
T1 |
1197 |
1119 |
0 |
0 |
T2 |
106 |
6 |
0 |
0 |
T3 |
733 |
683 |
0 |
0 |
T4 |
1245 |
1147 |
0 |
0 |
T5 |
642 |
148 |
0 |
0 |
T6 |
674 |
579 |
0 |
0 |
T7 |
1152 |
1077 |
0 |
0 |
T21 |
899 |
18 |
0 |
0 |
T22 |
74 |
9 |
0 |
0 |
T23 |
946 |
27 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
1922 |
0 |
0 |
T11 |
112949 |
2 |
0 |
0 |
T12 |
255584 |
1 |
0 |
0 |
T13 |
171132 |
2 |
0 |
0 |
T14 |
395989 |
1 |
0 |
0 |
T15 |
0 |
1 |
0 |
0 |
T16 |
0 |
1 |
0 |
0 |
T17 |
0 |
1 |
0 |
0 |
T18 |
0 |
2 |
0 |
0 |
T19 |
0 |
4 |
0 |
0 |
T20 |
0 |
1 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
T25 |
50651 |
0 |
0 |
0 |
T26 |
109966 |
0 |
0 |
0 |
T27 |
183417 |
0 |
0 |
0 |
T28 |
180001 |
0 |
0 |
0 |
T29 |
96579 |
0 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
2147483647 |
0 |
0 |
T1 |
299630 |
299544 |
0 |
0 |
T2 |
25763 |
25713 |
0 |
0 |
T3 |
179799 |
179705 |
0 |
0 |
T4 |
105974 |
105879 |
0 |
0 |
T5 |
308670 |
305678 |
0 |
0 |
T6 |
327577 |
327525 |
0 |
0 |
T7 |
144286 |
144204 |
0 |
0 |
T21 |
108025 |
107168 |
0 |
0 |
T22 |
9439 |
9367 |
0 |
0 |
T23 |
71080 |
70224 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_reg.u_adc_chn0_filter_ctl_4_cdc
| Line No. | Total | Covered | Percent |
TOTAL | | 22 | 22 | 100.00 |
CONT_ASSIGN | 65 | 1 | 1 | 100.00 |
ALWAYS | 71 | 6 | 6 | 100.00 |
CONT_ASSIGN | 85 | 1 | 1 | 100.00 |
CONT_ASSIGN | 109 | 1 | 1 | 100.00 |
ALWAYS | 115 | 9 | 9 | 100.00 |
CONT_ASSIGN | 150 | 1 | 1 | 100.00 |
CONT_ASSIGN | 155 | 1 | 1 | 100.00 |
CONT_ASSIGN | 156 | 1 | 1 | 100.00 |
CONT_ASSIGN | 200 | 1 | 1 | 100.00 |
64
65 1/1 assign src_req = src_we_i | src_re_i;
Tests: T11 T12 T13
66
67 // busy indication back-pressures upstream if the register is accessed
68 // again. The busy indication is also used as a "commit" indication for
69 // resolving software and hardware write conflicts
70 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
71 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
72 1/1 src_busy_q <= '0;
Tests: T1 T2 T3
73 1/1 end else if (src_req) begin
Tests: T1 T2 T3
74 1/1 src_busy_q <= 1'b1;
Tests: T11 T12 T13
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T11 T12 T13
77 end
MISSING_ELSE
78 end
79
80 // A src_ack should only be sent if there was a src_req.
81 // src_busy_q asserts whenever there is a src_req. By association,
82 // whenever src_ack is seen, then src_busy must be high.
83 `ASSERT(SrcAckBusyChk_A, src_ack |-> src_busy_q, clk_src_i, !rst_src_ni)
84
85 1/1 assign src_busy_o = src_busy_q;
Tests: T1 T2 T3
86
87 // src_q acts as both the write holding register and the software read back
88 // register.
89 // When software performs a write, the write data is captured in src_q for
90 // CDC purposes. When not performing a write, the src_q reflects the most recent
91 // hardware value. For registers with no hardware access, this is simply the
92 // the value programmed by software (or in the case R1C, W1C etc) the value after
93 // the operation. For registers with hardware access, this reflects a potentially
94 // delayed version of the real value, as the software facing updates lag real
95 // time updates.
96 //
97 // To resolve software and hardware conflicts, the process is as follows:
98 // When software issues a write, this module asserts "busy". While busy,
99 // src_q does not take on destination value updates. Since the
100 // logic has committed to updating based on software command, there is an irreversible
101 // window from which hardware writes are ignored. Once the busy window completes,
102 // the cdc portion then begins sampling once more.
103 //
104 // This is consistent with prim_subreg_arb where during software / hardware conflicts,
105 // software is always prioritized. The main difference is the conflict resolution window
106 // is now larger instead of just one destination clock cycle.
107
108 logic busy;
109 1/1 assign busy = src_busy_q & !src_ack;
Tests: T1 T2 T3
110
111 // This is the current destination value
112 logic [DataWidth-1:0] dst_qs;
113 logic src_update;
114 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
115 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
116 1/1 src_q <= ResetVal;
Tests: T1 T2 T3
117 1/1 txn_bits_q <= '0;
Tests: T1 T2 T3
118 1/1 end else if (src_req) begin
Tests: T1 T2 T3
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 1/1 src_q <= src_wd_i & BitMask;
Tests: T11 T12 T13
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T11 T12 T13
125 1/1 end else if (src_busy_q && src_ack || src_update && !busy) begin
Tests: T1 T2 T3
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 1/1 src_q <= dst_qs;
Tests: T11 T12 T13
135 1/1 txn_bits_q <= '0;
Tests: T11 T12 T13
136 end
MISSING_ELSE
137 end
138
139 // The current design (tlul_adapter_reg) does not spit out a request if the destination it chooses
140 // (decoded from address) is busy. So this creates a situation in the current design where
141 // src_req_i and busy can never be high at the same time.
142 // While the code above could be coded directly to be expressed as `src_req & !busy`, which makes
143 // the intent clearer, it ends up causing coverage holes from the tool's perspective since that
144 // condition cannot be met.
145 // Thus we add an assertion here to ensure the condition is always satisfied.
146 `ASSERT(BusySrcReqChk_A, busy |-> !src_req, clk_src_i, !rst_src_ni)
147
148 // reserved bits are not used
149 logic unused_wd;
150 1/1 assign unused_wd = ^src_wd_i;
Tests: T1 T2 T3
151
152 // src_q is always updated in the clk_src domain.
153 // when performing an update to the destination domain, it is guaranteed
154 // to not change by protocol.
155 1/1 assign src_qs_o = src_q;
Tests: T1 T2 T3
156 1/1 assign dst_wd_o = src_q;
Tests: T1 T2 T3
157
158 ////////////////////////////
159 // CDC handling
160 ////////////////////////////
161
162 logic dst_req_from_src;
163 logic dst_req;
164
165
166 // the software transaction is pulse synced across the domain.
167 // the prim_reg_cdc_arb module handles conflicts with ongoing hardware updates.
168 prim_pulse_sync u_src_to_dst_req (
169 .clk_src_i,
170 .rst_src_ni,
171 .clk_dst_i,
172 .rst_dst_ni,
173 .src_pulse_i(src_req),
174 .dst_pulse_o(dst_req_from_src)
175 );
176
177 prim_reg_cdc_arb #(
178 .DataWidth(DataWidth),
179 .ResetVal(ResetVal),
180 .DstWrReq(DstWrReq)
181 ) u_arb (
182 .clk_src_i,
183 .rst_src_ni,
184 .clk_dst_i,
185 .rst_dst_ni,
186 .src_ack_o(src_ack),
187 .src_update_o(src_update),
188 .dst_req_i(dst_req_from_src),
189 .dst_req_o(dst_req),
190 .dst_update_i,
191 .dst_ds_i,
192 .dst_qs_i,
193 .dst_qs_o(dst_qs)
194 );
195
196
197 // Each is valid only when destination request pulse is high; this is important in not propagating
198 // the internal assertion of 'dst_req' by the 'prim_pulse_sync' channel when just one domain is
199 // reset.
200 1/1 assign {dst_we_o, dst_re_o, dst_regwen_o} = txn_bits_q & {TxnWidth{dst_req}};
Tests: T1 T2 T3
Cond Coverage for Instance : tb.dut.u_reg.u_adc_chn0_filter_ctl_4_cdc
| Total | Covered | Percent |
Conditions | 11 | 10 | 90.91 |
Logical | 11 | 10 | 90.91 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 65
EXPRESSION (src_we_i | src_re_i)
----1--- ----2---
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T11,T12,T13 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T11,T12,T13 |
1 | 1 | Covered | T11,T12,T13 |
LINE 125
EXPRESSION ((src_busy_q && src_ack) || (src_update && ((!busy))))
-----------1----------- ------------2------------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T11,T12,T13 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T11,T12,T13 |
1 | 1 | Covered | T11,T12,T13 |
LINE 125
SUB-EXPRESSION (src_update && ((!busy)))
-----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Unreachable | |
1 | 1 | Unreachable | |
Branch Coverage for Instance : tb.dut.u_reg.u_adc_chn0_filter_ctl_4_cdc
| Line No. | Total | Covered | Percent |
Branches |
|
8 |
8 |
100.00 |
IF |
71 |
4 |
4 |
100.00 |
IF |
115 |
4 |
4 |
100.00 |
71 if (!rst_src_ni) begin
-1-
72 src_busy_q <= '0;
==>
73 end else if (src_req) begin
-2-
74 src_busy_q <= 1'b1;
==>
75 end else if (src_ack) begin
-3-
76 src_busy_q <= 1'b0;
==>
77 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T11,T12,T13 |
0 |
0 |
1 |
Covered |
T11,T12,T13 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
115 if (!rst_src_ni) begin
-1-
116 src_q <= ResetVal;
==>
117 txn_bits_q <= '0;
118 end else if (src_req) begin
-2-
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 src_q <= src_wd_i & BitMask;
==>
124 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
125 end else if (src_busy_q && src_ack || src_update && !busy) begin
-3-
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 src_q <= dst_qs;
==>
135 txn_bits_q <= '0;
136 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T11,T12,T13 |
0 |
0 |
1 |
Covered |
T11,T12,T13 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.u_reg.u_adc_chn0_filter_ctl_4_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
1634488 |
0 |
0 |
T11 |
112949 |
425 |
0 |
0 |
T12 |
255584 |
1947 |
0 |
0 |
T13 |
171132 |
250 |
0 |
0 |
T14 |
395989 |
307 |
0 |
0 |
T15 |
0 |
370 |
0 |
0 |
T16 |
0 |
365 |
0 |
0 |
T17 |
0 |
365 |
0 |
0 |
T18 |
0 |
622 |
0 |
0 |
T19 |
0 |
1457 |
0 |
0 |
T20 |
0 |
257 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
T25 |
50651 |
0 |
0 |
0 |
T26 |
109966 |
0 |
0 |
0 |
T27 |
183417 |
0 |
0 |
0 |
T28 |
180001 |
0 |
0 |
0 |
T29 |
96579 |
0 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
34247075 |
33952252 |
0 |
0 |
T1 |
1197 |
1119 |
0 |
0 |
T2 |
106 |
6 |
0 |
0 |
T3 |
733 |
683 |
0 |
0 |
T4 |
1245 |
1147 |
0 |
0 |
T5 |
642 |
148 |
0 |
0 |
T6 |
674 |
579 |
0 |
0 |
T7 |
1152 |
1077 |
0 |
0 |
T21 |
899 |
18 |
0 |
0 |
T22 |
74 |
9 |
0 |
0 |
T23 |
946 |
27 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
1895 |
0 |
0 |
T11 |
112949 |
2 |
0 |
0 |
T12 |
255584 |
1 |
0 |
0 |
T13 |
171132 |
2 |
0 |
0 |
T14 |
395989 |
1 |
0 |
0 |
T15 |
0 |
1 |
0 |
0 |
T16 |
0 |
1 |
0 |
0 |
T17 |
0 |
1 |
0 |
0 |
T18 |
0 |
2 |
0 |
0 |
T19 |
0 |
4 |
0 |
0 |
T20 |
0 |
1 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
T25 |
50651 |
0 |
0 |
0 |
T26 |
109966 |
0 |
0 |
0 |
T27 |
183417 |
0 |
0 |
0 |
T28 |
180001 |
0 |
0 |
0 |
T29 |
96579 |
0 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
2147483647 |
0 |
0 |
T1 |
299630 |
299544 |
0 |
0 |
T2 |
25763 |
25713 |
0 |
0 |
T3 |
179799 |
179705 |
0 |
0 |
T4 |
105974 |
105879 |
0 |
0 |
T5 |
308670 |
305678 |
0 |
0 |
T6 |
327577 |
327525 |
0 |
0 |
T7 |
144286 |
144204 |
0 |
0 |
T21 |
108025 |
107168 |
0 |
0 |
T22 |
9439 |
9367 |
0 |
0 |
T23 |
71080 |
70224 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_reg.u_adc_chn0_filter_ctl_5_cdc
| Line No. | Total | Covered | Percent |
TOTAL | | 22 | 22 | 100.00 |
CONT_ASSIGN | 65 | 1 | 1 | 100.00 |
ALWAYS | 71 | 6 | 6 | 100.00 |
CONT_ASSIGN | 85 | 1 | 1 | 100.00 |
CONT_ASSIGN | 109 | 1 | 1 | 100.00 |
ALWAYS | 115 | 9 | 9 | 100.00 |
CONT_ASSIGN | 150 | 1 | 1 | 100.00 |
CONT_ASSIGN | 155 | 1 | 1 | 100.00 |
CONT_ASSIGN | 156 | 1 | 1 | 100.00 |
CONT_ASSIGN | 200 | 1 | 1 | 100.00 |
64
65 1/1 assign src_req = src_we_i | src_re_i;
Tests: T11 T12 T13
66
67 // busy indication back-pressures upstream if the register is accessed
68 // again. The busy indication is also used as a "commit" indication for
69 // resolving software and hardware write conflicts
70 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
71 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
72 1/1 src_busy_q <= '0;
Tests: T1 T2 T3
73 1/1 end else if (src_req) begin
Tests: T1 T2 T3
74 1/1 src_busy_q <= 1'b1;
Tests: T11 T12 T13
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T11 T12 T13
77 end
MISSING_ELSE
78 end
79
80 // A src_ack should only be sent if there was a src_req.
81 // src_busy_q asserts whenever there is a src_req. By association,
82 // whenever src_ack is seen, then src_busy must be high.
83 `ASSERT(SrcAckBusyChk_A, src_ack |-> src_busy_q, clk_src_i, !rst_src_ni)
84
85 1/1 assign src_busy_o = src_busy_q;
Tests: T1 T2 T3
86
87 // src_q acts as both the write holding register and the software read back
88 // register.
89 // When software performs a write, the write data is captured in src_q for
90 // CDC purposes. When not performing a write, the src_q reflects the most recent
91 // hardware value. For registers with no hardware access, this is simply the
92 // the value programmed by software (or in the case R1C, W1C etc) the value after
93 // the operation. For registers with hardware access, this reflects a potentially
94 // delayed version of the real value, as the software facing updates lag real
95 // time updates.
96 //
97 // To resolve software and hardware conflicts, the process is as follows:
98 // When software issues a write, this module asserts "busy". While busy,
99 // src_q does not take on destination value updates. Since the
100 // logic has committed to updating based on software command, there is an irreversible
101 // window from which hardware writes are ignored. Once the busy window completes,
102 // the cdc portion then begins sampling once more.
103 //
104 // This is consistent with prim_subreg_arb where during software / hardware conflicts,
105 // software is always prioritized. The main difference is the conflict resolution window
106 // is now larger instead of just one destination clock cycle.
107
108 logic busy;
109 1/1 assign busy = src_busy_q & !src_ack;
Tests: T1 T2 T3
110
111 // This is the current destination value
112 logic [DataWidth-1:0] dst_qs;
113 logic src_update;
114 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
115 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
116 1/1 src_q <= ResetVal;
Tests: T1 T2 T3
117 1/1 txn_bits_q <= '0;
Tests: T1 T2 T3
118 1/1 end else if (src_req) begin
Tests: T1 T2 T3
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 1/1 src_q <= src_wd_i & BitMask;
Tests: T11 T12 T13
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T11 T12 T13
125 1/1 end else if (src_busy_q && src_ack || src_update && !busy) begin
Tests: T1 T2 T3
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 1/1 src_q <= dst_qs;
Tests: T11 T12 T13
135 1/1 txn_bits_q <= '0;
Tests: T11 T12 T13
136 end
MISSING_ELSE
137 end
138
139 // The current design (tlul_adapter_reg) does not spit out a request if the destination it chooses
140 // (decoded from address) is busy. So this creates a situation in the current design where
141 // src_req_i and busy can never be high at the same time.
142 // While the code above could be coded directly to be expressed as `src_req & !busy`, which makes
143 // the intent clearer, it ends up causing coverage holes from the tool's perspective since that
144 // condition cannot be met.
145 // Thus we add an assertion here to ensure the condition is always satisfied.
146 `ASSERT(BusySrcReqChk_A, busy |-> !src_req, clk_src_i, !rst_src_ni)
147
148 // reserved bits are not used
149 logic unused_wd;
150 1/1 assign unused_wd = ^src_wd_i;
Tests: T1 T2 T3
151
152 // src_q is always updated in the clk_src domain.
153 // when performing an update to the destination domain, it is guaranteed
154 // to not change by protocol.
155 1/1 assign src_qs_o = src_q;
Tests: T1 T2 T3
156 1/1 assign dst_wd_o = src_q;
Tests: T1 T2 T3
157
158 ////////////////////////////
159 // CDC handling
160 ////////////////////////////
161
162 logic dst_req_from_src;
163 logic dst_req;
164
165
166 // the software transaction is pulse synced across the domain.
167 // the prim_reg_cdc_arb module handles conflicts with ongoing hardware updates.
168 prim_pulse_sync u_src_to_dst_req (
169 .clk_src_i,
170 .rst_src_ni,
171 .clk_dst_i,
172 .rst_dst_ni,
173 .src_pulse_i(src_req),
174 .dst_pulse_o(dst_req_from_src)
175 );
176
177 prim_reg_cdc_arb #(
178 .DataWidth(DataWidth),
179 .ResetVal(ResetVal),
180 .DstWrReq(DstWrReq)
181 ) u_arb (
182 .clk_src_i,
183 .rst_src_ni,
184 .clk_dst_i,
185 .rst_dst_ni,
186 .src_ack_o(src_ack),
187 .src_update_o(src_update),
188 .dst_req_i(dst_req_from_src),
189 .dst_req_o(dst_req),
190 .dst_update_i,
191 .dst_ds_i,
192 .dst_qs_i,
193 .dst_qs_o(dst_qs)
194 );
195
196
197 // Each is valid only when destination request pulse is high; this is important in not propagating
198 // the internal assertion of 'dst_req' by the 'prim_pulse_sync' channel when just one domain is
199 // reset.
200 1/1 assign {dst_we_o, dst_re_o, dst_regwen_o} = txn_bits_q & {TxnWidth{dst_req}};
Tests: T1 T2 T3
Cond Coverage for Instance : tb.dut.u_reg.u_adc_chn0_filter_ctl_5_cdc
| Total | Covered | Percent |
Conditions | 11 | 10 | 90.91 |
Logical | 11 | 10 | 90.91 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 65
EXPRESSION (src_we_i | src_re_i)
----1--- ----2---
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T11,T12,T13 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T11,T12,T13 |
1 | 1 | Covered | T11,T12,T13 |
LINE 125
EXPRESSION ((src_busy_q && src_ack) || (src_update && ((!busy))))
-----------1----------- ------------2------------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T11,T12,T13 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T11,T12,T13 |
1 | 1 | Covered | T11,T12,T13 |
LINE 125
SUB-EXPRESSION (src_update && ((!busy)))
-----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Unreachable | |
1 | 1 | Unreachable | |
Branch Coverage for Instance : tb.dut.u_reg.u_adc_chn0_filter_ctl_5_cdc
| Line No. | Total | Covered | Percent |
Branches |
|
8 |
8 |
100.00 |
IF |
71 |
4 |
4 |
100.00 |
IF |
115 |
4 |
4 |
100.00 |
71 if (!rst_src_ni) begin
-1-
72 src_busy_q <= '0;
==>
73 end else if (src_req) begin
-2-
74 src_busy_q <= 1'b1;
==>
75 end else if (src_ack) begin
-3-
76 src_busy_q <= 1'b0;
==>
77 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T11,T12,T13 |
0 |
0 |
1 |
Covered |
T11,T12,T13 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
115 if (!rst_src_ni) begin
-1-
116 src_q <= ResetVal;
==>
117 txn_bits_q <= '0;
118 end else if (src_req) begin
-2-
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 src_q <= src_wd_i & BitMask;
==>
124 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
125 end else if (src_busy_q && src_ack || src_update && !busy) begin
-3-
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 src_q <= dst_qs;
==>
135 txn_bits_q <= '0;
136 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T11,T12,T13 |
0 |
0 |
1 |
Covered |
T11,T12,T13 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.u_reg.u_adc_chn0_filter_ctl_5_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
1595405 |
0 |
0 |
T11 |
112949 |
408 |
0 |
0 |
T12 |
255584 |
1934 |
0 |
0 |
T13 |
171132 |
246 |
0 |
0 |
T14 |
395989 |
301 |
0 |
0 |
T15 |
0 |
361 |
0 |
0 |
T16 |
0 |
363 |
0 |
0 |
T17 |
0 |
363 |
0 |
0 |
T18 |
0 |
618 |
0 |
0 |
T19 |
0 |
1420 |
0 |
0 |
T20 |
0 |
248 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
T25 |
50651 |
0 |
0 |
0 |
T26 |
109966 |
0 |
0 |
0 |
T27 |
183417 |
0 |
0 |
0 |
T28 |
180001 |
0 |
0 |
0 |
T29 |
96579 |
0 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
34247075 |
33952252 |
0 |
0 |
T1 |
1197 |
1119 |
0 |
0 |
T2 |
106 |
6 |
0 |
0 |
T3 |
733 |
683 |
0 |
0 |
T4 |
1245 |
1147 |
0 |
0 |
T5 |
642 |
148 |
0 |
0 |
T6 |
674 |
579 |
0 |
0 |
T7 |
1152 |
1077 |
0 |
0 |
T21 |
899 |
18 |
0 |
0 |
T22 |
74 |
9 |
0 |
0 |
T23 |
946 |
27 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
1878 |
0 |
0 |
T11 |
112949 |
2 |
0 |
0 |
T12 |
255584 |
1 |
0 |
0 |
T13 |
171132 |
2 |
0 |
0 |
T14 |
395989 |
1 |
0 |
0 |
T15 |
0 |
1 |
0 |
0 |
T16 |
0 |
1 |
0 |
0 |
T17 |
0 |
1 |
0 |
0 |
T18 |
0 |
2 |
0 |
0 |
T19 |
0 |
4 |
0 |
0 |
T20 |
0 |
1 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
T25 |
50651 |
0 |
0 |
0 |
T26 |
109966 |
0 |
0 |
0 |
T27 |
183417 |
0 |
0 |
0 |
T28 |
180001 |
0 |
0 |
0 |
T29 |
96579 |
0 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
2147483647 |
0 |
0 |
T1 |
299630 |
299544 |
0 |
0 |
T2 |
25763 |
25713 |
0 |
0 |
T3 |
179799 |
179705 |
0 |
0 |
T4 |
105974 |
105879 |
0 |
0 |
T5 |
308670 |
305678 |
0 |
0 |
T6 |
327577 |
327525 |
0 |
0 |
T7 |
144286 |
144204 |
0 |
0 |
T21 |
108025 |
107168 |
0 |
0 |
T22 |
9439 |
9367 |
0 |
0 |
T23 |
71080 |
70224 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_reg.u_adc_chn0_filter_ctl_6_cdc
| Line No. | Total | Covered | Percent |
TOTAL | | 22 | 22 | 100.00 |
CONT_ASSIGN | 65 | 1 | 1 | 100.00 |
ALWAYS | 71 | 6 | 6 | 100.00 |
CONT_ASSIGN | 85 | 1 | 1 | 100.00 |
CONT_ASSIGN | 109 | 1 | 1 | 100.00 |
ALWAYS | 115 | 9 | 9 | 100.00 |
CONT_ASSIGN | 150 | 1 | 1 | 100.00 |
CONT_ASSIGN | 155 | 1 | 1 | 100.00 |
CONT_ASSIGN | 156 | 1 | 1 | 100.00 |
CONT_ASSIGN | 200 | 1 | 1 | 100.00 |
64
65 1/1 assign src_req = src_we_i | src_re_i;
Tests: T11 T12 T13
66
67 // busy indication back-pressures upstream if the register is accessed
68 // again. The busy indication is also used as a "commit" indication for
69 // resolving software and hardware write conflicts
70 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
71 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
72 1/1 src_busy_q <= '0;
Tests: T1 T2 T3
73 1/1 end else if (src_req) begin
Tests: T1 T2 T3
74 1/1 src_busy_q <= 1'b1;
Tests: T11 T12 T13
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T11 T12 T13
77 end
MISSING_ELSE
78 end
79
80 // A src_ack should only be sent if there was a src_req.
81 // src_busy_q asserts whenever there is a src_req. By association,
82 // whenever src_ack is seen, then src_busy must be high.
83 `ASSERT(SrcAckBusyChk_A, src_ack |-> src_busy_q, clk_src_i, !rst_src_ni)
84
85 1/1 assign src_busy_o = src_busy_q;
Tests: T1 T2 T3
86
87 // src_q acts as both the write holding register and the software read back
88 // register.
89 // When software performs a write, the write data is captured in src_q for
90 // CDC purposes. When not performing a write, the src_q reflects the most recent
91 // hardware value. For registers with no hardware access, this is simply the
92 // the value programmed by software (or in the case R1C, W1C etc) the value after
93 // the operation. For registers with hardware access, this reflects a potentially
94 // delayed version of the real value, as the software facing updates lag real
95 // time updates.
96 //
97 // To resolve software and hardware conflicts, the process is as follows:
98 // When software issues a write, this module asserts "busy". While busy,
99 // src_q does not take on destination value updates. Since the
100 // logic has committed to updating based on software command, there is an irreversible
101 // window from which hardware writes are ignored. Once the busy window completes,
102 // the cdc portion then begins sampling once more.
103 //
104 // This is consistent with prim_subreg_arb where during software / hardware conflicts,
105 // software is always prioritized. The main difference is the conflict resolution window
106 // is now larger instead of just one destination clock cycle.
107
108 logic busy;
109 1/1 assign busy = src_busy_q & !src_ack;
Tests: T1 T2 T3
110
111 // This is the current destination value
112 logic [DataWidth-1:0] dst_qs;
113 logic src_update;
114 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
115 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
116 1/1 src_q <= ResetVal;
Tests: T1 T2 T3
117 1/1 txn_bits_q <= '0;
Tests: T1 T2 T3
118 1/1 end else if (src_req) begin
Tests: T1 T2 T3
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 1/1 src_q <= src_wd_i & BitMask;
Tests: T11 T12 T13
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T11 T12 T13
125 1/1 end else if (src_busy_q && src_ack || src_update && !busy) begin
Tests: T1 T2 T3
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 1/1 src_q <= dst_qs;
Tests: T11 T12 T13
135 1/1 txn_bits_q <= '0;
Tests: T11 T12 T13
136 end
MISSING_ELSE
137 end
138
139 // The current design (tlul_adapter_reg) does not spit out a request if the destination it chooses
140 // (decoded from address) is busy. So this creates a situation in the current design where
141 // src_req_i and busy can never be high at the same time.
142 // While the code above could be coded directly to be expressed as `src_req & !busy`, which makes
143 // the intent clearer, it ends up causing coverage holes from the tool's perspective since that
144 // condition cannot be met.
145 // Thus we add an assertion here to ensure the condition is always satisfied.
146 `ASSERT(BusySrcReqChk_A, busy |-> !src_req, clk_src_i, !rst_src_ni)
147
148 // reserved bits are not used
149 logic unused_wd;
150 1/1 assign unused_wd = ^src_wd_i;
Tests: T1 T2 T3
151
152 // src_q is always updated in the clk_src domain.
153 // when performing an update to the destination domain, it is guaranteed
154 // to not change by protocol.
155 1/1 assign src_qs_o = src_q;
Tests: T1 T2 T3
156 1/1 assign dst_wd_o = src_q;
Tests: T1 T2 T3
157
158 ////////////////////////////
159 // CDC handling
160 ////////////////////////////
161
162 logic dst_req_from_src;
163 logic dst_req;
164
165
166 // the software transaction is pulse synced across the domain.
167 // the prim_reg_cdc_arb module handles conflicts with ongoing hardware updates.
168 prim_pulse_sync u_src_to_dst_req (
169 .clk_src_i,
170 .rst_src_ni,
171 .clk_dst_i,
172 .rst_dst_ni,
173 .src_pulse_i(src_req),
174 .dst_pulse_o(dst_req_from_src)
175 );
176
177 prim_reg_cdc_arb #(
178 .DataWidth(DataWidth),
179 .ResetVal(ResetVal),
180 .DstWrReq(DstWrReq)
181 ) u_arb (
182 .clk_src_i,
183 .rst_src_ni,
184 .clk_dst_i,
185 .rst_dst_ni,
186 .src_ack_o(src_ack),
187 .src_update_o(src_update),
188 .dst_req_i(dst_req_from_src),
189 .dst_req_o(dst_req),
190 .dst_update_i,
191 .dst_ds_i,
192 .dst_qs_i,
193 .dst_qs_o(dst_qs)
194 );
195
196
197 // Each is valid only when destination request pulse is high; this is important in not propagating
198 // the internal assertion of 'dst_req' by the 'prim_pulse_sync' channel when just one domain is
199 // reset.
200 1/1 assign {dst_we_o, dst_re_o, dst_regwen_o} = txn_bits_q & {TxnWidth{dst_req}};
Tests: T1 T2 T3
Cond Coverage for Instance : tb.dut.u_reg.u_adc_chn0_filter_ctl_6_cdc
| Total | Covered | Percent |
Conditions | 11 | 10 | 90.91 |
Logical | 11 | 10 | 90.91 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 65
EXPRESSION (src_we_i | src_re_i)
----1--- ----2---
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T11,T12,T13 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T11,T12,T13 |
1 | 1 | Covered | T11,T12,T13 |
LINE 125
EXPRESSION ((src_busy_q && src_ack) || (src_update && ((!busy))))
-----------1----------- ------------2------------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T11,T12,T13 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T11,T12,T13 |
1 | 1 | Covered | T11,T12,T13 |
LINE 125
SUB-EXPRESSION (src_update && ((!busy)))
-----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Unreachable | |
1 | 1 | Unreachable | |
Branch Coverage for Instance : tb.dut.u_reg.u_adc_chn0_filter_ctl_6_cdc
| Line No. | Total | Covered | Percent |
Branches |
|
8 |
8 |
100.00 |
IF |
71 |
4 |
4 |
100.00 |
IF |
115 |
4 |
4 |
100.00 |
71 if (!rst_src_ni) begin
-1-
72 src_busy_q <= '0;
==>
73 end else if (src_req) begin
-2-
74 src_busy_q <= 1'b1;
==>
75 end else if (src_ack) begin
-3-
76 src_busy_q <= 1'b0;
==>
77 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T11,T12,T13 |
0 |
0 |
1 |
Covered |
T11,T12,T13 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
115 if (!rst_src_ni) begin
-1-
116 src_q <= ResetVal;
==>
117 txn_bits_q <= '0;
118 end else if (src_req) begin
-2-
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 src_q <= src_wd_i & BitMask;
==>
124 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
125 end else if (src_busy_q && src_ack || src_update && !busy) begin
-3-
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 src_q <= dst_qs;
==>
135 txn_bits_q <= '0;
136 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T11,T12,T13 |
0 |
0 |
1 |
Covered |
T11,T12,T13 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.u_reg.u_adc_chn0_filter_ctl_6_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
1598163 |
0 |
0 |
T11 |
112949 |
396 |
0 |
0 |
T12 |
255584 |
1929 |
0 |
0 |
T13 |
171132 |
242 |
0 |
0 |
T14 |
395989 |
296 |
0 |
0 |
T15 |
0 |
355 |
0 |
0 |
T16 |
0 |
361 |
0 |
0 |
T17 |
0 |
361 |
0 |
0 |
T18 |
0 |
614 |
0 |
0 |
T19 |
0 |
1399 |
0 |
0 |
T20 |
0 |
240 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
T25 |
50651 |
0 |
0 |
0 |
T26 |
109966 |
0 |
0 |
0 |
T27 |
183417 |
0 |
0 |
0 |
T28 |
180001 |
0 |
0 |
0 |
T29 |
96579 |
0 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
34247075 |
33952252 |
0 |
0 |
T1 |
1197 |
1119 |
0 |
0 |
T2 |
106 |
6 |
0 |
0 |
T3 |
733 |
683 |
0 |
0 |
T4 |
1245 |
1147 |
0 |
0 |
T5 |
642 |
148 |
0 |
0 |
T6 |
674 |
579 |
0 |
0 |
T7 |
1152 |
1077 |
0 |
0 |
T21 |
899 |
18 |
0 |
0 |
T22 |
74 |
9 |
0 |
0 |
T23 |
946 |
27 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
1902 |
0 |
0 |
T11 |
112949 |
2 |
0 |
0 |
T12 |
255584 |
1 |
0 |
0 |
T13 |
171132 |
2 |
0 |
0 |
T14 |
395989 |
1 |
0 |
0 |
T15 |
0 |
1 |
0 |
0 |
T16 |
0 |
1 |
0 |
0 |
T17 |
0 |
1 |
0 |
0 |
T18 |
0 |
2 |
0 |
0 |
T19 |
0 |
4 |
0 |
0 |
T20 |
0 |
1 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
T25 |
50651 |
0 |
0 |
0 |
T26 |
109966 |
0 |
0 |
0 |
T27 |
183417 |
0 |
0 |
0 |
T28 |
180001 |
0 |
0 |
0 |
T29 |
96579 |
0 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
2147483647 |
0 |
0 |
T1 |
299630 |
299544 |
0 |
0 |
T2 |
25763 |
25713 |
0 |
0 |
T3 |
179799 |
179705 |
0 |
0 |
T4 |
105974 |
105879 |
0 |
0 |
T5 |
308670 |
305678 |
0 |
0 |
T6 |
327577 |
327525 |
0 |
0 |
T7 |
144286 |
144204 |
0 |
0 |
T21 |
108025 |
107168 |
0 |
0 |
T22 |
9439 |
9367 |
0 |
0 |
T23 |
71080 |
70224 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_reg.u_adc_chn0_filter_ctl_7_cdc
| Line No. | Total | Covered | Percent |
TOTAL | | 22 | 22 | 100.00 |
CONT_ASSIGN | 65 | 1 | 1 | 100.00 |
ALWAYS | 71 | 6 | 6 | 100.00 |
CONT_ASSIGN | 85 | 1 | 1 | 100.00 |
CONT_ASSIGN | 109 | 1 | 1 | 100.00 |
ALWAYS | 115 | 9 | 9 | 100.00 |
CONT_ASSIGN | 150 | 1 | 1 | 100.00 |
CONT_ASSIGN | 155 | 1 | 1 | 100.00 |
CONT_ASSIGN | 156 | 1 | 1 | 100.00 |
CONT_ASSIGN | 200 | 1 | 1 | 100.00 |
64
65 1/1 assign src_req = src_we_i | src_re_i;
Tests: T11 T12 T13
66
67 // busy indication back-pressures upstream if the register is accessed
68 // again. The busy indication is also used as a "commit" indication for
69 // resolving software and hardware write conflicts
70 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
71 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
72 1/1 src_busy_q <= '0;
Tests: T1 T2 T3
73 1/1 end else if (src_req) begin
Tests: T1 T2 T3
74 1/1 src_busy_q <= 1'b1;
Tests: T11 T12 T13
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T11 T12 T13
77 end
MISSING_ELSE
78 end
79
80 // A src_ack should only be sent if there was a src_req.
81 // src_busy_q asserts whenever there is a src_req. By association,
82 // whenever src_ack is seen, then src_busy must be high.
83 `ASSERT(SrcAckBusyChk_A, src_ack |-> src_busy_q, clk_src_i, !rst_src_ni)
84
85 1/1 assign src_busy_o = src_busy_q;
Tests: T1 T2 T3
86
87 // src_q acts as both the write holding register and the software read back
88 // register.
89 // When software performs a write, the write data is captured in src_q for
90 // CDC purposes. When not performing a write, the src_q reflects the most recent
91 // hardware value. For registers with no hardware access, this is simply the
92 // the value programmed by software (or in the case R1C, W1C etc) the value after
93 // the operation. For registers with hardware access, this reflects a potentially
94 // delayed version of the real value, as the software facing updates lag real
95 // time updates.
96 //
97 // To resolve software and hardware conflicts, the process is as follows:
98 // When software issues a write, this module asserts "busy". While busy,
99 // src_q does not take on destination value updates. Since the
100 // logic has committed to updating based on software command, there is an irreversible
101 // window from which hardware writes are ignored. Once the busy window completes,
102 // the cdc portion then begins sampling once more.
103 //
104 // This is consistent with prim_subreg_arb where during software / hardware conflicts,
105 // software is always prioritized. The main difference is the conflict resolution window
106 // is now larger instead of just one destination clock cycle.
107
108 logic busy;
109 1/1 assign busy = src_busy_q & !src_ack;
Tests: T1 T2 T3
110
111 // This is the current destination value
112 logic [DataWidth-1:0] dst_qs;
113 logic src_update;
114 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
115 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
116 1/1 src_q <= ResetVal;
Tests: T1 T2 T3
117 1/1 txn_bits_q <= '0;
Tests: T1 T2 T3
118 1/1 end else if (src_req) begin
Tests: T1 T2 T3
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 1/1 src_q <= src_wd_i & BitMask;
Tests: T11 T12 T13
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T11 T12 T13
125 1/1 end else if (src_busy_q && src_ack || src_update && !busy) begin
Tests: T1 T2 T3
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 1/1 src_q <= dst_qs;
Tests: T11 T12 T13
135 1/1 txn_bits_q <= '0;
Tests: T11 T12 T13
136 end
MISSING_ELSE
137 end
138
139 // The current design (tlul_adapter_reg) does not spit out a request if the destination it chooses
140 // (decoded from address) is busy. So this creates a situation in the current design where
141 // src_req_i and busy can never be high at the same time.
142 // While the code above could be coded directly to be expressed as `src_req & !busy`, which makes
143 // the intent clearer, it ends up causing coverage holes from the tool's perspective since that
144 // condition cannot be met.
145 // Thus we add an assertion here to ensure the condition is always satisfied.
146 `ASSERT(BusySrcReqChk_A, busy |-> !src_req, clk_src_i, !rst_src_ni)
147
148 // reserved bits are not used
149 logic unused_wd;
150 1/1 assign unused_wd = ^src_wd_i;
Tests: T1 T2 T3
151
152 // src_q is always updated in the clk_src domain.
153 // when performing an update to the destination domain, it is guaranteed
154 // to not change by protocol.
155 1/1 assign src_qs_o = src_q;
Tests: T1 T2 T3
156 1/1 assign dst_wd_o = src_q;
Tests: T1 T2 T3
157
158 ////////////////////////////
159 // CDC handling
160 ////////////////////////////
161
162 logic dst_req_from_src;
163 logic dst_req;
164
165
166 // the software transaction is pulse synced across the domain.
167 // the prim_reg_cdc_arb module handles conflicts with ongoing hardware updates.
168 prim_pulse_sync u_src_to_dst_req (
169 .clk_src_i,
170 .rst_src_ni,
171 .clk_dst_i,
172 .rst_dst_ni,
173 .src_pulse_i(src_req),
174 .dst_pulse_o(dst_req_from_src)
175 );
176
177 prim_reg_cdc_arb #(
178 .DataWidth(DataWidth),
179 .ResetVal(ResetVal),
180 .DstWrReq(DstWrReq)
181 ) u_arb (
182 .clk_src_i,
183 .rst_src_ni,
184 .clk_dst_i,
185 .rst_dst_ni,
186 .src_ack_o(src_ack),
187 .src_update_o(src_update),
188 .dst_req_i(dst_req_from_src),
189 .dst_req_o(dst_req),
190 .dst_update_i,
191 .dst_ds_i,
192 .dst_qs_i,
193 .dst_qs_o(dst_qs)
194 );
195
196
197 // Each is valid only when destination request pulse is high; this is important in not propagating
198 // the internal assertion of 'dst_req' by the 'prim_pulse_sync' channel when just one domain is
199 // reset.
200 1/1 assign {dst_we_o, dst_re_o, dst_regwen_o} = txn_bits_q & {TxnWidth{dst_req}};
Tests: T1 T2 T3
Cond Coverage for Instance : tb.dut.u_reg.u_adc_chn0_filter_ctl_7_cdc
| Total | Covered | Percent |
Conditions | 11 | 10 | 90.91 |
Logical | 11 | 10 | 90.91 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 65
EXPRESSION (src_we_i | src_re_i)
----1--- ----2---
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T11,T12,T13 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T11,T12,T13 |
1 | 1 | Covered | T11,T12,T13 |
LINE 125
EXPRESSION ((src_busy_q && src_ack) || (src_update && ((!busy))))
-----------1----------- ------------2------------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T11,T12,T13 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T11,T12,T13 |
1 | 1 | Covered | T11,T12,T13 |
LINE 125
SUB-EXPRESSION (src_update && ((!busy)))
-----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Unreachable | |
1 | 1 | Unreachable | |
Branch Coverage for Instance : tb.dut.u_reg.u_adc_chn0_filter_ctl_7_cdc
| Line No. | Total | Covered | Percent |
Branches |
|
8 |
8 |
100.00 |
IF |
71 |
4 |
4 |
100.00 |
IF |
115 |
4 |
4 |
100.00 |
71 if (!rst_src_ni) begin
-1-
72 src_busy_q <= '0;
==>
73 end else if (src_req) begin
-2-
74 src_busy_q <= 1'b1;
==>
75 end else if (src_ack) begin
-3-
76 src_busy_q <= 1'b0;
==>
77 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T11,T12,T13 |
0 |
0 |
1 |
Covered |
T11,T12,T13 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
115 if (!rst_src_ni) begin
-1-
116 src_q <= ResetVal;
==>
117 txn_bits_q <= '0;
118 end else if (src_req) begin
-2-
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 src_q <= src_wd_i & BitMask;
==>
124 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
125 end else if (src_busy_q && src_ack || src_update && !busy) begin
-3-
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 src_q <= dst_qs;
==>
135 txn_bits_q <= '0;
136 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T11,T12,T13 |
0 |
0 |
1 |
Covered |
T11,T12,T13 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.u_reg.u_adc_chn0_filter_ctl_7_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
1577103 |
0 |
0 |
T11 |
112949 |
378 |
0 |
0 |
T12 |
255584 |
1921 |
0 |
0 |
T13 |
171132 |
238 |
0 |
0 |
T14 |
395989 |
284 |
0 |
0 |
T15 |
0 |
353 |
0 |
0 |
T16 |
0 |
359 |
0 |
0 |
T17 |
0 |
359 |
0 |
0 |
T18 |
0 |
610 |
0 |
0 |
T19 |
0 |
1367 |
0 |
0 |
T20 |
0 |
234 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
T25 |
50651 |
0 |
0 |
0 |
T26 |
109966 |
0 |
0 |
0 |
T27 |
183417 |
0 |
0 |
0 |
T28 |
180001 |
0 |
0 |
0 |
T29 |
96579 |
0 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
34247075 |
33952252 |
0 |
0 |
T1 |
1197 |
1119 |
0 |
0 |
T2 |
106 |
6 |
0 |
0 |
T3 |
733 |
683 |
0 |
0 |
T4 |
1245 |
1147 |
0 |
0 |
T5 |
642 |
148 |
0 |
0 |
T6 |
674 |
579 |
0 |
0 |
T7 |
1152 |
1077 |
0 |
0 |
T21 |
899 |
18 |
0 |
0 |
T22 |
74 |
9 |
0 |
0 |
T23 |
946 |
27 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
1873 |
0 |
0 |
T11 |
112949 |
2 |
0 |
0 |
T12 |
255584 |
1 |
0 |
0 |
T13 |
171132 |
2 |
0 |
0 |
T14 |
395989 |
1 |
0 |
0 |
T15 |
0 |
1 |
0 |
0 |
T16 |
0 |
1 |
0 |
0 |
T17 |
0 |
1 |
0 |
0 |
T18 |
0 |
2 |
0 |
0 |
T19 |
0 |
4 |
0 |
0 |
T20 |
0 |
1 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
T25 |
50651 |
0 |
0 |
0 |
T26 |
109966 |
0 |
0 |
0 |
T27 |
183417 |
0 |
0 |
0 |
T28 |
180001 |
0 |
0 |
0 |
T29 |
96579 |
0 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
2147483647 |
0 |
0 |
T1 |
299630 |
299544 |
0 |
0 |
T2 |
25763 |
25713 |
0 |
0 |
T3 |
179799 |
179705 |
0 |
0 |
T4 |
105974 |
105879 |
0 |
0 |
T5 |
308670 |
305678 |
0 |
0 |
T6 |
327577 |
327525 |
0 |
0 |
T7 |
144286 |
144204 |
0 |
0 |
T21 |
108025 |
107168 |
0 |
0 |
T22 |
9439 |
9367 |
0 |
0 |
T23 |
71080 |
70224 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_reg.u_adc_chn1_filter_ctl_0_cdc
| Line No. | Total | Covered | Percent |
TOTAL | | 22 | 22 | 100.00 |
CONT_ASSIGN | 65 | 1 | 1 | 100.00 |
ALWAYS | 71 | 6 | 6 | 100.00 |
CONT_ASSIGN | 85 | 1 | 1 | 100.00 |
CONT_ASSIGN | 109 | 1 | 1 | 100.00 |
ALWAYS | 115 | 9 | 9 | 100.00 |
CONT_ASSIGN | 150 | 1 | 1 | 100.00 |
CONT_ASSIGN | 155 | 1 | 1 | 100.00 |
CONT_ASSIGN | 156 | 1 | 1 | 100.00 |
CONT_ASSIGN | 200 | 1 | 1 | 100.00 |
64
65 1/1 assign src_req = src_we_i | src_re_i;
Tests: T5 T11 T12
66
67 // busy indication back-pressures upstream if the register is accessed
68 // again. The busy indication is also used as a "commit" indication for
69 // resolving software and hardware write conflicts
70 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
71 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
72 1/1 src_busy_q <= '0;
Tests: T1 T2 T3
73 1/1 end else if (src_req) begin
Tests: T1 T2 T3
74 1/1 src_busy_q <= 1'b1;
Tests: T5 T11 T12
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T5 T11 T12
77 end
MISSING_ELSE
78 end
79
80 // A src_ack should only be sent if there was a src_req.
81 // src_busy_q asserts whenever there is a src_req. By association,
82 // whenever src_ack is seen, then src_busy must be high.
83 `ASSERT(SrcAckBusyChk_A, src_ack |-> src_busy_q, clk_src_i, !rst_src_ni)
84
85 1/1 assign src_busy_o = src_busy_q;
Tests: T1 T2 T3
86
87 // src_q acts as both the write holding register and the software read back
88 // register.
89 // When software performs a write, the write data is captured in src_q for
90 // CDC purposes. When not performing a write, the src_q reflects the most recent
91 // hardware value. For registers with no hardware access, this is simply the
92 // the value programmed by software (or in the case R1C, W1C etc) the value after
93 // the operation. For registers with hardware access, this reflects a potentially
94 // delayed version of the real value, as the software facing updates lag real
95 // time updates.
96 //
97 // To resolve software and hardware conflicts, the process is as follows:
98 // When software issues a write, this module asserts "busy". While busy,
99 // src_q does not take on destination value updates. Since the
100 // logic has committed to updating based on software command, there is an irreversible
101 // window from which hardware writes are ignored. Once the busy window completes,
102 // the cdc portion then begins sampling once more.
103 //
104 // This is consistent with prim_subreg_arb where during software / hardware conflicts,
105 // software is always prioritized. The main difference is the conflict resolution window
106 // is now larger instead of just one destination clock cycle.
107
108 logic busy;
109 1/1 assign busy = src_busy_q & !src_ack;
Tests: T1 T2 T3
110
111 // This is the current destination value
112 logic [DataWidth-1:0] dst_qs;
113 logic src_update;
114 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
115 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
116 1/1 src_q <= ResetVal;
Tests: T1 T2 T3
117 1/1 txn_bits_q <= '0;
Tests: T1 T2 T3
118 1/1 end else if (src_req) begin
Tests: T1 T2 T3
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 1/1 src_q <= src_wd_i & BitMask;
Tests: T5 T11 T12
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T5 T11 T12
125 1/1 end else if (src_busy_q && src_ack || src_update && !busy) begin
Tests: T1 T2 T3
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 1/1 src_q <= dst_qs;
Tests: T5 T11 T12
135 1/1 txn_bits_q <= '0;
Tests: T5 T11 T12
136 end
MISSING_ELSE
137 end
138
139 // The current design (tlul_adapter_reg) does not spit out a request if the destination it chooses
140 // (decoded from address) is busy. So this creates a situation in the current design where
141 // src_req_i and busy can never be high at the same time.
142 // While the code above could be coded directly to be expressed as `src_req & !busy`, which makes
143 // the intent clearer, it ends up causing coverage holes from the tool's perspective since that
144 // condition cannot be met.
145 // Thus we add an assertion here to ensure the condition is always satisfied.
146 `ASSERT(BusySrcReqChk_A, busy |-> !src_req, clk_src_i, !rst_src_ni)
147
148 // reserved bits are not used
149 logic unused_wd;
150 1/1 assign unused_wd = ^src_wd_i;
Tests: T1 T2 T3
151
152 // src_q is always updated in the clk_src domain.
153 // when performing an update to the destination domain, it is guaranteed
154 // to not change by protocol.
155 1/1 assign src_qs_o = src_q;
Tests: T1 T2 T3
156 1/1 assign dst_wd_o = src_q;
Tests: T1 T2 T3
157
158 ////////////////////////////
159 // CDC handling
160 ////////////////////////////
161
162 logic dst_req_from_src;
163 logic dst_req;
164
165
166 // the software transaction is pulse synced across the domain.
167 // the prim_reg_cdc_arb module handles conflicts with ongoing hardware updates.
168 prim_pulse_sync u_src_to_dst_req (
169 .clk_src_i,
170 .rst_src_ni,
171 .clk_dst_i,
172 .rst_dst_ni,
173 .src_pulse_i(src_req),
174 .dst_pulse_o(dst_req_from_src)
175 );
176
177 prim_reg_cdc_arb #(
178 .DataWidth(DataWidth),
179 .ResetVal(ResetVal),
180 .DstWrReq(DstWrReq)
181 ) u_arb (
182 .clk_src_i,
183 .rst_src_ni,
184 .clk_dst_i,
185 .rst_dst_ni,
186 .src_ack_o(src_ack),
187 .src_update_o(src_update),
188 .dst_req_i(dst_req_from_src),
189 .dst_req_o(dst_req),
190 .dst_update_i,
191 .dst_ds_i,
192 .dst_qs_i,
193 .dst_qs_o(dst_qs)
194 );
195
196
197 // Each is valid only when destination request pulse is high; this is important in not propagating
198 // the internal assertion of 'dst_req' by the 'prim_pulse_sync' channel when just one domain is
199 // reset.
200 1/1 assign {dst_we_o, dst_re_o, dst_regwen_o} = txn_bits_q & {TxnWidth{dst_req}};
Tests: T1 T2 T3
Cond Coverage for Instance : tb.dut.u_reg.u_adc_chn1_filter_ctl_0_cdc
| Total | Covered | Percent |
Conditions | 11 | 10 | 90.91 |
Logical | 11 | 10 | 90.91 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 65
EXPRESSION (src_we_i | src_re_i)
----1--- ----2---
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T5,T11,T12 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T5,T11,T12 |
1 | 1 | Covered | T5,T11,T12 |
LINE 125
EXPRESSION ((src_busy_q && src_ack) || (src_update && ((!busy))))
-----------1----------- ------------2------------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T5,T11,T12 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T5,T11,T12 |
1 | 1 | Covered | T5,T11,T12 |
LINE 125
SUB-EXPRESSION (src_update && ((!busy)))
-----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Unreachable | |
1 | 1 | Unreachable | |
Branch Coverage for Instance : tb.dut.u_reg.u_adc_chn1_filter_ctl_0_cdc
| Line No. | Total | Covered | Percent |
Branches |
|
8 |
8 |
100.00 |
IF |
71 |
4 |
4 |
100.00 |
IF |
115 |
4 |
4 |
100.00 |
71 if (!rst_src_ni) begin
-1-
72 src_busy_q <= '0;
==>
73 end else if (src_req) begin
-2-
74 src_busy_q <= 1'b1;
==>
75 end else if (src_ack) begin
-3-
76 src_busy_q <= 1'b0;
==>
77 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T5,T11,T12 |
0 |
0 |
1 |
Covered |
T5,T11,T12 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
115 if (!rst_src_ni) begin
-1-
116 src_q <= ResetVal;
==>
117 txn_bits_q <= '0;
118 end else if (src_req) begin
-2-
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 src_q <= src_wd_i & BitMask;
==>
124 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
125 end else if (src_busy_q && src_ack || src_update && !busy) begin
-3-
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 src_q <= dst_qs;
==>
135 txn_bits_q <= '0;
136 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T5,T11,T12 |
0 |
0 |
1 |
Covered |
T5,T11,T12 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.u_reg.u_adc_chn1_filter_ctl_0_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
1669531 |
0 |
0 |
T5 |
308670 |
1896 |
0 |
0 |
T6 |
327577 |
0 |
0 |
0 |
T7 |
144286 |
0 |
0 |
0 |
T8 |
355717 |
0 |
0 |
0 |
T9 |
235626 |
0 |
0 |
0 |
T10 |
372228 |
0 |
0 |
0 |
T11 |
112949 |
452 |
0 |
0 |
T12 |
0 |
3892 |
0 |
0 |
T13 |
0 |
234 |
0 |
0 |
T14 |
0 |
282 |
0 |
0 |
T15 |
0 |
347 |
0 |
0 |
T16 |
0 |
357 |
0 |
0 |
T17 |
0 |
357 |
0 |
0 |
T18 |
0 |
606 |
0 |
0 |
T19 |
0 |
2186 |
0 |
0 |
T22 |
9439 |
0 |
0 |
0 |
T23 |
71080 |
0 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
34247075 |
33952252 |
0 |
0 |
T1 |
1197 |
1119 |
0 |
0 |
T2 |
106 |
6 |
0 |
0 |
T3 |
733 |
683 |
0 |
0 |
T4 |
1245 |
1147 |
0 |
0 |
T5 |
642 |
148 |
0 |
0 |
T6 |
674 |
579 |
0 |
0 |
T7 |
1152 |
1077 |
0 |
0 |
T21 |
899 |
18 |
0 |
0 |
T22 |
74 |
9 |
0 |
0 |
T23 |
946 |
27 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
1984 |
0 |
0 |
T5 |
308670 |
1 |
0 |
0 |
T6 |
327577 |
0 |
0 |
0 |
T7 |
144286 |
0 |
0 |
0 |
T8 |
355717 |
0 |
0 |
0 |
T9 |
235626 |
0 |
0 |
0 |
T10 |
372228 |
0 |
0 |
0 |
T11 |
112949 |
2 |
0 |
0 |
T12 |
0 |
2 |
0 |
0 |
T13 |
0 |
2 |
0 |
0 |
T14 |
0 |
1 |
0 |
0 |
T15 |
0 |
1 |
0 |
0 |
T16 |
0 |
1 |
0 |
0 |
T17 |
0 |
1 |
0 |
0 |
T18 |
0 |
2 |
0 |
0 |
T19 |
0 |
6 |
0 |
0 |
T22 |
9439 |
0 |
0 |
0 |
T23 |
71080 |
0 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
2147483647 |
0 |
0 |
T1 |
299630 |
299544 |
0 |
0 |
T2 |
25763 |
25713 |
0 |
0 |
T3 |
179799 |
179705 |
0 |
0 |
T4 |
105974 |
105879 |
0 |
0 |
T5 |
308670 |
305678 |
0 |
0 |
T6 |
327577 |
327525 |
0 |
0 |
T7 |
144286 |
144204 |
0 |
0 |
T21 |
108025 |
107168 |
0 |
0 |
T22 |
9439 |
9367 |
0 |
0 |
T23 |
71080 |
70224 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_reg.u_adc_chn1_filter_ctl_1_cdc
| Line No. | Total | Covered | Percent |
TOTAL | | 22 | 22 | 100.00 |
CONT_ASSIGN | 65 | 1 | 1 | 100.00 |
ALWAYS | 71 | 6 | 6 | 100.00 |
CONT_ASSIGN | 85 | 1 | 1 | 100.00 |
CONT_ASSIGN | 109 | 1 | 1 | 100.00 |
ALWAYS | 115 | 9 | 9 | 100.00 |
CONT_ASSIGN | 150 | 1 | 1 | 100.00 |
CONT_ASSIGN | 155 | 1 | 1 | 100.00 |
CONT_ASSIGN | 156 | 1 | 1 | 100.00 |
CONT_ASSIGN | 200 | 1 | 1 | 100.00 |
64
65 1/1 assign src_req = src_we_i | src_re_i;
Tests: T11 T12 T13
66
67 // busy indication back-pressures upstream if the register is accessed
68 // again. The busy indication is also used as a "commit" indication for
69 // resolving software and hardware write conflicts
70 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
71 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
72 1/1 src_busy_q <= '0;
Tests: T1 T2 T3
73 1/1 end else if (src_req) begin
Tests: T1 T2 T3
74 1/1 src_busy_q <= 1'b1;
Tests: T11 T12 T13
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T11 T12 T13
77 end
MISSING_ELSE
78 end
79
80 // A src_ack should only be sent if there was a src_req.
81 // src_busy_q asserts whenever there is a src_req. By association,
82 // whenever src_ack is seen, then src_busy must be high.
83 `ASSERT(SrcAckBusyChk_A, src_ack |-> src_busy_q, clk_src_i, !rst_src_ni)
84
85 1/1 assign src_busy_o = src_busy_q;
Tests: T1 T2 T3
86
87 // src_q acts as both the write holding register and the software read back
88 // register.
89 // When software performs a write, the write data is captured in src_q for
90 // CDC purposes. When not performing a write, the src_q reflects the most recent
91 // hardware value. For registers with no hardware access, this is simply the
92 // the value programmed by software (or in the case R1C, W1C etc) the value after
93 // the operation. For registers with hardware access, this reflects a potentially
94 // delayed version of the real value, as the software facing updates lag real
95 // time updates.
96 //
97 // To resolve software and hardware conflicts, the process is as follows:
98 // When software issues a write, this module asserts "busy". While busy,
99 // src_q does not take on destination value updates. Since the
100 // logic has committed to updating based on software command, there is an irreversible
101 // window from which hardware writes are ignored. Once the busy window completes,
102 // the cdc portion then begins sampling once more.
103 //
104 // This is consistent with prim_subreg_arb where during software / hardware conflicts,
105 // software is always prioritized. The main difference is the conflict resolution window
106 // is now larger instead of just one destination clock cycle.
107
108 logic busy;
109 1/1 assign busy = src_busy_q & !src_ack;
Tests: T1 T2 T3
110
111 // This is the current destination value
112 logic [DataWidth-1:0] dst_qs;
113 logic src_update;
114 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
115 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
116 1/1 src_q <= ResetVal;
Tests: T1 T2 T3
117 1/1 txn_bits_q <= '0;
Tests: T1 T2 T3
118 1/1 end else if (src_req) begin
Tests: T1 T2 T3
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 1/1 src_q <= src_wd_i & BitMask;
Tests: T11 T12 T13
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T11 T12 T13
125 1/1 end else if (src_busy_q && src_ack || src_update && !busy) begin
Tests: T1 T2 T3
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 1/1 src_q <= dst_qs;
Tests: T11 T12 T13
135 1/1 txn_bits_q <= '0;
Tests: T11 T12 T13
136 end
MISSING_ELSE
137 end
138
139 // The current design (tlul_adapter_reg) does not spit out a request if the destination it chooses
140 // (decoded from address) is busy. So this creates a situation in the current design where
141 // src_req_i and busy can never be high at the same time.
142 // While the code above could be coded directly to be expressed as `src_req & !busy`, which makes
143 // the intent clearer, it ends up causing coverage holes from the tool's perspective since that
144 // condition cannot be met.
145 // Thus we add an assertion here to ensure the condition is always satisfied.
146 `ASSERT(BusySrcReqChk_A, busy |-> !src_req, clk_src_i, !rst_src_ni)
147
148 // reserved bits are not used
149 logic unused_wd;
150 1/1 assign unused_wd = ^src_wd_i;
Tests: T1 T2 T3
151
152 // src_q is always updated in the clk_src domain.
153 // when performing an update to the destination domain, it is guaranteed
154 // to not change by protocol.
155 1/1 assign src_qs_o = src_q;
Tests: T1 T2 T3
156 1/1 assign dst_wd_o = src_q;
Tests: T1 T2 T3
157
158 ////////////////////////////
159 // CDC handling
160 ////////////////////////////
161
162 logic dst_req_from_src;
163 logic dst_req;
164
165
166 // the software transaction is pulse synced across the domain.
167 // the prim_reg_cdc_arb module handles conflicts with ongoing hardware updates.
168 prim_pulse_sync u_src_to_dst_req (
169 .clk_src_i,
170 .rst_src_ni,
171 .clk_dst_i,
172 .rst_dst_ni,
173 .src_pulse_i(src_req),
174 .dst_pulse_o(dst_req_from_src)
175 );
176
177 prim_reg_cdc_arb #(
178 .DataWidth(DataWidth),
179 .ResetVal(ResetVal),
180 .DstWrReq(DstWrReq)
181 ) u_arb (
182 .clk_src_i,
183 .rst_src_ni,
184 .clk_dst_i,
185 .rst_dst_ni,
186 .src_ack_o(src_ack),
187 .src_update_o(src_update),
188 .dst_req_i(dst_req_from_src),
189 .dst_req_o(dst_req),
190 .dst_update_i,
191 .dst_ds_i,
192 .dst_qs_i,
193 .dst_qs_o(dst_qs)
194 );
195
196
197 // Each is valid only when destination request pulse is high; this is important in not propagating
198 // the internal assertion of 'dst_req' by the 'prim_pulse_sync' channel when just one domain is
199 // reset.
200 1/1 assign {dst_we_o, dst_re_o, dst_regwen_o} = txn_bits_q & {TxnWidth{dst_req}};
Tests: T1 T2 T3
Cond Coverage for Instance : tb.dut.u_reg.u_adc_chn1_filter_ctl_1_cdc
| Total | Covered | Percent |
Conditions | 11 | 10 | 90.91 |
Logical | 11 | 10 | 90.91 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 65
EXPRESSION (src_we_i | src_re_i)
----1--- ----2---
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T11,T12,T13 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T11,T12,T13 |
1 | 1 | Covered | T11,T12,T13 |
LINE 125
EXPRESSION ((src_busy_q && src_ack) || (src_update && ((!busy))))
-----------1----------- ------------2------------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T11,T12,T13 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T11,T12,T13 |
1 | 1 | Covered | T11,T12,T13 |
LINE 125
SUB-EXPRESSION (src_update && ((!busy)))
-----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Unreachable | |
1 | 1 | Unreachable | |
Branch Coverage for Instance : tb.dut.u_reg.u_adc_chn1_filter_ctl_1_cdc
| Line No. | Total | Covered | Percent |
Branches |
|
8 |
8 |
100.00 |
IF |
71 |
4 |
4 |
100.00 |
IF |
115 |
4 |
4 |
100.00 |
71 if (!rst_src_ni) begin
-1-
72 src_busy_q <= '0;
==>
73 end else if (src_req) begin
-2-
74 src_busy_q <= 1'b1;
==>
75 end else if (src_ack) begin
-3-
76 src_busy_q <= 1'b0;
==>
77 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T11,T12,T13 |
0 |
0 |
1 |
Covered |
T11,T12,T13 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
115 if (!rst_src_ni) begin
-1-
116 src_q <= ResetVal;
==>
117 txn_bits_q <= '0;
118 end else if (src_req) begin
-2-
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 src_q <= src_wd_i & BitMask;
==>
124 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
125 end else if (src_busy_q && src_ack || src_update && !busy) begin
-3-
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 src_q <= dst_qs;
==>
135 txn_bits_q <= '0;
136 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T11,T12,T13 |
0 |
0 |
1 |
Covered |
T11,T12,T13 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.u_reg.u_adc_chn1_filter_ctl_1_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
1598783 |
0 |
0 |
T11 |
112949 |
528 |
0 |
0 |
T12 |
255584 |
1906 |
0 |
0 |
T13 |
171132 |
230 |
0 |
0 |
T14 |
395989 |
270 |
0 |
0 |
T15 |
0 |
345 |
0 |
0 |
T16 |
0 |
355 |
0 |
0 |
T17 |
0 |
355 |
0 |
0 |
T18 |
0 |
602 |
0 |
0 |
T19 |
0 |
1296 |
0 |
0 |
T20 |
0 |
293 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
T25 |
50651 |
0 |
0 |
0 |
T26 |
109966 |
0 |
0 |
0 |
T27 |
183417 |
0 |
0 |
0 |
T28 |
180001 |
0 |
0 |
0 |
T29 |
96579 |
0 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
34247075 |
33952252 |
0 |
0 |
T1 |
1197 |
1119 |
0 |
0 |
T2 |
106 |
6 |
0 |
0 |
T3 |
733 |
683 |
0 |
0 |
T4 |
1245 |
1147 |
0 |
0 |
T5 |
642 |
148 |
0 |
0 |
T6 |
674 |
579 |
0 |
0 |
T7 |
1152 |
1077 |
0 |
0 |
T21 |
899 |
18 |
0 |
0 |
T22 |
74 |
9 |
0 |
0 |
T23 |
946 |
27 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
1903 |
0 |
0 |
T11 |
112949 |
2 |
0 |
0 |
T12 |
255584 |
1 |
0 |
0 |
T13 |
171132 |
2 |
0 |
0 |
T14 |
395989 |
1 |
0 |
0 |
T15 |
0 |
1 |
0 |
0 |
T16 |
0 |
1 |
0 |
0 |
T17 |
0 |
1 |
0 |
0 |
T18 |
0 |
2 |
0 |
0 |
T19 |
0 |
4 |
0 |
0 |
T20 |
0 |
1 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
T25 |
50651 |
0 |
0 |
0 |
T26 |
109966 |
0 |
0 |
0 |
T27 |
183417 |
0 |
0 |
0 |
T28 |
180001 |
0 |
0 |
0 |
T29 |
96579 |
0 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
2147483647 |
0 |
0 |
T1 |
299630 |
299544 |
0 |
0 |
T2 |
25763 |
25713 |
0 |
0 |
T3 |
179799 |
179705 |
0 |
0 |
T4 |
105974 |
105879 |
0 |
0 |
T5 |
308670 |
305678 |
0 |
0 |
T6 |
327577 |
327525 |
0 |
0 |
T7 |
144286 |
144204 |
0 |
0 |
T21 |
108025 |
107168 |
0 |
0 |
T22 |
9439 |
9367 |
0 |
0 |
T23 |
71080 |
70224 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_reg.u_adc_chn1_filter_ctl_2_cdc
| Line No. | Total | Covered | Percent |
TOTAL | | 22 | 22 | 100.00 |
CONT_ASSIGN | 65 | 1 | 1 | 100.00 |
ALWAYS | 71 | 6 | 6 | 100.00 |
CONT_ASSIGN | 85 | 1 | 1 | 100.00 |
CONT_ASSIGN | 109 | 1 | 1 | 100.00 |
ALWAYS | 115 | 9 | 9 | 100.00 |
CONT_ASSIGN | 150 | 1 | 1 | 100.00 |
CONT_ASSIGN | 155 | 1 | 1 | 100.00 |
CONT_ASSIGN | 156 | 1 | 1 | 100.00 |
CONT_ASSIGN | 200 | 1 | 1 | 100.00 |
64
65 1/1 assign src_req = src_we_i | src_re_i;
Tests: T11 T12 T13
66
67 // busy indication back-pressures upstream if the register is accessed
68 // again. The busy indication is also used as a "commit" indication for
69 // resolving software and hardware write conflicts
70 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
71 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
72 1/1 src_busy_q <= '0;
Tests: T1 T2 T3
73 1/1 end else if (src_req) begin
Tests: T1 T2 T3
74 1/1 src_busy_q <= 1'b1;
Tests: T11 T12 T13
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T11 T12 T13
77 end
MISSING_ELSE
78 end
79
80 // A src_ack should only be sent if there was a src_req.
81 // src_busy_q asserts whenever there is a src_req. By association,
82 // whenever src_ack is seen, then src_busy must be high.
83 `ASSERT(SrcAckBusyChk_A, src_ack |-> src_busy_q, clk_src_i, !rst_src_ni)
84
85 1/1 assign src_busy_o = src_busy_q;
Tests: T1 T2 T3
86
87 // src_q acts as both the write holding register and the software read back
88 // register.
89 // When software performs a write, the write data is captured in src_q for
90 // CDC purposes. When not performing a write, the src_q reflects the most recent
91 // hardware value. For registers with no hardware access, this is simply the
92 // the value programmed by software (or in the case R1C, W1C etc) the value after
93 // the operation. For registers with hardware access, this reflects a potentially
94 // delayed version of the real value, as the software facing updates lag real
95 // time updates.
96 //
97 // To resolve software and hardware conflicts, the process is as follows:
98 // When software issues a write, this module asserts "busy". While busy,
99 // src_q does not take on destination value updates. Since the
100 // logic has committed to updating based on software command, there is an irreversible
101 // window from which hardware writes are ignored. Once the busy window completes,
102 // the cdc portion then begins sampling once more.
103 //
104 // This is consistent with prim_subreg_arb where during software / hardware conflicts,
105 // software is always prioritized. The main difference is the conflict resolution window
106 // is now larger instead of just one destination clock cycle.
107
108 logic busy;
109 1/1 assign busy = src_busy_q & !src_ack;
Tests: T1 T2 T3
110
111 // This is the current destination value
112 logic [DataWidth-1:0] dst_qs;
113 logic src_update;
114 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
115 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
116 1/1 src_q <= ResetVal;
Tests: T1 T2 T3
117 1/1 txn_bits_q <= '0;
Tests: T1 T2 T3
118 1/1 end else if (src_req) begin
Tests: T1 T2 T3
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 1/1 src_q <= src_wd_i & BitMask;
Tests: T11 T12 T13
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T11 T12 T13
125 1/1 end else if (src_busy_q && src_ack || src_update && !busy) begin
Tests: T1 T2 T3
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 1/1 src_q <= dst_qs;
Tests: T11 T12 T13
135 1/1 txn_bits_q <= '0;
Tests: T11 T12 T13
136 end
MISSING_ELSE
137 end
138
139 // The current design (tlul_adapter_reg) does not spit out a request if the destination it chooses
140 // (decoded from address) is busy. So this creates a situation in the current design where
141 // src_req_i and busy can never be high at the same time.
142 // While the code above could be coded directly to be expressed as `src_req & !busy`, which makes
143 // the intent clearer, it ends up causing coverage holes from the tool's perspective since that
144 // condition cannot be met.
145 // Thus we add an assertion here to ensure the condition is always satisfied.
146 `ASSERT(BusySrcReqChk_A, busy |-> !src_req, clk_src_i, !rst_src_ni)
147
148 // reserved bits are not used
149 logic unused_wd;
150 1/1 assign unused_wd = ^src_wd_i;
Tests: T1 T2 T3
151
152 // src_q is always updated in the clk_src domain.
153 // when performing an update to the destination domain, it is guaranteed
154 // to not change by protocol.
155 1/1 assign src_qs_o = src_q;
Tests: T1 T2 T3
156 1/1 assign dst_wd_o = src_q;
Tests: T1 T2 T3
157
158 ////////////////////////////
159 // CDC handling
160 ////////////////////////////
161
162 logic dst_req_from_src;
163 logic dst_req;
164
165
166 // the software transaction is pulse synced across the domain.
167 // the prim_reg_cdc_arb module handles conflicts with ongoing hardware updates.
168 prim_pulse_sync u_src_to_dst_req (
169 .clk_src_i,
170 .rst_src_ni,
171 .clk_dst_i,
172 .rst_dst_ni,
173 .src_pulse_i(src_req),
174 .dst_pulse_o(dst_req_from_src)
175 );
176
177 prim_reg_cdc_arb #(
178 .DataWidth(DataWidth),
179 .ResetVal(ResetVal),
180 .DstWrReq(DstWrReq)
181 ) u_arb (
182 .clk_src_i,
183 .rst_src_ni,
184 .clk_dst_i,
185 .rst_dst_ni,
186 .src_ack_o(src_ack),
187 .src_update_o(src_update),
188 .dst_req_i(dst_req_from_src),
189 .dst_req_o(dst_req),
190 .dst_update_i,
191 .dst_ds_i,
192 .dst_qs_i,
193 .dst_qs_o(dst_qs)
194 );
195
196
197 // Each is valid only when destination request pulse is high; this is important in not propagating
198 // the internal assertion of 'dst_req' by the 'prim_pulse_sync' channel when just one domain is
199 // reset.
200 1/1 assign {dst_we_o, dst_re_o, dst_regwen_o} = txn_bits_q & {TxnWidth{dst_req}};
Tests: T1 T2 T3
Cond Coverage for Instance : tb.dut.u_reg.u_adc_chn1_filter_ctl_2_cdc
| Total | Covered | Percent |
Conditions | 11 | 10 | 90.91 |
Logical | 11 | 10 | 90.91 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 65
EXPRESSION (src_we_i | src_re_i)
----1--- ----2---
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T11,T12,T13 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T11,T12,T13 |
1 | 1 | Covered | T11,T12,T13 |
LINE 125
EXPRESSION ((src_busy_q && src_ack) || (src_update && ((!busy))))
-----------1----------- ------------2------------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T11,T12,T13 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T11,T12,T13 |
1 | 1 | Covered | T11,T12,T13 |
LINE 125
SUB-EXPRESSION (src_update && ((!busy)))
-----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Unreachable | |
1 | 1 | Unreachable | |
Branch Coverage for Instance : tb.dut.u_reg.u_adc_chn1_filter_ctl_2_cdc
| Line No. | Total | Covered | Percent |
Branches |
|
8 |
8 |
100.00 |
IF |
71 |
4 |
4 |
100.00 |
IF |
115 |
4 |
4 |
100.00 |
71 if (!rst_src_ni) begin
-1-
72 src_busy_q <= '0;
==>
73 end else if (src_req) begin
-2-
74 src_busy_q <= 1'b1;
==>
75 end else if (src_ack) begin
-3-
76 src_busy_q <= 1'b0;
==>
77 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T11,T12,T13 |
0 |
0 |
1 |
Covered |
T11,T12,T13 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
115 if (!rst_src_ni) begin
-1-
116 src_q <= ResetVal;
==>
117 txn_bits_q <= '0;
118 end else if (src_req) begin
-2-
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 src_q <= src_wd_i & BitMask;
==>
124 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
125 end else if (src_busy_q && src_ack || src_update && !busy) begin
-3-
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 src_q <= dst_qs;
==>
135 txn_bits_q <= '0;
136 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T11,T12,T13 |
0 |
0 |
1 |
Covered |
T11,T12,T13 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.u_reg.u_adc_chn1_filter_ctl_2_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
1581866 |
0 |
0 |
T11 |
112949 |
514 |
0 |
0 |
T12 |
255584 |
1896 |
0 |
0 |
T13 |
171132 |
226 |
0 |
0 |
T14 |
395989 |
267 |
0 |
0 |
T15 |
0 |
341 |
0 |
0 |
T16 |
0 |
353 |
0 |
0 |
T17 |
0 |
353 |
0 |
0 |
T18 |
0 |
598 |
0 |
0 |
T19 |
0 |
1272 |
0 |
0 |
T20 |
0 |
276 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
T25 |
50651 |
0 |
0 |
0 |
T26 |
109966 |
0 |
0 |
0 |
T27 |
183417 |
0 |
0 |
0 |
T28 |
180001 |
0 |
0 |
0 |
T29 |
96579 |
0 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
34247075 |
33952252 |
0 |
0 |
T1 |
1197 |
1119 |
0 |
0 |
T2 |
106 |
6 |
0 |
0 |
T3 |
733 |
683 |
0 |
0 |
T4 |
1245 |
1147 |
0 |
0 |
T5 |
642 |
148 |
0 |
0 |
T6 |
674 |
579 |
0 |
0 |
T7 |
1152 |
1077 |
0 |
0 |
T21 |
899 |
18 |
0 |
0 |
T22 |
74 |
9 |
0 |
0 |
T23 |
946 |
27 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
1895 |
0 |
0 |
T11 |
112949 |
2 |
0 |
0 |
T12 |
255584 |
1 |
0 |
0 |
T13 |
171132 |
2 |
0 |
0 |
T14 |
395989 |
1 |
0 |
0 |
T15 |
0 |
1 |
0 |
0 |
T16 |
0 |
1 |
0 |
0 |
T17 |
0 |
1 |
0 |
0 |
T18 |
0 |
2 |
0 |
0 |
T19 |
0 |
4 |
0 |
0 |
T20 |
0 |
1 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
T25 |
50651 |
0 |
0 |
0 |
T26 |
109966 |
0 |
0 |
0 |
T27 |
183417 |
0 |
0 |
0 |
T28 |
180001 |
0 |
0 |
0 |
T29 |
96579 |
0 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
2147483647 |
0 |
0 |
T1 |
299630 |
299544 |
0 |
0 |
T2 |
25763 |
25713 |
0 |
0 |
T3 |
179799 |
179705 |
0 |
0 |
T4 |
105974 |
105879 |
0 |
0 |
T5 |
308670 |
305678 |
0 |
0 |
T6 |
327577 |
327525 |
0 |
0 |
T7 |
144286 |
144204 |
0 |
0 |
T21 |
108025 |
107168 |
0 |
0 |
T22 |
9439 |
9367 |
0 |
0 |
T23 |
71080 |
70224 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_reg.u_adc_chn1_filter_ctl_3_cdc
| Line No. | Total | Covered | Percent |
TOTAL | | 22 | 22 | 100.00 |
CONT_ASSIGN | 65 | 1 | 1 | 100.00 |
ALWAYS | 71 | 6 | 6 | 100.00 |
CONT_ASSIGN | 85 | 1 | 1 | 100.00 |
CONT_ASSIGN | 109 | 1 | 1 | 100.00 |
ALWAYS | 115 | 9 | 9 | 100.00 |
CONT_ASSIGN | 150 | 1 | 1 | 100.00 |
CONT_ASSIGN | 155 | 1 | 1 | 100.00 |
CONT_ASSIGN | 156 | 1 | 1 | 100.00 |
CONT_ASSIGN | 200 | 1 | 1 | 100.00 |
64
65 1/1 assign src_req = src_we_i | src_re_i;
Tests: T11 T12 T13
66
67 // busy indication back-pressures upstream if the register is accessed
68 // again. The busy indication is also used as a "commit" indication for
69 // resolving software and hardware write conflicts
70 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
71 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
72 1/1 src_busy_q <= '0;
Tests: T1 T2 T3
73 1/1 end else if (src_req) begin
Tests: T1 T2 T3
74 1/1 src_busy_q <= 1'b1;
Tests: T11 T12 T13
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T11 T12 T13
77 end
MISSING_ELSE
78 end
79
80 // A src_ack should only be sent if there was a src_req.
81 // src_busy_q asserts whenever there is a src_req. By association,
82 // whenever src_ack is seen, then src_busy must be high.
83 `ASSERT(SrcAckBusyChk_A, src_ack |-> src_busy_q, clk_src_i, !rst_src_ni)
84
85 1/1 assign src_busy_o = src_busy_q;
Tests: T1 T2 T3
86
87 // src_q acts as both the write holding register and the software read back
88 // register.
89 // When software performs a write, the write data is captured in src_q for
90 // CDC purposes. When not performing a write, the src_q reflects the most recent
91 // hardware value. For registers with no hardware access, this is simply the
92 // the value programmed by software (or in the case R1C, W1C etc) the value after
93 // the operation. For registers with hardware access, this reflects a potentially
94 // delayed version of the real value, as the software facing updates lag real
95 // time updates.
96 //
97 // To resolve software and hardware conflicts, the process is as follows:
98 // When software issues a write, this module asserts "busy". While busy,
99 // src_q does not take on destination value updates. Since the
100 // logic has committed to updating based on software command, there is an irreversible
101 // window from which hardware writes are ignored. Once the busy window completes,
102 // the cdc portion then begins sampling once more.
103 //
104 // This is consistent with prim_subreg_arb where during software / hardware conflicts,
105 // software is always prioritized. The main difference is the conflict resolution window
106 // is now larger instead of just one destination clock cycle.
107
108 logic busy;
109 1/1 assign busy = src_busy_q & !src_ack;
Tests: T1 T2 T3
110
111 // This is the current destination value
112 logic [DataWidth-1:0] dst_qs;
113 logic src_update;
114 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
115 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
116 1/1 src_q <= ResetVal;
Tests: T1 T2 T3
117 1/1 txn_bits_q <= '0;
Tests: T1 T2 T3
118 1/1 end else if (src_req) begin
Tests: T1 T2 T3
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 1/1 src_q <= src_wd_i & BitMask;
Tests: T11 T12 T13
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T11 T12 T13
125 1/1 end else if (src_busy_q && src_ack || src_update && !busy) begin
Tests: T1 T2 T3
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 1/1 src_q <= dst_qs;
Tests: T11 T12 T13
135 1/1 txn_bits_q <= '0;
Tests: T11 T12 T13
136 end
MISSING_ELSE
137 end
138
139 // The current design (tlul_adapter_reg) does not spit out a request if the destination it chooses
140 // (decoded from address) is busy. So this creates a situation in the current design where
141 // src_req_i and busy can never be high at the same time.
142 // While the code above could be coded directly to be expressed as `src_req & !busy`, which makes
143 // the intent clearer, it ends up causing coverage holes from the tool's perspective since that
144 // condition cannot be met.
145 // Thus we add an assertion here to ensure the condition is always satisfied.
146 `ASSERT(BusySrcReqChk_A, busy |-> !src_req, clk_src_i, !rst_src_ni)
147
148 // reserved bits are not used
149 logic unused_wd;
150 1/1 assign unused_wd = ^src_wd_i;
Tests: T1 T2 T3
151
152 // src_q is always updated in the clk_src domain.
153 // when performing an update to the destination domain, it is guaranteed
154 // to not change by protocol.
155 1/1 assign src_qs_o = src_q;
Tests: T1 T2 T3
156 1/1 assign dst_wd_o = src_q;
Tests: T1 T2 T3
157
158 ////////////////////////////
159 // CDC handling
160 ////////////////////////////
161
162 logic dst_req_from_src;
163 logic dst_req;
164
165
166 // the software transaction is pulse synced across the domain.
167 // the prim_reg_cdc_arb module handles conflicts with ongoing hardware updates.
168 prim_pulse_sync u_src_to_dst_req (
169 .clk_src_i,
170 .rst_src_ni,
171 .clk_dst_i,
172 .rst_dst_ni,
173 .src_pulse_i(src_req),
174 .dst_pulse_o(dst_req_from_src)
175 );
176
177 prim_reg_cdc_arb #(
178 .DataWidth(DataWidth),
179 .ResetVal(ResetVal),
180 .DstWrReq(DstWrReq)
181 ) u_arb (
182 .clk_src_i,
183 .rst_src_ni,
184 .clk_dst_i,
185 .rst_dst_ni,
186 .src_ack_o(src_ack),
187 .src_update_o(src_update),
188 .dst_req_i(dst_req_from_src),
189 .dst_req_o(dst_req),
190 .dst_update_i,
191 .dst_ds_i,
192 .dst_qs_i,
193 .dst_qs_o(dst_qs)
194 );
195
196
197 // Each is valid only when destination request pulse is high; this is important in not propagating
198 // the internal assertion of 'dst_req' by the 'prim_pulse_sync' channel when just one domain is
199 // reset.
200 1/1 assign {dst_we_o, dst_re_o, dst_regwen_o} = txn_bits_q & {TxnWidth{dst_req}};
Tests: T1 T2 T3
Cond Coverage for Instance : tb.dut.u_reg.u_adc_chn1_filter_ctl_3_cdc
| Total | Covered | Percent |
Conditions | 11 | 10 | 90.91 |
Logical | 11 | 10 | 90.91 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 65
EXPRESSION (src_we_i | src_re_i)
----1--- ----2---
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T11,T12,T13 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T11,T12,T13 |
1 | 1 | Covered | T11,T12,T13 |
LINE 125
EXPRESSION ((src_busy_q && src_ack) || (src_update && ((!busy))))
-----------1----------- ------------2------------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T11,T12,T13 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T11,T12,T13 |
1 | 1 | Covered | T11,T12,T13 |
LINE 125
SUB-EXPRESSION (src_update && ((!busy)))
-----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Unreachable | |
1 | 1 | Unreachable | |
Branch Coverage for Instance : tb.dut.u_reg.u_adc_chn1_filter_ctl_3_cdc
| Line No. | Total | Covered | Percent |
Branches |
|
8 |
8 |
100.00 |
IF |
71 |
4 |
4 |
100.00 |
IF |
115 |
4 |
4 |
100.00 |
71 if (!rst_src_ni) begin
-1-
72 src_busy_q <= '0;
==>
73 end else if (src_req) begin
-2-
74 src_busy_q <= 1'b1;
==>
75 end else if (src_ack) begin
-3-
76 src_busy_q <= 1'b0;
==>
77 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T11,T12,T13 |
0 |
0 |
1 |
Covered |
T11,T12,T13 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
115 if (!rst_src_ni) begin
-1-
116 src_q <= ResetVal;
==>
117 txn_bits_q <= '0;
118 end else if (src_req) begin
-2-
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 src_q <= src_wd_i & BitMask;
==>
124 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
125 end else if (src_busy_q && src_ack || src_update && !busy) begin
-3-
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 src_q <= dst_qs;
==>
135 txn_bits_q <= '0;
136 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T11,T12,T13 |
0 |
0 |
1 |
Covered |
T11,T12,T13 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.u_reg.u_adc_chn1_filter_ctl_3_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
1604715 |
0 |
0 |
T11 |
112949 |
501 |
0 |
0 |
T12 |
255584 |
1886 |
0 |
0 |
T13 |
171132 |
222 |
0 |
0 |
T14 |
395989 |
261 |
0 |
0 |
T15 |
0 |
337 |
0 |
0 |
T16 |
0 |
351 |
0 |
0 |
T17 |
0 |
351 |
0 |
0 |
T18 |
0 |
594 |
0 |
0 |
T19 |
0 |
1237 |
0 |
0 |
T20 |
0 |
265 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
T25 |
50651 |
0 |
0 |
0 |
T26 |
109966 |
0 |
0 |
0 |
T27 |
183417 |
0 |
0 |
0 |
T28 |
180001 |
0 |
0 |
0 |
T29 |
96579 |
0 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
34247075 |
33952252 |
0 |
0 |
T1 |
1197 |
1119 |
0 |
0 |
T2 |
106 |
6 |
0 |
0 |
T3 |
733 |
683 |
0 |
0 |
T4 |
1245 |
1147 |
0 |
0 |
T5 |
642 |
148 |
0 |
0 |
T6 |
674 |
579 |
0 |
0 |
T7 |
1152 |
1077 |
0 |
0 |
T21 |
899 |
18 |
0 |
0 |
T22 |
74 |
9 |
0 |
0 |
T23 |
946 |
27 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
1933 |
0 |
0 |
T11 |
112949 |
2 |
0 |
0 |
T12 |
255584 |
1 |
0 |
0 |
T13 |
171132 |
2 |
0 |
0 |
T14 |
395989 |
1 |
0 |
0 |
T15 |
0 |
1 |
0 |
0 |
T16 |
0 |
1 |
0 |
0 |
T17 |
0 |
1 |
0 |
0 |
T18 |
0 |
2 |
0 |
0 |
T19 |
0 |
4 |
0 |
0 |
T20 |
0 |
1 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
T25 |
50651 |
0 |
0 |
0 |
T26 |
109966 |
0 |
0 |
0 |
T27 |
183417 |
0 |
0 |
0 |
T28 |
180001 |
0 |
0 |
0 |
T29 |
96579 |
0 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
2147483647 |
0 |
0 |
T1 |
299630 |
299544 |
0 |
0 |
T2 |
25763 |
25713 |
0 |
0 |
T3 |
179799 |
179705 |
0 |
0 |
T4 |
105974 |
105879 |
0 |
0 |
T5 |
308670 |
305678 |
0 |
0 |
T6 |
327577 |
327525 |
0 |
0 |
T7 |
144286 |
144204 |
0 |
0 |
T21 |
108025 |
107168 |
0 |
0 |
T22 |
9439 |
9367 |
0 |
0 |
T23 |
71080 |
70224 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_reg.u_adc_chn1_filter_ctl_4_cdc
| Line No. | Total | Covered | Percent |
TOTAL | | 22 | 22 | 100.00 |
CONT_ASSIGN | 65 | 1 | 1 | 100.00 |
ALWAYS | 71 | 6 | 6 | 100.00 |
CONT_ASSIGN | 85 | 1 | 1 | 100.00 |
CONT_ASSIGN | 109 | 1 | 1 | 100.00 |
ALWAYS | 115 | 9 | 9 | 100.00 |
CONT_ASSIGN | 150 | 1 | 1 | 100.00 |
CONT_ASSIGN | 155 | 1 | 1 | 100.00 |
CONT_ASSIGN | 156 | 1 | 1 | 100.00 |
CONT_ASSIGN | 200 | 1 | 1 | 100.00 |
64
65 1/1 assign src_req = src_we_i | src_re_i;
Tests: T11 T12 T13
66
67 // busy indication back-pressures upstream if the register is accessed
68 // again. The busy indication is also used as a "commit" indication for
69 // resolving software and hardware write conflicts
70 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
71 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
72 1/1 src_busy_q <= '0;
Tests: T1 T2 T3
73 1/1 end else if (src_req) begin
Tests: T1 T2 T3
74 1/1 src_busy_q <= 1'b1;
Tests: T11 T12 T13
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T11 T12 T13
77 end
MISSING_ELSE
78 end
79
80 // A src_ack should only be sent if there was a src_req.
81 // src_busy_q asserts whenever there is a src_req. By association,
82 // whenever src_ack is seen, then src_busy must be high.
83 `ASSERT(SrcAckBusyChk_A, src_ack |-> src_busy_q, clk_src_i, !rst_src_ni)
84
85 1/1 assign src_busy_o = src_busy_q;
Tests: T1 T2 T3
86
87 // src_q acts as both the write holding register and the software read back
88 // register.
89 // When software performs a write, the write data is captured in src_q for
90 // CDC purposes. When not performing a write, the src_q reflects the most recent
91 // hardware value. For registers with no hardware access, this is simply the
92 // the value programmed by software (or in the case R1C, W1C etc) the value after
93 // the operation. For registers with hardware access, this reflects a potentially
94 // delayed version of the real value, as the software facing updates lag real
95 // time updates.
96 //
97 // To resolve software and hardware conflicts, the process is as follows:
98 // When software issues a write, this module asserts "busy". While busy,
99 // src_q does not take on destination value updates. Since the
100 // logic has committed to updating based on software command, there is an irreversible
101 // window from which hardware writes are ignored. Once the busy window completes,
102 // the cdc portion then begins sampling once more.
103 //
104 // This is consistent with prim_subreg_arb where during software / hardware conflicts,
105 // software is always prioritized. The main difference is the conflict resolution window
106 // is now larger instead of just one destination clock cycle.
107
108 logic busy;
109 1/1 assign busy = src_busy_q & !src_ack;
Tests: T1 T2 T3
110
111 // This is the current destination value
112 logic [DataWidth-1:0] dst_qs;
113 logic src_update;
114 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
115 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
116 1/1 src_q <= ResetVal;
Tests: T1 T2 T3
117 1/1 txn_bits_q <= '0;
Tests: T1 T2 T3
118 1/1 end else if (src_req) begin
Tests: T1 T2 T3
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 1/1 src_q <= src_wd_i & BitMask;
Tests: T11 T12 T13
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T11 T12 T13
125 1/1 end else if (src_busy_q && src_ack || src_update && !busy) begin
Tests: T1 T2 T3
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 1/1 src_q <= dst_qs;
Tests: T11 T12 T13
135 1/1 txn_bits_q <= '0;
Tests: T11 T12 T13
136 end
MISSING_ELSE
137 end
138
139 // The current design (tlul_adapter_reg) does not spit out a request if the destination it chooses
140 // (decoded from address) is busy. So this creates a situation in the current design where
141 // src_req_i and busy can never be high at the same time.
142 // While the code above could be coded directly to be expressed as `src_req & !busy`, which makes
143 // the intent clearer, it ends up causing coverage holes from the tool's perspective since that
144 // condition cannot be met.
145 // Thus we add an assertion here to ensure the condition is always satisfied.
146 `ASSERT(BusySrcReqChk_A, busy |-> !src_req, clk_src_i, !rst_src_ni)
147
148 // reserved bits are not used
149 logic unused_wd;
150 1/1 assign unused_wd = ^src_wd_i;
Tests: T1 T2 T3
151
152 // src_q is always updated in the clk_src domain.
153 // when performing an update to the destination domain, it is guaranteed
154 // to not change by protocol.
155 1/1 assign src_qs_o = src_q;
Tests: T1 T2 T3
156 1/1 assign dst_wd_o = src_q;
Tests: T1 T2 T3
157
158 ////////////////////////////
159 // CDC handling
160 ////////////////////////////
161
162 logic dst_req_from_src;
163 logic dst_req;
164
165
166 // the software transaction is pulse synced across the domain.
167 // the prim_reg_cdc_arb module handles conflicts with ongoing hardware updates.
168 prim_pulse_sync u_src_to_dst_req (
169 .clk_src_i,
170 .rst_src_ni,
171 .clk_dst_i,
172 .rst_dst_ni,
173 .src_pulse_i(src_req),
174 .dst_pulse_o(dst_req_from_src)
175 );
176
177 prim_reg_cdc_arb #(
178 .DataWidth(DataWidth),
179 .ResetVal(ResetVal),
180 .DstWrReq(DstWrReq)
181 ) u_arb (
182 .clk_src_i,
183 .rst_src_ni,
184 .clk_dst_i,
185 .rst_dst_ni,
186 .src_ack_o(src_ack),
187 .src_update_o(src_update),
188 .dst_req_i(dst_req_from_src),
189 .dst_req_o(dst_req),
190 .dst_update_i,
191 .dst_ds_i,
192 .dst_qs_i,
193 .dst_qs_o(dst_qs)
194 );
195
196
197 // Each is valid only when destination request pulse is high; this is important in not propagating
198 // the internal assertion of 'dst_req' by the 'prim_pulse_sync' channel when just one domain is
199 // reset.
200 1/1 assign {dst_we_o, dst_re_o, dst_regwen_o} = txn_bits_q & {TxnWidth{dst_req}};
Tests: T1 T2 T3
Cond Coverage for Instance : tb.dut.u_reg.u_adc_chn1_filter_ctl_4_cdc
| Total | Covered | Percent |
Conditions | 11 | 10 | 90.91 |
Logical | 11 | 10 | 90.91 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 65
EXPRESSION (src_we_i | src_re_i)
----1--- ----2---
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T11,T12,T13 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T11,T12,T13 |
1 | 1 | Covered | T11,T12,T13 |
LINE 125
EXPRESSION ((src_busy_q && src_ack) || (src_update && ((!busy))))
-----------1----------- ------------2------------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T11,T12,T13 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T11,T12,T13 |
1 | 1 | Covered | T11,T12,T13 |
LINE 125
SUB-EXPRESSION (src_update && ((!busy)))
-----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Unreachable | |
1 | 1 | Unreachable | |
Branch Coverage for Instance : tb.dut.u_reg.u_adc_chn1_filter_ctl_4_cdc
| Line No. | Total | Covered | Percent |
Branches |
|
8 |
8 |
100.00 |
IF |
71 |
4 |
4 |
100.00 |
IF |
115 |
4 |
4 |
100.00 |
71 if (!rst_src_ni) begin
-1-
72 src_busy_q <= '0;
==>
73 end else if (src_req) begin
-2-
74 src_busy_q <= 1'b1;
==>
75 end else if (src_ack) begin
-3-
76 src_busy_q <= 1'b0;
==>
77 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T11,T12,T13 |
0 |
0 |
1 |
Covered |
T11,T12,T13 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
115 if (!rst_src_ni) begin
-1-
116 src_q <= ResetVal;
==>
117 txn_bits_q <= '0;
118 end else if (src_req) begin
-2-
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 src_q <= src_wd_i & BitMask;
==>
124 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
125 end else if (src_busy_q && src_ack || src_update && !busy) begin
-3-
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 src_q <= dst_qs;
==>
135 txn_bits_q <= '0;
136 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T11,T12,T13 |
0 |
0 |
1 |
Covered |
T11,T12,T13 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.u_reg.u_adc_chn1_filter_ctl_4_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
1575796 |
0 |
0 |
T11 |
112949 |
489 |
0 |
0 |
T12 |
255584 |
1879 |
0 |
0 |
T13 |
171132 |
218 |
0 |
0 |
T14 |
395989 |
256 |
0 |
0 |
T15 |
0 |
330 |
0 |
0 |
T16 |
0 |
349 |
0 |
0 |
T17 |
0 |
349 |
0 |
0 |
T18 |
0 |
590 |
0 |
0 |
T19 |
0 |
1203 |
0 |
0 |
T20 |
0 |
261 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
T25 |
50651 |
0 |
0 |
0 |
T26 |
109966 |
0 |
0 |
0 |
T27 |
183417 |
0 |
0 |
0 |
T28 |
180001 |
0 |
0 |
0 |
T29 |
96579 |
0 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
34247075 |
33952252 |
0 |
0 |
T1 |
1197 |
1119 |
0 |
0 |
T2 |
106 |
6 |
0 |
0 |
T3 |
733 |
683 |
0 |
0 |
T4 |
1245 |
1147 |
0 |
0 |
T5 |
642 |
148 |
0 |
0 |
T6 |
674 |
579 |
0 |
0 |
T7 |
1152 |
1077 |
0 |
0 |
T21 |
899 |
18 |
0 |
0 |
T22 |
74 |
9 |
0 |
0 |
T23 |
946 |
27 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
1905 |
0 |
0 |
T11 |
112949 |
2 |
0 |
0 |
T12 |
255584 |
1 |
0 |
0 |
T13 |
171132 |
2 |
0 |
0 |
T14 |
395989 |
1 |
0 |
0 |
T15 |
0 |
1 |
0 |
0 |
T16 |
0 |
1 |
0 |
0 |
T17 |
0 |
1 |
0 |
0 |
T18 |
0 |
2 |
0 |
0 |
T19 |
0 |
4 |
0 |
0 |
T20 |
0 |
1 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
T25 |
50651 |
0 |
0 |
0 |
T26 |
109966 |
0 |
0 |
0 |
T27 |
183417 |
0 |
0 |
0 |
T28 |
180001 |
0 |
0 |
0 |
T29 |
96579 |
0 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
2147483647 |
0 |
0 |
T1 |
299630 |
299544 |
0 |
0 |
T2 |
25763 |
25713 |
0 |
0 |
T3 |
179799 |
179705 |
0 |
0 |
T4 |
105974 |
105879 |
0 |
0 |
T5 |
308670 |
305678 |
0 |
0 |
T6 |
327577 |
327525 |
0 |
0 |
T7 |
144286 |
144204 |
0 |
0 |
T21 |
108025 |
107168 |
0 |
0 |
T22 |
9439 |
9367 |
0 |
0 |
T23 |
71080 |
70224 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_reg.u_adc_chn1_filter_ctl_5_cdc
| Line No. | Total | Covered | Percent |
TOTAL | | 22 | 22 | 100.00 |
CONT_ASSIGN | 65 | 1 | 1 | 100.00 |
ALWAYS | 71 | 6 | 6 | 100.00 |
CONT_ASSIGN | 85 | 1 | 1 | 100.00 |
CONT_ASSIGN | 109 | 1 | 1 | 100.00 |
ALWAYS | 115 | 9 | 9 | 100.00 |
CONT_ASSIGN | 150 | 1 | 1 | 100.00 |
CONT_ASSIGN | 155 | 1 | 1 | 100.00 |
CONT_ASSIGN | 156 | 1 | 1 | 100.00 |
CONT_ASSIGN | 200 | 1 | 1 | 100.00 |
64
65 1/1 assign src_req = src_we_i | src_re_i;
Tests: T11 T12 T13
66
67 // busy indication back-pressures upstream if the register is accessed
68 // again. The busy indication is also used as a "commit" indication for
69 // resolving software and hardware write conflicts
70 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
71 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
72 1/1 src_busy_q <= '0;
Tests: T1 T2 T3
73 1/1 end else if (src_req) begin
Tests: T1 T2 T3
74 1/1 src_busy_q <= 1'b1;
Tests: T11 T12 T13
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T11 T12 T13
77 end
MISSING_ELSE
78 end
79
80 // A src_ack should only be sent if there was a src_req.
81 // src_busy_q asserts whenever there is a src_req. By association,
82 // whenever src_ack is seen, then src_busy must be high.
83 `ASSERT(SrcAckBusyChk_A, src_ack |-> src_busy_q, clk_src_i, !rst_src_ni)
84
85 1/1 assign src_busy_o = src_busy_q;
Tests: T1 T2 T3
86
87 // src_q acts as both the write holding register and the software read back
88 // register.
89 // When software performs a write, the write data is captured in src_q for
90 // CDC purposes. When not performing a write, the src_q reflects the most recent
91 // hardware value. For registers with no hardware access, this is simply the
92 // the value programmed by software (or in the case R1C, W1C etc) the value after
93 // the operation. For registers with hardware access, this reflects a potentially
94 // delayed version of the real value, as the software facing updates lag real
95 // time updates.
96 //
97 // To resolve software and hardware conflicts, the process is as follows:
98 // When software issues a write, this module asserts "busy". While busy,
99 // src_q does not take on destination value updates. Since the
100 // logic has committed to updating based on software command, there is an irreversible
101 // window from which hardware writes are ignored. Once the busy window completes,
102 // the cdc portion then begins sampling once more.
103 //
104 // This is consistent with prim_subreg_arb where during software / hardware conflicts,
105 // software is always prioritized. The main difference is the conflict resolution window
106 // is now larger instead of just one destination clock cycle.
107
108 logic busy;
109 1/1 assign busy = src_busy_q & !src_ack;
Tests: T1 T2 T3
110
111 // This is the current destination value
112 logic [DataWidth-1:0] dst_qs;
113 logic src_update;
114 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
115 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
116 1/1 src_q <= ResetVal;
Tests: T1 T2 T3
117 1/1 txn_bits_q <= '0;
Tests: T1 T2 T3
118 1/1 end else if (src_req) begin
Tests: T1 T2 T3
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 1/1 src_q <= src_wd_i & BitMask;
Tests: T11 T12 T13
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T11 T12 T13
125 1/1 end else if (src_busy_q && src_ack || src_update && !busy) begin
Tests: T1 T2 T3
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 1/1 src_q <= dst_qs;
Tests: T11 T12 T13
135 1/1 txn_bits_q <= '0;
Tests: T11 T12 T13
136 end
MISSING_ELSE
137 end
138
139 // The current design (tlul_adapter_reg) does not spit out a request if the destination it chooses
140 // (decoded from address) is busy. So this creates a situation in the current design where
141 // src_req_i and busy can never be high at the same time.
142 // While the code above could be coded directly to be expressed as `src_req & !busy`, which makes
143 // the intent clearer, it ends up causing coverage holes from the tool's perspective since that
144 // condition cannot be met.
145 // Thus we add an assertion here to ensure the condition is always satisfied.
146 `ASSERT(BusySrcReqChk_A, busy |-> !src_req, clk_src_i, !rst_src_ni)
147
148 // reserved bits are not used
149 logic unused_wd;
150 1/1 assign unused_wd = ^src_wd_i;
Tests: T1 T2 T3
151
152 // src_q is always updated in the clk_src domain.
153 // when performing an update to the destination domain, it is guaranteed
154 // to not change by protocol.
155 1/1 assign src_qs_o = src_q;
Tests: T1 T2 T3
156 1/1 assign dst_wd_o = src_q;
Tests: T1 T2 T3
157
158 ////////////////////////////
159 // CDC handling
160 ////////////////////////////
161
162 logic dst_req_from_src;
163 logic dst_req;
164
165
166 // the software transaction is pulse synced across the domain.
167 // the prim_reg_cdc_arb module handles conflicts with ongoing hardware updates.
168 prim_pulse_sync u_src_to_dst_req (
169 .clk_src_i,
170 .rst_src_ni,
171 .clk_dst_i,
172 .rst_dst_ni,
173 .src_pulse_i(src_req),
174 .dst_pulse_o(dst_req_from_src)
175 );
176
177 prim_reg_cdc_arb #(
178 .DataWidth(DataWidth),
179 .ResetVal(ResetVal),
180 .DstWrReq(DstWrReq)
181 ) u_arb (
182 .clk_src_i,
183 .rst_src_ni,
184 .clk_dst_i,
185 .rst_dst_ni,
186 .src_ack_o(src_ack),
187 .src_update_o(src_update),
188 .dst_req_i(dst_req_from_src),
189 .dst_req_o(dst_req),
190 .dst_update_i,
191 .dst_ds_i,
192 .dst_qs_i,
193 .dst_qs_o(dst_qs)
194 );
195
196
197 // Each is valid only when destination request pulse is high; this is important in not propagating
198 // the internal assertion of 'dst_req' by the 'prim_pulse_sync' channel when just one domain is
199 // reset.
200 1/1 assign {dst_we_o, dst_re_o, dst_regwen_o} = txn_bits_q & {TxnWidth{dst_req}};
Tests: T1 T2 T3
Cond Coverage for Instance : tb.dut.u_reg.u_adc_chn1_filter_ctl_5_cdc
| Total | Covered | Percent |
Conditions | 11 | 10 | 90.91 |
Logical | 11 | 10 | 90.91 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 65
EXPRESSION (src_we_i | src_re_i)
----1--- ----2---
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T11,T12,T13 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T11,T12,T13 |
1 | 1 | Covered | T11,T12,T13 |
LINE 125
EXPRESSION ((src_busy_q && src_ack) || (src_update && ((!busy))))
-----------1----------- ------------2------------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T11,T12,T13 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T11,T12,T13 |
1 | 1 | Covered | T11,T12,T13 |
LINE 125
SUB-EXPRESSION (src_update && ((!busy)))
-----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Unreachable | |
1 | 1 | Unreachable | |
Branch Coverage for Instance : tb.dut.u_reg.u_adc_chn1_filter_ctl_5_cdc
| Line No. | Total | Covered | Percent |
Branches |
|
8 |
8 |
100.00 |
IF |
71 |
4 |
4 |
100.00 |
IF |
115 |
4 |
4 |
100.00 |
71 if (!rst_src_ni) begin
-1-
72 src_busy_q <= '0;
==>
73 end else if (src_req) begin
-2-
74 src_busy_q <= 1'b1;
==>
75 end else if (src_ack) begin
-3-
76 src_busy_q <= 1'b0;
==>
77 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T11,T12,T13 |
0 |
0 |
1 |
Covered |
T11,T12,T13 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
115 if (!rst_src_ni) begin
-1-
116 src_q <= ResetVal;
==>
117 txn_bits_q <= '0;
118 end else if (src_req) begin
-2-
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 src_q <= src_wd_i & BitMask;
==>
124 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
125 end else if (src_busy_q && src_ack || src_update && !busy) begin
-3-
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 src_q <= dst_qs;
==>
135 txn_bits_q <= '0;
136 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T11,T12,T13 |
0 |
0 |
1 |
Covered |
T11,T12,T13 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.u_reg.u_adc_chn1_filter_ctl_5_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
1559533 |
0 |
0 |
T11 |
112949 |
471 |
0 |
0 |
T12 |
255584 |
1866 |
0 |
0 |
T13 |
171132 |
214 |
0 |
0 |
T14 |
395989 |
251 |
0 |
0 |
T15 |
0 |
328 |
0 |
0 |
T16 |
0 |
347 |
0 |
0 |
T17 |
0 |
347 |
0 |
0 |
T18 |
0 |
586 |
0 |
0 |
T19 |
0 |
1303 |
0 |
0 |
T20 |
0 |
250 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
T25 |
50651 |
0 |
0 |
0 |
T26 |
109966 |
0 |
0 |
0 |
T27 |
183417 |
0 |
0 |
0 |
T28 |
180001 |
0 |
0 |
0 |
T29 |
96579 |
0 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
34247075 |
33952252 |
0 |
0 |
T1 |
1197 |
1119 |
0 |
0 |
T2 |
106 |
6 |
0 |
0 |
T3 |
733 |
683 |
0 |
0 |
T4 |
1245 |
1147 |
0 |
0 |
T5 |
642 |
148 |
0 |
0 |
T6 |
674 |
579 |
0 |
0 |
T7 |
1152 |
1077 |
0 |
0 |
T21 |
899 |
18 |
0 |
0 |
T22 |
74 |
9 |
0 |
0 |
T23 |
946 |
27 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
1866 |
0 |
0 |
T11 |
112949 |
2 |
0 |
0 |
T12 |
255584 |
1 |
0 |
0 |
T13 |
171132 |
2 |
0 |
0 |
T14 |
395989 |
1 |
0 |
0 |
T15 |
0 |
1 |
0 |
0 |
T16 |
0 |
1 |
0 |
0 |
T17 |
0 |
1 |
0 |
0 |
T18 |
0 |
2 |
0 |
0 |
T19 |
0 |
4 |
0 |
0 |
T20 |
0 |
1 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
T25 |
50651 |
0 |
0 |
0 |
T26 |
109966 |
0 |
0 |
0 |
T27 |
183417 |
0 |
0 |
0 |
T28 |
180001 |
0 |
0 |
0 |
T29 |
96579 |
0 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
2147483647 |
0 |
0 |
T1 |
299630 |
299544 |
0 |
0 |
T2 |
25763 |
25713 |
0 |
0 |
T3 |
179799 |
179705 |
0 |
0 |
T4 |
105974 |
105879 |
0 |
0 |
T5 |
308670 |
305678 |
0 |
0 |
T6 |
327577 |
327525 |
0 |
0 |
T7 |
144286 |
144204 |
0 |
0 |
T21 |
108025 |
107168 |
0 |
0 |
T22 |
9439 |
9367 |
0 |
0 |
T23 |
71080 |
70224 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_reg.u_adc_chn1_filter_ctl_6_cdc
| Line No. | Total | Covered | Percent |
TOTAL | | 22 | 22 | 100.00 |
CONT_ASSIGN | 65 | 1 | 1 | 100.00 |
ALWAYS | 71 | 6 | 6 | 100.00 |
CONT_ASSIGN | 85 | 1 | 1 | 100.00 |
CONT_ASSIGN | 109 | 1 | 1 | 100.00 |
ALWAYS | 115 | 9 | 9 | 100.00 |
CONT_ASSIGN | 150 | 1 | 1 | 100.00 |
CONT_ASSIGN | 155 | 1 | 1 | 100.00 |
CONT_ASSIGN | 156 | 1 | 1 | 100.00 |
CONT_ASSIGN | 200 | 1 | 1 | 100.00 |
64
65 1/1 assign src_req = src_we_i | src_re_i;
Tests: T11 T12 T13
66
67 // busy indication back-pressures upstream if the register is accessed
68 // again. The busy indication is also used as a "commit" indication for
69 // resolving software and hardware write conflicts
70 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
71 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
72 1/1 src_busy_q <= '0;
Tests: T1 T2 T3
73 1/1 end else if (src_req) begin
Tests: T1 T2 T3
74 1/1 src_busy_q <= 1'b1;
Tests: T11 T12 T13
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T11 T12 T13
77 end
MISSING_ELSE
78 end
79
80 // A src_ack should only be sent if there was a src_req.
81 // src_busy_q asserts whenever there is a src_req. By association,
82 // whenever src_ack is seen, then src_busy must be high.
83 `ASSERT(SrcAckBusyChk_A, src_ack |-> src_busy_q, clk_src_i, !rst_src_ni)
84
85 1/1 assign src_busy_o = src_busy_q;
Tests: T1 T2 T3
86
87 // src_q acts as both the write holding register and the software read back
88 // register.
89 // When software performs a write, the write data is captured in src_q for
90 // CDC purposes. When not performing a write, the src_q reflects the most recent
91 // hardware value. For registers with no hardware access, this is simply the
92 // the value programmed by software (or in the case R1C, W1C etc) the value after
93 // the operation. For registers with hardware access, this reflects a potentially
94 // delayed version of the real value, as the software facing updates lag real
95 // time updates.
96 //
97 // To resolve software and hardware conflicts, the process is as follows:
98 // When software issues a write, this module asserts "busy". While busy,
99 // src_q does not take on destination value updates. Since the
100 // logic has committed to updating based on software command, there is an irreversible
101 // window from which hardware writes are ignored. Once the busy window completes,
102 // the cdc portion then begins sampling once more.
103 //
104 // This is consistent with prim_subreg_arb where during software / hardware conflicts,
105 // software is always prioritized. The main difference is the conflict resolution window
106 // is now larger instead of just one destination clock cycle.
107
108 logic busy;
109 1/1 assign busy = src_busy_q & !src_ack;
Tests: T1 T2 T3
110
111 // This is the current destination value
112 logic [DataWidth-1:0] dst_qs;
113 logic src_update;
114 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
115 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
116 1/1 src_q <= ResetVal;
Tests: T1 T2 T3
117 1/1 txn_bits_q <= '0;
Tests: T1 T2 T3
118 1/1 end else if (src_req) begin
Tests: T1 T2 T3
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 1/1 src_q <= src_wd_i & BitMask;
Tests: T11 T12 T13
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T11 T12 T13
125 1/1 end else if (src_busy_q && src_ack || src_update && !busy) begin
Tests: T1 T2 T3
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 1/1 src_q <= dst_qs;
Tests: T11 T12 T13
135 1/1 txn_bits_q <= '0;
Tests: T11 T12 T13
136 end
MISSING_ELSE
137 end
138
139 // The current design (tlul_adapter_reg) does not spit out a request if the destination it chooses
140 // (decoded from address) is busy. So this creates a situation in the current design where
141 // src_req_i and busy can never be high at the same time.
142 // While the code above could be coded directly to be expressed as `src_req & !busy`, which makes
143 // the intent clearer, it ends up causing coverage holes from the tool's perspective since that
144 // condition cannot be met.
145 // Thus we add an assertion here to ensure the condition is always satisfied.
146 `ASSERT(BusySrcReqChk_A, busy |-> !src_req, clk_src_i, !rst_src_ni)
147
148 // reserved bits are not used
149 logic unused_wd;
150 1/1 assign unused_wd = ^src_wd_i;
Tests: T1 T2 T3
151
152 // src_q is always updated in the clk_src domain.
153 // when performing an update to the destination domain, it is guaranteed
154 // to not change by protocol.
155 1/1 assign src_qs_o = src_q;
Tests: T1 T2 T3
156 1/1 assign dst_wd_o = src_q;
Tests: T1 T2 T3
157
158 ////////////////////////////
159 // CDC handling
160 ////////////////////////////
161
162 logic dst_req_from_src;
163 logic dst_req;
164
165
166 // the software transaction is pulse synced across the domain.
167 // the prim_reg_cdc_arb module handles conflicts with ongoing hardware updates.
168 prim_pulse_sync u_src_to_dst_req (
169 .clk_src_i,
170 .rst_src_ni,
171 .clk_dst_i,
172 .rst_dst_ni,
173 .src_pulse_i(src_req),
174 .dst_pulse_o(dst_req_from_src)
175 );
176
177 prim_reg_cdc_arb #(
178 .DataWidth(DataWidth),
179 .ResetVal(ResetVal),
180 .DstWrReq(DstWrReq)
181 ) u_arb (
182 .clk_src_i,
183 .rst_src_ni,
184 .clk_dst_i,
185 .rst_dst_ni,
186 .src_ack_o(src_ack),
187 .src_update_o(src_update),
188 .dst_req_i(dst_req_from_src),
189 .dst_req_o(dst_req),
190 .dst_update_i,
191 .dst_ds_i,
192 .dst_qs_i,
193 .dst_qs_o(dst_qs)
194 );
195
196
197 // Each is valid only when destination request pulse is high; this is important in not propagating
198 // the internal assertion of 'dst_req' by the 'prim_pulse_sync' channel when just one domain is
199 // reset.
200 1/1 assign {dst_we_o, dst_re_o, dst_regwen_o} = txn_bits_q & {TxnWidth{dst_req}};
Tests: T1 T2 T3
Cond Coverage for Instance : tb.dut.u_reg.u_adc_chn1_filter_ctl_6_cdc
| Total | Covered | Percent |
Conditions | 11 | 10 | 90.91 |
Logical | 11 | 10 | 90.91 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 65
EXPRESSION (src_we_i | src_re_i)
----1--- ----2---
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T11,T12,T13 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T11,T12,T13 |
1 | 1 | Covered | T11,T12,T13 |
LINE 125
EXPRESSION ((src_busy_q && src_ack) || (src_update && ((!busy))))
-----------1----------- ------------2------------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T11,T12,T13 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T11,T12,T13 |
1 | 1 | Covered | T11,T12,T13 |
LINE 125
SUB-EXPRESSION (src_update && ((!busy)))
-----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Unreachable | |
1 | 1 | Unreachable | |
Branch Coverage for Instance : tb.dut.u_reg.u_adc_chn1_filter_ctl_6_cdc
| Line No. | Total | Covered | Percent |
Branches |
|
8 |
8 |
100.00 |
IF |
71 |
4 |
4 |
100.00 |
IF |
115 |
4 |
4 |
100.00 |
71 if (!rst_src_ni) begin
-1-
72 src_busy_q <= '0;
==>
73 end else if (src_req) begin
-2-
74 src_busy_q <= 1'b1;
==>
75 end else if (src_ack) begin
-3-
76 src_busy_q <= 1'b0;
==>
77 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T11,T12,T13 |
0 |
0 |
1 |
Covered |
T11,T12,T13 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
115 if (!rst_src_ni) begin
-1-
116 src_q <= ResetVal;
==>
117 txn_bits_q <= '0;
118 end else if (src_req) begin
-2-
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 src_q <= src_wd_i & BitMask;
==>
124 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
125 end else if (src_busy_q && src_ack || src_update && !busy) begin
-3-
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 src_q <= dst_qs;
==>
135 txn_bits_q <= '0;
136 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T11,T12,T13 |
0 |
0 |
1 |
Covered |
T11,T12,T13 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.u_reg.u_adc_chn1_filter_ctl_6_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
1569993 |
0 |
0 |
T11 |
112949 |
454 |
0 |
0 |
T12 |
255584 |
1859 |
0 |
0 |
T13 |
171132 |
210 |
0 |
0 |
T14 |
395989 |
353 |
0 |
0 |
T15 |
0 |
316 |
0 |
0 |
T16 |
0 |
345 |
0 |
0 |
T17 |
0 |
345 |
0 |
0 |
T18 |
0 |
582 |
0 |
0 |
T19 |
0 |
1276 |
0 |
0 |
T20 |
0 |
246 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
T25 |
50651 |
0 |
0 |
0 |
T26 |
109966 |
0 |
0 |
0 |
T27 |
183417 |
0 |
0 |
0 |
T28 |
180001 |
0 |
0 |
0 |
T29 |
96579 |
0 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
34247075 |
33952252 |
0 |
0 |
T1 |
1197 |
1119 |
0 |
0 |
T2 |
106 |
6 |
0 |
0 |
T3 |
733 |
683 |
0 |
0 |
T4 |
1245 |
1147 |
0 |
0 |
T5 |
642 |
148 |
0 |
0 |
T6 |
674 |
579 |
0 |
0 |
T7 |
1152 |
1077 |
0 |
0 |
T21 |
899 |
18 |
0 |
0 |
T22 |
74 |
9 |
0 |
0 |
T23 |
946 |
27 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
1880 |
0 |
0 |
T11 |
112949 |
2 |
0 |
0 |
T12 |
255584 |
1 |
0 |
0 |
T13 |
171132 |
2 |
0 |
0 |
T14 |
395989 |
1 |
0 |
0 |
T15 |
0 |
1 |
0 |
0 |
T16 |
0 |
1 |
0 |
0 |
T17 |
0 |
1 |
0 |
0 |
T18 |
0 |
2 |
0 |
0 |
T19 |
0 |
4 |
0 |
0 |
T20 |
0 |
1 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
T25 |
50651 |
0 |
0 |
0 |
T26 |
109966 |
0 |
0 |
0 |
T27 |
183417 |
0 |
0 |
0 |
T28 |
180001 |
0 |
0 |
0 |
T29 |
96579 |
0 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
2147483647 |
0 |
0 |
T1 |
299630 |
299544 |
0 |
0 |
T2 |
25763 |
25713 |
0 |
0 |
T3 |
179799 |
179705 |
0 |
0 |
T4 |
105974 |
105879 |
0 |
0 |
T5 |
308670 |
305678 |
0 |
0 |
T6 |
327577 |
327525 |
0 |
0 |
T7 |
144286 |
144204 |
0 |
0 |
T21 |
108025 |
107168 |
0 |
0 |
T22 |
9439 |
9367 |
0 |
0 |
T23 |
71080 |
70224 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_reg.u_adc_chn1_filter_ctl_7_cdc
| Line No. | Total | Covered | Percent |
TOTAL | | 22 | 22 | 100.00 |
CONT_ASSIGN | 65 | 1 | 1 | 100.00 |
ALWAYS | 71 | 6 | 6 | 100.00 |
CONT_ASSIGN | 85 | 1 | 1 | 100.00 |
CONT_ASSIGN | 109 | 1 | 1 | 100.00 |
ALWAYS | 115 | 9 | 9 | 100.00 |
CONT_ASSIGN | 150 | 1 | 1 | 100.00 |
CONT_ASSIGN | 155 | 1 | 1 | 100.00 |
CONT_ASSIGN | 156 | 1 | 1 | 100.00 |
CONT_ASSIGN | 200 | 1 | 1 | 100.00 |
64
65 1/1 assign src_req = src_we_i | src_re_i;
Tests: T11 T12 T13
66
67 // busy indication back-pressures upstream if the register is accessed
68 // again. The busy indication is also used as a "commit" indication for
69 // resolving software and hardware write conflicts
70 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
71 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
72 1/1 src_busy_q <= '0;
Tests: T1 T2 T3
73 1/1 end else if (src_req) begin
Tests: T1 T2 T3
74 1/1 src_busy_q <= 1'b1;
Tests: T11 T12 T13
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T11 T12 T13
77 end
MISSING_ELSE
78 end
79
80 // A src_ack should only be sent if there was a src_req.
81 // src_busy_q asserts whenever there is a src_req. By association,
82 // whenever src_ack is seen, then src_busy must be high.
83 `ASSERT(SrcAckBusyChk_A, src_ack |-> src_busy_q, clk_src_i, !rst_src_ni)
84
85 1/1 assign src_busy_o = src_busy_q;
Tests: T1 T2 T3
86
87 // src_q acts as both the write holding register and the software read back
88 // register.
89 // When software performs a write, the write data is captured in src_q for
90 // CDC purposes. When not performing a write, the src_q reflects the most recent
91 // hardware value. For registers with no hardware access, this is simply the
92 // the value programmed by software (or in the case R1C, W1C etc) the value after
93 // the operation. For registers with hardware access, this reflects a potentially
94 // delayed version of the real value, as the software facing updates lag real
95 // time updates.
96 //
97 // To resolve software and hardware conflicts, the process is as follows:
98 // When software issues a write, this module asserts "busy". While busy,
99 // src_q does not take on destination value updates. Since the
100 // logic has committed to updating based on software command, there is an irreversible
101 // window from which hardware writes are ignored. Once the busy window completes,
102 // the cdc portion then begins sampling once more.
103 //
104 // This is consistent with prim_subreg_arb where during software / hardware conflicts,
105 // software is always prioritized. The main difference is the conflict resolution window
106 // is now larger instead of just one destination clock cycle.
107
108 logic busy;
109 1/1 assign busy = src_busy_q & !src_ack;
Tests: T1 T2 T3
110
111 // This is the current destination value
112 logic [DataWidth-1:0] dst_qs;
113 logic src_update;
114 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
115 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
116 1/1 src_q <= ResetVal;
Tests: T1 T2 T3
117 1/1 txn_bits_q <= '0;
Tests: T1 T2 T3
118 1/1 end else if (src_req) begin
Tests: T1 T2 T3
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 1/1 src_q <= src_wd_i & BitMask;
Tests: T11 T12 T13
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T11 T12 T13
125 1/1 end else if (src_busy_q && src_ack || src_update && !busy) begin
Tests: T1 T2 T3
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 1/1 src_q <= dst_qs;
Tests: T11 T12 T13
135 1/1 txn_bits_q <= '0;
Tests: T11 T12 T13
136 end
MISSING_ELSE
137 end
138
139 // The current design (tlul_adapter_reg) does not spit out a request if the destination it chooses
140 // (decoded from address) is busy. So this creates a situation in the current design where
141 // src_req_i and busy can never be high at the same time.
142 // While the code above could be coded directly to be expressed as `src_req & !busy`, which makes
143 // the intent clearer, it ends up causing coverage holes from the tool's perspective since that
144 // condition cannot be met.
145 // Thus we add an assertion here to ensure the condition is always satisfied.
146 `ASSERT(BusySrcReqChk_A, busy |-> !src_req, clk_src_i, !rst_src_ni)
147
148 // reserved bits are not used
149 logic unused_wd;
150 1/1 assign unused_wd = ^src_wd_i;
Tests: T1 T2 T3
151
152 // src_q is always updated in the clk_src domain.
153 // when performing an update to the destination domain, it is guaranteed
154 // to not change by protocol.
155 1/1 assign src_qs_o = src_q;
Tests: T1 T2 T3
156 1/1 assign dst_wd_o = src_q;
Tests: T1 T2 T3
157
158 ////////////////////////////
159 // CDC handling
160 ////////////////////////////
161
162 logic dst_req_from_src;
163 logic dst_req;
164
165
166 // the software transaction is pulse synced across the domain.
167 // the prim_reg_cdc_arb module handles conflicts with ongoing hardware updates.
168 prim_pulse_sync u_src_to_dst_req (
169 .clk_src_i,
170 .rst_src_ni,
171 .clk_dst_i,
172 .rst_dst_ni,
173 .src_pulse_i(src_req),
174 .dst_pulse_o(dst_req_from_src)
175 );
176
177 prim_reg_cdc_arb #(
178 .DataWidth(DataWidth),
179 .ResetVal(ResetVal),
180 .DstWrReq(DstWrReq)
181 ) u_arb (
182 .clk_src_i,
183 .rst_src_ni,
184 .clk_dst_i,
185 .rst_dst_ni,
186 .src_ack_o(src_ack),
187 .src_update_o(src_update),
188 .dst_req_i(dst_req_from_src),
189 .dst_req_o(dst_req),
190 .dst_update_i,
191 .dst_ds_i,
192 .dst_qs_i,
193 .dst_qs_o(dst_qs)
194 );
195
196
197 // Each is valid only when destination request pulse is high; this is important in not propagating
198 // the internal assertion of 'dst_req' by the 'prim_pulse_sync' channel when just one domain is
199 // reset.
200 1/1 assign {dst_we_o, dst_re_o, dst_regwen_o} = txn_bits_q & {TxnWidth{dst_req}};
Tests: T1 T2 T3
Cond Coverage for Instance : tb.dut.u_reg.u_adc_chn1_filter_ctl_7_cdc
| Total | Covered | Percent |
Conditions | 11 | 10 | 90.91 |
Logical | 11 | 10 | 90.91 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 65
EXPRESSION (src_we_i | src_re_i)
----1--- ----2---
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T11,T12,T13 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T11,T12,T13 |
1 | 1 | Covered | T11,T12,T13 |
LINE 125
EXPRESSION ((src_busy_q && src_ack) || (src_update && ((!busy))))
-----------1----------- ------------2------------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T11,T12,T13 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T11,T12,T13 |
1 | 1 | Covered | T11,T12,T13 |
LINE 125
SUB-EXPRESSION (src_update && ((!busy)))
-----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Unreachable | |
1 | 1 | Unreachable | |
Branch Coverage for Instance : tb.dut.u_reg.u_adc_chn1_filter_ctl_7_cdc
| Line No. | Total | Covered | Percent |
Branches |
|
8 |
8 |
100.00 |
IF |
71 |
4 |
4 |
100.00 |
IF |
115 |
4 |
4 |
100.00 |
71 if (!rst_src_ni) begin
-1-
72 src_busy_q <= '0;
==>
73 end else if (src_req) begin
-2-
74 src_busy_q <= 1'b1;
==>
75 end else if (src_ack) begin
-3-
76 src_busy_q <= 1'b0;
==>
77 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T11,T12,T13 |
0 |
0 |
1 |
Covered |
T11,T12,T13 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
115 if (!rst_src_ni) begin
-1-
116 src_q <= ResetVal;
==>
117 txn_bits_q <= '0;
118 end else if (src_req) begin
-2-
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 src_q <= src_wd_i & BitMask;
==>
124 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
125 end else if (src_busy_q && src_ack || src_update && !busy) begin
-3-
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 src_q <= dst_qs;
==>
135 txn_bits_q <= '0;
136 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T11,T12,T13 |
0 |
0 |
1 |
Covered |
T11,T12,T13 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.u_reg.u_adc_chn1_filter_ctl_7_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
1586595 |
0 |
0 |
T11 |
112949 |
448 |
0 |
0 |
T12 |
255584 |
1852 |
0 |
0 |
T13 |
171132 |
206 |
0 |
0 |
T14 |
395989 |
339 |
0 |
0 |
T15 |
0 |
311 |
0 |
0 |
T16 |
0 |
343 |
0 |
0 |
T17 |
0 |
343 |
0 |
0 |
T18 |
0 |
578 |
0 |
0 |
T19 |
0 |
1376 |
0 |
0 |
T20 |
0 |
240 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
T25 |
50651 |
0 |
0 |
0 |
T26 |
109966 |
0 |
0 |
0 |
T27 |
183417 |
0 |
0 |
0 |
T28 |
180001 |
0 |
0 |
0 |
T29 |
96579 |
0 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
34247075 |
33952252 |
0 |
0 |
T1 |
1197 |
1119 |
0 |
0 |
T2 |
106 |
6 |
0 |
0 |
T3 |
733 |
683 |
0 |
0 |
T4 |
1245 |
1147 |
0 |
0 |
T5 |
642 |
148 |
0 |
0 |
T6 |
674 |
579 |
0 |
0 |
T7 |
1152 |
1077 |
0 |
0 |
T21 |
899 |
18 |
0 |
0 |
T22 |
74 |
9 |
0 |
0 |
T23 |
946 |
27 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
1920 |
0 |
0 |
T11 |
112949 |
2 |
0 |
0 |
T12 |
255584 |
1 |
0 |
0 |
T13 |
171132 |
2 |
0 |
0 |
T14 |
395989 |
1 |
0 |
0 |
T15 |
0 |
1 |
0 |
0 |
T16 |
0 |
1 |
0 |
0 |
T17 |
0 |
1 |
0 |
0 |
T18 |
0 |
2 |
0 |
0 |
T19 |
0 |
4 |
0 |
0 |
T20 |
0 |
1 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
T25 |
50651 |
0 |
0 |
0 |
T26 |
109966 |
0 |
0 |
0 |
T27 |
183417 |
0 |
0 |
0 |
T28 |
180001 |
0 |
0 |
0 |
T29 |
96579 |
0 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
2147483647 |
0 |
0 |
T1 |
299630 |
299544 |
0 |
0 |
T2 |
25763 |
25713 |
0 |
0 |
T3 |
179799 |
179705 |
0 |
0 |
T4 |
105974 |
105879 |
0 |
0 |
T5 |
308670 |
305678 |
0 |
0 |
T6 |
327577 |
327525 |
0 |
0 |
T7 |
144286 |
144204 |
0 |
0 |
T21 |
108025 |
107168 |
0 |
0 |
T22 |
9439 |
9367 |
0 |
0 |
T23 |
71080 |
70224 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_reg.u_adc_wakeup_ctl_cdc
| Line No. | Total | Covered | Percent |
TOTAL | | 22 | 22 | 100.00 |
CONT_ASSIGN | 65 | 1 | 1 | 100.00 |
ALWAYS | 71 | 6 | 6 | 100.00 |
CONT_ASSIGN | 85 | 1 | 1 | 100.00 |
CONT_ASSIGN | 109 | 1 | 1 | 100.00 |
ALWAYS | 115 | 9 | 9 | 100.00 |
CONT_ASSIGN | 150 | 1 | 1 | 100.00 |
CONT_ASSIGN | 155 | 1 | 1 | 100.00 |
CONT_ASSIGN | 156 | 1 | 1 | 100.00 |
CONT_ASSIGN | 200 | 1 | 1 | 100.00 |
64
65 1/1 assign src_req = src_we_i | src_re_i;
Tests: T11 T12 T13
66
67 // busy indication back-pressures upstream if the register is accessed
68 // again. The busy indication is also used as a "commit" indication for
69 // resolving software and hardware write conflicts
70 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
71 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
72 1/1 src_busy_q <= '0;
Tests: T1 T2 T3
73 1/1 end else if (src_req) begin
Tests: T1 T2 T3
74 1/1 src_busy_q <= 1'b1;
Tests: T11 T12 T13
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T11 T12 T13
77 end
MISSING_ELSE
78 end
79
80 // A src_ack should only be sent if there was a src_req.
81 // src_busy_q asserts whenever there is a src_req. By association,
82 // whenever src_ack is seen, then src_busy must be high.
83 `ASSERT(SrcAckBusyChk_A, src_ack |-> src_busy_q, clk_src_i, !rst_src_ni)
84
85 1/1 assign src_busy_o = src_busy_q;
Tests: T1 T2 T3
86
87 // src_q acts as both the write holding register and the software read back
88 // register.
89 // When software performs a write, the write data is captured in src_q for
90 // CDC purposes. When not performing a write, the src_q reflects the most recent
91 // hardware value. For registers with no hardware access, this is simply the
92 // the value programmed by software (or in the case R1C, W1C etc) the value after
93 // the operation. For registers with hardware access, this reflects a potentially
94 // delayed version of the real value, as the software facing updates lag real
95 // time updates.
96 //
97 // To resolve software and hardware conflicts, the process is as follows:
98 // When software issues a write, this module asserts "busy". While busy,
99 // src_q does not take on destination value updates. Since the
100 // logic has committed to updating based on software command, there is an irreversible
101 // window from which hardware writes are ignored. Once the busy window completes,
102 // the cdc portion then begins sampling once more.
103 //
104 // This is consistent with prim_subreg_arb where during software / hardware conflicts,
105 // software is always prioritized. The main difference is the conflict resolution window
106 // is now larger instead of just one destination clock cycle.
107
108 logic busy;
109 1/1 assign busy = src_busy_q & !src_ack;
Tests: T1 T2 T3
110
111 // This is the current destination value
112 logic [DataWidth-1:0] dst_qs;
113 logic src_update;
114 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
115 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
116 1/1 src_q <= ResetVal;
Tests: T1 T2 T3
117 1/1 txn_bits_q <= '0;
Tests: T1 T2 T3
118 1/1 end else if (src_req) begin
Tests: T1 T2 T3
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 1/1 src_q <= src_wd_i & BitMask;
Tests: T11 T12 T13
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T11 T12 T13
125 1/1 end else if (src_busy_q && src_ack || src_update && !busy) begin
Tests: T1 T2 T3
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 1/1 src_q <= dst_qs;
Tests: T11 T12 T13
135 1/1 txn_bits_q <= '0;
Tests: T11 T12 T13
136 end
MISSING_ELSE
137 end
138
139 // The current design (tlul_adapter_reg) does not spit out a request if the destination it chooses
140 // (decoded from address) is busy. So this creates a situation in the current design where
141 // src_req_i and busy can never be high at the same time.
142 // While the code above could be coded directly to be expressed as `src_req & !busy`, which makes
143 // the intent clearer, it ends up causing coverage holes from the tool's perspective since that
144 // condition cannot be met.
145 // Thus we add an assertion here to ensure the condition is always satisfied.
146 `ASSERT(BusySrcReqChk_A, busy |-> !src_req, clk_src_i, !rst_src_ni)
147
148 // reserved bits are not used
149 logic unused_wd;
150 1/1 assign unused_wd = ^src_wd_i;
Tests: T1 T2 T3
151
152 // src_q is always updated in the clk_src domain.
153 // when performing an update to the destination domain, it is guaranteed
154 // to not change by protocol.
155 1/1 assign src_qs_o = src_q;
Tests: T1 T2 T3
156 1/1 assign dst_wd_o = src_q;
Tests: T1 T2 T3
157
158 ////////////////////////////
159 // CDC handling
160 ////////////////////////////
161
162 logic dst_req_from_src;
163 logic dst_req;
164
165
166 // the software transaction is pulse synced across the domain.
167 // the prim_reg_cdc_arb module handles conflicts with ongoing hardware updates.
168 prim_pulse_sync u_src_to_dst_req (
169 .clk_src_i,
170 .rst_src_ni,
171 .clk_dst_i,
172 .rst_dst_ni,
173 .src_pulse_i(src_req),
174 .dst_pulse_o(dst_req_from_src)
175 );
176
177 prim_reg_cdc_arb #(
178 .DataWidth(DataWidth),
179 .ResetVal(ResetVal),
180 .DstWrReq(DstWrReq)
181 ) u_arb (
182 .clk_src_i,
183 .rst_src_ni,
184 .clk_dst_i,
185 .rst_dst_ni,
186 .src_ack_o(src_ack),
187 .src_update_o(src_update),
188 .dst_req_i(dst_req_from_src),
189 .dst_req_o(dst_req),
190 .dst_update_i,
191 .dst_ds_i,
192 .dst_qs_i,
193 .dst_qs_o(dst_qs)
194 );
195
196
197 // Each is valid only when destination request pulse is high; this is important in not propagating
198 // the internal assertion of 'dst_req' by the 'prim_pulse_sync' channel when just one domain is
199 // reset.
200 1/1 assign {dst_we_o, dst_re_o, dst_regwen_o} = txn_bits_q & {TxnWidth{dst_req}};
Tests: T1 T2 T3
Cond Coverage for Instance : tb.dut.u_reg.u_adc_wakeup_ctl_cdc
| Total | Covered | Percent |
Conditions | 11 | 10 | 90.91 |
Logical | 11 | 10 | 90.91 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 65
EXPRESSION (src_we_i | src_re_i)
----1--- ----2---
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T11,T12,T13 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T11,T12,T13 |
1 | 1 | Covered | T11,T12,T13 |
LINE 125
EXPRESSION ((src_busy_q && src_ack) || (src_update && ((!busy))))
-----------1----------- ------------2------------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T11,T12,T13 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T11,T12,T13 |
1 | 1 | Covered | T11,T12,T13 |
LINE 125
SUB-EXPRESSION (src_update && ((!busy)))
-----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Unreachable | |
1 | 1 | Unreachable | |
Branch Coverage for Instance : tb.dut.u_reg.u_adc_wakeup_ctl_cdc
| Line No. | Total | Covered | Percent |
Branches |
|
8 |
8 |
100.00 |
IF |
71 |
4 |
4 |
100.00 |
IF |
115 |
4 |
4 |
100.00 |
71 if (!rst_src_ni) begin
-1-
72 src_busy_q <= '0;
==>
73 end else if (src_req) begin
-2-
74 src_busy_q <= 1'b1;
==>
75 end else if (src_ack) begin
-3-
76 src_busy_q <= 1'b0;
==>
77 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T11,T12,T13 |
0 |
0 |
1 |
Covered |
T11,T12,T13 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
115 if (!rst_src_ni) begin
-1-
116 src_q <= ResetVal;
==>
117 txn_bits_q <= '0;
118 end else if (src_req) begin
-2-
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 src_q <= src_wd_i & BitMask;
==>
124 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
125 end else if (src_busy_q && src_ack || src_update && !busy) begin
-3-
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 src_q <= dst_qs;
==>
135 txn_bits_q <= '0;
136 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T11,T12,T13 |
0 |
0 |
1 |
Covered |
T11,T12,T13 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.u_reg.u_adc_wakeup_ctl_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
1196084 |
0 |
0 |
T11 |
112949 |
182 |
0 |
0 |
T12 |
255584 |
1814 |
0 |
0 |
T13 |
171132 |
190 |
0 |
0 |
T14 |
395989 |
0 |
0 |
0 |
T15 |
0 |
287 |
0 |
0 |
T17 |
0 |
335 |
0 |
0 |
T19 |
0 |
339 |
0 |
0 |
T20 |
0 |
273 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
T25 |
50651 |
0 |
0 |
0 |
T26 |
109966 |
0 |
0 |
0 |
T27 |
183417 |
0 |
0 |
0 |
T28 |
180001 |
0 |
0 |
0 |
T29 |
96579 |
0 |
0 |
0 |
T40 |
0 |
261 |
0 |
0 |
T41 |
0 |
761 |
0 |
0 |
T46 |
0 |
358 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
34247075 |
33952252 |
0 |
0 |
T1 |
1197 |
1119 |
0 |
0 |
T2 |
106 |
6 |
0 |
0 |
T3 |
733 |
683 |
0 |
0 |
T4 |
1245 |
1147 |
0 |
0 |
T5 |
642 |
148 |
0 |
0 |
T6 |
674 |
579 |
0 |
0 |
T7 |
1152 |
1077 |
0 |
0 |
T21 |
899 |
18 |
0 |
0 |
T22 |
74 |
9 |
0 |
0 |
T23 |
946 |
27 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
1436 |
0 |
0 |
T11 |
112949 |
1 |
0 |
0 |
T12 |
255584 |
1 |
0 |
0 |
T13 |
171132 |
2 |
0 |
0 |
T14 |
395989 |
0 |
0 |
0 |
T15 |
0 |
1 |
0 |
0 |
T17 |
0 |
1 |
0 |
0 |
T19 |
0 |
1 |
0 |
0 |
T20 |
0 |
1 |
0 |
0 |
T24 |
12738 |
0 |
0 |
0 |
T25 |
50651 |
0 |
0 |
0 |
T26 |
109966 |
0 |
0 |
0 |
T27 |
183417 |
0 |
0 |
0 |
T28 |
180001 |
0 |
0 |
0 |
T29 |
96579 |
0 |
0 |
0 |
T40 |
0 |
1 |
0 |
0 |
T41 |
0 |
2 |
0 |
0 |
T46 |
0 |
1 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
2147483647 |
0 |
0 |
T1 |
299630 |
299544 |
0 |
0 |
T2 |
25763 |
25713 |
0 |
0 |
T3 |
179799 |
179705 |
0 |
0 |
T4 |
105974 |
105879 |
0 |
0 |
T5 |
308670 |
305678 |
0 |
0 |
T6 |
327577 |
327525 |
0 |
0 |
T7 |
144286 |
144204 |
0 |
0 |
T21 |
108025 |
107168 |
0 |
0 |
T22 |
9439 |
9367 |
0 |
0 |
T23 |
71080 |
70224 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_reg.u_adc_fsm_rst_cdc
| Line No. | Total | Covered | Percent |
TOTAL | | 22 | 22 | 100.00 |
CONT_ASSIGN | 65 | 1 | 1 | 100.00 |
ALWAYS | 71 | 6 | 6 | 100.00 |
CONT_ASSIGN | 85 | 1 | 1 | 100.00 |
CONT_ASSIGN | 109 | 1 | 1 | 100.00 |
ALWAYS | 115 | 9 | 9 | 100.00 |
CONT_ASSIGN | 150 | 1 | 1 | 100.00 |
CONT_ASSIGN | 155 | 1 | 1 | 100.00 |
CONT_ASSIGN | 156 | 1 | 1 | 100.00 |
CONT_ASSIGN | 200 | 1 | 1 | 100.00 |
64
65 1/1 assign src_req = src_we_i | src_re_i;
Tests: T12 T13 T14
66
67 // busy indication back-pressures upstream if the register is accessed
68 // again. The busy indication is also used as a "commit" indication for
69 // resolving software and hardware write conflicts
70 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
71 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
72 1/1 src_busy_q <= '0;
Tests: T1 T2 T3
73 1/1 end else if (src_req) begin
Tests: T1 T2 T3
74 1/1 src_busy_q <= 1'b1;
Tests: T12 T13 T14
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T12 T13 T14
77 end
MISSING_ELSE
78 end
79
80 // A src_ack should only be sent if there was a src_req.
81 // src_busy_q asserts whenever there is a src_req. By association,
82 // whenever src_ack is seen, then src_busy must be high.
83 `ASSERT(SrcAckBusyChk_A, src_ack |-> src_busy_q, clk_src_i, !rst_src_ni)
84
85 1/1 assign src_busy_o = src_busy_q;
Tests: T1 T2 T3
86
87 // src_q acts as both the write holding register and the software read back
88 // register.
89 // When software performs a write, the write data is captured in src_q for
90 // CDC purposes. When not performing a write, the src_q reflects the most recent
91 // hardware value. For registers with no hardware access, this is simply the
92 // the value programmed by software (or in the case R1C, W1C etc) the value after
93 // the operation. For registers with hardware access, this reflects a potentially
94 // delayed version of the real value, as the software facing updates lag real
95 // time updates.
96 //
97 // To resolve software and hardware conflicts, the process is as follows:
98 // When software issues a write, this module asserts "busy". While busy,
99 // src_q does not take on destination value updates. Since the
100 // logic has committed to updating based on software command, there is an irreversible
101 // window from which hardware writes are ignored. Once the busy window completes,
102 // the cdc portion then begins sampling once more.
103 //
104 // This is consistent with prim_subreg_arb where during software / hardware conflicts,
105 // software is always prioritized. The main difference is the conflict resolution window
106 // is now larger instead of just one destination clock cycle.
107
108 logic busy;
109 1/1 assign busy = src_busy_q & !src_ack;
Tests: T1 T2 T3
110
111 // This is the current destination value
112 logic [DataWidth-1:0] dst_qs;
113 logic src_update;
114 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin
115 1/1 if (!rst_src_ni) begin
Tests: T1 T2 T3
116 1/1 src_q <= ResetVal;
Tests: T1 T2 T3
117 1/1 txn_bits_q <= '0;
Tests: T1 T2 T3
118 1/1 end else if (src_req) begin
Tests: T1 T2 T3
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 1/1 src_q <= src_wd_i & BitMask;
Tests: T12 T13 T14
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T12 T13 T14
125 1/1 end else if (src_busy_q && src_ack || src_update && !busy) begin
Tests: T1 T2 T3
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 1/1 src_q <= dst_qs;
Tests: T12 T13 T14
135 1/1 txn_bits_q <= '0;
Tests: T12 T13 T14
136 end
MISSING_ELSE
137 end
138
139 // The current design (tlul_adapter_reg) does not spit out a request if the destination it chooses
140 // (decoded from address) is busy. So this creates a situation in the current design where
141 // src_req_i and busy can never be high at the same time.
142 // While the code above could be coded directly to be expressed as `src_req & !busy`, which makes
143 // the intent clearer, it ends up causing coverage holes from the tool's perspective since that
144 // condition cannot be met.
145 // Thus we add an assertion here to ensure the condition is always satisfied.
146 `ASSERT(BusySrcReqChk_A, busy |-> !src_req, clk_src_i, !rst_src_ni)
147
148 // reserved bits are not used
149 logic unused_wd;
150 1/1 assign unused_wd = ^src_wd_i;
Tests: T1 T2 T3
151
152 // src_q is always updated in the clk_src domain.
153 // when performing an update to the destination domain, it is guaranteed
154 // to not change by protocol.
155 1/1 assign src_qs_o = src_q;
Tests: T1 T2 T3
156 1/1 assign dst_wd_o = src_q;
Tests: T1 T2 T3
157
158 ////////////////////////////
159 // CDC handling
160 ////////////////////////////
161
162 logic dst_req_from_src;
163 logic dst_req;
164
165
166 // the software transaction is pulse synced across the domain.
167 // the prim_reg_cdc_arb module handles conflicts with ongoing hardware updates.
168 prim_pulse_sync u_src_to_dst_req (
169 .clk_src_i,
170 .rst_src_ni,
171 .clk_dst_i,
172 .rst_dst_ni,
173 .src_pulse_i(src_req),
174 .dst_pulse_o(dst_req_from_src)
175 );
176
177 prim_reg_cdc_arb #(
178 .DataWidth(DataWidth),
179 .ResetVal(ResetVal),
180 .DstWrReq(DstWrReq)
181 ) u_arb (
182 .clk_src_i,
183 .rst_src_ni,
184 .clk_dst_i,
185 .rst_dst_ni,
186 .src_ack_o(src_ack),
187 .src_update_o(src_update),
188 .dst_req_i(dst_req_from_src),
189 .dst_req_o(dst_req),
190 .dst_update_i,
191 .dst_ds_i,
192 .dst_qs_i,
193 .dst_qs_o(dst_qs)
194 );
195
196
197 // Each is valid only when destination request pulse is high; this is important in not propagating
198 // the internal assertion of 'dst_req' by the 'prim_pulse_sync' channel when just one domain is
199 // reset.
200 1/1 assign {dst_we_o, dst_re_o, dst_regwen_o} = txn_bits_q & {TxnWidth{dst_req}};
Tests: T1 T2 T3
Cond Coverage for Instance : tb.dut.u_reg.u_adc_fsm_rst_cdc
| Total | Covered | Percent |
Conditions | 13 | 12 | 92.31 |
Logical | 13 | 12 | 92.31 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 65
EXPRESSION (src_we_i | src_re_i)
----1--- ----2---
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T12,T13,T14 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T12,T13,T14 |
1 | 1 | Covered | T12,T13,T14 |
LINE 123
EXPRESSION (src_wd_i & BitMask)
----1--- ---2---
-1- | -2- | Status | Tests |
0 | - | Covered | T12,T13,T14 |
1 | - | Covered | T13,T14,T15 |
LINE 125
EXPRESSION ((src_busy_q && src_ack) || (src_update && ((!busy))))
-----------1----------- ------------2------------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Unreachable | |
1 | 0 | Covered | T12,T13,T14 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T12,T13,T14 |
1 | 1 | Covered | T12,T13,T14 |
LINE 125
SUB-EXPRESSION (src_update && ((!busy)))
-----1---- ----2----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Unreachable | |
1 | 1 | Unreachable | |
Branch Coverage for Instance : tb.dut.u_reg.u_adc_fsm_rst_cdc
| Line No. | Total | Covered | Percent |
Branches |
|
8 |
8 |
100.00 |
IF |
71 |
4 |
4 |
100.00 |
IF |
115 |
4 |
4 |
100.00 |
71 if (!rst_src_ni) begin
-1-
72 src_busy_q <= '0;
==>
73 end else if (src_req) begin
-2-
74 src_busy_q <= 1'b1;
==>
75 end else if (src_ack) begin
-3-
76 src_busy_q <= 1'b0;
==>
77 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T12,T13,T14 |
0 |
0 |
1 |
Covered |
T12,T13,T14 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
115 if (!rst_src_ni) begin
-1-
116 src_q <= ResetVal;
==>
117 txn_bits_q <= '0;
118 end else if (src_req) begin
-2-
119 // See assertion below
120 // At the beginning of a software initiated transaction, the following
121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot
122 // change for the duration of the synchronization operation.
123 src_q <= src_wd_i & BitMask;
==>
124 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
125 end else if (src_busy_q && src_ack || src_update && !busy) begin
-3-
126 // sample data whenever a busy transaction finishes OR
127 // when an update pulse is seen.
128 // TODO: We should add a cover group to test different sync timings
129 // between src_ack and src_update. ie. there can be 3 scenarios:
130 // 1. update one cycle before ack
131 // 2. ack one cycle before update
132 // 3. update / ack on the same cycle
133 // During all 3 cases the read data should be correct
134 src_q <= dst_qs;
==>
135 txn_bits_q <= '0;
136 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T12,T13,T14 |
0 |
0 |
1 |
Covered |
T12,T13,T14 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.u_reg.u_adc_fsm_rst_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
16780500 |
0 |
0 |
T12 |
255584 |
1991 |
0 |
0 |
T13 |
171132 |
632 |
0 |
0 |
T14 |
395989 |
830 |
0 |
0 |
T15 |
522269 |
937 |
0 |
0 |
T16 |
0 |
750 |
0 |
0 |
T17 |
0 |
876 |
0 |
0 |
T18 |
0 |
1203 |
0 |
0 |
T19 |
0 |
4090 |
0 |
0 |
T20 |
0 |
514 |
0 |
0 |
T25 |
50651 |
0 |
0 |
0 |
T26 |
109966 |
0 |
0 |
0 |
T27 |
183417 |
0 |
0 |
0 |
T28 |
180001 |
0 |
0 |
0 |
T29 |
96579 |
0 |
0 |
0 |
T40 |
0 |
751 |
0 |
0 |
T47 |
44086 |
0 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
34247075 |
33952252 |
0 |
0 |
T1 |
1197 |
1119 |
0 |
0 |
T2 |
106 |
6 |
0 |
0 |
T3 |
733 |
683 |
0 |
0 |
T4 |
1245 |
1147 |
0 |
0 |
T5 |
642 |
148 |
0 |
0 |
T6 |
674 |
579 |
0 |
0 |
T7 |
1152 |
1077 |
0 |
0 |
T21 |
899 |
18 |
0 |
0 |
T22 |
74 |
9 |
0 |
0 |
T23 |
946 |
27 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
16501 |
0 |
0 |
T12 |
255584 |
1 |
0 |
0 |
T13 |
171132 |
4 |
0 |
0 |
T14 |
395989 |
2 |
0 |
0 |
T15 |
522269 |
2 |
0 |
0 |
T16 |
0 |
2 |
0 |
0 |
T17 |
0 |
2 |
0 |
0 |
T18 |
0 |
4 |
0 |
0 |
T19 |
0 |
10 |
0 |
0 |
T20 |
0 |
2 |
0 |
0 |
T25 |
50651 |
0 |
0 |
0 |
T26 |
109966 |
0 |
0 |
0 |
T27 |
183417 |
0 |
0 |
0 |
T28 |
180001 |
0 |
0 |
0 |
T29 |
96579 |
0 |
0 |
0 |
T40 |
0 |
3 |
0 |
0 |
T47 |
44086 |
0 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2147483647 |
2147483647 |
0 |
0 |
T1 |
299630 |
299544 |
0 |
0 |
T2 |
25763 |
25713 |
0 |
0 |
T3 |
179799 |
179705 |
0 |
0 |
T4 |
105974 |
105879 |
0 |
0 |
T5 |
308670 |
305678 |
0 |
0 |
T6 |
327577 |
327525 |
0 |
0 |
T7 |
144286 |
144204 |
0 |
0 |
T21 |
108025 |
107168 |
0 |
0 |
T22 |
9439 |
9367 |
0 |
0 |
T23 |
71080 |
70224 |
0 |
0 |