dashboard | hierarchy | modlist | groups | tests | asserts

Module Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_2_cdc

Instance :
SCORELINECONDTOGGLEFSMBRANCHASSERT
97.73 100.00 90.91 100.00 100.00


Instance's subtree :
SCORELINECONDTOGGLEFSMBRANCHASSERT
99.17 100.00 96.67 100.00 100.00


Parent :
SCORELINECONDTOGGLEFSMBRANCHASSERTNAME
99.25 99.77 97.22 100.00 100.00 u_reg


Subtrees :
NAMESCORELINECONDTOGGLEFSMBRANCHASSERT
u_arb 100.00 100.00 100.00 100.00 100.00
u_src_to_dst_req 100.00 100.00 100.00 100.00 100.00


Module Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_3_cdc

Instance :
SCORELINECONDTOGGLEFSMBRANCHASSERT
97.73 100.00 90.91 100.00 100.00


Instance's subtree :
SCORELINECONDTOGGLEFSMBRANCHASSERT
99.17 100.00 96.67 100.00 100.00


Parent :
SCORELINECONDTOGGLEFSMBRANCHASSERTNAME
99.25 99.77 97.22 100.00 100.00 u_reg


Subtrees :
NAMESCORELINECONDTOGGLEFSMBRANCHASSERT
u_arb 100.00 100.00 100.00 100.00 100.00
u_src_to_dst_req 100.00 100.00 100.00 100.00 100.00


Module Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_4_cdc

Instance :
SCORELINECONDTOGGLEFSMBRANCHASSERT
97.73 100.00 90.91 100.00 100.00


Instance's subtree :
SCORELINECONDTOGGLEFSMBRANCHASSERT
99.17 100.00 96.67 100.00 100.00


Parent :
SCORELINECONDTOGGLEFSMBRANCHASSERTNAME
99.25 99.77 97.22 100.00 100.00 u_reg


Subtrees :
NAMESCORELINECONDTOGGLEFSMBRANCHASSERT
u_arb 100.00 100.00 100.00 100.00 100.00
u_src_to_dst_req 100.00 100.00 100.00 100.00 100.00


Module Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_5_cdc

Instance :
SCORELINECONDTOGGLEFSMBRANCHASSERT
97.73 100.00 90.91 100.00 100.00


Instance's subtree :
SCORELINECONDTOGGLEFSMBRANCHASSERT
99.17 100.00 96.67 100.00 100.00


Parent :
SCORELINECONDTOGGLEFSMBRANCHASSERTNAME
99.25 99.77 97.22 100.00 100.00 u_reg


Subtrees :
NAMESCORELINECONDTOGGLEFSMBRANCHASSERT
u_arb 100.00 100.00 100.00 100.00 100.00
u_src_to_dst_req 100.00 100.00 100.00 100.00 100.00


Module Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_6_cdc

Instance :
SCORELINECONDTOGGLEFSMBRANCHASSERT
97.73 100.00 90.91 100.00 100.00


Instance's subtree :
SCORELINECONDTOGGLEFSMBRANCHASSERT
99.17 100.00 96.67 100.00 100.00


Parent :
SCORELINECONDTOGGLEFSMBRANCHASSERTNAME
99.25 99.77 97.22 100.00 100.00 u_reg


Subtrees :
NAMESCORELINECONDTOGGLEFSMBRANCHASSERT
u_arb 100.00 100.00 100.00 100.00 100.00
u_src_to_dst_req 100.00 100.00 100.00 100.00 100.00


Module Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_7_cdc

Instance :
SCORELINECONDTOGGLEFSMBRANCHASSERT
97.73 100.00 90.91 100.00 100.00


Instance's subtree :
SCORELINECONDTOGGLEFSMBRANCHASSERT
99.17 100.00 96.67 100.00 100.00


Parent :
SCORELINECONDTOGGLEFSMBRANCHASSERTNAME
99.25 99.77 97.22 100.00 100.00 u_reg


Subtrees :
NAMESCORELINECONDTOGGLEFSMBRANCHASSERT
u_arb 100.00 100.00 100.00 100.00 100.00
u_src_to_dst_req 100.00 100.00 100.00 100.00 100.00


Module Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_cause_cdc

Instance :
SCORELINECONDTOGGLEFSMBRANCHASSERT
96.43 100.00 85.71 100.00 100.00


Instance's subtree :
SCORELINECONDTOGGLEFSMBRANCHASSERT
93.68 96.99 84.51 93.22 100.00


Parent :
SCORELINECONDTOGGLEFSMBRANCHASSERTNAME
99.25 99.77 97.22 100.00 100.00 u_reg


Subtrees :
NAMESCORELINECONDTOGGLEFSMBRANCHASSERT
u_arb 92.06 95.92 81.63 90.70 100.00
u_src_to_dst_req 100.00 100.00 100.00 100.00 100.00

Go back
Module Instances:
tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_2_cdc
tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_3_cdc
tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_4_cdc
tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_5_cdc
tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_6_cdc
tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_7_cdc
tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_cause_cdc
Line Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_2_cdc
Line No.TotalCoveredPercent
TOTAL2222100.00
CONT_ASSIGN6511100.00
ALWAYS7166100.00
CONT_ASSIGN8511100.00
CONT_ASSIGN10911100.00
ALWAYS11599100.00
CONT_ASSIGN15011100.00
CONT_ASSIGN15511100.00
CONT_ASSIGN15611100.00
CONT_ASSIGN20011100.00

64 65 1/1 assign src_req = src_we_i | src_re_i; Tests: T32 T85 T86  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: T32 T96 T153  75 1/1 end else if (src_ack) begin Tests: T1 T2 T3  76 1/1 src_busy_q <= 1'b0; Tests: T32 T96 T153  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: T32 T96 T153  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: T32 T96 T153  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: T32 T96 T153  124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i}; Tests: T32 T96 T153  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: T32 T96 T153  135 1/1 txn_bits_q <= '0; Tests: T32 T96 T153  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: T32 T96 T153  156 1/1 assign dst_wd_o = src_q; Tests: T32 T96 T153  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: T32 T96 T153 

