Module Definition
dashboard | hierarchy | modlist | groups | tests | asserts



Module Instance : tb.dut.u_otp_ctrl_lfsr_timer

Instance :
SCORELINECONDTOGGLEFSMBRANCHASSERT
96.16 100.00 89.61 100.00 91.18 100.00


Instance's subtree :
SCORELINECONDTOGGLEFSMBRANCHASSERT
93.08 100.00 89.87 76.92 100.00 91.67 100.00


Parent :
SCORELINECONDTOGGLEFSMBRANCHASSERTNAME
96.19 94.16 96.15 97.04 96.43 97.18 dut


Subtrees :
NAMESCORELINECONDTOGGLEFSMBRANCHASSERT
u_prim_count_cnsty 93.60 93.60
u_prim_count_integ 93.60 93.60
u_prim_double_lfsr 87.95 100.00 100.00 51.81 100.00
u_state_regs 100.00 100.00 100.00 100.00

Line Coverage for Module : otp_ctrl_lfsr_timer
Line No.TotalCoveredPercent
TOTAL9191100.00
CONT_ASSIGN7211100.00
CONT_ASSIGN7711100.00
CONT_ASSIGN7811100.00
CONT_ASSIGN8711100.00
CONT_ASSIGN11411100.00
CONT_ASSIGN13211100.00
CONT_ASSIGN13311100.00
CONT_ASSIGN13411100.00
CONT_ASSIGN13511100.00
CONT_ASSIGN13611100.00
CONT_ASSIGN13811100.00
CONT_ASSIGN13911100.00
CONT_ASSIGN14111100.00
CONT_ASSIGN14211100.00
CONT_ASSIGN14311100.00
CONT_ASSIGN14411100.00
CONT_ASSIGN18911100.00
CONT_ASSIGN19011100.00
CONT_ASSIGN19111100.00
CONT_ASSIGN19311100.00
CONT_ASSIGN20111100.00
CONT_ASSIGN20211100.00
CONT_ASSIGN24311100.00
ALWAYS2465252100.00
ALWAYS36733100.00
ALWAYS3701313100.00

