Line Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_en_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 T26 T71
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 T26 T71
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T5 T26 T71
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: T5 T26 T71
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: T5 T26 T71
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 T26 T71
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T5 T26 T71
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 T26 T71
135 1/1 txn_bits_q <= '0;
Tests: T5 T26 T71
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: T5 T26 T71
156 1/1 assign dst_wd_o = src_q;
Tests: T5 T26 T71
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: T5 T26 T71
Cond Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_en_0_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 | T5,T26,T71 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T5,T26,T71 |
1 | 1 | Covered | T5,T26,T71 |
LINE 123
EXPRESSION (src_wd_i & BitMask)
----1--- ---2---
-1- | -2- | Status | Tests |
0 | - | Covered | T5,T26,T71 |
1 | - | Covered | T5,T26,T71 |
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,T26,T71 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T5,T26,T71 |
1 | 1 | Covered | T5,T26,T71 |
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.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_en_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,T26,T71 |
0 |
0 |
1 |
Covered |
T5,T26,T71 |
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,T26,T71 |
0 |
0 |
1 |
Covered |
T5,T26,T71 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_en_0_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
91720 |
0 |
0 |
T5 |
30991 |
1971 |
0 |
0 |
T6 |
28994 |
0 |
0 |
0 |
T11 |
30994 |
0 |
0 |
0 |
T23 |
20721 |
0 |
0 |
0 |
T25 |
20968 |
0 |
0 |
0 |
T26 |
0 |
905 |
0 |
0 |
T30 |
23299 |
0 |
0 |
0 |
T68 |
53404 |
0 |
0 |
0 |
T71 |
0 |
723 |
0 |
0 |
T77 |
0 |
683 |
0 |
0 |
T78 |
0 |
1977 |
0 |
0 |
T79 |
0 |
1663 |
0 |
0 |
T104 |
24805 |
0 |
0 |
0 |
T105 |
17024 |
0 |
0 |
0 |
T121 |
21745 |
0 |
0 |
0 |
T182 |
0 |
466 |
0 |
0 |
T183 |
0 |
429 |
0 |
0 |
T396 |
0 |
275 |
0 |
0 |
T417 |
0 |
749 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1668691 |
1446789 |
0 |
0 |
T1 |
321 |
147 |
0 |
0 |
T2 |
469 |
296 |
0 |
0 |
T3 |
500 |
328 |
0 |
0 |
T4 |
390 |
218 |
0 |
0 |
T5 |
559 |
388 |
0 |
0 |
T6 |
509 |
335 |
0 |
0 |
T30 |
389 |
215 |
0 |
0 |
T68 |
713 |
541 |
0 |
0 |
T104 |
382 |
210 |
0 |
0 |
T105 |
405 |
232 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
233 |
0 |
0 |
T5 |
30991 |
4 |
0 |
0 |
T6 |
28994 |
0 |
0 |
0 |
T11 |
30994 |
0 |
0 |
0 |
T23 |
20721 |
0 |
0 |
0 |
T25 |
20968 |
0 |
0 |
0 |
T26 |
0 |
2 |
0 |
0 |
T30 |
23299 |
0 |
0 |
0 |
T68 |
53404 |
0 |
0 |
0 |
T71 |
0 |
2 |
0 |
0 |
T77 |
0 |
2 |
0 |
0 |
T78 |
0 |
4 |
0 |
0 |
T79 |
0 |
5 |
0 |
0 |
T104 |
24805 |
0 |
0 |
0 |
T105 |
17024 |
0 |
0 |
0 |
T121 |
21745 |
0 |
0 |
0 |
T182 |
0 |
1 |
0 |
0 |
T183 |
0 |
1 |
0 |
0 |
T396 |
0 |
1 |
0 |
0 |
T417 |
0 |
2 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
139789547 |
0 |
0 |
T1 |
11041 |
10513 |
0 |
0 |
T2 |
22580 |
22245 |
0 |
0 |
T3 |
28424 |
28018 |
0 |
0 |
T4 |
27950 |
26976 |
0 |
0 |
T5 |
30991 |
30702 |
0 |
0 |
T6 |
28994 |
28555 |
0 |
0 |
T30 |
23299 |
22636 |
0 |
0 |
T68 |
53404 |
53009 |
0 |
0 |
T104 |
24805 |
24018 |
0 |
0 |
T105 |
17024 |
16662 |
0 |
0 |
Line Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_en_1_cdc
| Line No. | Total | Covered | Percent |
TOTAL | | 22 | 20 | 90.91 |
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 | 0 | 0.00 |
CONT_ASSIGN | 156 | 1 | 0 | 0.00 |
CONT_ASSIGN | 200 | 1 | 1 | 100.00 |
64
65 1/1 assign src_req = src_we_i | src_re_i;
Tests: T94 T95 T96
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: T178 T182 T183
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T178 T182 T183
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: T178 T182 T183
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: T178 T182 T183
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: T178 T182 T183
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T178 T182 T183
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: T178 T182 T183
135 1/1 txn_bits_q <= '0;
Tests: T178 T182 T183
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 0/1 ==> assign src_qs_o = src_q;
156 0/1 ==> assign dst_wd_o = src_q;
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: T178 T182 T183
Cond Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_en_1_cdc
| Total | Covered | Percent |
Conditions | 13 | 11 | 84.62 |
Logical | 13 | 11 | 84.62 |
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 | T178,T182,T183 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T178,T182,T183 |
1 | 1 | Covered | T178,T182,T183 |
LINE 123
EXPRESSION (src_wd_i & BitMask)
----1--- ---2---
-1- | -2- | Status | Tests |
0 | - | Covered | T178,T182,T183 |
1 | - | Not Covered | |
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 | T178,T182,T183 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T178,T182,T183 |
1 | 1 | Covered | T178,T182,T183 |
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.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_en_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 |
T178,T182,T183 |
0 |
0 |
1 |
Covered |
T178,T182,T183 |
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 |
T178,T182,T183 |
0 |
0 |
1 |
Covered |
T178,T182,T183 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_en_1_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
78234 |
0 |
0 |
T182 |
46628 |
426 |
0 |
0 |
T183 |
52327 |
392 |
0 |
0 |
T396 |
59750 |
260 |
0 |
0 |
T404 |
79766 |
583 |
0 |
0 |
T405 |
120826 |
592 |
0 |
0 |
T417 |
122411 |
621 |
0 |
0 |
T418 |
51097 |
399 |
0 |
0 |
T420 |
46713 |
371 |
0 |
0 |
T421 |
70376 |
372 |
0 |
0 |
T422 |
104150 |
544 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1668691 |
1446789 |
0 |
0 |
T1 |
321 |
147 |
0 |
0 |
T2 |
469 |
296 |
0 |
0 |
T3 |
500 |
328 |
0 |
0 |
T4 |
390 |
218 |
0 |
0 |
T5 |
559 |
388 |
0 |
0 |
T6 |
509 |
335 |
0 |
0 |
T30 |
389 |
215 |
0 |
0 |
T68 |
713 |
541 |
0 |
0 |
T104 |
382 |
210 |
0 |
0 |
T105 |
405 |
232 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
204 |
0 |
0 |
T182 |
46628 |
1 |
0 |
0 |
T183 |
52327 |
1 |
0 |
0 |
T396 |
59750 |
1 |
0 |
0 |
T404 |
79766 |
2 |
0 |
0 |
T405 |
120826 |
2 |
0 |
0 |
T417 |
122411 |
2 |
0 |
0 |
T418 |
51097 |
1 |
0 |
0 |
T420 |
46713 |
1 |
0 |
0 |
T421 |
70376 |
1 |
0 |
0 |
T422 |
104150 |
2 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
139789547 |
0 |
0 |
T1 |
11041 |
10513 |
0 |
0 |
T2 |
22580 |
22245 |
0 |
0 |
T3 |
28424 |
28018 |
0 |
0 |
T4 |
27950 |
26976 |
0 |
0 |
T5 |
30991 |
30702 |
0 |
0 |
T6 |
28994 |
28555 |
0 |
0 |
T30 |
23299 |
22636 |
0 |
0 |
T68 |
53404 |
53009 |
0 |
0 |
T104 |
24805 |
24018 |
0 |
0 |
T105 |
17024 |
16662 |
0 |
0 |
Line Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_en_2_cdc
| Line No. | Total | Covered | Percent |
TOTAL | | 22 | 20 | 90.91 |
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 | 0 | 0.00 |
CONT_ASSIGN | 156 | 1 | 0 | 0.00 |
CONT_ASSIGN | 200 | 1 | 1 | 100.00 |
64
65 1/1 assign src_req = src_we_i | src_re_i;
Tests: T94 T95 T96
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: T178 T182 T183
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T178 T182 T183
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: T178 T182 T183
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: T178 T182 T183
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: T178 T182 T183
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T178 T182 T183
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: T178 T182 T183
135 1/1 txn_bits_q <= '0;
Tests: T178 T182 T183
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 0/1 ==> assign src_qs_o = src_q;
156 0/1 ==> assign dst_wd_o = src_q;
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: T178 T182 T183
Cond Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_en_2_cdc
| Total | Covered | Percent |
Conditions | 13 | 11 | 84.62 |
Logical | 13 | 11 | 84.62 |
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 | T178,T182,T183 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T178,T182,T183 |
1 | 1 | Covered | T178,T182,T183 |
LINE 123
EXPRESSION (src_wd_i & BitMask)
----1--- ---2---
-1- | -2- | Status | Tests |
0 | - | Covered | T178,T182,T183 |
1 | - | Not Covered | |
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 | T178,T182,T183 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T178,T182,T183 |
1 | 1 | Covered | T178,T182,T183 |
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.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_en_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 |
T178,T182,T183 |
0 |
0 |
1 |
Covered |
T178,T182,T183 |
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 |
T178,T182,T183 |
0 |
0 |
1 |
Covered |
T178,T182,T183 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_en_2_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
89947 |
0 |
0 |
T182 |
46628 |
448 |
0 |
0 |
T183 |
52327 |
479 |
0 |
0 |
T396 |
59750 |
343 |
0 |
0 |
T404 |
79766 |
585 |
0 |
0 |
T405 |
120826 |
594 |
0 |
0 |
T417 |
122411 |
802 |
0 |
0 |
T418 |
51097 |
451 |
0 |
0 |
T420 |
46713 |
476 |
0 |
0 |
T421 |
70376 |
451 |
0 |
0 |
T422 |
104150 |
612 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1668691 |
1446789 |
0 |
0 |
T1 |
321 |
147 |
0 |
0 |
T2 |
469 |
296 |
0 |
0 |
T3 |
500 |
328 |
0 |
0 |
T4 |
390 |
218 |
0 |
0 |
T5 |
559 |
388 |
0 |
0 |
T6 |
509 |
335 |
0 |
0 |
T30 |
389 |
215 |
0 |
0 |
T68 |
713 |
541 |
0 |
0 |
T104 |
382 |
210 |
0 |
0 |
T105 |
405 |
232 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
230 |
0 |
0 |
T182 |
46628 |
1 |
0 |
0 |
T183 |
52327 |
1 |
0 |
0 |
T396 |
59750 |
1 |
0 |
0 |
T404 |
79766 |
2 |
0 |
0 |
T405 |
120826 |
2 |
0 |
0 |
T417 |
122411 |
2 |
0 |
0 |
T418 |
51097 |
1 |
0 |
0 |
T420 |
46713 |
1 |
0 |
0 |
T421 |
70376 |
1 |
0 |
0 |
T422 |
104150 |
2 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
139789547 |
0 |
0 |
T1 |
11041 |
10513 |
0 |
0 |
T2 |
22580 |
22245 |
0 |
0 |
T3 |
28424 |
28018 |
0 |
0 |
T4 |
27950 |
26976 |
0 |
0 |
T5 |
30991 |
30702 |
0 |
0 |
T6 |
28994 |
28555 |
0 |
0 |
T30 |
23299 |
22636 |
0 |
0 |
T68 |
53404 |
53009 |
0 |
0 |
T104 |
24805 |
24018 |
0 |
0 |
T105 |
17024 |
16662 |
0 |
0 |
Line Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_en_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: T23 T94 T95
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: T23 T178 T182
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T23 T178 T182
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: T23 T178 T182
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: T23 T178 T182
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: T23 T178 T182
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T23 T178 T182
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: T23 T178 T182
135 1/1 txn_bits_q <= '0;
Tests: T23 T178 T182
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: T23
156 1/1 assign dst_wd_o = src_q;
Tests: T23
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: T23 T178 T182
Cond Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_en_3_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 | T23,T178,T182 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T23,T178,T182 |
1 | 1 | Covered | T23,T178,T182 |
LINE 123
EXPRESSION (src_wd_i & BitMask)
----1--- ---2---
-1- | -2- | Status | Tests |
0 | - | Covered | T23,T178,T182 |
1 | - | Covered | T23 |
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 | T23,T178,T182 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T23,T178,T182 |
1 | 1 | Covered | T23,T178,T182 |
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.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_en_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 |
T23,T178,T182 |
0 |
0 |
1 |
Covered |
T23,T178,T182 |
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 |
T23,T178,T182 |
0 |
0 |
1 |
Covered |
T23,T178,T182 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_en_3_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
91058 |
0 |
0 |
T7 |
39911 |
0 |
0 |
0 |
T11 |
30994 |
0 |
0 |
0 |
T23 |
20721 |
819 |
0 |
0 |
T25 |
20968 |
0 |
0 |
0 |
T26 |
28491 |
0 |
0 |
0 |
T28 |
47134 |
0 |
0 |
0 |
T34 |
17832 |
0 |
0 |
0 |
T121 |
21745 |
0 |
0 |
0 |
T182 |
0 |
379 |
0 |
0 |
T183 |
0 |
456 |
0 |
0 |
T264 |
33915 |
0 |
0 |
0 |
T396 |
0 |
317 |
0 |
0 |
T404 |
0 |
651 |
0 |
0 |
T405 |
0 |
520 |
0 |
0 |
T417 |
0 |
771 |
0 |
0 |
T418 |
0 |
476 |
0 |
0 |
T420 |
0 |
418 |
0 |
0 |
T421 |
0 |
377 |
0 |
0 |
T423 |
19692 |
0 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1668691 |
1446789 |
0 |
0 |
T1 |
321 |
147 |
0 |
0 |
T2 |
469 |
296 |
0 |
0 |
T3 |
500 |
328 |
0 |
0 |
T4 |
390 |
218 |
0 |
0 |
T5 |
559 |
388 |
0 |
0 |
T6 |
509 |
335 |
0 |
0 |
T30 |
389 |
215 |
0 |
0 |
T68 |
713 |
541 |
0 |
0 |
T104 |
382 |
210 |
0 |
0 |
T105 |
405 |
232 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
233 |
0 |
0 |
T7 |
39911 |
0 |
0 |
0 |
T11 |
30994 |
0 |
0 |
0 |
T23 |
20721 |
2 |
0 |
0 |
T25 |
20968 |
0 |
0 |
0 |
T26 |
28491 |
0 |
0 |
0 |
T28 |
47134 |
0 |
0 |
0 |
T34 |
17832 |
0 |
0 |
0 |
T121 |
21745 |
0 |
0 |
0 |
T182 |
0 |
1 |
0 |
0 |
T183 |
0 |
1 |
0 |
0 |
T264 |
33915 |
0 |
0 |
0 |
T396 |
0 |
1 |
0 |
0 |
T404 |
0 |
2 |
0 |
0 |
T405 |
0 |
2 |
0 |
0 |
T417 |
0 |
2 |
0 |
0 |
T418 |
0 |
1 |
0 |
0 |
T420 |
0 |
1 |
0 |
0 |
T421 |
0 |
1 |
0 |
0 |
T423 |
19692 |
0 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
139789547 |
0 |
0 |
T1 |
11041 |
10513 |
0 |
0 |
T2 |
22580 |
22245 |
0 |
0 |
T3 |
28424 |
28018 |
0 |
0 |
T4 |
27950 |
26976 |
0 |
0 |
T5 |
30991 |
30702 |
0 |
0 |
T6 |
28994 |
28555 |
0 |
0 |
T30 |
23299 |
22636 |
0 |
0 |
T68 |
53404 |
53009 |
0 |
0 |
T104 |
24805 |
24018 |
0 |
0 |
T105 |
17024 |
16662 |
0 |
0 |
Line Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_en_4_cdc
| Line No. | Total | Covered | Percent |
TOTAL | | 22 | 20 | 90.91 |
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 | 0 | 0.00 |
CONT_ASSIGN | 156 | 1 | 0 | 0.00 |
CONT_ASSIGN | 200 | 1 | 1 | 100.00 |
64
65 1/1 assign src_req = src_we_i | src_re_i;
Tests: T94 T95 T96
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: T178 T182 T183
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T178 T182 T183
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: T178 T182 T183
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: T178 T182 T183
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: T178 T182 T183
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T178 T182 T183
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: T178 T182 T183
135 1/1 txn_bits_q <= '0;
Tests: T178 T182 T183
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 0/1 ==> assign src_qs_o = src_q;
156 0/1 ==> assign dst_wd_o = src_q;
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: T178 T182 T183
Cond Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_en_4_cdc
| Total | Covered | Percent |
Conditions | 13 | 11 | 84.62 |
Logical | 13 | 11 | 84.62 |
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 | T178,T182,T183 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T178,T182,T183 |
1 | 1 | Covered | T178,T182,T183 |
LINE 123
EXPRESSION (src_wd_i & BitMask)
----1--- ---2---
-1- | -2- | Status | Tests |
0 | - | Covered | T178,T182,T183 |
1 | - | Not Covered | |
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 | T178,T182,T183 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T178,T182,T183 |
1 | 1 | Covered | T178,T182,T183 |
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.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_en_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 |
T178,T182,T183 |
0 |
0 |
1 |
Covered |
T178,T182,T183 |
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 |
T178,T182,T183 |
0 |
0 |
1 |
Covered |
T178,T182,T183 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_en_4_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
83763 |
0 |
0 |
T182 |
46628 |
477 |
0 |
0 |
T183 |
52327 |
386 |
0 |
0 |
T396 |
59750 |
309 |
0 |
0 |
T404 |
79766 |
596 |
0 |
0 |
T405 |
120826 |
600 |
0 |
0 |
T417 |
122411 |
766 |
0 |
0 |
T418 |
51097 |
416 |
0 |
0 |
T420 |
46713 |
417 |
0 |
0 |
T421 |
70376 |
411 |
0 |
0 |
T422 |
104150 |
580 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1668691 |
1446789 |
0 |
0 |
T1 |
321 |
147 |
0 |
0 |
T2 |
469 |
296 |
0 |
0 |
T3 |
500 |
328 |
0 |
0 |
T4 |
390 |
218 |
0 |
0 |
T5 |
559 |
388 |
0 |
0 |
T6 |
509 |
335 |
0 |
0 |
T30 |
389 |
215 |
0 |
0 |
T68 |
713 |
541 |
0 |
0 |
T104 |
382 |
210 |
0 |
0 |
T105 |
405 |
232 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
215 |
0 |
0 |
T182 |
46628 |
1 |
0 |
0 |
T183 |
52327 |
1 |
0 |
0 |
T396 |
59750 |
1 |
0 |
0 |
T404 |
79766 |
2 |
0 |
0 |
T405 |
120826 |
2 |
0 |
0 |
T417 |
122411 |
2 |
0 |
0 |
T418 |
51097 |
1 |
0 |
0 |
T420 |
46713 |
1 |
0 |
0 |
T421 |
70376 |
1 |
0 |
0 |
T422 |
104150 |
2 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
139789547 |
0 |
0 |
T1 |
11041 |
10513 |
0 |
0 |
T2 |
22580 |
22245 |
0 |
0 |
T3 |
28424 |
28018 |
0 |
0 |
T4 |
27950 |
26976 |
0 |
0 |
T5 |
30991 |
30702 |
0 |
0 |
T6 |
28994 |
28555 |
0 |
0 |
T30 |
23299 |
22636 |
0 |
0 |
T68 |
53404 |
53009 |
0 |
0 |
T104 |
24805 |
24018 |
0 |
0 |
T105 |
17024 |
16662 |
0 |
0 |
Line Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_en_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: T72 T73 T74
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: T72 T73 T74
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T72 T73 T74
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: T72 T73 T74
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: T72 T73 T74
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: T72 T73 T74
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T72 T73 T74
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: T72 T73 T74
135 1/1 txn_bits_q <= '0;
Tests: T72 T73 T74
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: T72 T73 T74
156 1/1 assign dst_wd_o = src_q;
Tests: T72 T73 T74
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: T72 T73 T74
Cond Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_en_5_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 | T72,T73,T74 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T72,T73,T74 |
1 | 1 | Covered | T72,T73,T74 |
LINE 123
EXPRESSION (src_wd_i & BitMask)
----1--- ---2---
-1- | -2- | Status | Tests |
0 | - | Covered | T72,T73,T74 |
1 | - | Covered | T72,T73,T74 |
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 | T72,T73,T74 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T72,T73,T74 |
1 | 1 | Covered | T72,T73,T74 |
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.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_en_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 |
T72,T73,T74 |
0 |
0 |
1 |
Covered |
T72,T73,T74 |
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 |
T72,T73,T74 |
0 |
0 |
1 |
Covered |
T72,T73,T74 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_en_5_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
99847 |
0 |
0 |
T72 |
50220 |
851 |
0 |
0 |
T73 |
0 |
1634 |
0 |
0 |
T74 |
0 |
761 |
0 |
0 |
T80 |
0 |
931 |
0 |
0 |
T87 |
38016 |
0 |
0 |
0 |
T88 |
36549 |
0 |
0 |
0 |
T120 |
0 |
733 |
0 |
0 |
T124 |
0 |
1420 |
0 |
0 |
T125 |
0 |
1392 |
0 |
0 |
T166 |
43823 |
0 |
0 |
0 |
T203 |
59720 |
0 |
0 |
0 |
T214 |
21095 |
0 |
0 |
0 |
T215 |
19968 |
0 |
0 |
0 |
T221 |
97042 |
0 |
0 |
0 |
T315 |
40841 |
0 |
0 |
0 |
T340 |
127496 |
0 |
0 |
0 |
T419 |
0 |
774 |
0 |
0 |
T424 |
0 |
732 |
0 |
0 |
T425 |
0 |
781 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1668691 |
1446789 |
0 |
0 |
T1 |
321 |
147 |
0 |
0 |
T2 |
469 |
296 |
0 |
0 |
T3 |
500 |
328 |
0 |
0 |
T4 |
390 |
218 |
0 |
0 |
T5 |
559 |
388 |
0 |
0 |
T6 |
509 |
335 |
0 |
0 |
T30 |
389 |
215 |
0 |
0 |
T68 |
713 |
541 |
0 |
0 |
T104 |
382 |
210 |
0 |
0 |
T105 |
405 |
232 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
257 |
0 |
0 |
T72 |
50220 |
2 |
0 |
0 |
T73 |
0 |
4 |
0 |
0 |
T74 |
0 |
2 |
0 |
0 |
T80 |
0 |
2 |
0 |
0 |
T87 |
38016 |
0 |
0 |
0 |
T88 |
36549 |
0 |
0 |
0 |
T120 |
0 |
2 |
0 |
0 |
T124 |
0 |
4 |
0 |
0 |
T125 |
0 |
4 |
0 |
0 |
T166 |
43823 |
0 |
0 |
0 |
T203 |
59720 |
0 |
0 |
0 |
T214 |
21095 |
0 |
0 |
0 |
T215 |
19968 |
0 |
0 |
0 |
T221 |
97042 |
0 |
0 |
0 |
T315 |
40841 |
0 |
0 |
0 |
T340 |
127496 |
0 |
0 |
0 |
T419 |
0 |
2 |
0 |
0 |
T424 |
0 |
2 |
0 |
0 |
T425 |
0 |
2 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
139789547 |
0 |
0 |
T1 |
11041 |
10513 |
0 |
0 |
T2 |
22580 |
22245 |
0 |
0 |
T3 |
28424 |
28018 |
0 |
0 |
T4 |
27950 |
26976 |
0 |
0 |
T5 |
30991 |
30702 |
0 |
0 |
T6 |
28994 |
28555 |
0 |
0 |
T30 |
23299 |
22636 |
0 |
0 |
T68 |
53404 |
53009 |
0 |
0 |
T104 |
24805 |
24018 |
0 |
0 |
T105 |
17024 |
16662 |
0 |
0 |
Line Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_en_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: T24 T94 T95
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: T24 T178 T182
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T24 T178 T182
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: T24 T178 T182
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: T24 T178 T182
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: T24 T178 T182
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T24 T178 T182
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: T24 T178 T182
135 1/1 txn_bits_q <= '0;
Tests: T24 T178 T182
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: T24
156 1/1 assign dst_wd_o = src_q;
Tests: T24
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: T24 T178 T182
Cond Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_en_6_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 | T24,T178,T182 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T24,T178,T182 |
1 | 1 | Covered | T24,T178,T182 |
LINE 123
EXPRESSION (src_wd_i & BitMask)
----1--- ---2---
-1- | -2- | Status | Tests |
0 | - | Covered | T24,T178,T182 |
1 | - | Covered | T24 |
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 | T24,T178,T182 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T24,T178,T182 |
1 | 1 | Covered | T24,T178,T182 |
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.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_en_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 |
T24,T178,T182 |
0 |
0 |
1 |
Covered |
T24,T178,T182 |
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 |
T24,T178,T182 |
0 |
0 |
1 |
Covered |
T24,T178,T182 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_en_6_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
85402 |
0 |
0 |
T24 |
35114 |
876 |
0 |
0 |
T133 |
51935 |
0 |
0 |
0 |
T182 |
0 |
380 |
0 |
0 |
T183 |
0 |
379 |
0 |
0 |
T338 |
56971 |
0 |
0 |
0 |
T376 |
440126 |
0 |
0 |
0 |
T396 |
0 |
290 |
0 |
0 |
T404 |
0 |
533 |
0 |
0 |
T405 |
0 |
545 |
0 |
0 |
T417 |
0 |
717 |
0 |
0 |
T418 |
0 |
390 |
0 |
0 |
T420 |
0 |
422 |
0 |
0 |
T421 |
0 |
375 |
0 |
0 |
T426 |
326479 |
0 |
0 |
0 |
T427 |
301031 |
0 |
0 |
0 |
T428 |
303448 |
0 |
0 |
0 |
T429 |
326005 |
0 |
0 |
0 |
T430 |
328507 |
0 |
0 |
0 |
T431 |
315904 |
0 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1668691 |
1446789 |
0 |
0 |
T1 |
321 |
147 |
0 |
0 |
T2 |
469 |
296 |
0 |
0 |
T3 |
500 |
328 |
0 |
0 |
T4 |
390 |
218 |
0 |
0 |
T5 |
559 |
388 |
0 |
0 |
T6 |
509 |
335 |
0 |
0 |
T30 |
389 |
215 |
0 |
0 |
T68 |
713 |
541 |
0 |
0 |
T104 |
382 |
210 |
0 |
0 |
T105 |
405 |
232 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
221 |
0 |
0 |
T24 |
35114 |
2 |
0 |
0 |
T133 |
51935 |
0 |
0 |
0 |
T182 |
0 |
1 |
0 |
0 |
T183 |
0 |
1 |
0 |
0 |
T338 |
56971 |
0 |
0 |
0 |
T376 |
440126 |
0 |
0 |
0 |
T396 |
0 |
1 |
0 |
0 |
T404 |
0 |
2 |
0 |
0 |
T405 |
0 |
2 |
0 |
0 |
T417 |
0 |
2 |
0 |
0 |
T418 |
0 |
1 |
0 |
0 |
T420 |
0 |
1 |
0 |
0 |
T421 |
0 |
1 |
0 |
0 |
T426 |
326479 |
0 |
0 |
0 |
T427 |
301031 |
0 |
0 |
0 |
T428 |
303448 |
0 |
0 |
0 |
T429 |
326005 |
0 |
0 |
0 |
T430 |
328507 |
0 |
0 |
0 |
T431 |
315904 |
0 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
139789547 |
0 |
0 |
T1 |
11041 |
10513 |
0 |
0 |
T2 |
22580 |
22245 |
0 |
0 |
T3 |
28424 |
28018 |
0 |
0 |
T4 |
27950 |
26976 |
0 |
0 |
T5 |
30991 |
30702 |
0 |
0 |
T6 |
28994 |
28555 |
0 |
0 |
T30 |
23299 |
22636 |
0 |
0 |
T68 |
53404 |
53009 |
0 |
0 |
T104 |
24805 |
24018 |
0 |
0 |
T105 |
17024 |
16662 |
0 |
0 |
Line Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_en_7_cdc
| Line No. | Total | Covered | Percent |
TOTAL | | 22 | 20 | 90.91 |
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 | 0 | 0.00 |
CONT_ASSIGN | 156 | 1 | 0 | 0.00 |
CONT_ASSIGN | 200 | 1 | 1 | 100.00 |
64
65 1/1 assign src_req = src_we_i | src_re_i;
Tests: T94 T95 T96
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: T178 T182 T183
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T178 T182 T183
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: T178 T182 T183
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: T178 T182 T183
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: T178 T182 T183
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T178 T182 T183
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: T178 T182 T183
135 1/1 txn_bits_q <= '0;
Tests: T178 T182 T183
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 0/1 ==> assign src_qs_o = src_q;
156 0/1 ==> assign dst_wd_o = src_q;
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: T178 T182 T183
Cond Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_en_7_cdc
| Total | Covered | Percent |
Conditions | 13 | 11 | 84.62 |
Logical | 13 | 11 | 84.62 |
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 | T178,T182,T183 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T178,T182,T183 |
1 | 1 | Covered | T178,T182,T183 |
LINE 123
EXPRESSION (src_wd_i & BitMask)
----1--- ---2---
-1- | -2- | Status | Tests |
0 | - | Covered | T178,T182,T183 |
1 | - | Not Covered | |
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 | T178,T182,T183 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T178,T182,T183 |
1 | 1 | Covered | T178,T182,T183 |
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.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_en_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 |
T178,T182,T183 |
0 |
0 |
1 |
Covered |
T178,T182,T183 |
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 |
T178,T182,T183 |
0 |
0 |
1 |
Covered |
T178,T182,T183 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_en_7_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
85002 |
0 |
0 |
T182 |
46628 |
384 |
0 |
0 |
T183 |
52327 |
410 |
0 |
0 |
T396 |
59750 |
352 |
0 |
0 |
T404 |
79766 |
577 |
0 |
0 |
T405 |
120826 |
646 |
0 |
0 |
T417 |
122411 |
719 |
0 |
0 |
T418 |
51097 |
450 |
0 |
0 |
T420 |
46713 |
382 |
0 |
0 |
T421 |
70376 |
417 |
0 |
0 |
T422 |
104150 |
690 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1668691 |
1446789 |
0 |
0 |
T1 |
321 |
147 |
0 |
0 |
T2 |
469 |
296 |
0 |
0 |
T3 |
500 |
328 |
0 |
0 |
T4 |
390 |
218 |
0 |
0 |
T5 |
559 |
388 |
0 |
0 |
T6 |
509 |
335 |
0 |
0 |
T30 |
389 |
215 |
0 |
0 |
T68 |
713 |
541 |
0 |
0 |
T104 |
382 |
210 |
0 |
0 |
T105 |
405 |
232 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
218 |
0 |
0 |
T182 |
46628 |
1 |
0 |
0 |
T183 |
52327 |
1 |
0 |
0 |
T396 |
59750 |
1 |
0 |
0 |
T404 |
79766 |
2 |
0 |
0 |
T405 |
120826 |
2 |
0 |
0 |
T417 |
122411 |
2 |
0 |
0 |
T418 |
51097 |
1 |
0 |
0 |
T420 |
46713 |
1 |
0 |
0 |
T421 |
70376 |
1 |
0 |
0 |
T422 |
104150 |
2 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
139789547 |
0 |
0 |
T1 |
11041 |
10513 |
0 |
0 |
T2 |
22580 |
22245 |
0 |
0 |
T3 |
28424 |
28018 |
0 |
0 |
T4 |
27950 |
26976 |
0 |
0 |
T5 |
30991 |
30702 |
0 |
0 |
T6 |
28994 |
28555 |
0 |
0 |
T30 |
23299 |
22636 |
0 |
0 |
T68 |
53404 |
53009 |
0 |
0 |
T104 |
24805 |
24018 |
0 |
0 |
T105 |
17024 |
16662 |
0 |
0 |
Line Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_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 T26 T71
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 T26 T71
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T5 T26 T71
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: T5 T26 T71
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: T5 T26 T71
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 T26 T71
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T5 T26 T71
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 T26 T71
135 1/1 txn_bits_q <= '0;
Tests: T5 T26 T71
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: T5 T78 T79
156 1/1 assign dst_wd_o = src_q;
Tests: T5 T78 T79
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: T5 T26 T71
Cond Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_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,T26,T71 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T5,T26,T71 |
1 | 1 | Covered | T5,T26,T71 |
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,T26,T71 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T5,T26,T71 |
1 | 1 | Covered | T5,T26,T71 |
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.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_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,T26,T71 |
0 |
0 |
1 |
Covered |
T5,T26,T71 |
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,T26,T71 |
0 |
0 |
1 |
Covered |
T5,T26,T71 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_0_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
92475 |
0 |
0 |
T5 |
30991 |
685 |
0 |
0 |
T6 |
28994 |
0 |
0 |
0 |
T11 |
30994 |
0 |
0 |
0 |
T23 |
20721 |
0 |
0 |
0 |
T25 |
20968 |
0 |
0 |
0 |
T26 |
0 |
410 |
0 |
0 |
T30 |
23299 |
0 |
0 |
0 |
T68 |
53404 |
0 |
0 |
0 |
T71 |
0 |
468 |
0 |
0 |
T77 |
0 |
307 |
0 |
0 |
T78 |
0 |
817 |
0 |
0 |
T79 |
0 |
593 |
0 |
0 |
T104 |
24805 |
0 |
0 |
0 |
T105 |
17024 |
0 |
0 |
0 |
T121 |
21745 |
0 |
0 |
0 |
T182 |
0 |
458 |
0 |
0 |
T183 |
0 |
394 |
0 |
0 |
T396 |
0 |
317 |
0 |
0 |
T417 |
0 |
700 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1668691 |
1446789 |
0 |
0 |
T1 |
321 |
147 |
0 |
0 |
T2 |
469 |
296 |
0 |
0 |
T3 |
500 |
328 |
0 |
0 |
T4 |
390 |
218 |
0 |
0 |
T5 |
559 |
388 |
0 |
0 |
T6 |
509 |
335 |
0 |
0 |
T30 |
389 |
215 |
0 |
0 |
T68 |
713 |
541 |
0 |
0 |
T104 |
382 |
210 |
0 |
0 |
T105 |
405 |
232 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
236 |
0 |
0 |
T5 |
30991 |
2 |
0 |
0 |
T6 |
28994 |
0 |
0 |
0 |
T11 |
30994 |
0 |
0 |
0 |
T23 |
20721 |
0 |
0 |
0 |
T25 |
20968 |
0 |
0 |
0 |
T26 |
0 |
1 |
0 |
0 |
T30 |
23299 |
0 |
0 |
0 |
T68 |
53404 |
0 |
0 |
0 |
T71 |
0 |
1 |
0 |
0 |
T77 |
0 |
1 |
0 |
0 |
T78 |
0 |
2 |
0 |
0 |
T79 |
0 |
2 |
0 |
0 |
T104 |
24805 |
0 |
0 |
0 |
T105 |
17024 |
0 |
0 |
0 |
T121 |
21745 |
0 |
0 |
0 |
T182 |
0 |
1 |
0 |
0 |
T183 |
0 |
1 |
0 |
0 |
T396 |
0 |
1 |
0 |
0 |
T417 |
0 |
2 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
139789547 |
0 |
0 |
T1 |
11041 |
10513 |
0 |
0 |
T2 |
22580 |
22245 |
0 |
0 |
T3 |
28424 |
28018 |
0 |
0 |
T4 |
27950 |
26976 |
0 |
0 |
T5 |
30991 |
30702 |
0 |
0 |
T6 |
28994 |
28555 |
0 |
0 |
T30 |
23299 |
22636 |
0 |
0 |
T68 |
53404 |
53009 |
0 |
0 |
T104 |
24805 |
24018 |
0 |
0 |
T105 |
17024 |
16662 |
0 |
0 |
Line Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_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: T94 T95 T96
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: T178 T182 T183
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T178 T182 T183
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: T178 T182 T183
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: T178 T182 T183
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: T178 T182 T183
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T178 T182 T183
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: T178 T182 T183
135 1/1 txn_bits_q <= '0;
Tests: T178 T182 T183
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: T178 T182 T183
156 1/1 assign dst_wd_o = src_q;
Tests: T178 T182 T183
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: T178 T182 T183
Cond Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_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 | T178,T182,T183 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T178,T182,T183 |
1 | 1 | Covered | T178,T182,T183 |
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 | T178,T182,T183 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T178,T182,T183 |
1 | 1 | Covered | T178,T182,T183 |
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.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_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 |
T178,T182,T183 |
0 |
0 |
1 |
Covered |
T178,T182,T183 |
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 |
T178,T182,T183 |
0 |
0 |
1 |
Covered |
T178,T182,T183 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_1_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
80169 |
0 |
0 |
T182 |
46628 |
399 |
0 |
0 |
T183 |
52327 |
409 |
0 |
0 |
T396 |
59750 |
351 |
0 |
0 |
T404 |
79766 |
511 |
0 |
0 |
T405 |
120826 |
616 |
0 |
0 |
T417 |
122411 |
715 |
0 |
0 |
T418 |
51097 |
399 |
0 |
0 |
T420 |
46713 |
431 |
0 |
0 |
T421 |
70376 |
470 |
0 |
0 |
T422 |
104150 |
617 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1668691 |
1446789 |
0 |
0 |
T1 |
321 |
147 |
0 |
0 |
T2 |
469 |
296 |
0 |
0 |
T3 |
500 |
328 |
0 |
0 |
T4 |
390 |
218 |
0 |
0 |
T5 |
559 |
388 |
0 |
0 |
T6 |
509 |
335 |
0 |
0 |
T30 |
389 |
215 |
0 |
0 |
T68 |
713 |
541 |
0 |
0 |
T104 |
382 |
210 |
0 |
0 |
T105 |
405 |
232 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
206 |
0 |
0 |
T182 |
46628 |
1 |
0 |
0 |
T183 |
52327 |
1 |
0 |
0 |
T396 |
59750 |
1 |
0 |
0 |
T404 |
79766 |
2 |
0 |
0 |
T405 |
120826 |
2 |
0 |
0 |
T417 |
122411 |
2 |
0 |
0 |
T418 |
51097 |
1 |
0 |
0 |
T420 |
46713 |
1 |
0 |
0 |
T421 |
70376 |
1 |
0 |
0 |
T422 |
104150 |
2 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
139789547 |
0 |
0 |
T1 |
11041 |
10513 |
0 |
0 |
T2 |
22580 |
22245 |
0 |
0 |
T3 |
28424 |
28018 |
0 |
0 |
T4 |
27950 |
26976 |
0 |
0 |
T5 |
30991 |
30702 |
0 |
0 |
T6 |
28994 |
28555 |
0 |
0 |
T30 |
23299 |
22636 |
0 |
0 |
T68 |
53404 |
53009 |
0 |
0 |
T104 |
24805 |
24018 |
0 |
0 |
T105 |
17024 |
16662 |
0 |
0 |
Line Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_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: T94 T95 T96
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: T178 T182 T183
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T178 T182 T183
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: T178 T182 T183
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: T178 T182 T183
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: T178 T182 T183
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T178 T182 T183
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: T178 T182 T183
135 1/1 txn_bits_q <= '0;
Tests: T178 T182 T183
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: T178 T182 T183
156 1/1 assign dst_wd_o = src_q;
Tests: T178 T182 T183
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: T178 T182 T183
Cond Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_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 | T178,T432,T182 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T178,T182,T183 |
1 | 1 | Covered | T178,T182,T183 |
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 | T178,T182,T183 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T178,T182,T183 |
1 | 1 | Covered | T178,T182,T183 |
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.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_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 |
T178,T182,T183 |
0 |
0 |
1 |
Covered |
T178,T182,T183 |
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 |
T178,T182,T183 |
0 |
0 |
1 |
Covered |
T178,T182,T183 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_2_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
86566 |
0 |
0 |
T182 |
46628 |
387 |
0 |
0 |
T183 |
52327 |
379 |
0 |
0 |
T396 |
59750 |
350 |
0 |
0 |
T404 |
79766 |
591 |
0 |
0 |
T405 |
120826 |
549 |
0 |
0 |
T417 |
122411 |
686 |
0 |
0 |
T418 |
51097 |
431 |
0 |
0 |
T420 |
46713 |
399 |
0 |
0 |
T421 |
70376 |
419 |
0 |
0 |
T422 |
104150 |
495 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1668691 |
1446789 |
0 |
0 |
T1 |
321 |
147 |
0 |
0 |
T2 |
469 |
296 |
0 |
0 |
T3 |
500 |
328 |
0 |
0 |
T4 |
390 |
218 |
0 |
0 |
T5 |
559 |
388 |
0 |
0 |
T6 |
509 |
335 |
0 |
0 |
T30 |
389 |
215 |
0 |
0 |
T68 |
713 |
541 |
0 |
0 |
T104 |
382 |
210 |
0 |
0 |
T105 |
405 |
232 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
224 |
0 |
0 |
T182 |
46628 |
1 |
0 |
0 |
T183 |
52327 |
1 |
0 |
0 |
T396 |
59750 |
1 |
0 |
0 |
T404 |
79766 |
2 |
0 |
0 |
T405 |
120826 |
2 |
0 |
0 |
T417 |
122411 |
2 |
0 |
0 |
T418 |
51097 |
1 |
0 |
0 |
T420 |
46713 |
1 |
0 |
0 |
T421 |
70376 |
1 |
0 |
0 |
T422 |
104150 |
2 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
139789547 |
0 |
0 |
T1 |
11041 |
10513 |
0 |
0 |
T2 |
22580 |
22245 |
0 |
0 |
T3 |
28424 |
28018 |
0 |
0 |
T4 |
27950 |
26976 |
0 |
0 |
T5 |
30991 |
30702 |
0 |
0 |
T6 |
28994 |
28555 |
0 |
0 |
T30 |
23299 |
22636 |
0 |
0 |
T68 |
53404 |
53009 |
0 |
0 |
T104 |
24805 |
24018 |
0 |
0 |
T105 |
17024 |
16662 |
0 |
0 |
Line Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_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: T23 T94 T95
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: T23 T178 T182
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T23 T178 T182
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: T23 T178 T182
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: T23 T178 T182
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: T23 T178 T182
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T23 T178 T182
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: T23 T178 T182
135 1/1 txn_bits_q <= '0;
Tests: T23 T178 T182
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: T23 T178 T182
156 1/1 assign dst_wd_o = src_q;
Tests: T23 T178 T182
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: T23 T178 T182
Cond Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_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 | T23,T178,T432 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T23,T178,T182 |
1 | 1 | Covered | T23,T178,T182 |
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 | T23,T178,T182 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T23,T178,T182 |
1 | 1 | Covered | T23,T178,T182 |
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.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_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 |
T23,T178,T182 |
0 |
0 |
1 |
Covered |
T23,T178,T182 |
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 |
T23,T178,T182 |
0 |
0 |
1 |
Covered |
T23,T178,T182 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_3_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
89743 |
0 |
0 |
T7 |
39911 |
0 |
0 |
0 |
T11 |
30994 |
0 |
0 |
0 |
T23 |
20721 |
277 |
0 |
0 |
T25 |
20968 |
0 |
0 |
0 |
T26 |
28491 |
0 |
0 |
0 |
T28 |
47134 |
0 |
0 |
0 |
T34 |
17832 |
0 |
0 |
0 |
T121 |
21745 |
0 |
0 |
0 |
T182 |
0 |
370 |
0 |
0 |
T183 |
0 |
374 |
0 |
0 |
T264 |
33915 |
0 |
0 |
0 |
T396 |
0 |
333 |
0 |
0 |
T404 |
0 |
580 |
0 |
0 |
T405 |
0 |
670 |
0 |
0 |
T417 |
0 |
709 |
0 |
0 |
T418 |
0 |
383 |
0 |
0 |
T420 |
0 |
473 |
0 |
0 |
T421 |
0 |
429 |
0 |
0 |
T423 |
19692 |
0 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1668691 |
1446789 |
0 |
0 |
T1 |
321 |
147 |
0 |
0 |
T2 |
469 |
296 |
0 |
0 |
T3 |
500 |
328 |
0 |
0 |
T4 |
390 |
218 |
0 |
0 |
T5 |
559 |
388 |
0 |
0 |
T6 |
509 |
335 |
0 |
0 |
T30 |
389 |
215 |
0 |
0 |
T68 |
713 |
541 |
0 |
0 |
T104 |
382 |
210 |
0 |
0 |
T105 |
405 |
232 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
226 |
0 |
0 |
T7 |
39911 |
0 |
0 |
0 |
T11 |
30994 |
0 |
0 |
0 |
T23 |
20721 |
1 |
0 |
0 |
T25 |
20968 |
0 |
0 |
0 |
T26 |
28491 |
0 |
0 |
0 |
T28 |
47134 |
0 |
0 |
0 |
T34 |
17832 |
0 |
0 |
0 |
T121 |
21745 |
0 |
0 |
0 |
T182 |
0 |
1 |
0 |
0 |
T183 |
0 |
1 |
0 |
0 |
T264 |
33915 |
0 |
0 |
0 |
T396 |
0 |
1 |
0 |
0 |
T404 |
0 |
2 |
0 |
0 |
T405 |
0 |
2 |
0 |
0 |
T417 |
0 |
2 |
0 |
0 |
T418 |
0 |
1 |
0 |
0 |
T420 |
0 |
1 |
0 |
0 |
T421 |
0 |
1 |
0 |
0 |
T423 |
19692 |
0 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
139789547 |
0 |
0 |
T1 |
11041 |
10513 |
0 |
0 |
T2 |
22580 |
22245 |
0 |
0 |
T3 |
28424 |
28018 |
0 |
0 |
T4 |
27950 |
26976 |
0 |
0 |
T5 |
30991 |
30702 |
0 |
0 |
T6 |
28994 |
28555 |
0 |
0 |
T30 |
23299 |
22636 |
0 |
0 |
T68 |
53404 |
53009 |
0 |
0 |
T104 |
24805 |
24018 |
0 |
0 |
T105 |
17024 |
16662 |
0 |
0 |
Line Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_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: T94 T95 T96
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: T178 T182 T183
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T178 T182 T183
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: T178 T182 T183
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: T178 T182 T183
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: T178 T182 T183
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T178 T182 T183
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: T178 T182 T183
135 1/1 txn_bits_q <= '0;
Tests: T178 T182 T183
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: T178 T182 T183
156 1/1 assign dst_wd_o = src_q;
Tests: T178 T182 T183
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: T178 T182 T183
Cond Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_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 | T178,T182,T433 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T178,T182,T183 |
1 | 1 | Covered | T178,T182,T183 |
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 | T178,T182,T183 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T178,T182,T183 |
1 | 1 | Covered | T178,T182,T183 |
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.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_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 |
T178,T182,T183 |
0 |
0 |
1 |
Covered |
T178,T182,T183 |
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 |
T178,T182,T183 |
0 |
0 |
1 |
Covered |
T178,T182,T183 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_4_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
87123 |
0 |
0 |
T182 |
46628 |
448 |
0 |
0 |
T183 |
52327 |
409 |
0 |
0 |
T396 |
59750 |
249 |
0 |
0 |
T404 |
79766 |
647 |
0 |
0 |
T405 |
120826 |
631 |
0 |
0 |
T417 |
122411 |
808 |
0 |
0 |
T418 |
51097 |
460 |
0 |
0 |
T420 |
46713 |
413 |
0 |
0 |
T421 |
70376 |
417 |
0 |
0 |
T422 |
104150 |
578 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1668691 |
1446789 |
0 |
0 |
T1 |
321 |
147 |
0 |
0 |
T2 |
469 |
296 |
0 |
0 |
T3 |
500 |
328 |
0 |
0 |
T4 |
390 |
218 |
0 |
0 |
T5 |
559 |
388 |
0 |
0 |
T6 |
509 |
335 |
0 |
0 |
T30 |
389 |
215 |
0 |
0 |
T68 |
713 |
541 |
0 |
0 |
T104 |
382 |
210 |
0 |
0 |
T105 |
405 |
232 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
224 |
0 |
0 |
T182 |
46628 |
1 |
0 |
0 |
T183 |
52327 |
1 |
0 |
0 |
T396 |
59750 |
1 |
0 |
0 |
T404 |
79766 |
2 |
0 |
0 |
T405 |
120826 |
2 |
0 |
0 |
T417 |
122411 |
2 |
0 |
0 |
T418 |
51097 |
1 |
0 |
0 |
T420 |
46713 |
1 |
0 |
0 |
T421 |
70376 |
1 |
0 |
0 |
T422 |
104150 |
2 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
139789547 |
0 |
0 |
T1 |
11041 |
10513 |
0 |
0 |
T2 |
22580 |
22245 |
0 |
0 |
T3 |
28424 |
28018 |
0 |
0 |
T4 |
27950 |
26976 |
0 |
0 |
T5 |
30991 |
30702 |
0 |
0 |
T6 |
28994 |
28555 |
0 |
0 |
T30 |
23299 |
22636 |
0 |
0 |
T68 |
53404 |
53009 |
0 |
0 |
T104 |
24805 |
24018 |
0 |
0 |
T105 |
17024 |
16662 |
0 |
0 |
Line Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_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: T72 T73 T74
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: T72 T73 T74
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T72 T73 T74
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: T72 T73 T74
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: T72 T73 T74
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: T72 T73 T74
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T72 T73 T74
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: T72 T73 T74
135 1/1 txn_bits_q <= '0;
Tests: T72 T73 T74
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: T80 T178 T182
156 1/1 assign dst_wd_o = src_q;
Tests: T80 T178 T182
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: T72 T73 T74
Cond Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_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 | T72,T73,T74 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T72,T73,T74 |
1 | 1 | Covered | T72,T73,T74 |
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 | T72,T73,T74 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T72,T73,T74 |
1 | 1 | Covered | T72,T73,T74 |
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.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_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 |
T72,T73,T74 |
0 |
0 |
1 |
Covered |
T72,T73,T74 |
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 |
T72,T73,T74 |
0 |
0 |
1 |
Covered |
T72,T73,T74 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_5_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
80484 |
0 |
0 |
T72 |
50220 |
475 |
0 |
0 |
T73 |
0 |
887 |
0 |
0 |
T74 |
0 |
387 |
0 |
0 |
T80 |
0 |
267 |
0 |
0 |
T87 |
38016 |
0 |
0 |
0 |
T88 |
36549 |
0 |
0 |
0 |
T120 |
0 |
479 |
0 |
0 |
T124 |
0 |
673 |
0 |
0 |
T125 |
0 |
646 |
0 |
0 |
T166 |
43823 |
0 |
0 |
0 |
T203 |
59720 |
0 |
0 |
0 |
T214 |
21095 |
0 |
0 |
0 |
T215 |
19968 |
0 |
0 |
0 |
T221 |
97042 |
0 |
0 |
0 |
T315 |
40841 |
0 |
0 |
0 |
T340 |
127496 |
0 |
0 |
0 |
T419 |
0 |
400 |
0 |
0 |
T424 |
0 |
479 |
0 |
0 |
T425 |
0 |
285 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1668691 |
1446789 |
0 |
0 |
T1 |
321 |
147 |
0 |
0 |
T2 |
469 |
296 |
0 |
0 |
T3 |
500 |
328 |
0 |
0 |
T4 |
390 |
218 |
0 |
0 |
T5 |
559 |
388 |
0 |
0 |
T6 |
509 |
335 |
0 |
0 |
T30 |
389 |
215 |
0 |
0 |
T68 |
713 |
541 |
0 |
0 |
T104 |
382 |
210 |
0 |
0 |
T105 |
405 |
232 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
208 |
0 |
0 |
T72 |
50220 |
1 |
0 |
0 |
T73 |
0 |
2 |
0 |
0 |
T74 |
0 |
1 |
0 |
0 |
T80 |
0 |
1 |
0 |
0 |
T87 |
38016 |
0 |
0 |
0 |
T88 |
36549 |
0 |
0 |
0 |
T120 |
0 |
1 |
0 |
0 |
T124 |
0 |
2 |
0 |
0 |
T125 |
0 |
2 |
0 |
0 |
T166 |
43823 |
0 |
0 |
0 |
T203 |
59720 |
0 |
0 |
0 |
T214 |
21095 |
0 |
0 |
0 |
T215 |
19968 |
0 |
0 |
0 |
T221 |
97042 |
0 |
0 |
0 |
T315 |
40841 |
0 |
0 |
0 |
T340 |
127496 |
0 |
0 |
0 |
T419 |
0 |
1 |
0 |
0 |
T424 |
0 |
1 |
0 |
0 |
T425 |
0 |
1 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
139789547 |
0 |
0 |
T1 |
11041 |
10513 |
0 |
0 |
T2 |
22580 |
22245 |
0 |
0 |
T3 |
28424 |
28018 |
0 |
0 |
T4 |
27950 |
26976 |
0 |
0 |
T5 |
30991 |
30702 |
0 |
0 |
T6 |
28994 |
28555 |
0 |
0 |
T30 |
23299 |
22636 |
0 |
0 |
T68 |
53404 |
53009 |
0 |
0 |
T104 |
24805 |
24018 |
0 |
0 |
T105 |
17024 |
16662 |
0 |
0 |
Line Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_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: T24 T94 T95
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: T24 T178 T182
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T24 T178 T182
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: T24 T178 T182
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: T24 T178 T182
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: T24 T178 T182
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T24 T178 T182
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: T24 T178 T182
135 1/1 txn_bits_q <= '0;
Tests: T24 T178 T182
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: T178 T182 T183
156 1/1 assign dst_wd_o = src_q;
Tests: T178 T182 T183
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: T24 T178 T182
Cond Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_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 | T24,T178,T182 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T24,T178,T182 |
1 | 1 | Covered | T24,T178,T182 |
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 | T24,T178,T182 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T24,T178,T182 |
1 | 1 | Covered | T24,T178,T182 |
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.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_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 |
T24,T178,T182 |
0 |
0 |
1 |
Covered |
T24,T178,T182 |
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 |
T24,T178,T182 |
0 |
0 |
1 |
Covered |
T24,T178,T182 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_6_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
87570 |
0 |
0 |
T24 |
35114 |
332 |
0 |
0 |
T133 |
51935 |
0 |
0 |
0 |
T182 |
0 |
441 |
0 |
0 |
T183 |
0 |
383 |
0 |
0 |
T338 |
56971 |
0 |
0 |
0 |
T376 |
440126 |
0 |
0 |
0 |
T396 |
0 |
258 |
0 |
0 |
T404 |
0 |
631 |
0 |
0 |
T405 |
0 |
602 |
0 |
0 |
T417 |
0 |
786 |
0 |
0 |
T418 |
0 |
409 |
0 |
0 |
T420 |
0 |
480 |
0 |
0 |
T421 |
0 |
450 |
0 |
0 |
T426 |
326479 |
0 |
0 |
0 |
T427 |
301031 |
0 |
0 |
0 |
T428 |
303448 |
0 |
0 |
0 |
T429 |
326005 |
0 |
0 |
0 |
T430 |
328507 |
0 |
0 |
0 |
T431 |
315904 |
0 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1668691 |
1446789 |
0 |
0 |
T1 |
321 |
147 |
0 |
0 |
T2 |
469 |
296 |
0 |
0 |
T3 |
500 |
328 |
0 |
0 |
T4 |
390 |
218 |
0 |
0 |
T5 |
559 |
388 |
0 |
0 |
T6 |
509 |
335 |
0 |
0 |
T30 |
389 |
215 |
0 |
0 |
T68 |
713 |
541 |
0 |
0 |
T104 |
382 |
210 |
0 |
0 |
T105 |
405 |
232 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
223 |
0 |
0 |
T24 |
35114 |
1 |
0 |
0 |
T133 |
51935 |
0 |
0 |
0 |
T182 |
0 |
1 |
0 |
0 |
T183 |
0 |
1 |
0 |
0 |
T338 |
56971 |
0 |
0 |
0 |
T376 |
440126 |
0 |
0 |
0 |
T396 |
0 |
1 |
0 |
0 |
T404 |
0 |
2 |
0 |
0 |
T405 |
0 |
2 |
0 |
0 |
T417 |
0 |
2 |
0 |
0 |
T418 |
0 |
1 |
0 |
0 |
T420 |
0 |
1 |
0 |
0 |
T421 |
0 |
1 |
0 |
0 |
T426 |
326479 |
0 |
0 |
0 |
T427 |
301031 |
0 |
0 |
0 |
T428 |
303448 |
0 |
0 |
0 |
T429 |
326005 |
0 |
0 |
0 |
T430 |
328507 |
0 |
0 |
0 |
T431 |
315904 |
0 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
139789547 |
0 |
0 |
T1 |
11041 |
10513 |
0 |
0 |
T2 |
22580 |
22245 |
0 |
0 |
T3 |
28424 |
28018 |
0 |
0 |
T4 |
27950 |
26976 |
0 |
0 |
T5 |
30991 |
30702 |
0 |
0 |
T6 |
28994 |
28555 |
0 |
0 |
T30 |
23299 |
22636 |
0 |
0 |
T68 |
53404 |
53009 |
0 |
0 |
T104 |
24805 |
24018 |
0 |
0 |
T105 |
17024 |
16662 |
0 |
0 |
Line Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_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: T94 T95 T96
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: T178 T182 T183
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T178 T182 T183
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: T178 T182 T183
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: T178 T182 T183
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: T178 T182 T183
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T178 T182 T183
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: T178 T182 T183
135 1/1 txn_bits_q <= '0;
Tests: T178 T182 T183
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: T178 T182 T183
156 1/1 assign dst_wd_o = src_q;
Tests: T178 T182 T183
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: T178 T182 T183
Cond Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_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 | T178,T182,T183 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T178,T182,T183 |
1 | 1 | Covered | T178,T182,T183 |
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 | T178,T182,T183 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T178,T182,T183 |
1 | 1 | Covered | T178,T182,T183 |
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.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_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 |
T178,T182,T183 |
0 |
0 |
1 |
Covered |
T178,T182,T183 |
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 |
T178,T182,T183 |
0 |
0 |
1 |
Covered |
T178,T182,T183 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_7_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
87685 |
0 |
0 |
T182 |
46628 |
429 |
0 |
0 |
T183 |
52327 |
396 |
0 |
0 |
T396 |
59750 |
283 |
0 |
0 |
T404 |
79766 |
621 |
0 |
0 |
T405 |
120826 |
599 |
0 |
0 |
T417 |
122411 |
715 |
0 |
0 |
T418 |
51097 |
459 |
0 |
0 |
T420 |
46713 |
471 |
0 |
0 |
T421 |
70376 |
377 |
0 |
0 |
T422 |
104150 |
565 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1668691 |
1446789 |
0 |
0 |
T1 |
321 |
147 |
0 |
0 |
T2 |
469 |
296 |
0 |
0 |
T3 |
500 |
328 |
0 |
0 |
T4 |
390 |
218 |
0 |
0 |
T5 |
559 |
388 |
0 |
0 |
T6 |
509 |
335 |
0 |
0 |
T30 |
389 |
215 |
0 |
0 |
T68 |
713 |
541 |
0 |
0 |
T104 |
382 |
210 |
0 |
0 |
T105 |
405 |
232 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
226 |
0 |
0 |
T182 |
46628 |
1 |
0 |
0 |
T183 |
52327 |
1 |
0 |
0 |
T396 |
59750 |
1 |
0 |
0 |
T404 |
79766 |
2 |
0 |
0 |
T405 |
120826 |
2 |
0 |
0 |
T417 |
122411 |
2 |
0 |
0 |
T418 |
51097 |
1 |
0 |
0 |
T420 |
46713 |
1 |
0 |
0 |
T421 |
70376 |
1 |
0 |
0 |
T422 |
104150 |
2 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
139789547 |
0 |
0 |
T1 |
11041 |
10513 |
0 |
0 |
T2 |
22580 |
22245 |
0 |
0 |
T3 |
28424 |
28018 |
0 |
0 |
T4 |
27950 |
26976 |
0 |
0 |
T5 |
30991 |
30702 |
0 |
0 |
T6 |
28994 |
28555 |
0 |
0 |
T30 |
23299 |
22636 |
0 |
0 |
T68 |
53404 |
53009 |
0 |
0 |
T104 |
24805 |
24018 |
0 |
0 |
T105 |
17024 |
16662 |
0 |
0 |
Line Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_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: T94 T95 T96
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: T178 T182 T183
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T178 T182 T183
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: T178 T182 T183
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: T178 T182 T183
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: T178 T182 T183
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T178 T182 T183
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: T178 T182 T183
135 1/1 txn_bits_q <= '0;
Tests: T178 T182 T183
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: T178 T182 T183
156 1/1 assign dst_wd_o = src_q;
Tests: T178 T182 T183
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: T178 T182 T183
Cond Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_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 | T178,T182,T183 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T178,T182,T183 |
1 | 1 | Covered | T178,T182,T183 |
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 | T178,T182,T183 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T178,T182,T183 |
1 | 1 | Covered | T178,T182,T183 |
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.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_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 |
T178,T182,T183 |
0 |
0 |
1 |
Covered |
T178,T182,T183 |
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 |
T178,T182,T183 |
0 |
0 |
1 |
Covered |
T178,T182,T183 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_0_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
101912 |
0 |
0 |
T182 |
46628 |
450 |
0 |
0 |
T183 |
52327 |
404 |
0 |
0 |
T396 |
59750 |
315 |
0 |
0 |
T404 |
79766 |
666 |
0 |
0 |
T405 |
120826 |
625 |
0 |
0 |
T417 |
122411 |
631 |
0 |
0 |
T418 |
51097 |
446 |
0 |
0 |
T420 |
46713 |
467 |
0 |
0 |
T421 |
70376 |
417 |
0 |
0 |
T422 |
104150 |
562 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1668691 |
1446789 |
0 |
0 |
T1 |
321 |
147 |
0 |
0 |
T2 |
469 |
296 |
0 |
0 |
T3 |
500 |
328 |
0 |
0 |
T4 |
390 |
218 |
0 |
0 |
T5 |
559 |
388 |
0 |
0 |
T6 |
509 |
335 |
0 |
0 |
T30 |
389 |
215 |
0 |
0 |
T68 |
713 |
541 |
0 |
0 |
T104 |
382 |
210 |
0 |
0 |
T105 |
405 |
232 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
257 |
0 |
0 |
T182 |
46628 |
1 |
0 |
0 |
T183 |
52327 |
1 |
0 |
0 |
T396 |
59750 |
1 |
0 |
0 |
T404 |
79766 |
2 |
0 |
0 |
T405 |
120826 |
2 |
0 |
0 |
T417 |
122411 |
2 |
0 |
0 |
T418 |
51097 |
1 |
0 |
0 |
T420 |
46713 |
1 |
0 |
0 |
T421 |
70376 |
1 |
0 |
0 |
T422 |
104150 |
2 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
139789547 |
0 |
0 |
T1 |
11041 |
10513 |
0 |
0 |
T2 |
22580 |
22245 |
0 |
0 |
T3 |
28424 |
28018 |
0 |
0 |
T4 |
27950 |
26976 |
0 |
0 |
T5 |
30991 |
30702 |
0 |
0 |
T6 |
28994 |
28555 |
0 |
0 |
T30 |
23299 |
22636 |
0 |
0 |
T68 |
53404 |
53009 |
0 |
0 |
T104 |
24805 |
24018 |
0 |
0 |
T105 |
17024 |
16662 |
0 |
0 |
Line Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_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: T87 T122 T123
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: T87 T122 T123
75 1/1 end else if (src_ack) begin
Tests: T1 T2 T3
76 1/1 src_busy_q <= 1'b0;
Tests: T87 T122 T123
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: T87 T122 T123
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: T87 T122 T123
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: T87 T122 T123
124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i};
Tests: T87 T122 T123
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: T87 T122 T123
135 1/1 txn_bits_q <= '0;
Tests: T87 T122 T123
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: T87 T122 T123
156 1/1 assign dst_wd_o = src_q;
Tests: T87 T122 T123
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: T87 T122 T123
Cond Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_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 | T87,T122,T123 |
LINE 109
EXPRESSION (src_busy_q & ((!src_ack)))
-----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T87,T122,T123 |
1 | 1 | Covered | T87,T122,T123 |
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 | T87,T122,T123 |
LINE 125
SUB-EXPRESSION (src_busy_q && src_ack)
-----1---- ---2---
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T87,T122,T123 |
1 | 1 | Covered | T87,T122,T123 |
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.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_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 |
T87,T122,T123 |
0 |
0 |
1 |
Covered |
T87,T122,T123 |
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 |
T87,T122,T123 |
0 |
0 |
1 |
Covered |
T87,T122,T123 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_1_cdc
Assertion Details
BusySrcReqChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
79519 |
0 |
0 |
T87 |
38016 |
399 |
0 |
0 |
T88 |
36549 |
0 |
0 |
0 |
T122 |
0 |
327 |
0 |
0 |
T123 |
0 |
390 |
0 |
0 |
T166 |
43823 |
0 |
0 |
0 |
T182 |
0 |
425 |
0 |
0 |
T183 |
0 |
384 |
0 |
0 |
T203 |
59720 |
0 |
0 |
0 |
T214 |
21095 |
0 |
0 |
0 |
T215 |
19968 |
0 |
0 |
0 |
T221 |
97042 |
0 |
0 |
0 |
T315 |
40841 |
0 |
0 |
0 |
T316 |
137095 |
0 |
0 |
0 |
T340 |
127496 |
0 |
0 |
0 |
T396 |
0 |
348 |
0 |
0 |
T404 |
0 |
614 |
0 |
0 |
T405 |
0 |
664 |
0 |
0 |
T417 |
0 |
707 |
0 |
0 |
T418 |
0 |
387 |
0 |
0 |
DstReqKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1668691 |
1446789 |
0 |
0 |
T1 |
321 |
147 |
0 |
0 |
T2 |
469 |
296 |
0 |
0 |
T3 |
500 |
328 |
0 |
0 |
T4 |
390 |
218 |
0 |
0 |
T5 |
559 |
388 |
0 |
0 |
T6 |
509 |
335 |
0 |
0 |
T30 |
389 |
215 |
0 |
0 |
T68 |
713 |
541 |
0 |
0 |
T104 |
382 |
210 |
0 |
0 |
T105 |
405 |
232 |
0 |
0 |
SrcAckBusyChk_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
206 |
0 |
0 |
T87 |
38016 |
1 |
0 |
0 |
T88 |
36549 |
0 |
0 |
0 |
T122 |
0 |
1 |
0 |
0 |
T123 |
0 |
1 |
0 |
0 |
T166 |
43823 |
0 |
0 |
0 |
T182 |
0 |
1 |
0 |
0 |
T183 |
0 |
1 |
0 |
0 |
T203 |
59720 |
0 |
0 |
0 |
T214 |
21095 |
0 |
0 |
0 |
T215 |
19968 |
0 |
0 |
0 |
T221 |
97042 |
0 |
0 |
0 |
T315 |
40841 |
0 |
0 |
0 |
T316 |
137095 |
0 |
0 |
0 |
T340 |
127496 |
0 |
0 |
0 |
T396 |
0 |
1 |
0 |
0 |
T404 |
0 |
2 |
0 |
0 |
T405 |
0 |
2 |
0 |
0 |
T417 |
0 |
2 |
0 |
0 |
T418 |
0 |
1 |
0 |
0 |
SrcBusyKnown_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
140595849 |
139789547 |
0 |
0 |
T1 |
11041 |
10513 |
0 |
0 |
T2 |
22580 |
22245 |
0 |
0 |
T3 |
28424 |
28018 |
0 |
0 |
T4 |
27950 |
26976 |
0 |
0 |
T5 |
30991 |
30702 |
0 |
0 |
T6 |
28994 |
28555 |
0 |
0 |
T30 |
23299 |
22636 |
0 |
0 |
T68 |
53404 |
53009 |
0 |
0 |
T104 |
24805 |
24018 |
0 |
0 |
T105 |
17024 |
16662 |
0 |
0 |