Cond Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_2_cdc
TotalCoveredPercent
Conditions111090.91
Logical111090.91
Non-Logical00
Event00

 LINE       65
 EXPRESSION (src_we_i | src_re_i)
             ----1---   ----2---
-1--2-StatusTests
00CoveredT1,T2,T3
01Unreachable
10CoveredT32,T250,T96

 LINE       109
 EXPRESSION (src_busy_q & ((!src_ack)))
             -----1----   ------2-----
-1--2-StatusTests
01CoveredT1,T2,T3
10CoveredT32,T96,T153
11CoveredT32,T96,T153

 LINE       125
 EXPRESSION ((src_busy_q && src_ack) || (src_update && ((!busy))))
             -----------1-----------    ------------2------------
-1--2-StatusTests
00CoveredT1,T2,T3
01Unreachable
10CoveredT32,T96,T153

 LINE       125
 SUB-EXPRESSION (src_busy_q && src_ack)
                 -----1----    ---2---
-1--2-StatusTests
01Not Covered
10CoveredT32,T96,T153
11CoveredT32,T96,T153

 LINE       125
 SUB-EXPRESSION (src_update && ((!busy)))
                 -----1----    ----2----
-1--2-StatusTests
01CoveredT1,T2,T3
10Unreachable
11Unreachable

Branch Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_2_cdc
Line No.TotalCoveredPercent
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-StatusTests
1 - - Covered T1,T2,T3
0 1 - Covered T32,T96,T153
0 0 1 Covered T32,T96,T153
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-StatusTests
1 - - Covered T1,T2,T3
0 1 - Covered T32,T96,T153
0 0 1 Covered T32,T96,T153
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_2_cdc
TotalAttemptedPercentSucceeded/MatchedPercent
Assertions 4 4 100.00 4 100.00
Cover properties 0 0 0
Cover sequences 0 0 0
Total 4 4 100.00 4 100.00




Assertion Details

NameAttemptsReal SuccessesFailuresIncomplete
BusySrcReqChk_A 126457039 79158 0 0
DstReqKnown_A 1533647 1356605 0 0
SrcAckBusyChk_A 126457039 203 0 0
SrcBusyKnown_A 126457039 125819088 0 0


BusySrcReqChk_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 126457039 79158 0 0
T32 245200 338 0 0
T80 274520 0 0 0
T179 101118 0 0 0
T182 44652 0 0 0
T219 224013 0 0 0
T220 253782 0 0 0
T311 100479 0 0 0
T371 0 414 0 0
T374 0 868 0 0
T375 0 243 0 0
T383 0 262 0 0
T390 0 372 0 0
T391 0 534 0 0
T392 0 666 0 0
T393 0 763 0 0
T394 0 772 0 0
T395 40649 0 0 0
T396 35495 0 0 0
T397 21637 0 0 0

DstReqKnown_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 1533647 1356605 0 0
T1 507 335 0 0
T2 428 256 0 0
T3 615 443 0 0
T4 558 385 0 0
T11 495 324 0 0
T22 728 557 0 0
T24 686 514 0 0
T31 564 331 0 0
T39 815 640 0 0
T97 333 159 0 0

SrcAckBusyChk_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 126457039 203 0 0
T32 245200 1 0 0
T80 274520 0 0 0
T179 101118 0 0 0
T182 44652 0 0 0
T219 224013 0 0 0
T220 253782 0 0 0
T311 100479 0 0 0
T371 0 1 0 0
T374 0 2 0 0
T375 0 1 0 0
T383 0 1 0 0
T390 0 1 0 0
T391 0 2 0 0
T392 0 2 0 0
T393 0 2 0 0
T394 0 2 0 0
T395 40649 0 0 0
T396 35495 0 0 0
T397 21637 0 0 0

SrcBusyKnown_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 126457039 125819088 0 0
T1 36435 35822 0 0
T2 17245 16877 0 0
T3 52205 51443 0 0
T4 44432 43807 0 0
T11 32125 31678 0 0
T22 40201 39891 0 0
T24 53419 52941 0 0
T31 24511 23756 0 0
T39 55223 54746 0 0
T97 20174 19259 0 0

Line Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_3_cdc
Line No.TotalCoveredPercent
TOTAL2222100.00
CONT_ASSIGN6511100.00
ALWAYS7166100.00
CONT_ASSIGN8511100.00
CONT_ASSIGN10911100.00
ALWAYS11599100.00
CONT_ASSIGN15011100.00
CONT_ASSIGN15511100.00
CONT_ASSIGN15611100.00
CONT_ASSIGN20011100.00

64 65 1/1 assign src_req = src_we_i | src_re_i; Tests: T32 T85 T86  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: T32 T96 T153  75 1/1 end else if (src_ack) begin Tests: T1 T2 T3  76 1/1 src_busy_q <= 1'b0; Tests: T32 T96 T153  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: T32 T96 T153  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: T32 T96 T153  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: T32 T96 T153  124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i}; Tests: T32 T96 T153  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: T32 T96 T153  135 1/1 txn_bits_q <= '0; Tests: T32 T96 T153  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: T32 T96 T153  156 1/1 assign dst_wd_o = src_q; Tests: T32 T96 T153  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: T32 T96 T153 

Cond Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_3_cdc
TotalCoveredPercent
Conditions111090.91
Logical111090.91
Non-Logical00
Event00

 LINE       65
 EXPRESSION (src_we_i | src_re_i)
             ----1---   ----2---
-1--2-StatusTests
00CoveredT1,T2,T3
01Unreachable
10CoveredT32,T96,T153

 LINE       109
 EXPRESSION (src_busy_q & ((!src_ack)))
             -----1----   ------2-----