71 logic [$clog2(LfsrUsageThreshold+1)-1:0] reseed_cnt_d, reseed_cnt_q; 72 1/1 assign reseed_cnt_d = (reseed_en) ? '0 : Tests: T1 T2 T3  73 (edn_req_o) ? reseed_cnt_q : 74 (lfsr_en) ? reseed_cnt_q + 1'b1 : 75 reseed_cnt_q; 76 77 1/1 assign edn_req_o = (reseed_cnt_q >= LfsrUsageThreshold); Tests: T1 T2 T3  78 1/1 assign reseed_en = edn_req_o & edn_ack_i; Tests: T1 T2 T3  79 80 /////////////////////////// 81 // Tandem LFSR Instances // 82 /////////////////////////// 83 84 logic lfsr_err; 85 logic [LfsrWidth-1:0] entropy; 86 logic [LfsrWidth-1:0] lfsr_state; 87 1/1 assign entropy = (reseed_en) ? edn_data_i[LfsrWidth-1:0] : '0; Tests: T1 T2 T3  88 89 // We employ two redundant LFSRs to guard against FI attacks. 90 // If any of the two is glitched and the two LFSR states do not agree, 91 // the FSM below is moved into a terminal error state. 92 // SEC_CM: TIMER.LFSR.REDUN 93 prim_double_lfsr #( 94 .LfsrDw ( LfsrWidth ), 95 .EntropyDw ( LfsrWidth ), 96 .StateOutDw ( LfsrWidth ), 97 .DefaultSeed ( RndCnstLfsrSeed ), 98 .StatePermEn ( 1'b1 ), 99 .StatePerm ( RndCnstLfsrPerm ), 100 .ExtSeedSVA ( 1'b0 ) 101 ) u_prim_double_lfsr ( 102 .clk_i, 103 .rst_ni, 104 .seed_en_i ( 1'b0 ), 105 .seed_i ( '0 ), 106 .lfsr_en_i ( reseed_en || lfsr_en ), 107 .entropy_i ( entropy ), 108 .state_o ( lfsr_state ), 109 .err_o ( lfsr_err ) 110 ); 111 112 // Not all entropy bits are used. 113 logic unused_seed; 114 1/1 assign unused_seed = ^edn_data_i; Tests: T1 T2 T3  115 116 `ASSERT_INIT(EdnIsWideEnough_A, EdnDataWidth >= LfsrWidth) 117 118 ////////////////////////////// 119 // Tandem Counter Instances // 120 ////////////////////////////// 121 122 // We employ redundant counters to guard against FI attacks. 123 // If any of them is glitched and the redundant counter states do not agree, 124 // the FSM below is moved into a terminal error state. 125 logic [LfsrWidth-1:0] integ_cnt, cnsty_cnt, integ_cnt_set_val, cnsty_cnt_set_val; 126 logic [LfsrWidth-1:0] integ_mask, cnsty_mask; 127 logic integ_set_period, integ_set_timeout, integ_cnt_zero; 128 logic cnsty_set_period, cnsty_set_timeout, cnsty_cnt_zero; 129 logic integ_cnt_set, cnsty_cnt_set, integ_cnt_err, cnsty_cnt_err; 130 logic timeout_zero, integ_msk_zero, cnsty_msk_zero, cnsty_cnt_pause; 131 132 1/1 assign timeout_zero = (timeout_i == '0); Tests: T1 T2 T3  133 1/1 assign integ_msk_zero = (integ_period_msk_i == '0); Tests: T1 T2 T3  134 1/1 assign cnsty_msk_zero = (cnsty_period_msk_i == '0); Tests: T1 T2 T3  135 1/1 assign integ_cnt_zero = (integ_cnt == '0); Tests: T1 T2 T3  136 1/1 assign cnsty_cnt_zero = (cnsty_cnt == '0); Tests: T1 T2 T3  137 138 1/1 assign integ_cnt_set = integ_set_period || integ_set_timeout; Tests: T1 T2 T3  139 1/1 assign cnsty_cnt_set = cnsty_set_period || cnsty_set_timeout; Tests: T1 T2 T3  140 141 1/1 assign integ_mask = {integ_period_msk_i, {LfsrWidth-32{1'b1}}}; Tests: T1 T2 T3  142 1/1 assign cnsty_mask = {cnsty_period_msk_i, {LfsrWidth-32{1'b1}}}; Tests: T1 T2 T3  143 1/1 assign integ_cnt_set_val = (integ_set_period) ? (lfsr_state & integ_mask) : LfsrWidth'(timeout_i); Tests: T1 T2 T3  144 1/1 assign cnsty_cnt_set_val = (cnsty_set_period) ? (lfsr_state & cnsty_mask) : LfsrWidth'(timeout_i); Tests: T1 T2 T3  145 146 // SEC_CM: TIMER_INTEG.CTR.REDUN 147 prim_count #( 148 .Width(LfsrWidth) 149 ) u_prim_count_integ ( 150 .clk_i, 151 .rst_ni, 152 .clr_i(1'b0), 153 .set_i(integ_cnt_set), 154 .set_cnt_i(integ_cnt_set_val), 155 .incr_en_i(1'b0), 156 .decr_en_i(!integ_cnt_zero), 157 .step_i(LfsrWidth'(1)), 158 .commit_i(1'b1), 159 .cnt_o(integ_cnt), 160 .cnt_after_commit_o(), 161 .err_o(integ_cnt_err) 162 ); 163 164 // SEC_CM: TIMER_CNSTY.CTR.REDUN 165 prim_count #( 166 .Width(LfsrWidth) 167 ) u_prim_count_cnsty ( 168 .clk_i, 169 .rst_ni, 170 .clr_i(1'b0), 171 .set_i(cnsty_cnt_set), 172 .set_cnt_i(cnsty_cnt_set_val), 173 .incr_en_i(1'b0), 174 .decr_en_i(!cnsty_cnt_zero && !cnsty_cnt_pause), 175 .step_i(LfsrWidth'(1)), 176 .commit_i(1'b1), 177 .cnt_o(cnsty_cnt), 178 .cnt_after_commit_o(), 179 .err_o(cnsty_cnt_err) 180 ); 181 182 ///////////////////// 183 // Request signals // 184 ///////////////////// 185 186 logic set_all_integ_reqs, set_all_cnsty_reqs; 187 logic [NumPart-1:0] integ_chk_req_d, integ_chk_req_q; 188 logic [NumPart-1:0] cnsty_chk_req_d, cnsty_chk_req_q; 189 1/1 assign integ_chk_req_o = integ_chk_req_q; Tests: T1 T2 T3  190 1/1 assign cnsty_chk_req_o = cnsty_chk_req_q; Tests: T1 T2 T3  191 1/1 assign integ_chk_req_d = (set_all_integ_reqs) ? {NumPart{1'b1}} : Tests: T1 T2 T3  192 integ_chk_req_q & ~integ_chk_ack_i; 193 1/1 assign cnsty_chk_req_d = (set_all_cnsty_reqs) ? {NumPart{1'b1}} : Tests: T1 T2 T3  194 cnsty_chk_req_q & ~cnsty_chk_ack_i; 195 196 197 // external triggers 198 logic clr_integ_chk_trig, clr_cnsty_chk_trig; 199 logic integ_chk_trig_d, integ_chk_trig_q; 200 logic cnsty_chk_trig_d, cnsty_chk_trig_q; 201 1/1 assign integ_chk_trig_d = (integ_chk_trig_q & ~clr_integ_chk_trig) | integ_chk_trig_i; Tests: T1 T2 T3  202 1/1 assign cnsty_chk_trig_d = (cnsty_chk_trig_q & ~clr_cnsty_chk_trig) | cnsty_chk_trig_i; Tests: T1 T2 T3  203 204 //////////////////////////// 205 // Ping and Timeout Logic // 206 //////////////////////////// 207 208 // SEC_CM: TIMER.FSM.SPARSE 209 // Encoding generated with: 210 // $ ./util/design/sparse-fsm-encode.py -d 5 -m 5 -n 9 \ 211 // -s 628816752 --language=sv 212 // 213 // Hamming distance histogram: 214 // 215 // 0: -- 216 // 1: -- 217 // 2: -- 218 // 3: -- 219 // 4: -- 220 // 5: |||||||||||||||||||| (60.00%) 221 // 6: ||||||||||||| (40.00%) 222 // 7: -- 223 // 8: -- 224 // 9: -- 225 // 226 // Minimum Hamming distance: 5 227 // Maximum Hamming distance: 6 228 // Minimum Hamming weight: 4 229 // Maximum Hamming weight: 6 230 // 231 localparam int StateWidth = 9; 232 typedef enum logic [StateWidth-1:0] { 233 ResetSt = 9'b100100101, 234 IdleSt = 9'b001101110, 235 IntegWaitSt = 9'b010110011, 236 CnstyWaitSt = 9'b111010110, 237 ErrorSt = 9'b001011001 238 } state_e; 239 240 state_e state_d, state_q; 241 logic chk_timeout_d, chk_timeout_q; 242 243 1/1 assign chk_timeout_o = chk_timeout_q; Tests: T1 T2 T3  244 245 always_comb begin : p_fsm 246 1/1 state_d = state_q; Tests: T1 T2 T3  247 248 // LFSR and counter signals 249 1/1 lfsr_en = 1'b0; Tests: T1 T2 T3  250 1/1 integ_set_period = 1'b0; Tests: T1 T2 T3  251 1/1 cnsty_set_period = 1'b0; Tests: T1 T2 T3  252 1/1 integ_set_timeout = 1'b0; Tests: T1 T2 T3  253 1/1 cnsty_set_timeout = 1'b0; Tests: T1 T2 T3  254 1/1 cnsty_cnt_pause = 1'b0; Tests: T1 T2 T3  255 256 // Requests going to partitions. 257 1/1 set_all_integ_reqs = '0; Tests: T1 T2 T3  258 1/1 set_all_cnsty_reqs = '0; Tests: T1 T2 T3  259 260 // Status signals going to CSRs and error logic. 261 1/1 chk_timeout_d = chk_timeout_q; Tests: T1 T2 T3  262 1/1 chk_pending_o = cnsty_chk_trig_q || integ_chk_trig_q; Tests: T1 T2 T3  263 1/1 fsm_err_o = 1'b0; Tests: T1 T2 T3  264 265 // Clear signals for external triggers 266 1/1 clr_integ_chk_trig = 1'b0; Tests: T1 T2 T3  267 1/1 clr_cnsty_chk_trig = 1'b0; Tests: T1 T2 T3  268 269 1/1 unique case (state_q) Tests: T1 T2 T3  270 /////////////////////////////////////////////////////////////////// 271 // Wait until enabled. We never return to this state 272 // once enabled! 273 ResetSt: begin 274 1/1 if (timer_en_i) begin Tests: T1 T2 T3  275 1/1 state_d = IdleSt; Tests: T1 T2 T3  276 1/1 lfsr_en = 1'b1; Tests: T1 T2 T3  277 end MISSING_ELSE 278 end 279 /////////////////////////////////////////////////////////////////// 280 // Wait here until one of the two timers expires (if enabled) or if 281 // a check is triggered externally. 282 IdleSt: begin 283 1/1 if ((!integ_msk_zero && integ_cnt_zero) || integ_chk_trig_q) begin Tests: T1 T2 T3  284 1/1 state_d = IntegWaitSt; Tests: T6 T7 T17  285 1/1 integ_set_timeout = 1'b1; Tests: T6 T7 T17  286 1/1 set_all_integ_reqs = 1'b1; Tests: T6 T7 T17  287 1/1 clr_integ_chk_trig = integ_chk_trig_q; Tests: T6 T7 T17  288 1/1 end else if ((!cnsty_msk_zero && cnsty_cnt_zero) || cnsty_chk_trig_q) begin Tests: T1 T2 T3  289 1/1 state_d = CnstyWaitSt; Tests: T3 T6 T7  290 1/1 cnsty_set_timeout = 1'b1; Tests: T3 T6 T7  291 1/1 set_all_cnsty_reqs = 1'b1; Tests: T3 T6 T7  292 1/1 clr_cnsty_chk_trig = cnsty_chk_trig_q; Tests: T3 T6 T7  293 end MISSING_ELSE 294 end 295 /////////////////////////////////////////////////////////////////// 296 // Wait for all the partitions to respond and go back to idle. 297 // If the timeout is enabled, bail out into terminal error state 298 // if the timeout counter expires (this will raise an alert). 299 IntegWaitSt: begin 300 1/1 chk_pending_o = 1'b1; Tests: T6 T7 T17  301 1/1 if (!timeout_zero && integ_cnt_zero) begin Tests: T6 T7 T17  302 1/1 state_d = ErrorSt; Tests: T100 T101 T106  303 1/1 chk_timeout_d = 1'b1; Tests: T100 T101 T106  304 1/1 end else if (integ_chk_req_q == '0) begin Tests: T6 T7 T17  305 1/1 state_d = IdleSt; Tests: T6 T7 T17  306 // This draws the next wait period. 307 1/1 integ_set_period = 1'b1; Tests: T6 T7 T17  308 1/1 lfsr_en = 1'b1; Tests: T6 T7 T17  309 end MISSING_ELSE 310 end 311 /////////////////////////////////////////////////////////////////// 312 // Wait for all the partitions to respond and go back to idle. 313 // If the timeout is enabled, bail out into terminal error state 314 // if the timeout counter expires (this will raise an alert). 315 CnstyWaitSt: begin 316 1/1 chk_pending_o = 1'b1; Tests: T3 T6 T7  317 // Note that consistency checks go back and read from OTP. Hence, 318 // life cycle transitions and DAI programming operations 319 // may interfere with these checks and cause them to take longer 320 // than typically expected. Therefore, the timeout counter is stopped 321 // during programming operations. 322 1/1 cnsty_cnt_pause = otp_prog_busy_i; Tests: T3 T6 T7  323 1/1 if (!timeout_zero && cnsty_cnt_zero) begin Tests: T3 T6 T7  324 1/1 state_d = ErrorSt; Tests: T6 T95 T96  325 1/1 chk_timeout_d = 1'b1; Tests: T6 T95 T96  326 1/1 end else if (cnsty_chk_req_q == '0) begin Tests: T3 T6 T7  327 1/1 state_d = IdleSt; Tests: T3 T6 T7  328 // This draws the next wait period. 329 1/1 cnsty_set_period = 1'b1; Tests: T3 T6 T7  330 1/1 lfsr_en = 1'b1; Tests: T3 T6 T7  331 end MISSING_ELSE 332 end 333 /////////////////////////////////////////////////////////////////// 334 // Terminal error state. This raises an alert. 335 ErrorSt: begin 336 // Continuously clear pending checks. 337 1/1 clr_integ_chk_trig = 1'b1; Tests: T6 T12 T94  338 1/1 clr_cnsty_chk_trig = 1'b1; Tests: T6 T12 T94  339 1/1 if (!chk_timeout_q) begin Tests: T6 T12 T94  340 1/1 fsm_err_o = 1'b1; Tests: T12 T94 T128  341 end MISSING_ELSE 342 end 343 /////////////////////////////////////////////////////////////////// 344 // This should never happen, hence we directly jump into the 345 // error state, where an alert will be triggered. 346 default: begin 347 state_d = ErrorSt; 348 fsm_err_o = 1'b1; 349 end 350 /////////////////////////////////////////////////////////////////// 351 endcase // state_q 352 353 // Unconditionally jump into the terminal error state in case of escalation, 354 // or if the two LFSR or counter states do not agree. 355 // SEC_CM: TIMER.FSM.LOCAL_ESC, TIMER.FSM.GLOBAL_ESC 356 1/1 if (lfsr_err || integ_cnt_err || cnsty_cnt_err || Tests: T1 T2 T3  357 lc_ctrl_pkg::lc_tx_test_true_loose(escalate_en_i)) begin 358 1/1 state_d = ErrorSt; Tests: T12 T94 T128  359 1/1 fsm_err_o = 1'b1; Tests: T12 T94 T128  360 end MISSING_ELSE 361 end 362 363 /////////////// 364 // Registers // 365 /////////////// 366 367 3/3 `PRIM_FLOP_SPARSE_FSM(u_state_regs, state_d, state_q, state_e, ResetSt) Tests: T1 T2 T3  | T1 T2 T3  | T1 T2 T3 
PRIM_FLOP_SPARSE_FSM(u_state_regs, state_d, state_q, state_e, ResetSt): 367.1 `ifdef SIMULATION 367.2 prim_sparse_fsm_flop #( 367.3 .StateEnumT(state_e), 367.4 .Width($bits(state_e)), 367.5 .ResetValue($bits(state_e)'(ResetSt)), 367.6 .EnableAlertTriggerSVA(1), 367.7 .CustomForceName("state_q") 367.8 ) u_state_regs ( 367.9 .clk_i ( clk_i ), 367.10 .rst_ni ( rst_ni ), 367.11 .state_i ( state_d ), 367.12 .state_o ( ) 367.13 ); 367.14 always_ff @(posedge clk_i or negedge rst_ni) begin 367.15 1/1 if (!rst_ni) begin Tests: T1 T2 T3  367.16 1/1 state_q <= ResetSt; Tests: T1 T2 T3  367.17 end else begin 367.18 1/1 state_q <= state_d; Tests: T1 T2 T3  367.19 end 367.20 end 367.21 u_state_regs_A: assert property (@(posedge clk_i) disable iff ((!rst_ni) !== '0) (state_q === u_state_regs.state_o)) 367.22 else begin 367.23 `ifdef UVM 367.24 uvm_pkg::uvm_report_error("ASSERT FAILED", "u_state_regs_A", uvm_pkg::UVM_NONE, 367.25 "../src/lowrisc_ip_otp_ctrl_1.0/rtl/otp_ctrl_lfsr_timer.sv", 367, "", 1); 367.26 `else 367.27 $error("%0t: (%0s:%0d) [%m] [ASSERT FAILED] %0s", $time, `__FILE__, `__LINE__, 367.28 `PRIM_STRINGIFY(u_state_regs_A)); 367.29 `endif 367.30 end 367.31 `else 367.32 prim_sparse_fsm_flop #( 367.33 .StateEnumT(state_e), 367.34 .Width($bits(state_e)), 367.35 .ResetValue($bits(state_e)'(ResetSt)), 367.36 .EnableAlertTriggerSVA(1) 367.37 ) u_state_regs ( 367.38 .clk_i ( `PRIM_FLOP_CLK ), 367.39 .rst_ni ( `PRIM_FLOP_RST ), 367.40 .state_i ( state_d ), 367.41 .state_o ( state_q ) 367.42 ); 367.43 `endif368 369 always_ff @(posedge clk_i or negedge rst_ni) begin : p_regs 370 1/1 if (!rst_ni) begin Tests: T1 T2 T3  371 1/1 integ_chk_req_q <= '0; Tests: T1 T2 T3  372 1/1 cnsty_chk_req_q <= '0; Tests: T1 T2 T3  373 1/1 chk_timeout_q <= 1'b0; Tests: T1 T2 T3  374 1/1 reseed_cnt_q <= '0; Tests: T1 T2 T3  375 1/1 integ_chk_trig_q <= 1'b0; Tests: T1 T2 T3  376 1/1 cnsty_chk_trig_q <= 1'b0; Tests: T1 T2 T3  377 end else begin 378 1/1 integ_chk_req_q <= integ_chk_req_d; Tests: T1 T2 T3  379 1/1 cnsty_chk_req_q <= cnsty_chk_req_d; Tests: T1 T2 T3  380 1/1 chk_timeout_q <= chk_timeout_d; Tests: T1 T2 T3  381 1/1 reseed_cnt_q <= reseed_cnt_d; Tests: T1 T2 T3  382 1/1 integ_chk_trig_q <= integ_chk_trig_d; Tests: T1 T2 T3  383 1/1 cnsty_chk_trig_q <= cnsty_chk_trig_d; Tests: T1 T2 T3 