-1--2-StatusTests
01CoveredT1,T2,T3
10CoveredT32,T96,T153
11CoveredT32,T96,T153

 LINE       125
 EXPRESSION ((src_busy_q && src_ack) || (src_update && ((!busy))))
             -----------1-----------    ------------2------------
-1--2-StatusTests
00CoveredT1,T2,T3
01Unreachable
10CoveredT32,T96,T153

 LINE       125
 SUB-EXPRESSION (src_busy_q && src_ack)
                 -----1----    ---2---
-1--2-StatusTests
01Not Covered
10CoveredT32,T96,T153
11CoveredT32,T96,T153

 LINE       125
 SUB-EXPRESSION (src_update && ((!busy)))
                 -----1----    ----2----
-1--2-StatusTests
01CoveredT1,T2,T3
10Unreachable
11Unreachable

Branch Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_3_cdc
Line No.TotalCoveredPercent
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-StatusTests
1 - - Covered T1,T2,T3
0 1 - Covered T32,T96,T153
0 0 1 Covered T32,T96,T153
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-StatusTests
1 - - Covered T1,T2,T3
0 1 - Covered T32,T96,T153
0 0 1 Covered T32,T96,T153
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_3_cdc
TotalAttemptedPercentSucceeded/MatchedPercent
Assertions 4 4 100.00 4 100.00
Cover properties 0 0 0
Cover sequences 0 0 0
Total 4 4 100.00 4 100.00




Assertion Details

NameAttemptsReal SuccessesFailuresIncomplete
BusySrcReqChk_A 126457039 66178 0 0
DstReqKnown_A 1533647 1356605 0 0
SrcAckBusyChk_A 126457039 172 0 0
SrcBusyKnown_A 126457039 125819088 0 0


BusySrcReqChk_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 126457039 66178 0 0
T32 245200 256 0 0
T80 274520 0 0 0
T179 101118 0 0 0
T182 44652 0 0 0
T219 224013 0 0 0
T220 253782 0 0 0
T311 100479 0 0 0
T371 0 429 0 0
T374 0 841 0 0
T375 0 252 0 0
T383 0 255 0 0
T390 0 467 0 0
T391 0 607 0 0
T392 0 677 0 0
T393 0 685 0 0
T394 0 784 0 0
T395 40649 0 0 0
T396 35495 0 0 0
T397 21637 0 0 0

DstReqKnown_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 1533647 1356605 0 0
T1 507 335 0 0
T2 428 256 0 0
T3 615 443 0 0
T4 558 385 0 0
T11 495 324 0 0
T22 728 557 0 0
T24 686 514 0 0
T31 564 331 0 0
T39 815 640 0 0
T97 333 159 0 0

SrcAckBusyChk_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 126457039 172 0 0
T32 245200 1 0 0
T80 274520 0 0 0
T179 101118 0 0 0
T182 44652 0 0 0
T219 224013 0 0 0
T220 253782 0 0 0
T311 100479 0 0 0
T371 0 1 0 0
T374 0 2 0 0
T375 0 1 0 0
T383 0 1 0 0
T390 0 1 0 0
T391 0 2 0 0
T392 0 2 0 0
T393 0 2 0 0
T394 0 2 0 0
T395 40649 0 0 0
T396 35495 0 0 0
T397 21637 0 0 0

SrcBusyKnown_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 126457039 125819088 0 0
T1 36435 35822 0 0
T2 17245 16877 0 0
T3 52205 51443 0 0
T4 44432 43807 0 0
T11 32125 31678 0 0
T22 40201 39891 0 0
T24 53419 52941 0 0
T31 24511 23756 0 0
T39 55223 54746 0 0
T97 20174 19259 0 0

Line Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_4_cdc
Line No.TotalCoveredPercent
TOTAL2222100.00
CONT_ASSIGN6511100.00
ALWAYS7166100.00
CONT_ASSIGN8511100.00
CONT_ASSIGN10911100.00
ALWAYS11599100.00
CONT_ASSIGN15011100.00
CONT_ASSIGN15511100.00
CONT_ASSIGN15611100.00
CONT_ASSIGN20011100.00

64 65 1/1 assign src_req = src_we_i | src_re_i; Tests: T32 T85 T86  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: T32 T96 T153  75 1/1 end else if (src_ack) begin Tests: T1 T2 T3  76 1/1 src_busy_q <= 1'b0; Tests: T32 T96 T153  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: T32 T96 T153  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: T32 T96 T153  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: T32 T96 T153  124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i}; Tests: T32 T96 T153  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: T32 T96 T153  135 1/1 txn_bits_q <= '0; Tests: T32 T96 T153  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: T32 T96 T153  156 1/1 assign dst_wd_o = src_q; Tests: T32 T96 T153  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: T32 T96 T153 

Cond Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_4_cdc
TotalCoveredPercent
Conditions111090.91
Logical111090.91
Non-Logical00
Event00

 LINE       65
 EXPRESSION (src_we_i | src_re_i)
             ----1---   ----2---
-1--2-StatusTests
00CoveredT1,T2,T3
01Unreachable
10CoveredT32,T96,T153

 LINE       109
 EXPRESSION (src_busy_q & ((!src_ack)))
             -----1----   ------2-----
-1--2-StatusTests
01CoveredT1,T2,T3
10CoveredT32,T96,T153
11CoveredT32,T96,T153

 LINE       125
 EXPRESSION ((src_busy_q && src_ack) || (src_update && ((!busy))))
             -----------1-----------    ------------2------------
-1--2-StatusTests
00CoveredT1,T2,T3
01Unreachable
10CoveredT32,T96,T153

 LINE       125
 SUB-EXPRESSION (src_busy_q && src_ack)
                 -----1----    ---2---
-1--2-StatusTests
01Not Covered
10CoveredT32,T96,T153
11CoveredT32,T96,T153

 LINE       125
 SUB-EXPRESSION (src_update && ((!busy)))
                 -----1----    ----2----
-1--2-StatusTests
01CoveredT1,T2,T3
10Unreachable
11Unreachable

Branch Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_4_cdc
Line No.TotalCoveredPercent
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-StatusTests
1 - - Covered T1,T2,T3
0 1 - Covered T32,T96,T153
0 0 1 Covered T32,T96,T153
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-StatusTests
1 - - Covered T1,T2,T3
0 1 - Covered T32,T96,T153
0 0 1 Covered T32,T96,T153
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_4_cdc
TotalAttemptedPercentSucceeded/MatchedPercent
Assertions 4 4 100.00 4 100.00
Cover properties 0 0 0
Cover sequences 0 0 0
Total 4 4 100.00 4 100.00




Assertion Details

NameAttemptsReal SuccessesFailuresIncomplete
BusySrcReqChk_A 126457039 72386 0 0
DstReqKnown_A 1533647 1356605 0 0
SrcAckBusyChk_A 126457039 186 0 0
SrcBusyKnown_A 126457039 125819088 0 0


BusySrcReqChk_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 126457039 72386 0 0
T32 245200 307 0 0
T80 274520 0 0 0
T179 101118 0 0 0
T182 44652 0 0 0
T219 224013 0 0 0
T220 253782 0 0 0
T311 100479 0 0 0
T371 0 390 0 0
T374 0 897 0 0
T375 0 285 0 0
T383 0 249 0 0
T390 0 369 0 0
T391 0 584 0 0
T392 0 709 0 0
T393 0 641 0 0
T394 0 690 0 0
T395 40649 0 0 0
T396 35495 0 0 0
T397 21637 0 0 0

DstReqKnown_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 1533647 1356605 0 0
T1 507 335 0 0
T2 428 256 0 0
T3 615 443 0 0
T4 558 385 0 0
T11 495 324 0 0
T22 728 557 0 0
T24 686 514 0 0
T31 564 331 0 0
T39 815 640 0 0
T97 333 159 0 0

SrcAckBusyChk_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 126457039 186 0 0
T32 245200 1 0 0
T80 274520 0 0 0
T179 101118 0 0 0
T182 44652 0 0 0
T219 224013 0 0 0
T220 253782 0 0 0
T311 100479 0 0 0
T371 0 1 0 0
T374 0 2 0 0
T375 0 1 0 0
T383 0 1 0 0
T390 0 1 0 0
T391 0 2 0 0
T392 0 2 0 0
T393 0 2 0 0
T394 0 2 0 0
T395 40649 0 0 0
T396 35495 0 0 0
T397 21637 0 0 0

SrcBusyKnown_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 126457039 125819088 0 0
T1 36435 35822 0 0
T2 17245 16877 0 0
T3 52205 51443 0 0
T4 44432 43807 0 0
T11 32125 31678 0 0
T22 40201 39891 0 0
T24 53419 52941 0 0
T31 24511 23756 0 0
T39 55223 54746 0 0
T97 20174 19259 0 0

Line Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_5_cdc
Line No.TotalCoveredPercent
TOTAL2222100.00
CONT_ASSIGN6511100.00
ALWAYS7166100.00
CONT_ASSIGN8511100.00
CONT_ASSIGN10911100.00
ALWAYS11599100.00
CONT_ASSIGN15011100.00
CONT_ASSIGN15511100.00
CONT_ASSIGN15611100.00
CONT_ASSIGN20011100.00

64 65 1/1 assign src_req = src_we_i | src_re_i; Tests: T32 T85 T86  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: T32 T96 T153  75 1/1 end else if (src_ack) begin Tests: T1 T2 T3  76 1/1 src_busy_q <= 1'b0; Tests: T32 T96 T153  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: T32 T96 T153  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: T32 T96 T153  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: T32 T96 T153  124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i}; Tests: T32 T96 T153  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: T32 T96 T153  135 1/1 txn_bits_q <= '0; Tests: T32 T96 T153  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: T32 T96 T153  156 1/1 assign dst_wd_o = src_q; Tests: T32 T96 T153  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: T32 T96 T153 

Cond Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_5_cdc
TotalCoveredPercent
Conditions111090.91
Logical111090.91
Non-Logical00
Event00

 LINE       65
 EXPRESSION (src_we_i | src_re_i)
             ----1---   ----2---
-1--2-StatusTests
00CoveredT1,T2,T3
01Unreachable
10CoveredT32,T96,T153

 LINE       109
 EXPRESSION (src_busy_q & ((!src_ack)))
             -----1----   ------2-----
-1--2-StatusTests
01CoveredT1,T2,T3
10CoveredT32,T96,T153
11CoveredT32,T96,T153

 LINE       125
 EXPRESSION ((src_busy_q && src_ack) || (src_update && ((!busy))))
             -----------1-----------    ------------2------------
-1--2-StatusTests
00CoveredT1,T2,T3
01Unreachable
10CoveredT32,T96,T153

 LINE       125
 SUB-EXPRESSION (src_busy_q && src_ack)
                 -----1----    ---2---
-1--2-StatusTests
01Not Covered
10CoveredT32,T96,T153
11CoveredT32,T96,T153

 LINE       125
 SUB-EXPRESSION (src_update && ((!busy)))
                 -----1----    ----2----
-1--2-StatusTests
01CoveredT1,T2,T3
10Unreachable
11Unreachable

Branch Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_5_cdc
Line No.TotalCoveredPercent
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-StatusTests
1 - - Covered T1,T2,T3
0 1 - Covered T32,T96,T153
0 0 1 Covered T32,T96,T153
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-StatusTests
1 - - Covered T1,T2,T3
0 1 - Covered T32,T96,T153
0 0 1 Covered T32,T96,T153
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_5_cdc
TotalAttemptedPercentSucceeded/MatchedPercent
Assertions 4 4 100.00 4 100.00
Cover properties 0 0 0
Cover sequences 0 0 0
Total 4 4 100.00 4 100.00




Assertion Details

NameAttemptsReal SuccessesFailuresIncomplete
BusySrcReqChk_A 126457039 74381 0 0
DstReqKnown_A 1533647 1356605 0 0
SrcAckBusyChk_A 126457039 191 0 0
SrcBusyKnown_A 126457039 125819088 0 0