Cond Coverage for Module : otp_ctrl_lfsr_timer
TotalCoveredPercent
Conditions786988.46
Logical786988.46
Non-Logical00
Event00

 LINE       72
 EXPRESSION (reseed_en ? '0 : (edn_req_o ? reseed_cnt_q : (lfsr_en ? ((reseed_cnt_q + 1'b1)) : reseed_cnt_q)))
             ----1----
-1-StatusTests
0CoveredT1,T2,T3
1Not Covered

 LINE       72
 SUB-EXPRESSION (edn_req_o ? reseed_cnt_q : (lfsr_en ? ((reseed_cnt_q + 1'b1)) : reseed_cnt_q))
                 ----1----
-1-StatusTests
0CoveredT1,T2,T3
1Not Covered

 LINE       72
 SUB-EXPRESSION (lfsr_en ? ((reseed_cnt_q + 1'b1)) : reseed_cnt_q)
                 ---1---
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT1,T2,T3

 LINE       78
 EXPRESSION (edn_req_o & edn_ack_i)
             ----1----   ----2----
-1--2-StatusTests
01Not Covered
10Not Covered
11Not Covered

 LINE       87
 EXPRESSION (reseed_en ? edn_data_i[(otp_ctrl_pkg::LfsrWidth - 1):0] : '0)
             ----1----
-1-StatusTests
0CoveredT1,T2,T3
1Not Covered

 LINE       101
 EXPRESSION (reseed_en || lfsr_en)
             ----1----    ---2---
-1--2-StatusTests
00CoveredT1,T2,T3
01CoveredT1,T2,T3
10Not Covered

 LINE       132
 EXPRESSION (timeout_i == '0)
            --------1--------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT1,T2,T3

 LINE       133
 EXPRESSION (integ_period_msk_i == '0)
            -------------1------------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT1,T2,T3

 LINE       134
 EXPRESSION (cnsty_period_msk_i == '0)
            -------------1------------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT1,T2,T3

 LINE       135
 EXPRESSION (integ_cnt == '0)
            --------1--------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT1,T2,T3

 LINE       136
 EXPRESSION (cnsty_cnt == '0)
            --------1--------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT1,T2,T3

 LINE       138
 EXPRESSION (integ_set_period || integ_set_timeout)
             --------1-------    --------2--------
-1--2-StatusTests
00CoveredT1,T2,T3
01CoveredT6,T7,T17
10CoveredT6,T7,T17

 LINE       139
 EXPRESSION (cnsty_set_period || cnsty_set_timeout)
             --------1-------    --------2--------
-1--2-StatusTests
00CoveredT1,T2,T3
01CoveredT3,T6,T7
10CoveredT3,T6,T7

 LINE       143
 EXPRESSION (integ_set_period ? ((lfsr_state & integ_mask)) : (40'(timeout_i)))
             --------1-------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT6,T7,T17

 LINE       144
 EXPRESSION (cnsty_set_period ? ((lfsr_state & cnsty_mask)) : (40'(timeout_i)))
             --------1-------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT3,T6,T7

 LINE       167
 EXPRESSION (((!cnsty_cnt_zero)) && ((!cnsty_cnt_pause)))
             ---------1---------    ----------2---------
-1--2-StatusTests
01CoveredT1,T2,T3
10CoveredT7,T125,T92
11CoveredT3,T6,T7

 LINE       191
 EXPRESSION (set_all_integ_reqs ? ({otp_ctrl_reg_pkg::NumPart {1'b1}}) : ((integ_chk_req_q & (~integ_chk_ack_i))))
             ---------1--------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT6,T7,T17

 LINE       193
 EXPRESSION (set_all_cnsty_reqs ? ({otp_ctrl_reg_pkg::NumPart {1'b1}}) : ((cnsty_chk_req_q & (~cnsty_chk_ack_i))))
             ---------1--------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT3,T6,T7

 LINE       201
 EXPRESSION ((integ_chk_trig_q & ((~clr_integ_chk_trig))) | integ_chk_trig_i)
             ----------------------1---------------------   --------2-------
-1--2-StatusTests
00CoveredT1,T2,T3
01CoveredT7,T12,T17
10Not Covered

 LINE       201
 SUB-EXPRESSION (integ_chk_trig_q & ((~clr_integ_chk_trig)))
                 --------1-------   -----------2-----------
-1--2-StatusTests
01CoveredT1,T2,T3
10CoveredT7,T12,T17
11Not Covered

 LINE       202
 EXPRESSION ((cnsty_chk_trig_q & ((~clr_cnsty_chk_trig))) | cnsty_chk_trig_i)
             ----------------------1---------------------   --------2-------
-1--2-StatusTests
00CoveredT1,T2,T3
01CoveredT3,T7,T12
10CoveredT7,T17,T100

 LINE       202
 SUB-EXPRESSION (cnsty_chk_trig_q & ((~clr_cnsty_chk_trig)))
                 --------1-------   -----------2-----------
-1--2-StatusTests
01CoveredT1,T2,T3
10CoveredT3,T7,T12
11CoveredT7,T17,T100

 LINE       262
 EXPRESSION (cnsty_chk_trig_q || integ_chk_trig_q)
             --------1-------    --------2-------
-1--2-StatusTests
00CoveredT1,T2,T3
01CoveredT7,T129,T18
10CoveredT3,T7,T12

 LINE       283
 EXPRESSION ((((!integ_msk_zero)) && integ_cnt_zero) || integ_chk_trig_q)
             -------------------1-------------------    --------2-------
-1--2-StatusTests
00CoveredT1,T2,T3
01CoveredT7,T17,T100
10CoveredT6,T101,T95

 LINE       283
 SUB-EXPRESSION (((!integ_msk_zero)) && integ_cnt_zero)
                 ---------1---------    -------2------
-1--2-StatusTests
01CoveredT1,T2,T3
10CoveredT6,T101,T95
11CoveredT6,T101,T95

 LINE       288
 EXPRESSION ((((!cnsty_msk_zero)) && cnsty_cnt_zero) || cnsty_chk_trig_q)
             -------------------1-------------------    --------2-------
-1--2-StatusTests
00CoveredT1,T2,T3
01CoveredT3,T7,T17
10CoveredT6,T95,T141

 LINE       288
 SUB-EXPRESSION (((!cnsty_msk_zero)) && cnsty_cnt_zero)
                 ---------1---------    -------2------
-1--2-StatusTests
01CoveredT1,T2,T3
10CoveredT6,T95,T141
11CoveredT6,T95,T141

 LINE       301
 EXPRESSION (((!timeout_zero)) && integ_cnt_zero)
             --------1--------    -------2------
-1--2-StatusTests
01CoveredT6,T126,T128
10CoveredT7,T17,T100
11CoveredT100,T101,T106

 LINE       304
 EXPRESSION (integ_chk_req_q == '0)
            -----------1-----------
-1-StatusTests
0CoveredT6,T7,T17
1CoveredT6,T7,T17

 LINE       323
 EXPRESSION (((!timeout_zero)) && cnsty_cnt_zero)
             --------1--------    -------2------
-1--2-StatusTests
01CoveredT6,T126,T95
10CoveredT3,T7,T17
11CoveredT6,T95,T96

 LINE       326
 EXPRESSION (cnsty_chk_req_q == '0)
            -----------1-----------
-1-StatusTests
0CoveredT3,T6,T7
1CoveredT3,T6,T7

FSM Coverage for Module : otp_ctrl_lfsr_timer
Summary for FSM :: state_q
TotalCoveredPercent
States 5 5 100.00 (Not included in score)
Transitions 9 9 100.00
Sequences 0 0

State, Transition and Sequence Details for FSM :: state_q
statesLine No.CoveredTests
CnstyWaitSt 289 Covered T3,T6,T7
ErrorSt 302 Covered T6,T12,T94
IdleSt 275 Covered T1,T2,T3
IntegWaitSt 284 Covered T6,T7,T17
ResetSt 273 Covered T1,T2,T3


transitionsLine No.CoveredTests
CnstyWaitSt->ErrorSt 324 Covered T6,T95,T96
CnstyWaitSt->IdleSt 327 Covered T3,T6,T7
IdleSt->CnstyWaitSt 289 Covered T3,T6,T7
IdleSt->ErrorSt 358 Covered T12,T94,T128
IdleSt->IntegWaitSt 284 Covered T6,T7,T17
IntegWaitSt->ErrorSt 302 Covered T100,T101,T106
IntegWaitSt->IdleSt 305 Covered T6,T7,T17
ResetSt->ErrorSt 358 Covered T97,T281,T139
ResetSt->IdleSt 275 Covered T1,T2,T3



Branch Coverage for Module : otp_ctrl_lfsr_timer
Line No.TotalCoveredPercent
Branches 34 31 91.18
TERNARY 72 4 2 50.00
TERNARY 87 2 1 50.00
TERNARY 143 2 2 100.00
TERNARY 144 2 2 100.00
TERNARY 191 2 2 100.00
TERNARY 193 2 2 100.00
CASE 269 14 14 100.00
IF 356 2 2 100.00
IF 367 2 2 100.00
IF 370 2 2 100.00


72 assign reseed_cnt_d = (reseed_en) ? '0 : -1- ==> 73 (edn_req_o) ? reseed_cnt_q : -2- ==> 74 (lfsr_en) ? reseed_cnt_q + 1'b1 : -3- ==> ==>

Branches:
-1--2--3-StatusTests
1 - - Not Covered
0 1 - Not Covered
0 0 1 Covered T1,T2,T3
0 0 0 Covered T1,T2,T3


87 assign entropy = (reseed_en) ? edn_data_i[LfsrWidth-1:0] : '0; -1- ==> ==>

Branches:
-1-StatusTests
1 Not Covered
0 Covered T1,T2,T3


143 assign integ_cnt_set_val = (integ_set_period) ? (lfsr_state & integ_mask) : LfsrWidth'(timeout_i); -1- ==> ==>

Branches:
-1-StatusTests
1 Covered T6,T7,T17
0 Covered T1,T2,T3


144 assign cnsty_cnt_set_val = (cnsty_set_period) ? (lfsr_state & cnsty_mask) : LfsrWidth'(timeout_i); -1- ==> ==>

Branches:
-1-StatusTests
1 Covered T3,T6,T7
0 Covered T1,T2,T3


191 assign integ_chk_req_d = (set_all_integ_reqs) ? {NumPart{1'b1}} : -1- ==> ==>

Branches:
-1-StatusTests
1 Covered T6,T7,T17
0 Covered T1,T2,T3


193 assign cnsty_chk_req_d = (set_all_cnsty_reqs) ? {NumPart{1'b1}} : -1- ==> ==>

Branches:
-1-StatusTests
1 Covered T3,T6,T7
0 Covered T1,T2,T3


269 unique case (state_q) -1- 270 /////////////////////////////////////////////////////////////////// 271 // Wait until enabled. We never return to this state 272 // once enabled! 273 ResetSt: begin 274 if (timer_en_i) begin -2- 275 state_d = IdleSt; ==> 276 lfsr_en = 1'b1; 277 end MISSING_ELSE ==> 278 end 279 /////////////////////////////////////////////////////////////////// 280 // Wait here until one of the two timers expires (if enabled) or if 281 // a check is triggered externally. 282 IdleSt: begin 283 if ((!integ_msk_zero && integ_cnt_zero) || integ_chk_trig_q) begin -3- 284 state_d = IntegWaitSt; ==> 285 integ_set_timeout = 1'b1; 286 set_all_integ_reqs = 1'b1; 287 clr_integ_chk_trig = integ_chk_trig_q; 288 end else if ((!cnsty_msk_zero && cnsty_cnt_zero) || cnsty_chk_trig_q) begin -4- 289 state_d = CnstyWaitSt; ==> 290 cnsty_set_timeout = 1'b1; 291 set_all_cnsty_reqs = 1'b1; 292 clr_cnsty_chk_trig = cnsty_chk_trig_q; 293 end MISSING_ELSE ==> 294 end 295 /////////////////////////////////////////////////////////////////// 296 // Wait for all the partitions to respond and go back to idle. 297 // If the timeout is enabled, bail out into terminal error state 298 // if the timeout counter expires (this will raise an alert). 299 IntegWaitSt: begin 300 chk_pending_o = 1'b1; 301 if (!timeout_zero && integ_cnt_zero) begin -5- 302 state_d = ErrorSt; ==> 303 chk_timeout_d = 1'b1; 304 end else if (integ_chk_req_q == '0) begin -6- 305 state_d = IdleSt; ==> 306 // This draws the next wait period. 307 integ_set_period = 1'b1; 308 lfsr_en = 1'b1; 309 end MISSING_ELSE ==> 310 end 311 /////////////////////////////////////////////////////////////////// 312 // Wait for all the partitions to respond and go back to idle. 313 // If the timeout is enabled, bail out into terminal error state 314 // if the timeout counter expires (this will raise an alert). 315 CnstyWaitSt: begin 316 chk_pending_o = 1'b1; 317 // Note that consistency checks go back and read from OTP. Hence, 318 // life cycle transitions and DAI programming operations 319 // may interfere with these checks and cause them to take longer 320 // than typically expected. Therefore, the timeout counter is stopped 321 // during programming operations. 322 cnsty_cnt_pause = otp_prog_busy_i; 323 if (!timeout_zero && cnsty_cnt_zero) begin -7- 324 state_d = ErrorSt; ==> 325 chk_timeout_d = 1'b1; 326 end else if (cnsty_chk_req_q == '0) begin -8- 327 state_d = IdleSt; ==> 328 // This draws the next wait period. 329 cnsty_set_period = 1'b1; 330 lfsr_en = 1'b1; 331 end MISSING_ELSE ==> 332 end 333 /////////////////////////////////////////////////////////////////// 334 // Terminal error state. This raises an alert. 335 ErrorSt: begin 336 // Continuously clear pending checks. 337 clr_integ_chk_trig = 1'b1; 338 clr_cnsty_chk_trig = 1'b1; 339 if (!chk_timeout_q) begin -9- 340 fsm_err_o = 1'b1; ==> 341 end MISSING_ELSE ==> 342 end 343 /////////////////////////////////////////////////////////////////// 344 // This should never happen, hence we directly jump into the 345 // error state, where an alert will be triggered. 346 default: begin 347 state_d = ErrorSt; ==>

Branches:
-1--2--3--4--5--6--7--8--9-StatusTests
ResetSt 1 - - - - - - - Covered T1,T2,T3
ResetSt 0 - - - - - - - Covered T1,T2,T3
IdleSt - 1 - - - - - - Covered T6,T7,T17
IdleSt - 0 1 - - - - - Covered T3,T6,T7
IdleSt - 0 0 - - - - - Covered T1,T2,T3
IntegWaitSt - - - 1 - - - - Covered T100,T101,T106
IntegWaitSt - - - 0 1 - - - Covered T6,T7,T17
IntegWaitSt - - - 0 0 - - - Covered T6,T7,T17
CnstyWaitSt - - - - - 1 - - Covered T6,T95,T96
CnstyWaitSt - - - - - 0 1 - Covered T3,T6,T7
CnstyWaitSt - - - - - 0 0 - Covered T3,T6,T7
ErrorSt - - - - - - - 1 Covered T12,T94,T128
ErrorSt - - - - - - - 0 Covered T6,T100,T101
default - - - - - - - - Covered T22,T23,T24


356 if (lfsr_err || integ_cnt_err || cnsty_cnt_err || -1- 357 lc_ctrl_pkg::lc_tx_test_true_loose(escalate_en_i)) begin 358 state_d = ErrorSt; ==> 359 fsm_err_o = 1'b1; 360 end MISSING_ELSE ==>

Branches:
-1-StatusTests
1 Covered T12,T94,T128
0 Covered T1,T2,T3


367 `PRIM_FLOP_SPARSE_FSM(u_state_regs, state_d, state_q, state_e, ResetSt) -1- ==> ==>

Branches:
-1-StatusTests
1 Covered T1,T2,T3
0 Covered T1,T2,T3


370 if (!rst_ni) begin -1- 371 integ_chk_req_q <= '0; ==> 372 cnsty_chk_req_q <= '0; 373 chk_timeout_q <= 1'b0; 374 reseed_cnt_q <= '0; 375 integ_chk_trig_q <= 1'b0; 376 cnsty_chk_trig_q <= 1'b0; 377 end else begin 378 integ_chk_req_q <= integ_chk_req_d; ==>

Branches:
-1-StatusTests
1 Covered T1,T2,T3
0 Covered T1,T2,T3


Assert Coverage for Module : otp_ctrl_lfsr_timer
TotalAttemptedPercentSucceeded/MatchedPercent
Assertions 7 7 100.00 7 100.00
Cover properties 0 0 0
Cover sequences 0 0 0
Total 7 7 100.00 7 100.00




Assertion Details

NameAttemptsReal SuccessesFailuresIncomplete
ChkPendingKnown_A 87543204 86701732 0 0
ChkTimeoutKnown_A 87543204 86701732 0 0
CnstyChkReqKnown_A 87543204 86701732 0 0
EdnIsWideEnough_A 1124 1124 0 0
EdnReqKnown_A 87543204 86701732 0 0
IntegChkReqKnown_A 87543204 86701732 0 0
u_state_regs_A 87543204 86701732 0 0


ChkPendingKnown_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 87543204 86701732 0 0
T1 5432 5382 0 0
T2 10698 10452 0 0
T3 25481 25010 0 0
T4 10281 10014 0 0
T5 4680 4619 0 0
T6 40011 39222 0 0
T7 36446 35679 0 0
T11 6282 6220 0 0
T12 98597 98413 0 0
T13 28315 27844 0 0

ChkTimeoutKnown_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 87543204 86701732 0 0
T1 5432 5382 0 0
T2 10698 10452 0 0
T3 25481 25010 0 0
T4 10281 10014 0 0
T5 4680 4619 0 0
T6 40011 39222 0 0
T7 36446 35679 0 0
T11 6282 6220 0 0
T12 98597 98413 0 0
T13 28315 27844 0 0

CnstyChkReqKnown_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 87543204 86701732 0 0
T1 5432 5382 0 0
T2 10698 10452 0 0
T3 25481 25010 0 0
T4 10281 10014 0 0
T5 4680 4619 0 0
T6 40011 39222 0 0
T7 36446 35679 0 0
T11 6282 6220 0 0
T12 98597 98413 0 0
T13 28315 27844 0 0

EdnIsWideEnough_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 1124 1124 0 0
T1 1 1 0 0
T2 1 1 0 0
T3 1 1 0 0
T4 1 1 0 0
T5 1 1 0 0
T6 1 1 0 0
T7 1 1 0 0
T11 1 1 0 0
T12 1 1 0 0
T13 1 1 0 0

EdnReqKnown_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 87543204 86701732 0 0
T1 5432 5382 0 0
T2 10698 10452 0 0
T3 25481 25010 0 0
T4 10281 10014 0 0
T5 4680 4619 0 0
T6 40011 39222 0 0
T7 36446 35679 0 0
T11 6282 6220 0 0
T12 98597 98413 0 0
T13 28315 27844 0 0

IntegChkReqKnown_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 87543204 86701732 0 0
T1 5432 5382 0 0
T2 10698 10452 0 0
T3 25481 25010 0 0
T4 10281 10014 0 0
T5 4680 4619 0 0
T6 40011 39222 0 0
T7 36446 35679 0 0
T11 6282 6220 0 0
T12 98597 98413 0 0
T13 28315 27844 0 0

u_state_regs_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 87543204 86701732 0 0
T1 5432 5382 0 0
T2 10698 10452 0 0
T3 25481 25010 0 0
T4 10281 10014 0 0
T5 4680 4619 0 0
T6 40011 39222 0 0
T7 36446 35679 0 0
T11 6282 6220 0 0
T12 98597 98413 0 0
T13 28315 27844 0 0

Line Coverage for Instance : tb.dut.u_otp_ctrl_lfsr_timer
Line No.TotalCoveredPercent
TOTAL9191100.00
CONT_ASSIGN7211100.00
CONT_ASSIGN7711100.00
CONT_ASSIGN7811100.00
CONT_ASSIGN8711100.00
CONT_ASSIGN11411100.00
CONT_ASSIGN13211100.00
CONT_ASSIGN13311100.00
CONT_ASSIGN13411100.00
CONT_ASSIGN13511100.00
CONT_ASSIGN13611100.00
CONT_ASSIGN13811100.00
CONT_ASSIGN13911100.00
CONT_ASSIGN14111100.00
CONT_ASSIGN14211100.00
CONT_ASSIGN14311100.00
CONT_ASSIGN14411100.00
CONT_ASSIGN18911100.00
CONT_ASSIGN19011100.00
CONT_ASSIGN19111100.00
CONT_ASSIGN19311100.00
CONT_ASSIGN20111100.00
CONT_ASSIGN20211100.00
CONT_ASSIGN24311100.00
ALWAYS2465252100.00
ALWAYS36733100.00
ALWAYS3701313100.00

71 logic [$clog2(LfsrUsageThreshold+1)-1:0] reseed_cnt_d, reseed_cnt_q; 72 1/1 assign reseed_cnt_d = (reseed_en) ? '0 : Tests: T1 T2 T3  73 (edn_req_o) ? reseed_cnt_q : 74 (lfsr_en) ? reseed_cnt_q + 1'b1 : 75 reseed_cnt_q; 76 77 1/1 assign edn_req_o = (reseed_cnt_q >= LfsrUsageThreshold); Tests: T1 T2 T3  78 1/1 assign reseed_en = edn_req_o & edn_ack_i; Tests: T1 T2 T3  79 80 /////////////////////////// 81 // Tandem LFSR Instances // 82 /////////////////////////// 83 84 logic lfsr_err; 85 logic [LfsrWidth-1:0] entropy; 86 logic [LfsrWidth-1:0] lfsr_state; 87 1/1 assign entropy = (reseed_en) ? edn_data_i[LfsrWidth-1:0] : '0; Tests: T1 T2 T3  88 89 // We employ two redundant LFSRs to guard against FI attacks. 90 // If any of the two is glitched and the two LFSR states do not agree, 91 // the FSM below is moved into a terminal error state. 92 // SEC_CM: TIMER.LFSR.REDUN 93 prim_double_lfsr #( 94 .LfsrDw ( LfsrWidth ), 95 .EntropyDw ( LfsrWidth ), 96 .StateOutDw ( LfsrWidth ), 97 .DefaultSeed ( RndCnstLfsrSeed ), 98 .StatePermEn ( 1'b1 ), 99 .StatePerm ( RndCnstLfsrPerm ), 100 .ExtSeedSVA ( 1'b0 ) 101 ) u_prim_double_lfsr ( 102 .clk_i, 103 .rst_ni, 104 .seed_en_i ( 1'b0 ), 105 .seed_i ( '0 ), 106 .lfsr_en_i ( reseed_en || lfsr_en ), 107 .entropy_i ( entropy ), 108 .state_o ( lfsr_state ), 109 .err_o ( lfsr_err ) 110 ); 111 112 // Not all entropy bits are used. 113 logic unused_seed; 114 1/1 assign unused_seed = ^edn_data_i; Tests: T1 T2 T3  115 116 `ASSERT_INIT(EdnIsWideEnough_A, EdnDataWidth >= LfsrWidth) 117 118 ////////////////////////////// 119 // Tandem Counter Instances // 120 ////////////////////////////// 121 122 // We employ redundant counters to guard against FI attacks. 123 // If any of them is glitched and the redundant counter states do not agree, 124 // the FSM below is moved into a terminal error state. 125 logic [LfsrWidth-1:0] integ_cnt, cnsty_cnt, integ_cnt_set_val, cnsty_cnt_set_val; 126 logic [LfsrWidth-1:0] integ_mask, cnsty_mask; 127 logic integ_set_period, integ_set_timeout, integ_cnt_zero; 128 logic cnsty_set_period, cnsty_set_timeout, cnsty_cnt_zero; 129 logic integ_cnt_set, cnsty_cnt_set, integ_cnt_err, cnsty_cnt_err; 130 logic timeout_zero, integ_msk_zero, cnsty_msk_zero, cnsty_cnt_pause; 131 132 1/1 assign timeout_zero = (timeout_i == '0); Tests: T1 T2 T3  133 1/1 assign integ_msk_zero = (integ_period_msk_i == '0); Tests: T1 T2 T3  134 1/1 assign cnsty_msk_zero = (cnsty_period_msk_i == '0); Tests: T1 T2 T3  135 1/1 assign integ_cnt_zero = (integ_cnt == '0); Tests: T1 T2 T3  136 1/1 assign cnsty_cnt_zero = (cnsty_cnt == '0); Tests: T1 T2 T3  137 138 1/1 assign integ_cnt_set = integ_set_period || integ_set_timeout; Tests: T1 T2 T3  139 1/1 assign cnsty_cnt_set = cnsty_set_period || cnsty_set_timeout; Tests: T1 T2 T3  140 141 1/1 assign integ_mask = {integ_period_msk_i, {LfsrWidth-32{1'b1}}}; Tests: T1 T2 T3  142 1/1 assign cnsty_mask = {cnsty_period_msk_i, {LfsrWidth-32{1'b1}}}; Tests: T1 T2 T3  143 1/1 assign integ_cnt_set_val = (integ_set_period) ? (lfsr_state & integ_mask) : LfsrWidth'(timeout_i); Tests: T1 T2 T3  144 1/1 assign cnsty_cnt_set_val = (cnsty_set_period) ? (lfsr_state & cnsty_mask) : LfsrWidth'(timeout_i); Tests: T1 T2 T3  145 146 // SEC_CM: TIMER_INTEG.CTR.REDUN 147 prim_count #( 148 .Width(LfsrWidth) 149 ) u_prim_count_integ ( 150 .clk_i, 151 .rst_ni, 152 .clr_i(1'b0), 153 .set_i(integ_cnt_set), 154 .set_cnt_i(integ_cnt_set_val), 155 .incr_en_i(1'b0), 156 .decr_en_i(!integ_cnt_zero), 157 .step_i(LfsrWidth'(1)), 158 .commit_i(1'b1), 159 .cnt_o(integ_cnt), 160 .cnt_after_commit_o(), 161 .err_o(integ_cnt_err) 162 ); 163 164 // SEC_CM: TIMER_CNSTY.CTR.REDUN 165 prim_count #( 166 .Width(LfsrWidth) 167 ) u_prim_count_cnsty ( 168 .clk_i, 169 .rst_ni, 170 .clr_i(1'b0), 171 .set_i(cnsty_cnt_set), 172 .set_cnt_i(cnsty_cnt_set_val), 173 .incr_en_i(1'b0), 174 .decr_en_i(!cnsty_cnt_zero && !cnsty_cnt_pause), 175 .step_i(LfsrWidth'(1)), 176 .commit_i(1'b1), 177 .cnt_o(cnsty_cnt), 178 .cnt_after_commit_o(), 179 .err_o(cnsty_cnt_err) 180 ); 181 182 ///////////////////// 183 // Request signals // 184 ///////////////////// 185 186 logic set_all_integ_reqs, set_all_cnsty_reqs; 187 logic [NumPart-1:0] integ_chk_req_d, integ_chk_req_q; 188 logic [NumPart-1:0] cnsty_chk_req_d, cnsty_chk_req_q; 189 1/1 assign integ_chk_req_o = integ_chk_req_q; Tests: T1 T2 T3  190 1/1 assign cnsty_chk_req_o = cnsty_chk_req_q; Tests: T1 T2 T3  191 1/1 assign integ_chk_req_d = (set_all_integ_reqs) ? {NumPart{1'b1}} : Tests: T1 T2 T3  192 integ_chk_req_q & ~integ_chk_ack_i; 193 1/1 assign cnsty_chk_req_d = (set_all_cnsty_reqs) ? {NumPart{1'b1}} : Tests: T1 T2 T3  194 cnsty_chk_req_q & ~cnsty_chk_ack_i; 195 196 197 // external triggers 198 logic clr_integ_chk_trig, clr_cnsty_chk_trig; 199 logic integ_chk_trig_d, integ_chk_trig_q; 200 logic cnsty_chk_trig_d, cnsty_chk_trig_q; 201 1/1 assign integ_chk_trig_d = (integ_chk_trig_q & ~clr_integ_chk_trig) | integ_chk_trig_i; Tests: T1 T2 T3  202 1/1 assign cnsty_chk_trig_d = (cnsty_chk_trig_q & ~clr_cnsty_chk_trig) | cnsty_chk_trig_i; Tests: T1 T2 T3  203 204 //////////////////////////// 205 // Ping and Timeout Logic // 206 //////////////////////////// 207 208 // SEC_CM: TIMER.FSM.SPARSE 209 // Encoding generated with: 210 // $ ./util/design/sparse-fsm-encode.py -d 5 -m 5 -n 9 \ 211 // -s 628816752 --language=sv 212 // 213 // Hamming distance histogram: 214 // 215 // 0: -- 216 // 1: -- 217 // 2: -- 218 // 3: -- 219 // 4: -- 220 // 5: |||||||||||||||||||| (60.00%) 221 // 6: ||||||||||||| (40.00%) 222 // 7: -- 223 // 8: -- 224 // 9: -- 225 // 226 // Minimum Hamming distance: 5 227 // Maximum Hamming distance: 6 228 // Minimum Hamming weight: 4 229 // Maximum Hamming weight: 6 230 // 231 localparam int StateWidth = 9; 232 typedef enum logic [StateWidth-1:0] { 233 ResetSt = 9'b100100101, 234 IdleSt = 9'b001101110, 235 IntegWaitSt = 9'b010110011, 236 CnstyWaitSt = 9'b111010110, 237 ErrorSt = 9'b001011001 238 } state_e; 239 240 state_e state_d, state_q; 241 logic chk_timeout_d, chk_timeout_q; 242 243 1/1 assign chk_timeout_o = chk_timeout_q; Tests: T1 T2 T3  244 245 always_comb begin : p_fsm 246 1/1 state_d = state_q; Tests: T1 T2 T3  247 248 // LFSR and counter signals 249 1/1 lfsr_en = 1'b0; Tests: T1 T2 T3  250 1/1 integ_set_period = 1'b0; Tests: T1 T2 T3  251 1/1 cnsty_set_period = 1'b0; Tests: T1 T2 T3  252 1/1 integ_set_timeout = 1'b0; Tests: T1 T2 T3  253 1/1 cnsty_set_timeout = 1'b0; Tests: T1 T2 T3  254 1/1 cnsty_cnt_pause = 1'b0; Tests: T1 T2 T3  255 256 // Requests going to partitions. 257 1/1 set_all_integ_reqs = '0; Tests: T1 T2 T3  258 1/1 set_all_cnsty_reqs = '0; Tests: T1 T2 T3  259 260 // Status signals going to CSRs and error logic. 261 1/1 chk_timeout_d = chk_timeout_q; Tests: T1 T2 T3  262 1/1 chk_pending_o = cnsty_chk_trig_q || integ_chk_trig_q; Tests: T1 T2 T3  263 1/1 fsm_err_o = 1'b0; Tests: T1 T2 T3  264 265 // Clear signals for external triggers 266 1/1 clr_integ_chk_trig = 1'b0; Tests: T1 T2 T3  267 1/1 clr_cnsty_chk_trig = 1'b0; Tests: T1 T2 T3  268 269 1/1 unique case (state_q) Tests: T1 T2 T3  270 /////////////////////////////////////////////////////////////////// 271 // Wait until enabled. We never return to this state 272 // once enabled! 273 ResetSt: begin 274 1/1 if (timer_en_i) begin Tests: T1 T2 T3  275 1/1 state_d = IdleSt; Tests: T1 T2 T3  276 1/1 lfsr_en = 1'b1; Tests: T1 T2 T3  277 end MISSING_ELSE 278 end 279 /////////////////////////////////////////////////////////////////// 280 // Wait here until one of the two timers expires (if enabled) or if 281 // a check is triggered externally. 282 IdleSt: begin 283 1/1 if ((!integ_msk_zero && integ_cnt_zero) || integ_chk_trig_q) begin Tests: T1 T2 T3  284 1/1 state_d = IntegWaitSt; Tests: T6 T7 T17  285 1/1 integ_set_timeout = 1'b1; Tests: T6 T7 T17  286 1/1 set_all_integ_reqs = 1'b1; Tests: T6 T7 T17  287 1/1 clr_integ_chk_trig = integ_chk_trig_q; Tests: T6 T7 T17  288 1/1 end else if ((!cnsty_msk_zero && cnsty_cnt_zero) || cnsty_chk_trig_q) begin Tests: T1 T2 T3  289 1/1 state_d = CnstyWaitSt; Tests: T3 T6 T7  290 1/1 cnsty_set_timeout = 1'b1; Tests: T3 T6 T7  291 1/1 set_all_cnsty_reqs = 1'b1; Tests: T3 T6 T7  292 1/1 clr_cnsty_chk_trig = cnsty_chk_trig_q; Tests: T3 T6 T7  293 end MISSING_ELSE 294 end 295 /////////////////////////////////////////////////////////////////// 296 // Wait for all the partitions to respond and go back to idle. 297 // If the timeout is enabled, bail out into terminal error state 298 // if the timeout counter expires (this will raise an alert). 299 IntegWaitSt: begin 300 1/1 chk_pending_o = 1'b1; Tests: T6 T7 T17  301 1/1 if (!timeout_zero && integ_cnt_zero) begin Tests: T6 T7 T17  302 1/1 state_d = ErrorSt; Tests: T100 T101 T106  303 1/1 chk_timeout_d = 1'b1; Tests: T100 T101 T106  304 1/1 end else if (integ_chk_req_q == '0) begin Tests: T6 T7 T17  305 1/1 state_d = IdleSt; Tests: T6 T7 T17  306 // This draws the next wait period. 307 1/1 integ_set_period = 1'b1; Tests: T6 T7 T17  308 1/1 lfsr_en = 1'b1; Tests: T6 T7 T17  309 end MISSING_ELSE 310 end 311 /////////////////////////////////////////////////////////////////// 312 // Wait for all the partitions to respond and go back to idle. 313 // If the timeout is enabled, bail out into terminal error state 314 // if the timeout counter expires (this will raise an alert). 315 CnstyWaitSt: begin 316 1/1 chk_pending_o = 1'b1; Tests: T3 T6 T7  317 // Note that consistency checks go back and read from OTP. Hence, 318 // life cycle transitions and DAI programming operations 319 // may interfere with these checks and cause them to take longer 320 // than typically expected. Therefore, the timeout counter is stopped 321 // during programming operations. 322 1/1 cnsty_cnt_pause = otp_prog_busy_i; Tests: T3 T6 T7  323 1/1 if (!timeout_zero && cnsty_cnt_zero) begin Tests: T3 T6 T7  324 1/1 state_d = ErrorSt; Tests: T6 T95 T96  325 1/1 chk_timeout_d = 1'b1; Tests: T6 T95 T96  326 1/1 end else if (cnsty_chk_req_q == '0) begin Tests: T3 T6 T7  327 1/1 state_d = IdleSt; Tests: T3 T6 T7  328 // This draws the next wait period. 329 1/1 cnsty_set_period = 1'b1; Tests: T3 T6 T7  330 1/1 lfsr_en = 1'b1; Tests: T3 T6 T7  331 end MISSING_ELSE 332 end 333 /////////////////////////////////////////////////////////////////// 334 // Terminal error state. This raises an alert. 335 ErrorSt: begin 336 // Continuously clear pending checks. 337 1/1 clr_integ_chk_trig = 1'b1; Tests: T6 T12 T94  338 1/1 clr_cnsty_chk_trig = 1'b1; Tests: T6 T12 T94  339 1/1 if (!chk_timeout_q) begin Tests: T6 T12 T94  340 1/1 fsm_err_o = 1'b1; Tests: T12 T94 T128  341 end MISSING_ELSE 342 end 343 /////////////////////////////////////////////////////////////////// 344 // This should never happen, hence we directly jump into the 345 // error state, where an alert will be triggered. 346 default: begin 347 state_d = ErrorSt; 348 fsm_err_o = 1'b1; 349 end 350 /////////////////////////////////////////////////////////////////// 351 endcase // state_q 352 353 // Unconditionally jump into the terminal error state in case of escalation, 354 // or if the two LFSR or counter states do not agree. 355 // SEC_CM: TIMER.FSM.LOCAL_ESC, TIMER.FSM.GLOBAL_ESC 356 1/1 if (lfsr_err || integ_cnt_err || cnsty_cnt_err || Tests: T1 T2 T3  357 lc_ctrl_pkg::lc_tx_test_true_loose(escalate_en_i)) begin 358 1/1 state_d = ErrorSt; Tests: T12 T94 T128  359 1/1 fsm_err_o = 1'b1; Tests: T12 T94 T128  360 end MISSING_ELSE 361 end 362 363 /////////////// 364 // Registers // 365 /////////////// 366 367 3/3 `PRIM_FLOP_SPARSE_FSM(u_state_regs, state_d, state_q, state_e, ResetSt) Tests: T1 T2 T3  | T1 T2 T3  | T1 T2 T3 
PRIM_FLOP_SPARSE_FSM(u_state_regs, state_d, state_q, state_e, ResetSt): 367.1 `ifdef SIMULATION 367.2 prim_sparse_fsm_flop #( 367.3 .StateEnumT(state_e), 367.4 .Width($bits(state_e)), 367.5 .ResetValue($bits(state_e)'(ResetSt)), 367.6 .EnableAlertTriggerSVA(1), 367.7 .CustomForceName("state_q") 367.8 ) u_state_regs ( 367.9 .clk_i ( clk_i ), 367.10 .rst_ni ( rst_ni ), 367.11 .state_i ( state_d ), 367.12 .state_o ( ) 367.13 ); 367.14 always_ff @(posedge clk_i or negedge rst_ni) begin 367.15 1/1 if (!rst_ni) begin Tests: T1 T2 T3  367.16 1/1 state_q <= ResetSt; Tests: T1 T2 T3  367.17 end else begin 367.18 1/1 state_q <= state_d; Tests: T1 T2 T3  367.19 end 367.20 end 367.21 u_state_regs_A: assert property (@(posedge clk_i) disable iff ((!rst_ni) !== '0) (state_q === u_state_regs.state_o)) 367.22 else begin 367.23 `ifdef UVM 367.24 uvm_pkg::uvm_report_error("ASSERT FAILED", "u_state_regs_A", uvm_pkg::UVM_NONE, 367.25 "../src/lowrisc_ip_otp_ctrl_1.0/rtl/otp_ctrl_lfsr_timer.sv", 367, "", 1); 367.26 `else 367.27 $error("%0t: (%0s:%0d) [%m] [ASSERT FAILED] %0s", $time, `__FILE__, `__LINE__, 367.28 `PRIM_STRINGIFY(u_state_regs_A)); 367.29 `endif 367.30 end 367.31 `else 367.32 prim_sparse_fsm_flop #( 367.33 .StateEnumT(state_e), 367.34 .Width($bits(state_e)), 367.35 .ResetValue($bits(state_e)'(ResetSt)), 367.36 .EnableAlertTriggerSVA(1) 367.37 ) u_state_regs ( 367.38 .clk_i ( `PRIM_FLOP_CLK ), 367.39 .rst_ni ( `PRIM_FLOP_RST ), 367.40 .state_i ( state_d ), 367.41 .state_o ( state_q ) 367.42 ); 367.43 `endif368 369 always_ff @(posedge clk_i or negedge rst_ni) begin : p_regs 370 1/1 if (!rst_ni) begin Tests: T1 T2 T3  371 1/1 integ_chk_req_q <= '0; Tests: T1 T2 T3  372 1/1 cnsty_chk_req_q <= '0; Tests: T1 T2 T3  373 1/1 chk_timeout_q <= 1'b0; Tests: T1 T2 T3  374 1/1 reseed_cnt_q <= '0; Tests: T1 T2 T3  375 1/1 integ_chk_trig_q <= 1'b0; Tests: T1 T2 T3  376 1/1 cnsty_chk_trig_q <= 1'b0; Tests: T1 T2 T3  377 end else begin 378 1/1 integ_chk_req_q <= integ_chk_req_d; Tests: T1 T2 T3  379 1/1 cnsty_chk_req_q <= cnsty_chk_req_d; Tests: T1 T2 T3  380 1/1 chk_timeout_q <= chk_timeout_d; Tests: T1 T2 T3  381 1/1 reseed_cnt_q <= reseed_cnt_d; Tests: T1 T2 T3  382 1/1 integ_chk_trig_q <= integ_chk_trig_d; Tests: T1 T2 T3  383 1/1 cnsty_chk_trig_q <= cnsty_chk_trig_d; Tests: T1 T2 T3 

Cond Coverage for Instance : tb.dut.u_otp_ctrl_lfsr_timer
TotalCoveredPercent
Conditions776989.61
Logical776989.61
Non-Logical00
Event00

 LINE       72
 EXPRESSION (reseed_en ? '0 : (edn_req_o ? reseed_cnt_q : (lfsr_en ? ((reseed_cnt_q + 1'b1)) : reseed_cnt_q)))
             ----1----
-1-StatusTests
0CoveredT1,T2,T3
1Not Covered

 LINE       72
 SUB-EXPRESSION (edn_req_o ? reseed_cnt_q : (lfsr_en ? ((reseed_cnt_q + 1'b1)) : reseed_cnt_q))
                 ----1----
-1-StatusTests
0CoveredT1,T2,T3
1Not Covered

 LINE       72
 SUB-EXPRESSION (lfsr_en ? ((reseed_cnt_q + 1'b1)) : reseed_cnt_q)
                 ---1---
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT1,T2,T3

 LINE       78
 EXPRESSION (edn_req_o & edn_ack_i)
             ----1----   ----2----
-1--2-StatusTestsExclude Annotation
01Excluded VC_COV_UNR
10Not Covered
11Not Covered

 LINE       87
 EXPRESSION (reseed_en ? edn_data_i[(otp_ctrl_pkg::LfsrWidth - 1):0] : '0)
             ----1----
-1-StatusTests
0CoveredT1,T2,T3
1Not Covered

 LINE       101
 EXPRESSION (reseed_en || lfsr_en)
             ----1----    ---2---
-1--2-StatusTests
00CoveredT1,T2,T3
01CoveredT1,T2,T3
10Not Covered

 LINE       132
 EXPRESSION (timeout_i == '0)
            --------1--------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT1,T2,T3

 LINE       133
 EXPRESSION (integ_period_msk_i == '0)
            -------------1------------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT1,T2,T3

 LINE       134
 EXPRESSION (cnsty_period_msk_i == '0)
            -------------1------------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT1,T2,T3

 LINE       135
 EXPRESSION (integ_cnt == '0)
            --------1--------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT1,T2,T3

 LINE       136
 EXPRESSION (cnsty_cnt == '0)
            --------1--------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT1,T2,T3

 LINE       138
 EXPRESSION (integ_set_period || integ_set_timeout)
             --------1-------    --------2--------
-1--2-StatusTests
00CoveredT1,T2,T3
01CoveredT6,T7,T17
10CoveredT6,T7,T17

 LINE       139
 EXPRESSION (cnsty_set_period || cnsty_set_timeout)
             --------1-------    --------2--------
-1--2-StatusTests
00CoveredT1,T2,T3
01CoveredT3,T6,T7
10CoveredT3,T6,T7

 LINE       143
 EXPRESSION (integ_set_period ? ((lfsr_state & integ_mask)) : (40'(timeout_i)))
             --------1-------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT6,T7,T17

 LINE       144
 EXPRESSION (cnsty_set_period ? ((lfsr_state & cnsty_mask)) : (40'(timeout_i)))
             --------1-------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT3,T6,T7

 LINE       167
 EXPRESSION (((!cnsty_cnt_zero)) && ((!cnsty_cnt_pause)))
             ---------1---------    ----------2---------
-1--2-StatusTests
01CoveredT1,T2,T3
10CoveredT7,T125,T92
11CoveredT3,T6,T7

 LINE       191
 EXPRESSION (set_all_integ_reqs ? ({otp_ctrl_reg_pkg::NumPart {1'b1}}) : ((integ_chk_req_q & (~integ_chk_ack_i))))
             ---------1--------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT6,T7,T17

 LINE       193
 EXPRESSION (set_all_cnsty_reqs ? ({otp_ctrl_reg_pkg::NumPart {1'b1}}) : ((cnsty_chk_req_q & (~cnsty_chk_ack_i))))
             ---------1--------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT3,T6,T7

 LINE       201
 EXPRESSION ((integ_chk_trig_q & ((~clr_integ_chk_trig))) | integ_chk_trig_i)
             ----------------------1---------------------   --------2-------
-1--2-StatusTests
00CoveredT1,T2,T3
01CoveredT7,T12,T17
10Not Covered

 LINE       201
 SUB-EXPRESSION (integ_chk_trig_q & ((~clr_integ_chk_trig)))
                 --------1-------   -----------2-----------
-1--2-StatusTests
01CoveredT1,T2,T3
10CoveredT7,T12,T17
11Not Covered

 LINE       202
 EXPRESSION ((cnsty_chk_trig_q & ((~clr_cnsty_chk_trig))) | cnsty_chk_trig_i)
             ----------------------1---------------------   --------2-------
-1--2-StatusTests
00CoveredT1,T2,T3
01CoveredT3,T7,T12
10CoveredT7,T17,T100

 LINE       202
 SUB-EXPRESSION (cnsty_chk_trig_q & ((~clr_cnsty_chk_trig)))
                 --------1-------   -----------2-----------
-1--2-StatusTests
01CoveredT1,T2,T3
10CoveredT3,T7,T12
11CoveredT7,T17,T100

 LINE       262
 EXPRESSION (cnsty_chk_trig_q || integ_chk_trig_q)
             --------1-------    --------2-------
-1--2-StatusTests
00CoveredT1,T2,T3
01CoveredT7,T129,T18
10CoveredT3,T7,T12

 LINE       283
 EXPRESSION ((((!integ_msk_zero)) && integ_cnt_zero) || integ_chk_trig_q)
             -------------------1-------------------    --------2-------
-1--2-StatusTests
00CoveredT1,T2,T3
01CoveredT7,T17,T100
10CoveredT6,T101,T95

 LINE       283
 SUB-EXPRESSION (((!integ_msk_zero)) && integ_cnt_zero)
                 ---------1---------    -------2------
-1--2-StatusTests
01CoveredT1,T2,T3
10CoveredT6,T101,T95
11CoveredT6,T101,T95

 LINE       288
 EXPRESSION ((((!cnsty_msk_zero)) && cnsty_cnt_zero) || cnsty_chk_trig_q)
             -------------------1-------------------    --------2-------
-1--2-StatusTests
00CoveredT1,T2,T3
01CoveredT3,T7,T17
10CoveredT6,T95,T141

 LINE       288
 SUB-EXPRESSION (((!cnsty_msk_zero)) && cnsty_cnt_zero)
                 ---------1---------    -------2------
-1--2-StatusTests
01CoveredT1,T2,T3
10CoveredT6,T95,T141
11CoveredT6,T95,T141

 LINE       301
 EXPRESSION (((!timeout_zero)) && integ_cnt_zero)
             --------1--------    -------2------
-1--2-StatusTests
01CoveredT6,T126,T128
10CoveredT7,T17,T100
11CoveredT100,T101,T106

 LINE       304
 EXPRESSION (integ_chk_req_q == '0)
            -----------1-----------
-1-StatusTests
0CoveredT6,T7,T17
1CoveredT6,T7,T17

 LINE       323
 EXPRESSION (((!timeout_zero)) && cnsty_cnt_zero)
             --------1--------    -------2------
-1--2-StatusTests
01CoveredT6,T126,T95
10CoveredT3,T7,T17
11CoveredT6,T95,T96

 LINE       326
 EXPRESSION (cnsty_chk_req_q == '0)
            -----------1-----------
-1-StatusTests
0CoveredT3,T6,T7
1CoveredT3,T6,T7

FSM Coverage for Instance : tb.dut.u_otp_ctrl_lfsr_timer
Summary for FSM :: state_q
TotalCoveredPercent
States 5 5 100.00 (Not included in score)
Transitions 9 9 100.00
Sequences 0 0

State, Transition and Sequence Details for FSM :: state_q
statesLine No.CoveredTests
CnstyWaitSt 289 Covered T3,T6,T7
ErrorSt 302 Covered T6,T12,T94
IdleSt 275 Covered T1,T2,T3
IntegWaitSt 284 Covered T6,T7,T17
ResetSt 273 Covered T1,T2,T3


transitionsLine No.CoveredTests
CnstyWaitSt->ErrorSt 324 Covered T6,T95,T96
CnstyWaitSt->IdleSt 327 Covered T3,T6,T7
IdleSt->CnstyWaitSt 289 Covered T3,T6,T7
IdleSt->ErrorSt 358 Covered T12,T94,T128
IdleSt->IntegWaitSt 284 Covered T6,T7,T17
IntegWaitSt->ErrorSt 302 Covered T100,T101,T106
IntegWaitSt->IdleSt 305 Covered T6,T7,T17
ResetSt->ErrorSt 358 Covered T97,T281,T139
ResetSt->IdleSt 275 Covered T1,T2,T3



Branch Coverage for Instance : tb.dut.u_otp_ctrl_lfsr_timer
Line No.TotalCoveredPercent
Branches 34 31 91.18
TERNARY 72 4 2 50.00
TERNARY 87 2 1 50.00
TERNARY 143 2 2 100.00
TERNARY 144 2 2 100.00
TERNARY 191 2 2 100.00
TERNARY 193 2 2 100.00
CASE 269 14 14 100.00
IF 356 2 2 100.00
IF 367 2 2 100.00
IF 370 2 2 100.00


72 assign reseed_cnt_d = (reseed_en) ? '0 : -1- ==> 73 (edn_req_o) ? reseed_cnt_q : -2- ==> 74 (lfsr_en) ? reseed_cnt_q + 1'b1 : -3- ==> ==>

Branches:
-1--2--3-StatusTests
1 - - Not Covered
0 1 - Not Covered
0 0 1 Covered T1,T2,T3
0 0 0 Covered T1,T2,T3


87 assign entropy = (reseed_en) ? edn_data_i[LfsrWidth-1:0] : '0; -1- ==> ==>

Branches:
-1-StatusTests
1 Not Covered
0 Covered T1,T2,T3


143 assign integ_cnt_set_val = (integ_set_period) ? (lfsr_state & integ_mask) : LfsrWidth'(timeout_i); -1- ==> ==>

Branches:
-1-StatusTests
1 Covered T6,T7,T17
0 Covered T1,T2,T3


144 assign cnsty_cnt_set_val = (cnsty_set_period) ? (lfsr_state & cnsty_mask) : LfsrWidth'(timeout_i); -1- ==> ==>

Branches:
-1-StatusTests
1 Covered T3,T6,T7
0 Covered T1,T2,T3


191 assign integ_chk_req_d = (set_all_integ_reqs) ? {NumPart{1'b1}} : -1- ==> ==>

Branches:
-1-StatusTests
1 Covered T6,T7,T17
0 Covered T1,T2,T3


193 assign cnsty_chk_req_d = (set_all_cnsty_reqs) ? {NumPart{1'b1}} : -1- ==> ==>

Branches:
-1-StatusTests
1 Covered T3,T6,T7
0 Covered T1,T2,T3


269 unique case (state_q) -1- 270 /////////////////////////////////////////////////////////////////// 271 // Wait until enabled. We never return to this state 272 // once enabled! 273 ResetSt: begin 274 if (timer_en_i) begin -2- 275 state_d = IdleSt; ==> 276 lfsr_en = 1'b1; 277 end MISSING_ELSE ==> 278 end 279 /////////////////////////////////////////////////////////////////// 280 // Wait here until one of the two timers expires (if enabled) or if 281 // a check is triggered externally. 282 IdleSt: begin 283 if ((!integ_msk_zero && integ_cnt_zero) || integ_chk_trig_q) begin -3- 284 state_d = IntegWaitSt; ==> 285 integ_set_timeout = 1'b1; 286 set_all_integ_reqs = 1'b1; 287 clr_integ_chk_trig = integ_chk_trig_q; 288 end else if ((!cnsty_msk_zero && cnsty_cnt_zero) || cnsty_chk_trig_q) begin -4- 289 state_d = CnstyWaitSt; ==> 290 cnsty_set_timeout = 1'b1; 291 set_all_cnsty_reqs = 1'b1; 292 clr_cnsty_chk_trig = cnsty_chk_trig_q; 293 end MISSING_ELSE ==> 294 end 295 /////////////////////////////////////////////////////////////////// 296 // Wait for all the partitions to respond and go back to idle. 297 // If the timeout is enabled, bail out into terminal error state 298 // if the timeout counter expires (this will raise an alert). 299 IntegWaitSt: begin 300 chk_pending_o = 1'b1; 301 if (!timeout_zero && integ_cnt_zero) begin -5- 302 state_d = ErrorSt; ==> 303 chk_timeout_d = 1'b1; 304 end else if (integ_chk_req_q == '0) begin -6- 305 state_d = IdleSt; ==> 306 // This draws the next wait period. 307 integ_set_period = 1'b1; 308 lfsr_en = 1'b1; 309 end MISSING_ELSE ==> 310 end 311 /////////////////////////////////////////////////////////////////// 312 // Wait for all the partitions to respond and go back to idle. 313 // If the timeout is enabled, bail out into terminal error state 314 // if the timeout counter expires (this will raise an alert). 315 CnstyWaitSt: begin 316 chk_pending_o = 1'b1; 317 // Note that consistency checks go back and read from OTP. Hence, 318 // life cycle transitions and DAI programming operations 319 // may interfere with these checks and cause them to take longer 320 // than typically expected. Therefore, the timeout counter is stopped 321 // during programming operations. 322 cnsty_cnt_pause = otp_prog_busy_i; 323 if (!timeout_zero && cnsty_cnt_zero) begin -7- 324 state_d = ErrorSt; ==> 325 chk_timeout_d = 1'b1; 326 end else if (cnsty_chk_req_q == '0) begin -8- 327 state_d = IdleSt; ==> 328 // This draws the next wait period. 329 cnsty_set_period = 1'b1; 330 lfsr_en = 1'b1; 331 end MISSING_ELSE ==> 332 end 333 /////////////////////////////////////////////////////////////////// 334 // Terminal error state. This raises an alert. 335 ErrorSt: begin 336 // Continuously clear pending checks. 337 clr_integ_chk_trig = 1'b1; 338 clr_cnsty_chk_trig = 1'b1; 339 if (!chk_timeout_q) begin -9- 340 fsm_err_o = 1'b1; ==> 341 end MISSING_ELSE ==> 342 end 343 /////////////////////////////////////////////////////////////////// 344 // This should never happen, hence we directly jump into the 345 // error state, where an alert will be triggered. 346 default: begin 347 state_d = ErrorSt; ==>

Branches:
-1--2--3--4--5--6--7--8--9-StatusTests
ResetSt 1 - - - - - - - Covered T1,T2,T3
ResetSt 0 - - - - - - - Covered T1,T2,T3
IdleSt - 1 - - - - - - Covered T6,T7,T17
IdleSt - 0 1 - - - - - Covered T3,T6,T7
IdleSt - 0 0 - - - - - Covered T1,T2,T3
IntegWaitSt - - - 1 - - - - Covered T100,T101,T106
IntegWaitSt - - - 0 1 - - - Covered T6,T7,T17
IntegWaitSt - - - 0 0 - - - Covered T6,T7,T17
CnstyWaitSt - - - - - 1 - - Covered T6,T95,T96
CnstyWaitSt - - - - - 0 1 - Covered T3,T6,T7
CnstyWaitSt - - - - - 0 0 - Covered T3,T6,T7
ErrorSt - - - - - - - 1 Covered T12,T94,T128
ErrorSt - - - - - - - 0 Covered T6,T100,T101
default - - - - - - - - Covered T22,T23,T24


356 if (lfsr_err || integ_cnt_err || cnsty_cnt_err || -1- 357 lc_ctrl_pkg::lc_tx_test_true_loose(escalate_en_i)) begin 358 state_d = ErrorSt; ==> 359 fsm_err_o = 1'b1; 360 end MISSING_ELSE ==>

Branches:
-1-StatusTests
1 Covered T12,T94,T128
0 Covered T1,T2,T3


367 `PRIM_FLOP_SPARSE_FSM(u_state_regs, state_d, state_q, state_e, ResetSt) -1- ==> ==>

Branches:
-1-StatusTests
1 Covered T1,T2,T3
0 Covered T1,T2,T3


370 if (!rst_ni) begin -1- 371 integ_chk_req_q <= '0; ==> 372 cnsty_chk_req_q <= '0; 373 chk_timeout_q <= 1'b0; 374 reseed_cnt_q <= '0; 375 integ_chk_trig_q <= 1'b0; 376 cnsty_chk_trig_q <= 1'b0; 377 end else begin 378 integ_chk_req_q <= integ_chk_req_d; ==>

Branches:
-1-StatusTests
1 Covered T1,T2,T3
0 Covered T1,T2,T3


Assert Coverage for Instance : tb.dut.u_otp_ctrl_lfsr_timer
TotalAttemptedPercentSucceeded/MatchedPercent
Assertions 7 7 100.00 7 100.00
Cover properties 0 0 0
Cover sequences 0 0 0
Total 7 7 100.00 7 100.00




Assertion Details

NameAttemptsReal SuccessesFailuresIncomplete
ChkPendingKnown_A 87543204 86701732 0 0
ChkTimeoutKnown_A 87543204 86701732 0 0
CnstyChkReqKnown_A 87543204 86701732 0 0
EdnIsWideEnough_A 1124 1124 0 0
EdnReqKnown_A 87543204 86701732 0 0
IntegChkReqKnown_A 87543204 86701732 0 0
u_state_regs_A 87543204 86701732 0 0


ChkPendingKnown_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 87543204 86701732 0 0
T1 5432 5382 0 0
T2 10698 10452 0 0
T3 25481 25010 0 0
T4 10281 10014 0 0
T5 4680 4619 0 0
T6 40011 39222 0 0
T7 36446 35679 0 0
T11 6282 6220 0 0
T12 98597 98413 0 0
T13 28315 27844 0 0

ChkTimeoutKnown_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 87543204 86701732 0 0
T1 5432 5382 0 0
T2 10698 10452 0 0
T3 25481 25010 0 0
T4 10281 10014 0 0
T5 4680 4619 0 0
T6 40011 39222 0 0
T7 36446 35679 0 0
T11 6282 6220 0 0
T12 98597 98413 0 0
T13 28315 27844 0 0

CnstyChkReqKnown_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 87543204 86701732 0 0
T1 5432 5382 0 0
T2 10698 10452 0 0
T3 25481 25010 0 0
T4 10281 10014 0 0
T5 4680 4619 0 0
T6 40011 39222 0 0
T7 36446 35679 0 0
T11 6282 6220 0 0
T12 98597 98413 0 0
T13 28315 27844 0 0

EdnIsWideEnough_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 1124 1124 0 0
T1 1 1 0 0
T2 1 1 0 0
T3 1 1 0 0
T4 1 1 0 0
T5 1 1 0 0
T6 1 1 0 0
T7 1 1 0 0
T11 1 1 0 0
T12 1 1 0 0
T13 1 1 0 0

EdnReqKnown_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 87543204 86701732 0 0
T1 5432 5382 0 0
T2 10698 10452 0 0
T3 25481 25010 0 0
T4 10281 10014 0 0
T5 4680 4619 0 0
T6 40011 39222 0 0
T7 36446 35679 0 0
T11 6282 6220 0 0
T12 98597 98413 0 0
T13 28315 27844 0 0

IntegChkReqKnown_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 87543204 86701732 0 0
T1 5432 5382 0 0
T2 10698 10452 0 0
T3 25481 25010 0 0
T4 10281 10014 0 0
T5 4680 4619 0 0
T6 40011 39222 0 0
T7 36446 35679 0 0
T11 6282 6220 0 0
T12 98597 98413 0 0
T13 28315 27844 0 0

u_state_regs_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 87543204 86701732 0 0
T1 5432 5382 0 0
T2 10698 10452 0 0
T3 25481 25010 0 0
T4 10281 10014 0 0
T5 4680 4619 0 0
T6 40011 39222 0 0
T7 36446 35679 0 0
T11 6282 6220 0 0
T12 98597 98413 0 0
T13 28315 27844 0 0

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