BusySrcReqChk_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 126457039 74381 0 0
T32 245200 294 0 0
T80 274520 0 0 0
T179 101118 0 0 0
T182 44652 0 0 0
T219 224013 0 0 0
T220 253782 0 0 0
T311 100479 0 0 0
T371 0 372 0 0
T374 0 898 0 0
T375 0 247 0 0
T383 0 253 0 0
T390 0 416 0 0
T391 0 711 0 0
T392 0 749 0 0
T393 0 761 0 0
T394 0 744 0 0
T395 40649 0 0 0
T396 35495 0 0 0
T397 21637 0 0 0

DstReqKnown_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 1533647 1356605 0 0
T1 507 335 0 0
T2 428 256 0 0
T3 615 443 0 0
T4 558 385 0 0
T11 495 324 0 0
T22 728 557 0 0
T24 686 514 0 0
T31 564 331 0 0
T39 815 640 0 0
T97 333 159 0 0

SrcAckBusyChk_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 126457039 191 0 0
T32 245200 1 0 0
T80 274520 0 0 0
T179 101118 0 0 0
T182 44652 0 0 0
T219 224013 0 0 0
T220 253782 0 0 0
T311 100479 0 0 0
T371 0 1 0 0
T374 0 2 0 0
T375 0 1 0 0
T383 0 1 0 0
T390 0 1 0 0
T391 0 2 0 0
T392 0 2 0 0
T393 0 2 0 0
T394 0 2 0 0
T395 40649 0 0 0
T396 35495 0 0 0
T397 21637 0 0 0

SrcBusyKnown_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 126457039 125819088 0 0
T1 36435 35822 0 0
T2 17245 16877 0 0
T3 52205 51443 0 0
T4 44432 43807 0 0
T11 32125 31678 0 0
T22 40201 39891 0 0
T24 53419 52941 0 0
T31 24511 23756 0 0
T39 55223 54746 0 0
T97 20174 19259 0 0

Line Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_6_cdc
Line No.TotalCoveredPercent
TOTAL2222100.00
CONT_ASSIGN6511100.00
ALWAYS7166100.00
CONT_ASSIGN8511100.00
CONT_ASSIGN10911100.00
ALWAYS11599100.00
CONT_ASSIGN15011100.00
CONT_ASSIGN15511100.00
CONT_ASSIGN15611100.00
CONT_ASSIGN20011100.00

64 65 1/1 assign src_req = src_we_i | src_re_i; Tests: T32 T85 T86  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: T32 T96 T153  75 1/1 end else if (src_ack) begin Tests: T1 T2 T3  76 1/1 src_busy_q <= 1'b0; Tests: T32 T96 T153  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: T32 T96 T153  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: T32 T96 T153  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: T32 T96 T153  124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i}; Tests: T32 T96 T153  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: T32 T96 T153  135 1/1 txn_bits_q <= '0; Tests: T32 T96 T153  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: T32 T96 T153  156 1/1 assign dst_wd_o = src_q; Tests: T32 T96 T153  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: T32 T96 T153 

Cond Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_6_cdc
TotalCoveredPercent
Conditions111090.91
Logical111090.91
Non-Logical00
Event00

 LINE       65
 EXPRESSION (src_we_i | src_re_i)
             ----1---   ----2---
-1--2-StatusTests
00CoveredT1,T2,T3
01Unreachable
10CoveredT32,T96,T153

 LINE       109
 EXPRESSION (src_busy_q & ((!src_ack)))
             -----1----   ------2-----
-1--2-StatusTests
01CoveredT1,T2,T3
10CoveredT32,T96,T153
11CoveredT32,T96,T153

 LINE       125
 EXPRESSION ((src_busy_q && src_ack) || (src_update && ((!busy))))
             -----------1-----------    ------------2------------
-1--2-StatusTests
00CoveredT1,T2,T3
01Unreachable
10CoveredT32,T96,T153

 LINE       125
 SUB-EXPRESSION (src_busy_q && src_ack)
                 -----1----    ---2---
-1--2-StatusTests
01Not Covered
10CoveredT32,T96,T153
11CoveredT32,T96,T153

 LINE       125
 SUB-EXPRESSION (src_update && ((!busy)))
                 -----1----    ----2----
-1--2-StatusTests
01CoveredT1,T2,T3
10Unreachable
11Unreachable

Branch Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_6_cdc
Line No.TotalCoveredPercent
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-StatusTests
1 - - Covered T1,T2,T3
0 1 - Covered T32,T96,T153
0 0 1 Covered T32,T96,T153
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-StatusTests
1 - - Covered T1,T2,T3
0 1 - Covered T32,T96,T153
0 0 1 Covered T32,T96,T153
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_6_cdc
TotalAttemptedPercentSucceeded/MatchedPercent
Assertions 4 4 100.00 4 100.00
Cover properties 0 0 0
Cover sequences 0 0 0
Total 4 4 100.00 4 100.00




Assertion Details

NameAttemptsReal SuccessesFailuresIncomplete
BusySrcReqChk_A 126457039 74814 0 0
DstReqKnown_A 1533647 1356605 0 0
SrcAckBusyChk_A 126457039 191 0 0
SrcBusyKnown_A 126457039 125819088 0 0


BusySrcReqChk_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 126457039 74814 0 0
T32 245200 348 0 0
T80 274520 0 0 0
T179 101118 0 0 0
T182 44652 0 0 0
T219 224013 0 0 0
T220 253782 0 0 0
T311 100479 0 0 0
T371 0 374 0 0
T374 0 959 0 0
T375 0 279 0 0
T383 0 263 0 0
T390 0 379 0 0
T391 0 630 0 0
T392 0 769 0 0
T393 0 699 0 0
T394 0 762 0 0
T395 40649 0 0 0
T396 35495 0 0 0
T397 21637 0 0 0

DstReqKnown_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 1533647 1356605 0 0
T1 507 335 0 0
T2 428 256 0 0
T3 615 443 0 0
T4 558 385 0 0
T11 495 324 0 0
T22 728 557 0 0
T24 686 514 0 0
T31 564 331 0 0
T39 815 640 0 0
T97 333 159 0 0

SrcAckBusyChk_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 126457039 191 0 0
T32 245200 1 0 0
T80 274520 0 0 0
T179 101118 0 0 0
T182 44652 0 0 0
T219 224013 0 0 0
T220 253782 0 0 0
T311 100479 0 0 0
T371 0 1 0 0
T374 0 2 0 0
T375 0 1 0 0
T383 0 1 0 0
T390 0 1 0 0
T391 0 2 0 0
T392 0 2 0 0
T393 0 2 0 0
T394 0 2 0 0
T395 40649 0 0 0
T396 35495 0 0 0
T397 21637 0 0 0

SrcBusyKnown_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 126457039 125819088 0 0
T1 36435 35822 0 0
T2 17245 16877 0 0
T3 52205 51443 0 0
T4 44432 43807 0 0
T11 32125 31678 0 0
T22 40201 39891 0 0
T24 53419 52941 0 0
T31 24511 23756 0 0
T39 55223 54746 0 0
T97 20174 19259 0 0

Line Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_7_cdc
Line No.TotalCoveredPercent
TOTAL2222100.00
CONT_ASSIGN6511100.00
ALWAYS7166100.00
CONT_ASSIGN8511100.00
CONT_ASSIGN10911100.00
ALWAYS11599100.00
CONT_ASSIGN15011100.00
CONT_ASSIGN15511100.00
CONT_ASSIGN15611100.00
CONT_ASSIGN20011100.00

64 65 1/1 assign src_req = src_we_i | src_re_i; Tests: T32 T85 T86  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: T32 T96 T153  75 1/1 end else if (src_ack) begin Tests: T1 T2 T3  76 1/1 src_busy_q <= 1'b0; Tests: T32 T96 T153  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: T32 T96 T153  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: T32 T96 T153  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: T32 T96 T153  124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i}; Tests: T32 T96 T153  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: T32 T96 T153  135 1/1 txn_bits_q <= '0; Tests: T32 T96 T153  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: T32 T96 T153  156 1/1 assign dst_wd_o = src_q; Tests: T32 T96 T153  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: T32 T96 T153 

Cond Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_7_cdc
TotalCoveredPercent
Conditions111090.91
Logical111090.91
Non-Logical00
Event00

 LINE       65
 EXPRESSION (src_we_i | src_re_i)
             ----1---   ----2---
-1--2-StatusTests
00CoveredT1,T2,T3
01Unreachable
10CoveredT32,T96,T153

 LINE       109
 EXPRESSION (src_busy_q & ((!src_ack)))
             -----1----   ------2-----
-1--2-StatusTests
01CoveredT1,T2,T3
10CoveredT32,T96,T153
11CoveredT32,T96,T153

 LINE       125
 EXPRESSION ((src_busy_q && src_ack) || (src_update && ((!busy))))
             -----------1-----------    ------------2------------
-1--2-StatusTests
00CoveredT1,T2,T3
01Unreachable
10CoveredT32,T96,T153

 LINE       125
 SUB-EXPRESSION (src_busy_q && src_ack)
                 -----1----    ---2---
-1--2-StatusTests
01Not Covered
10CoveredT32,T96,T153
11CoveredT32,T96,T153

 LINE       125
 SUB-EXPRESSION (src_update && ((!busy)))
                 -----1----    ----2----
-1--2-StatusTests
01CoveredT1,T2,T3
10Unreachable
11Unreachable

Branch Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_detector_cnt_th_7_cdc
Line No.TotalCoveredPercent
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-StatusTests
1 - - Covered T1,T2,T3
0 1 - Covered T32,T96,T153
0 0 1 Covered T32,T96,T153
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-StatusTests
1 - - Covered T1,T2,T3
0 1 - Covered T32,T96,T153
0 0 1 Covered T32,T96,T153
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_7_cdc
TotalAttemptedPercentSucceeded/MatchedPercent
Assertions 4 4 100.00 4 100.00
Cover properties 0 0 0
Cover sequences 0 0 0
Total 4 4 100.00 4 100.00




Assertion Details

NameAttemptsReal SuccessesFailuresIncomplete
BusySrcReqChk_A 126457039 88789 0 0
DstReqKnown_A 1533647 1356605 0 0
SrcAckBusyChk_A 126457039 226 0 0
SrcBusyKnown_A 126457039 125819088 0 0


BusySrcReqChk_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 126457039 88789 0 0
T32 245200 242 0 0
T80 274520 0 0 0
T179 101118 0 0 0
T182 44652 0 0 0
T219 224013 0 0 0
T220 253782 0 0 0
T311 100479 0 0 0
T371 0 380 0 0
T374 0 787 0 0
T375 0 289 0 0
T383 0 340 0 0
T390 0 470 0 0
T391 0 583 0 0
T392 0 746 0 0
T393 0 748 0 0
T394 0 755 0 0
T395 40649 0 0 0
T396 35495 0 0 0
T397 21637 0 0 0

DstReqKnown_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 1533647 1356605 0 0
T1 507 335 0 0
T2 428 256 0 0
T3 615 443 0 0
T4 558 385 0 0
T11 495 324 0 0
T22 728 557 0 0
T24 686 514 0 0
T31 564 331 0 0
T39 815 640 0 0
T97 333 159 0 0

SrcAckBusyChk_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 126457039 226 0 0
T32 245200 1 0 0
T80 274520 0 0 0
T179 101118 0 0 0
T182 44652 0 0 0
T219 224013 0 0 0
T220 253782 0 0 0
T311 100479 0 0 0
T371 0 1 0 0
T374 0 2 0 0
T375 0 1 0 0
T383 0 1 0 0
T390 0 1 0 0
T391 0 2 0 0
T392 0 2 0 0
T393 0 2 0 0
T394 0 2 0 0
T395 40649 0 0 0
T396 35495 0 0 0
T397 21637 0 0 0

SrcBusyKnown_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 126457039 125819088 0 0
T1 36435 35822 0 0
T2 17245 16877 0 0
T3 52205 51443 0 0
T4 44432 43807 0 0
T11 32125 31678 0 0
T22 40201 39891 0 0
T24 53419 52941 0 0
T31 24511 23756 0 0
T39 55223 54746 0 0
T97 20174 19259 0 0

Line Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_cause_cdc
Line No.TotalCoveredPercent
TOTAL2222100.00
CONT_ASSIGN6511100.00
ALWAYS7166100.00
CONT_ASSIGN8511100.00
CONT_ASSIGN10911100.00
ALWAYS11599100.00
CONT_ASSIGN15011100.00
CONT_ASSIGN15511100.00
CONT_ASSIGN15611100.00
CONT_ASSIGN20011100.00

64 65 1/1 assign src_req = src_we_i | src_re_i; Tests: T1 T22 T32  66 67 // busy indication back-pressures upstream if the register is accessed 68 // again. The busy indication is also used as a "commit" indication for 69 // resolving software and hardware write conflicts 70 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin 71 1/1 if (!rst_src_ni) begin Tests: T1 T2 T3  72 1/1 src_busy_q <= '0; Tests: T1 T2 T3  73 1/1 end else if (src_req) begin Tests: T1 T2 T3  74 1/1 src_busy_q <= 1'b1; Tests: T1 T22 T32  75 1/1 end else if (src_ack) begin Tests: T1 T2 T3  76 1/1 src_busy_q <= 1'b0; Tests: T1 T22 T32  77 end MISSING_ELSE 78 end 79 80 // A src_ack should only be sent if there was a src_req. 81 // src_busy_q asserts whenever there is a src_req. By association, 82 // whenever src_ack is seen, then src_busy must be high. 83 `ASSERT(SrcAckBusyChk_A, src_ack |-> src_busy_q, clk_src_i, !rst_src_ni) 84 85 1/1 assign src_busy_o = src_busy_q; Tests: T1 T22 T32  86 87 // src_q acts as both the write holding register and the software read back 88 // register. 89 // When software performs a write, the write data is captured in src_q for 90 // CDC purposes. When not performing a write, the src_q reflects the most recent 91 // hardware value. For registers with no hardware access, this is simply the 92 // the value programmed by software (or in the case R1C, W1C etc) the value after 93 // the operation. For registers with hardware access, this reflects a potentially 94 // delayed version of the real value, as the software facing updates lag real 95 // time updates. 96 // 97 // To resolve software and hardware conflicts, the process is as follows: 98 // When software issues a write, this module asserts "busy". While busy, 99 // src_q does not take on destination value updates. Since the 100 // logic has committed to updating based on software command, there is an irreversible 101 // window from which hardware writes are ignored. Once the busy window completes, 102 // the cdc portion then begins sampling once more. 103 // 104 // This is consistent with prim_subreg_arb where during software / hardware conflicts, 105 // software is always prioritized. The main difference is the conflict resolution window 106 // is now larger instead of just one destination clock cycle. 107 108 logic busy; 109 1/1 assign busy = src_busy_q & !src_ack; Tests: T1 T22 T32  110 111 // This is the current destination value 112 logic [DataWidth-1:0] dst_qs; 113 logic src_update; 114 always_ff @(posedge clk_src_i or negedge rst_src_ni) begin 115 1/1 if (!rst_src_ni) begin Tests: T1 T2 T3  116 1/1 src_q <= ResetVal; Tests: T1 T2 T3  117 1/1 txn_bits_q <= '0; Tests: T1 T2 T3  118 1/1 end else if (src_req) begin Tests: T1 T2 T3  119 // See assertion below 120 // At the beginning of a software initiated transaction, the following 121 // values are captured in the src_q/txn_bits_q flops to ensure they cannot 122 // change for the duration of the synchronization operation. 123 1/1 src_q <= src_wd_i & BitMask; Tests: T1 T22 T32  124 1/1 txn_bits_q <= {src_we_i, src_re_i, src_regwen_i}; Tests: T1 T22 T32  125 1/1 end else if (src_busy_q && src_ack || src_update && !busy) begin Tests: T1 T2 T3  126 // sample data whenever a busy transaction finishes OR 127 // when an update pulse is seen. 128 // TODO: We should add a cover group to test different sync timings 129 // between src_ack and src_update. ie. there can be 3 scenarios: 130 // 1. update one cycle before ack 131 // 2. ack one cycle before update 132 // 3. update / ack on the same cycle 133 // During all 3 cases the read data should be correct 134 1/1 src_q <= dst_qs; Tests: T1 T22 T19  135 1/1 txn_bits_q <= '0; Tests: T1 T22 T19  136 end MISSING_ELSE 137 end 138 139 // The current design (tlul_adapter_reg) does not spit out a request if the destination it chooses 140 // (decoded from address) is busy. So this creates a situation in the current design where 141 // src_req_i and busy can never be high at the same time. 142 // While the code above could be coded directly to be expressed as `src_req & !busy`, which makes 143 // the intent clearer, it ends up causing coverage holes from the tool's perspective since that 144 // condition cannot be met. 145 // Thus we add an assertion here to ensure the condition is always satisfied. 146 `ASSERT(BusySrcReqChk_A, busy |-> !src_req, clk_src_i, !rst_src_ni) 147 148 // reserved bits are not used 149 logic unused_wd; 150 1/1 assign unused_wd = ^src_wd_i; Tests: T1 T2 T3  151 152 // src_q is always updated in the clk_src domain. 153 // when performing an update to the destination domain, it is guaranteed 154 // to not change by protocol. 155 1/1 assign src_qs_o = src_q; Tests: T1 T22 T19  156 1/1 assign dst_wd_o = src_q; Tests: T1 T22 T19  157 158 //////////////////////////// 159 // CDC handling 160 //////////////////////////// 161 162 logic dst_req_from_src; 163 logic dst_req; 164 165 166 // the software transaction is pulse synced across the domain. 167 // the prim_reg_cdc_arb module handles conflicts with ongoing hardware updates. 168 prim_pulse_sync u_src_to_dst_req ( 169 .clk_src_i, 170 .rst_src_ni, 171 .clk_dst_i, 172 .rst_dst_ni, 173 .src_pulse_i(src_req), 174 .dst_pulse_o(dst_req_from_src) 175 ); 176 177 prim_reg_cdc_arb #( 178 .DataWidth(DataWidth), 179 .ResetVal(ResetVal), 180 .DstWrReq(DstWrReq) 181 ) u_arb ( 182 .clk_src_i, 183 .rst_src_ni, 184 .clk_dst_i, 185 .rst_dst_ni, 186 .src_ack_o(src_ack), 187 .src_update_o(src_update), 188 .dst_req_i(dst_req_from_src), 189 .dst_req_o(dst_req), 190 .dst_update_i, 191 .dst_ds_i, 192 .dst_qs_i, 193 .dst_qs_o(dst_qs) 194 ); 195 196 197 // Each is valid only when destination request pulse is high; this is important in not propagating 198 // the internal assertion of 'dst_req' by the 'prim_pulse_sync' channel when just one domain is 199 // reset. 200 1/1 assign {dst_we_o, dst_re_o, dst_regwen_o} = txn_bits_q & {TxnWidth{dst_req}}; Tests: T1 T22 T32 

Cond Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_cause_cdc
TotalCoveredPercent
Conditions141285.71
Logical141285.71
Non-Logical00
Event00

 LINE       65
 EXPRESSION (src_we_i | src_re_i)
             ----1---   ----2---
-1--2-StatusTests
00CoveredT1,T2,T3
01Unreachable
10CoveredT1,T22,T32

 LINE       109
 EXPRESSION (src_busy_q & ((!src_ack)))
             -----1----   ------2-----
-1--2-StatusTests
01CoveredT1,T2,T3
10CoveredT1,T22,T32
11CoveredT1,T22,T32

 LINE       125
 EXPRESSION ((src_busy_q && src_ack) || (src_update && ((!busy))))
             -----------1-----------    ------------2------------
-1--2-StatusTests
00CoveredT1,T2,T3
01CoveredT1,T22,T19
10CoveredT1,T22,T32

 LINE       125
 SUB-EXPRESSION (src_busy_q && src_ack)
                 -----1----    ---2---
-1--2-StatusTests
01Not Covered
10CoveredT1,T22,T32
11CoveredT1,T22,T32

 LINE       125
 SUB-EXPRESSION (src_update && ((!busy)))
                 -----1----    ----2----
-1--2-StatusTests
01CoveredT1,T2,T3
10Not Covered
11CoveredT1,T22,T19

Branch Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_cause_cdc
Line No.TotalCoveredPercent
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-StatusTests
1 - - Covered T1,T2,T3
0 1 - Covered T1,T22,T32
0 0 1 Covered T1,T22,T32
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-StatusTests
1 - - Covered T1,T2,T3
0 1 - Covered T1,T22,T32
0 0 1 Covered T1,T22,T19
0 0 0 Covered T1,T2,T3


Assert Coverage for Instance : tb.dut.top_earlgrey.u_pinmux_aon.u_reg.u_wkup_cause_cdc
TotalAttemptedPercentSucceeded/MatchedPercent
Assertions 4 4 100.00 4 100.00
Cover properties 0 0 0
Cover sequences 0 0 0
Total 4 4 100.00 4 100.00




Assertion Details

NameAttemptsReal SuccessesFailuresIncomplete
BusySrcReqChk_A 126457039 104993 0 0
DstReqKnown_A 1533647 1356605 0 0
SrcAckBusyChk_A 126457039 239 0 0
SrcBusyKnown_A 126457039 125819088 0 0


BusySrcReqChk_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 126457039 104993 0 0
T1 36435 942 0 0
T2 17245 0 0 0
T3 52205 0 0 0
T4 44432 0 0 0
T11 32125 0 0 0
T22 40201 2002 0 0
T24 53419 0 0 0
T31 24511 0 0 0
T32 0 347 0 0
T39 55223 0 0 0
T66 0 1901 0 0
T67 0 665 0 0
T68 0 1512 0 0
T71 0 2168 0 0
T72 0 942 0 0
T73 0 1063 0 0
T74 0 722 0 0
T97 20174 0 0 0

DstReqKnown_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 1533647 1356605 0 0
T1 507 335 0 0
T2 428 256 0 0
T3 615 443 0 0
T4 558 385 0 0
T11 495 324 0 0
T22 728 557 0 0
T24 686 514 0 0
T31 564 331 0 0
T39 815 640 0 0
T97 333 159 0 0

SrcAckBusyChk_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 126457039 239 0 0
T1 36435 3 0 0
T2 17245 0 0 0
T3 52205 0 0 0
T4 44432 0 0 0
T11 32125 0 0 0
T22 40201 5 0 0
T24 53419 0 0 0
T31 24511 0 0 0
T32 0 1 0 0
T39 55223 0 0 0
T66 0 5 0 0
T67 0 2 0 0
T68 0 4 0 0
T71 0 7 0 0
T72 0 3 0 0
T73 0 3 0 0
T74 0 2 0 0
T97 20174 0 0 0

SrcBusyKnown_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 126457039 125819088 0 0
T1 36435 35822 0 0
T2 17245 16877 0 0
T3 52205 51443 0 0
T4 44432 43807 0 0
T11 32125 31678 0 0
T22 40201 39891 0 0
T24 53419 52941 0 0
T31 24511 23756 0 0
T39 55223 54746 0 0
T97 20174 19259 0 0

0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%