Line Coverage for Module :
flash_phy_prog
| Line No. | Total | Covered | Percent |
TOTAL | | 96 | 96 | 100.00 |
CONT_ASSIGN | 111 | 1 | 1 | 100.00 |
CONT_ASSIGN | 122 | 1 | 1 | 100.00 |
CONT_ASSIGN | 126 | 1 | 1 | 100.00 |
ALWAYS | 130 | 3 | 3 | 100.00 |
CONT_ASSIGN | 138 | 1 | 1 | 100.00 |
CONT_ASSIGN | 143 | 1 | 1 | 100.00 |
CONT_ASSIGN | 144 | 1 | 1 | 100.00 |
CONT_ASSIGN | 147 | 1 | 1 | 100.00 |
CONT_ASSIGN | 148 | 1 | 1 | 100.00 |
ALWAYS | 151 | 6 | 6 | 100.00 |
ALWAYS | 164 | 3 | 3 | 100.00 |
ALWAYS | 174 | 51 | 51 | 100.00 |
ALWAYS | 299 | 12 | 12 | 100.00 |
CONT_ASSIGN | 314 | 1 | 1 | 100.00 |
ALWAYS | 323 | 4 | 4 | 100.00 |
CONT_ASSIGN | 331 | 1 | 1 | 100.00 |
CONT_ASSIGN | 352 | 1 | 1 | 100.00 |
CONT_ASSIGN | 355 | 1 | 1 | 100.00 |
CONT_ASSIGN | 365 | 1 | 1 | 100.00 |
CONT_ASSIGN | 366 | 1 | 1 | 100.00 |
ALWAYS | 369 | 3 | 3 | 100.00 |
110 // selects empty data or real data
111 1/1 assign pack_data = (data_sel == Actual) ? data_i[BusWidth-1:0] : {BusWidth{1'b1}};
Tests: T1 T2 T3
112
113 logic data_intg_ok;
114 logic data_err;
115
116 // use the tlul integrity module directly for bus integrity
117 // SEC_CM: MEM.BUS.INTEGRITY
118 tlul_data_integ_dec u_data_intg_chk (
119 .data_intg_i(data_i),
120 .data_err_o(data_err)
121 );
122 1/1 assign data_intg_ok = ~data_err;
Tests: T1 T2 T3
123
124 logic data_invalid_q, data_invalid_d;
125 // hold on integrity failure indication until reset
126 1/1 assign data_invalid_d = data_invalid_q |
Tests: T1 T2 T3
127 (pack_valid & ~data_intg_ok);
128
129 always_ff @(posedge clk_i or negedge rst_ni) begin
130 1/1 if (!rst_ni) begin
Tests: T1 T2 T3
131 1/1 data_invalid_q <= '0;
Tests: T1 T2 T3
132 end else begin
133 1/1 data_invalid_q <= data_invalid_d;
Tests: T1 T2 T3
134 end
135 end
136
137 // indication to upper layer presence of error
138 1/1 assign intg_err_o = data_invalid_q;
Tests: T1 T2 T3
139
140 // if integrity failure is seen, fake communication with flash
141 // and simply terminate
142 logic ack, done;
143 1/1 assign ack = ack_i | data_invalid_q;
Tests: T1 T2 T3
144 1/1 assign done = done_i | data_invalid_q;
Tests: T1 T2 T3
145
146 // next idx will be aligned
147 1/1 assign idx_sub_one = idx - 1'b1;
Tests: T1 T2 T3
148 1/1 assign align_next = (idx > '0) ? (idx_sub_one == sel_i) : 1'b0;
Tests: T1 T2 T3
149
150 always_ff @(posedge clk_i or negedge rst_ni) begin
151 1/1 if (!rst_ni) begin
Tests: T1 T2 T3
152 1/1 idx <= '0;
Tests: T1 T2 T3
153 1/1 end else if (pack_valid && idx == MaxIdx) begin
Tests: T1 T2 T3
154 // when a flash word is packed full, return index to 0
155 1/1 idx <= '0;
Tests: T1 T4 T5
156 1/1 end else if (pack_valid) begin
Tests: T1 T2 T3
157 // increment otherwise
158 1/1 idx <= idx + 1'b1;
Tests: T1 T4 T5
159 end
MISSING_ELSE
160 end
161
162
163 // SEC_CM: PHY_PROG.FSM.SPARSE
164 3/3 `PRIM_FLOP_SPARSE_FSM(u_state_regs, state_d, state_q, state_e, StIdle)
Tests: T1 T2 T3 | T1 T2 T3 | T1 T2 T3
PRIM_FLOP_SPARSE_FSM(u_state_regs, state_d, state_q, state_e, StIdle):
164.1 `ifdef SIMULATION
164.2 prim_sparse_fsm_flop #(
164.3 .StateEnumT(state_e),
164.4 .Width($bits(state_e)),
164.5 .ResetValue($bits(state_e)'(StIdle)),
164.6 .EnableAlertTriggerSVA(1),
164.7 .CustomForceName("state_q")
164.8 ) u_state_regs (
164.9 .clk_i ( clk_i ),
164.10 .rst_ni ( rst_ni ),
164.11 .state_i ( state_d ),
164.12 .state_o ( )
164.13 );
164.14 always_ff @(posedge clk_i or negedge rst_ni) begin
164.15 1/1 if (!rst_ni) begin
Tests: T1 T2 T3
164.16 1/1 state_q <= StIdle;
Tests: T1 T2 T3
164.17 end else begin
164.18 1/1 state_q <= state_d;
Tests: T1 T2 T3
164.19 end
164.20 end
164.21 u_state_regs_A: assert property (@(posedge clk_i) disable iff ((!rst_ni) !== '0) (state_q === u_state_regs.state_o))
164.22 else begin
164.23 `ifdef UVM
164.24 uvm_pkg::uvm_report_error("ASSERT FAILED", "u_state_regs_A", uvm_pkg::UVM_NONE,
164.25 "../src/lowrisc_opentitan_top_earlgrey_flash_ctrl_0.1/rtl/flash_phy_prog.sv", 164, "", 1);
164.26 `else
164.27 $error("%0t: (%0s:%0d) [%m] [ASSERT FAILED] %0s", $time, `__FILE__, `__LINE__,
164.28 `PRIM_STRINGIFY(u_state_regs_A));
164.29 `endif
164.30 end
164.31 `else
164.32 prim_sparse_fsm_flop #(
164.33 .StateEnumT(state_e),
164.34 .Width($bits(state_e)),
164.35 .ResetValue($bits(state_e)'(StIdle)),
164.36 .EnableAlertTriggerSVA(1)
164.37 ) u_state_regs (
164.38 .clk_i ( `PRIM_FLOP_CLK ),
164.39 .rst_ni ( `PRIM_FLOP_RST ),
164.40 .state_i ( state_d ),
164.41 .state_o ( state_q )
164.42 );
164.43 `endif165
166 // If the first beat of an incoming transaction is not aligned to word boundary (for example
167 // if each flash word is 4 bus words wide, and the first word to program starts at index 1),
168 // the fsm pre-packs the flash word with empty words until the supplied index.
169 // Once at the index, real data supplied from the flash controller is packed until the last
170 // beat of data. At the last beat of data, if it is not also aligned (index 3 in this example),
171 // more empty words are packed at the end to fill out the word.
172 //
173 always_comb begin
174 1/1 state_d = state_q;
Tests: T1 T2 T3
175
176 1/1 pack_valid = 1'b0;
Tests: T1 T2 T3
177 1/1 data_sel = Filler;
Tests: T1 T2 T3
178 1/1 plain_ecc_en = 1'b0;
Tests: T1 T2 T3
179 1/1 req_o = 1'b0;
Tests: T1 T2 T3
180 1/1 ack_o = 1'b0;
Tests: T1 T2 T3
181 1/1 last_o = 1'b0;
Tests: T1 T2 T3
182 1/1 calc_req_o = 1'b0;
Tests: T1 T2 T3
183 1/1 scramble_req_o = 1'b0;
Tests: T1 T2 T3
184 1/1 fsm_err_o = 1'b0;
Tests: T1 T2 T3
185
186 1/1 unique case (state_q)
Tests: T1 T2 T3
187 StIdle: begin
188 // if first beat of a transaction is not aligned, prepack with empty bits
189 1/1 if (prim_mubi_pkg::mubi4_test_true_loose(disable_i)) begin
Tests: T1 T2 T3
190 // only disable during idle state to ensure program is able to gracefully complete
191 // this is important as we do not want to accidentally disturb any electrical procedure
192 // internal to the flash macro
193 1/1 state_d = StDisabled;
Tests: T5 T6 T7
194 1/1 end else if (req_i && |sel_i) begin
Tests: T1 T2 T3
195 1/1 state_d = StPrePack;
Tests: T34 T103 T201
196 1/1 end else if (req_i) begin
Tests: T1 T2 T3
197 1/1 state_d = StPackData;
Tests: T1 T4 T5
198 end
MISSING_ELSE
199 end
200
201 StPrePack: begin
202 // pack until currently supplied data
203 1/1 pack_valid = (idx < sel_i);
Tests: T34 T103 T201
204 1/1 if (idx == align_next) begin
Tests: T34 T103 T201
205 1/1 state_d = StPackData;
Tests: T34 T103 T201
206 end
==> MISSING_ELSE
207 end
208
209 StPackData: begin
210 1/1 pack_valid = req_i;
Tests: T1 T4 T5
211 1/1 data_sel = Actual;
Tests: T1 T4 T5
212
213 1/1 if (req_i && idx == MaxIdx) begin
Tests: T1 T4 T5
214 // last beat of a flash word
215 1/1 state_d = StCalcPlainEcc;
Tests: T1 T4 T5
216 1/1 end else if (req_i && last_i) begin
Tests: T1 T4 T5
217 // last beat is not aligned with the last entry of flash word
218 1/1 state_d = StPostPack;
Tests: T36 T34 T103
219 1/1 end else if (req_i) begin
Tests: T1 T4 T5
220 1/1 ack_o = 1'b1;
Tests: T1 T4 T5
221 end
MISSING_ELSE
222 end
223
224 StPostPack: begin
225 // supply filler data
226 1/1 pack_valid = 1'b1;
Tests: T36 T34 T103
227 1/1 data_sel = Filler;
Tests: T36 T34 T103
228
229 // finish packing remaining entries
230 1/1 if (idx == MaxIdx) begin
Tests: T36 T34 T103
231 1/1 state_d = StCalcPlainEcc;
Tests: T36 T34 T103
232 end
==> MISSING_ELSE
233 end
234
235 StCalcPlainEcc: begin
236 1/1 plain_ecc_en = 1'b1;
Tests: T1 T4 T5
237 1/1 state_d = scramble_i ? StCalcMask : StReqFlash;
Tests: T1 T4 T5
238 end
239
240 StCalcMask: begin
241 1/1 calc_req_o = 1'b1;
Tests: T5 T11 T8
242
243 1/1 if (calc_ack_i) begin
Tests: T5 T11 T8
244 1/1 state_d = StScrambleData;
Tests: T5 T11 T8
245 end
MISSING_ELSE
246 end
247
248 StScrambleData: begin
249 1/1 scramble_req_o = 1'b1;
Tests: T5 T11 T8
250
251 1/1 if (scramble_ack_i) begin
Tests: T5 T11 T8
252 1/1 state_d = StCalcEcc;
Tests: T5 T11 T8
253 end
MISSING_ELSE
254 end
255
256 StCalcEcc: begin
257 1/1 state_d = StReqFlash;
Tests: T5 T11 T8
258 end
259
260 StReqFlash: begin
261 // only request flash if data integrity was valid
262 1/1 req_o = ~data_invalid_q;
Tests: T1 T4 T5
263 1/1 last_o = last_i;
Tests: T1 T4 T5
264
265 // if this is the last beat of the program burst
266 // - wait for done
267 // if this is NOT the last beat
268 // - ack the upstream request and accept more beats
269 1/1 if (last_i) begin
Tests: T1 T4 T5
270 1/1 state_d = ack ? StWaitFlash : StReqFlash;
Tests: T1 T4 T5
271 end else begin
272 1/1 ack_o = ack;
Tests: T1 T4 T5
273 1/1 state_d = ack ? StIdle : StReqFlash;
Tests: T1 T4 T5
274 end
275 end
276
277 StWaitFlash: begin
278 1/1 if (done) begin
Tests: T1 T4 T5
279 1/1 ack_o = 1'b1;
Tests: T1 T4 T5
280 1/1 state_d = StIdle;
Tests: T1 T4 T5
281 end
MISSING_ELSE
282 end
283
284 StDisabled: begin
285 1/1 state_d = StDisabled;
Tests: T5 T6 T7
286 end
287
288 default: begin
289 fsm_err_o = 1'b1;
290 end
291
292 endcase // unique case (state_q)
293
294 end
295
296 logic [DataWidth-1:0] mask_q;
297
298 always_ff @(posedge clk_i or negedge rst_ni) begin
299 1/1 if (!rst_ni) begin
Tests: T1 T2 T3
300 1/1 packed_data <= '0;
Tests: T1 T2 T3
301 1/1 mask_q <= '0;
Tests: T1 T2 T3
302 1/1 end else if (req_o && ack) begin
Tests: T1 T2 T3
303 1/1 packed_data <= '0;
Tests: T1 T4 T5
304 1/1 end else if (calc_req_o && calc_ack_i) begin
Tests: T1 T2 T3
305 1/1 packed_data <= packed_data ^ mask_i;
Tests: T5 T11 T8
306 1/1 mask_q <= mask_i;
Tests: T5 T11 T8
307 1/1 end else if (scramble_req_o && scramble_ack_i) begin
Tests: T1 T2 T3
308 1/1 packed_data <= scrambled_data_i[DataWidth-1:0] ^ mask_q;
Tests: T5 T11 T8
309 1/1 end else if (pack_valid) begin
Tests: T1 T2 T3
310 1/1 packed_data[idx] <= pack_data;
Tests: T1 T4 T5
311 end
MISSING_ELSE
312 end
313
314 1/1 assign block_data_o = packed_data;
Tests: T1 T2 T3
315
316 // ECC handling
317 localparam int PlainDataEccWidth = DataWidth + 8;
318
319 logic [FullDataWidth-1:0] ecc_data;
320 logic [PlainDataEccWidth-1:0] plain_data_w_ecc;
321 logic [PlainIntgWidth-1:0] plain_data_ecc;
322 always_ff @(posedge clk_i or negedge rst_ni) begin
323 1/1 if (!rst_ni) begin
Tests: T1 T2 T3
324 1/1 plain_data_ecc <= '1;
Tests: T1 T2 T3
325 1/1 end else if (plain_ecc_en) begin
Tests: T1 T2 T3
326 1/1 plain_data_ecc <= plain_data_w_ecc[DataWidth +: PlainIntgWidth];
Tests: T1 T4 T5
327 end
MISSING_ELSE
328 end
329
330 logic [PlainDataWidth-1:0] ecc_data_in;
331 1/1 assign ecc_data_in = {plain_data_ecc, packed_data};
Tests: T1 T2 T3
332
333 // reliability ECC calculation
334 prim_secded_hamming_76_68_enc u_enc (
335 .data_i(ecc_data_in),
336 .data_o(ecc_data)
337 );
338
339 // integrity ECC calculation
340 // This instance can technically be merged with the instance above, but is
341 // kept separate for the sake of convenience
342 // The plain data ecc is calculated continuously from packed data (which changes
343 // from packed data to masked/scrambled data based on software configuration).
344 // The actual plain data ECC is explicitly captured during this process when
345 // it is required.
346 prim_secded_hamming_72_64_enc u_plain_enc (
347 .data_i(packed_data),
348 .data_o(plain_data_w_ecc)
349 );
350
351 logic unused_data;
352 1/1 assign unused_data = |plain_data_w_ecc;
Tests: T1 T2 T3
353
354 // pad the remaining bits with '1' if ecc is not used.
355 1/1 assign data_o = ecc_i ? ecc_data : {{EccWidth{1'b1}}, ecc_data_in};
Tests: T1 T2 T3
356
357 /////////////////////////////////
358 // Assertions
359 /////////////////////////////////
360
361 `ifdef INC_ASSERT
362 logic txn_done;
363 logic [15:0] done_cnt_d, done_cnt_q;
364
365 1/1 assign txn_done = req_i && ack_o && last_i;
Tests: T1 T2 T3
366 1/1 assign done_cnt_d = txn_done ? '0 : (done ? done_cnt_q + 16'h1 : done_cnt_q);
Tests: T1 T2 T3
367
368 always_ff @(posedge clk_i or negedge rst_ni) begin
369 1/1 if (!rst_ni) begin
Tests: T1 T2 T3
370 1/1 done_cnt_q <= '0;
Tests: T1 T2 T3
371 end else begin
372 1/1 done_cnt_q <= done_cnt_d;
Tests: T1 T2 T3
Cond Coverage for Module :
flash_phy_prog
| Total | Covered | Percent |
Conditions | 65 | 61 | 93.85 |
Logical | 65 | 61 | 93.85 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 111
EXPRESSION ((data_sel == Actual) ? data_i[(flash_phy_pkg::BusWidth - 1):0] : ({flash_phy_pkg::BusWidth {1'b1}}))
----------1---------
-1- | Status | Tests |
0 | Covered | T1,T2,T3 |
1 | Covered | T1,T4,T5 |
LINE 111
SUB-EXPRESSION (data_sel == Actual)
----------1---------
-1- | Status | Tests |
0 | Covered | T1,T2,T3 |
1 | Covered | T1,T4,T5 |
LINE 126
EXPRESSION (data_invalid_q | (pack_valid & ((~data_intg_ok))))
-------1------ ----------------2---------------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Covered | T8,T20,T134 |
1 | 0 | Covered | T8,T20,T134 |
LINE 126
SUB-EXPRESSION (pack_valid & ((~data_intg_ok)))
-----1---- --------2--------
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T1,T4,T5 |
1 | 1 | Covered | T8,T20,T134 |
LINE 143
EXPRESSION (ack_i | data_invalid_q)
--1-- -------2------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Not Covered | |
1 | 0 | Covered | T1,T2,T3 |
LINE 144
EXPRESSION (done_i | data_invalid_q)
---1-- -------2------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Covered | T8,T20,T134 |
1 | 0 | Covered | T1,T2,T3 |
LINE 148
EXPRESSION ((idx > '0) ? (idx_sub_one == sel_i) : 1'b0)
-----1----
-1- | Status | Tests |
0 | Covered | T1,T2,T3 |
1 | Covered | T1,T4,T5 |
LINE 148
SUB-EXPRESSION (idx_sub_one == sel_i)
-----------1----------
-1- | Status | Tests |
0 | Covered | T1,T4,T5 |
1 | Covered | T36,T34,T103 |
LINE 153
EXPRESSION (pack_valid && (idx == MaxIdx))
-----1---- -------2-------
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T4,T5 |
1 | 0 | Covered | T1,T4,T5 |
1 | 1 | Covered | T1,T4,T5 |
LINE 153
SUB-EXPRESSION (idx == MaxIdx)
-------1-------
-1- | Status | Tests |
0 | Covered | T1,T2,T3 |
1 | Covered | T1,T4,T5 |
LINE 194
EXPRESSION (req_i && ((|sel_i)))
--1-- -----2----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T1,T4,T5 |
1 | 1 | Covered | T34,T103,T201 |
LINE 204
EXPRESSION (idx == align_next)
---------1---------
-1- | Status | Tests |
0 | Not Covered | |
1 | Covered | T34,T103,T201 |
LINE 213
EXPRESSION (req_i && (idx == MaxIdx))
--1-- -------2-------
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T4,T5 |
1 | 0 | Covered | T1,T4,T5 |
1 | 1 | Covered | T1,T4,T5 |
LINE 213
SUB-EXPRESSION (idx == MaxIdx)
-------1-------
-1- | Status | Tests |
0 | Covered | T1,T4,T5 |
1 | Covered | T1,T4,T5 |
LINE 216
EXPRESSION (req_i && last_i)
--1-- ---2--
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T4,T5 |
1 | 0 | Covered | T1,T4,T5 |
1 | 1 | Covered | T36,T34,T103 |
LINE 230
EXPRESSION (idx == MaxIdx)
-------1-------
-1- | Status | Tests |
0 | Not Covered | |
1 | Covered | T36,T34,T103 |
LINE 237
EXPRESSION (scramble_i ? StCalcMask : StReqFlash)
-----1----
-1- | Status | Tests |
0 | Covered | T1,T4,T53 |
1 | Covered | T5,T22,T11 |
LINE 270
EXPRESSION (ack ? StWaitFlash : StReqFlash)
-1-
-1- | Status | Tests |
0 | Covered | T1,T4,T31 |
1 | Covered | T1,T4,T5 |
LINE 273
EXPRESSION (ack ? StIdle : StReqFlash)
-1-
-1- | Status | Tests |
0 | Covered | T1,T4,T11 |
1 | Covered | T1,T4,T5 |
LINE 302
EXPRESSION (req_o && ack)
--1-- -2-
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T1,T4,T11 |
1 | 1 | Covered | T1,T4,T5 |
LINE 304
EXPRESSION (calc_req_o && calc_ack_i)
-----1---- -----2----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T5,T11,T8 |
1 | 1 | Covered | T5,T11,T8 |
LINE 307
EXPRESSION (scramble_req_o && scramble_ack_i)
-------1------ -------2------
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T5,T11,T8 |
1 | 1 | Covered | T5,T11,T8 |
LINE 355
EXPRESSION (ecc_i ? ecc_data : ({{flash_phy_pkg::EccWidth {1'b1}}, ecc_data_in}))
--1--
-1- | Status | Tests |
0 | Covered | T1,T2,T3 |
1 | Covered | T1,T2,T3 |
LINE 365
EXPRESSION (req_i && ack_o && last_i)
--1-- --2-- ---3--
-1- | -2- | -3- | Status | Tests |
0 | 1 | 1 | Not Covered | |
1 | 0 | 1 | Covered | T1,T4,T5 |
1 | 1 | 0 | Covered | T1,T4,T5 |
1 | 1 | 1 | Covered | T1,T4,T5 |
LINE 366
EXPRESSION (txn_done ? '0 : (done ? ((done_cnt_q + 16'b1)) : done_cnt_q))
----1---
-1- | Status | Tests |
0 | Covered | T1,T2,T3 |
1 | Covered | T1,T4,T5 |
LINE 366
SUB-EXPRESSION (done ? ((done_cnt_q + 16'b1)) : done_cnt_q)
--1-
-1- | Status | Tests |
0 | Covered | T1,T2,T3 |
1 | Covered | T1,T2,T3 |
FSM Coverage for Module :
flash_phy_prog
Summary for FSM :: state_q
| Total | Covered | Percent | |
States |
11 |
11 |
100.00 |
(Not included in score) |
Transitions |
15 |
15 |
100.00 |
|
Sequences |
0 |
0 |
|
|
State, Transition and Sequence Details for FSM :: state_q
states | Line No. | Covered | Tests |
StCalcEcc |
252 |
Covered |
T5,T11,T8 |
StCalcMask |
237 |
Covered |
T5,T11,T8 |
StCalcPlainEcc |
215 |
Covered |
T1,T4,T5 |
StDisabled |
193 |
Covered |
T5,T6,T7 |
StIdle |
273 |
Covered |
T1,T2,T3 |
StPackData |
197 |
Covered |
T1,T4,T5 |
StPostPack |
218 |
Covered |
T36,T34,T103 |
StPrePack |
195 |
Covered |
T34,T103,T201 |
StReqFlash |
237 |
Covered |
T1,T4,T5 |
StScrambleData |
244 |
Covered |
T5,T11,T8 |
StWaitFlash |
270 |
Covered |
T1,T4,T5 |
transitions | Line No. | Covered | Tests |
StCalcEcc->StReqFlash |
257 |
Covered |
T5,T11,T8 |
StCalcMask->StScrambleData |
244 |
Covered |
T5,T11,T8 |
StCalcPlainEcc->StCalcMask |
237 |
Covered |
T5,T11,T8 |
StCalcPlainEcc->StReqFlash |
237 |
Covered |
T1,T4,T53 |
StIdle->StDisabled |
193 |
Covered |
T5,T6,T7 |
StIdle->StPackData |
197 |
Covered |
T1,T4,T5 |
StIdle->StPrePack |
195 |
Covered |
T34,T103,T201 |
StPackData->StCalcPlainEcc |
215 |
Covered |
T1,T4,T5 |
StPackData->StPostPack |
218 |
Covered |
T36,T34,T103 |
StPostPack->StCalcPlainEcc |
231 |
Covered |
T36,T34,T103 |
StPrePack->StPackData |
205 |
Covered |
T34,T103,T201 |
StReqFlash->StIdle |
273 |
Covered |
T1,T4,T5 |
StReqFlash->StWaitFlash |
270 |
Covered |
T1,T4,T5 |
StScrambleData->StCalcEcc |
252 |
Covered |
T5,T11,T8 |
StWaitFlash->StIdle |
280 |
Covered |
T1,T4,T5 |
Branch Coverage for Module :
flash_phy_prog
| Line No. | Total | Covered | Percent |
Branches |
|
55 |
53 |
96.36 |
TERNARY |
111 |
2 |
2 |
100.00 |
TERNARY |
148 |
2 |
2 |
100.00 |
TERNARY |
355 |
2 |
2 |
100.00 |
TERNARY |
366 |
3 |
3 |
100.00 |
IF |
130 |
2 |
2 |
100.00 |
IF |
151 |
4 |
4 |
100.00 |
IF |
164 |
2 |
2 |
100.00 |
CASE |
186 |
27 |
25 |
92.59 |
IF |
299 |
6 |
6 |
100.00 |
IF |
323 |
3 |
3 |
100.00 |
IF |
369 |
2 |
2 |
100.00 |
111 assign pack_data = (data_sel == Actual) ? data_i[BusWidth-1:0] : {BusWidth{1'b1}};
-1-
==>
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T1,T4,T5 |
0 |
Covered |
T1,T2,T3 |
148 assign align_next = (idx > '0) ? (idx_sub_one == sel_i) : 1'b0;
-1-
==>
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T1,T4,T5 |
0 |
Covered |
T1,T2,T3 |
355 assign data_o = ecc_i ? ecc_data : {{EccWidth{1'b1}}, ecc_data_in};
-1-
==>
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T1,T2,T3 |
0 |
Covered |
T1,T2,T3 |
366 assign done_cnt_d = txn_done ? '0 : (done ? done_cnt_q + 16'h1 : done_cnt_q);
-1- -2-
==> ==>
==>
Branches:
-1- | -2- | Status | Tests |
1 |
- |
Covered |
T1,T4,T5 |
0 |
1 |
Covered |
T1,T2,T3 |
0 |
0 |
Covered |
T1,T2,T3 |
130 if (!rst_ni) begin
-1-
131 data_invalid_q <= '0;
==>
132 end else begin
133 data_invalid_q <= data_invalid_d;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T1,T2,T3 |
0 |
Covered |
T1,T2,T3 |
151 if (!rst_ni) begin
-1-
152 idx <= '0;
==>
153 end else if (pack_valid && idx == MaxIdx) begin
-2-
154 // when a flash word is packed full, return index to 0
155 idx <= '0;
==>
156 end else if (pack_valid) begin
-3-
157 // increment otherwise
158 idx <= idx + 1'b1;
==>
159 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T1,T4,T5 |
0 |
0 |
1 |
Covered |
T1,T4,T5 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
164 `PRIM_FLOP_SPARSE_FSM(u_state_regs, state_d, state_q, state_e, StIdle)
-1-
==>
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T1,T2,T3 |
0 |
Covered |
T1,T2,T3 |
186 unique case (state_q)
-1-
187 StIdle: begin
188 // if first beat of a transaction is not aligned, prepack with empty bits
189 if (prim_mubi_pkg::mubi4_test_true_loose(disable_i)) begin
-2-
190 // only disable during idle state to ensure program is able to gracefully complete
191 // this is important as we do not want to accidentally disturb any electrical procedure
192 // internal to the flash macro
193 state_d = StDisabled;
==>
194 end else if (req_i && |sel_i) begin
-3-
195 state_d = StPrePack;
==>
196 end else if (req_i) begin
-4-
197 state_d = StPackData;
==>
198 end
MISSING_ELSE
==>
199 end
200
201 StPrePack: begin
202 // pack until currently supplied data
203 pack_valid = (idx < sel_i);
204 if (idx == align_next) begin
-5-
205 state_d = StPackData;
==>
206 end
MISSING_ELSE
==>
207 end
208
209 StPackData: begin
210 pack_valid = req_i;
211 data_sel = Actual;
212
213 if (req_i && idx == MaxIdx) begin
-6-
214 // last beat of a flash word
215 state_d = StCalcPlainEcc;
==>
216 end else if (req_i && last_i) begin
-7-
217 // last beat is not aligned with the last entry of flash word
218 state_d = StPostPack;
==>
219 end else if (req_i) begin
-8-
220 ack_o = 1'b1;
==>
221 end
MISSING_ELSE
==>
222 end
223
224 StPostPack: begin
225 // supply filler data
226 pack_valid = 1'b1;
227 data_sel = Filler;
228
229 // finish packing remaining entries
230 if (idx == MaxIdx) begin
-9-
231 state_d = StCalcPlainEcc;
==>
232 end
MISSING_ELSE
==>
233 end
234
235 StCalcPlainEcc: begin
236 plain_ecc_en = 1'b1;
237 state_d = scramble_i ? StCalcMask : StReqFlash;
-10-
==>
==>
238 end
239
240 StCalcMask: begin
241 calc_req_o = 1'b1;
242
243 if (calc_ack_i) begin
-11-
244 state_d = StScrambleData;
==>
245 end
MISSING_ELSE
==>
246 end
247
248 StScrambleData: begin
249 scramble_req_o = 1'b1;
250
251 if (scramble_ack_i) begin
-12-
252 state_d = StCalcEcc;
==>
253 end
MISSING_ELSE
==>
254 end
255
256 StCalcEcc: begin
257 state_d = StReqFlash;
==>
258 end
259
260 StReqFlash: begin
261 // only request flash if data integrity was valid
262 req_o = ~data_invalid_q;
263 last_o = last_i;
264
265 // if this is the last beat of the program burst
266 // - wait for done
267 // if this is NOT the last beat
268 // - ack the upstream request and accept more beats
269 if (last_i) begin
-13-
270 state_d = ack ? StWaitFlash : StReqFlash;
-14-
==>
==>
271 end else begin
272 ack_o = ack;
273 state_d = ack ? StIdle : StReqFlash;
-15-
==>
==>
274 end
275 end
276
277 StWaitFlash: begin
278 if (done) begin
-16-
279 ack_o = 1'b1;
==>
280 state_d = StIdle;
281 end
MISSING_ELSE
==>
282 end
283
284 StDisabled: begin
285 state_d = StDisabled;
==>
286 end
287
288 default: begin
289 fsm_err_o = 1'b1;
==>
Branches:
-1- | -2- | -3- | -4- | -5- | -6- | -7- | -8- | -9- | -10- | -11- | -12- | -13- | -14- | -15- | -16- | Status | Tests |
StIdle |
1 |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T5,T6,T7 |
StIdle |
0 |
1 |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T34,T103,T201 |
StIdle |
0 |
0 |
1 |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T1,T4,T5 |
StIdle |
0 |
0 |
0 |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T1,T2,T3 |
StPrePack |
- |
- |
- |
1 |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T34,T103,T201 |
StPrePack |
- |
- |
- |
0 |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
Not Covered |
|
StPackData |
- |
- |
- |
- |
1 |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T1,T4,T5 |
StPackData |
- |
- |
- |
- |
0 |
1 |
- |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T36,T34,T103 |
StPackData |
- |
- |
- |
- |
0 |
0 |
1 |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T1,T4,T5 |
StPackData |
- |
- |
- |
- |
0 |
0 |
0 |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T1,T4,T5 |
StPostPack |
- |
- |
- |
- |
- |
- |
- |
1 |
- |
- |
- |
- |
- |
- |
- |
Covered |
T36,T34,T103 |
StPostPack |
- |
- |
- |
- |
- |
- |
- |
0 |
- |
- |
- |
- |
- |
- |
- |
Not Covered |
|
StCalcPlainEcc |
- |
- |
- |
- |
- |
- |
- |
- |
1 |
- |
- |
- |
- |
- |
- |
Covered |
T5,T22,T11 |
StCalcPlainEcc |
- |
- |
- |
- |
- |
- |
- |
- |
0 |
- |
- |
- |
- |
- |
- |
Covered |
T1,T4,T53 |
StCalcMask |
- |
- |
- |
- |
- |
- |
- |
- |
- |
1 |
- |
- |
- |
- |
- |
Covered |
T5,T11,T8 |
StCalcMask |
- |
- |
- |
- |
- |
- |
- |
- |
- |
0 |
- |
- |
- |
- |
- |
Covered |
T5,T11,T8 |
StScrambleData |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
1 |
- |
- |
- |
- |
Covered |
T5,T11,T8 |
StScrambleData |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
0 |
- |
- |
- |
- |
Covered |
T5,T11,T8 |
StCalcEcc |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T5,T11,T8 |
StReqFlash |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
1 |
1 |
- |
- |
Covered |
T1,T4,T5 |
StReqFlash |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
1 |
0 |
- |
- |
Covered |
T1,T4,T31 |
StReqFlash |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
0 |
- |
1 |
- |
Covered |
T1,T4,T5 |
StReqFlash |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
0 |
- |
0 |
- |
Covered |
T1,T4,T11 |
StWaitFlash |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
1 |
Covered |
T1,T4,T5 |
StWaitFlash |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
0 |
Covered |
T1,T4,T5 |
StDisabled |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T5,T6,T7 |
default |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T13,T14,T15 |
299 if (!rst_ni) begin
-1-
300 packed_data <= '0;
==>
301 mask_q <= '0;
302 end else if (req_o && ack) begin
-2-
303 packed_data <= '0;
==>
304 end else if (calc_req_o && calc_ack_i) begin
-3-
305 packed_data <= packed_data ^ mask_i;
==>
306 mask_q <= mask_i;
307 end else if (scramble_req_o && scramble_ack_i) begin
-4-
308 packed_data <= scrambled_data_i[DataWidth-1:0] ^ mask_q;
==>
309 end else if (pack_valid) begin
-5-
310 packed_data[idx] <= pack_data;
==>
311 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | -4- | -5- | Status | Tests |
1 |
- |
- |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
- |
- |
Covered |
T1,T4,T5 |
0 |
0 |
1 |
- |
- |
Covered |
T5,T11,T8 |
0 |
0 |
0 |
1 |
- |
Covered |
T5,T11,T8 |
0 |
0 |
0 |
0 |
1 |
Covered |
T1,T4,T5 |
0 |
0 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
323 if (!rst_ni) begin
-1-
324 plain_data_ecc <= '1;
==>
325 end else if (plain_ecc_en) begin
-2-
326 plain_data_ecc <= plain_data_w_ecc[DataWidth +: PlainIntgWidth];
==>
327 end
MISSING_ELSE
==>
Branches:
-1- | -2- | Status | Tests |
1 |
- |
Covered |
T1,T2,T3 |
0 |
1 |
Covered |
T1,T4,T5 |
0 |
0 |
Covered |
T1,T2,T3 |
369 if (!rst_ni) begin
-1-
370 done_cnt_q <= '0;
==>
371 end else begin
372 done_cnt_q <= done_cnt_d;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T1,T2,T3 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Module :
flash_phy_prog
Assertion Details
OneDonePerTxn_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
712171850 |
2356819 |
0 |
0 |
T1 |
3968 |
14 |
0 |
0 |
T2 |
2197 |
0 |
0 |
0 |
T3 |
14398 |
0 |
0 |
0 |
T4 |
2284 |
1 |
0 |
0 |
T5 |
967 |
1 |
0 |
0 |
T8 |
0 |
1 |
0 |
0 |
T10 |
1608 |
0 |
0 |
0 |
T16 |
2149 |
0 |
0 |
0 |
T17 |
2075 |
0 |
0 |
0 |
T18 |
1552 |
0 |
0 |
0 |
T19 |
1174 |
0 |
0 |
0 |
T26 |
5068 |
0 |
0 |
0 |
T31 |
1686 |
1 |
0 |
0 |
T32 |
38012 |
9 |
0 |
0 |
T33 |
0 |
80 |
0 |
0 |
T34 |
0 |
30 |
0 |
0 |
T36 |
0 |
2 |
0 |
0 |
T37 |
1755 |
1 |
0 |
0 |
T38 |
2047 |
1 |
0 |
0 |
T40 |
0 |
729 |
0 |
0 |
T49 |
6237 |
0 |
0 |
0 |
T50 |
0 |
44 |
0 |
0 |
T51 |
0 |
217 |
0 |
0 |
T53 |
1913 |
1 |
0 |
0 |
T55 |
162052 |
118 |
0 |
0 |
T66 |
0 |
126 |
0 |
0 |
T103 |
0 |
1 |
0 |
0 |
T114 |
4267 |
0 |
0 |
0 |
T126 |
1497 |
0 |
0 |
0 |
PostPackRule_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
712171850 |
1666 |
0 |
0 |
T27 |
0 |
3 |
0 |
0 |
T28 |
0 |
11 |
0 |
0 |
T29 |
0 |
2 |
0 |
0 |
T30 |
0 |
5 |
0 |
0 |
T34 |
191154 |
35 |
0 |
0 |
T35 |
0 |
2 |
0 |
0 |
T36 |
2996 |
1 |
0 |
0 |
T40 |
481732 |
0 |
0 |
0 |
T43 |
31354 |
0 |
0 |
0 |
T50 |
32980 |
0 |
0 |
0 |
T51 |
127312 |
0 |
0 |
0 |
T52 |
30677 |
0 |
0 |
0 |
T57 |
1977 |
0 |
0 |
0 |
T60 |
0 |
29 |
0 |
0 |
T61 |
0 |
36 |
0 |
0 |
T66 |
119892 |
0 |
0 |
0 |
T68 |
3434 |
0 |
0 |
0 |
T69 |
10945 |
0 |
0 |
0 |
T70 |
48523 |
0 |
0 |
0 |
T103 |
2828 |
3 |
0 |
0 |
T127 |
1564 |
0 |
0 |
0 |
T200 |
2088 |
0 |
0 |
0 |
T201 |
0 |
4 |
0 |
0 |
T219 |
0 |
1 |
0 |
0 |
T220 |
0 |
1 |
0 |
0 |
T221 |
0 |
3 |
0 |
0 |
PrePackRule_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
712171850 |
1129 |
0 |
0 |
T27 |
0 |
3 |
0 |
0 |
T28 |
0 |
6 |
0 |
0 |
T29 |
0 |
1 |
0 |
0 |
T30 |
0 |
5 |
0 |
0 |
T34 |
191154 |
34 |
0 |
0 |
T35 |
0 |
4 |
0 |
0 |
T40 |
481732 |
0 |
0 |
0 |
T51 |
127312 |
0 |
0 |
0 |
T60 |
0 |
36 |
0 |
0 |
T61 |
0 |
24 |
0 |
0 |
T66 |
119892 |
0 |
0 |
0 |
T68 |
3434 |
0 |
0 |
0 |
T69 |
21890 |
0 |
0 |
0 |
T70 |
97046 |
0 |
0 |
0 |
T103 |
5656 |
2 |
0 |
0 |
T127 |
3128 |
0 |
0 |
0 |
T200 |
4176 |
0 |
0 |
0 |
T201 |
0 |
3 |
0 |
0 |
T219 |
0 |
1 |
0 |
0 |
T220 |
0 |
1 |
0 |
0 |
T221 |
0 |
2 |
0 |
0 |
T222 |
0 |
1 |
0 |
0 |
WidthCheck_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
2094 |
2094 |
0 |
0 |
T1 |
2 |
2 |
0 |
0 |
T2 |
2 |
2 |
0 |
0 |
T3 |
2 |
2 |
0 |
0 |
T4 |
2 |
2 |
0 |
0 |
T5 |
2 |
2 |
0 |
0 |
T10 |
2 |
2 |
0 |
0 |
T16 |
2 |
2 |
0 |
0 |
T17 |
2 |
2 |
0 |
0 |
T18 |
2 |
2 |
0 |
0 |
T19 |
2 |
2 |
0 |
0 |
u_state_regs_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
712171850 |
710510120 |
0 |
0 |
T1 |
7936 |
7760 |
0 |
0 |
T2 |
4394 |
4212 |
0 |
0 |
T3 |
28796 |
28622 |
0 |
0 |
T4 |
4568 |
4448 |
0 |
0 |
T5 |
1934 |
1742 |
0 |
0 |
T10 |
3216 |
3050 |
0 |
0 |
T16 |
4298 |
4118 |
0 |
0 |
T17 |
4150 |
3982 |
0 |
0 |
T18 |
3104 |
2980 |
0 |
0 |
T19 |
2348 |
2208 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_eflash.gen_flash_cores[0].u_core.gen_prog_data.u_prog
| Line No. | Total | Covered | Percent |
TOTAL | | 96 | 96 | 100.00 |
CONT_ASSIGN | 111 | 1 | 1 | 100.00 |
CONT_ASSIGN | 122 | 1 | 1 | 100.00 |
CONT_ASSIGN | 126 | 1 | 1 | 100.00 |
ALWAYS | 130 | 3 | 3 | 100.00 |
CONT_ASSIGN | 138 | 1 | 1 | 100.00 |
CONT_ASSIGN | 143 | 1 | 1 | 100.00 |
CONT_ASSIGN | 144 | 1 | 1 | 100.00 |
CONT_ASSIGN | 147 | 1 | 1 | 100.00 |
CONT_ASSIGN | 148 | 1 | 1 | 100.00 |
ALWAYS | 151 | 6 | 6 | 100.00 |
ALWAYS | 164 | 3 | 3 | 100.00 |
ALWAYS | 174 | 51 | 51 | 100.00 |
ALWAYS | 299 | 12 | 12 | 100.00 |
CONT_ASSIGN | 314 | 1 | 1 | 100.00 |
ALWAYS | 323 | 4 | 4 | 100.00 |
CONT_ASSIGN | 331 | 1 | 1 | 100.00 |
CONT_ASSIGN | 352 | 1 | 1 | 100.00 |
CONT_ASSIGN | 355 | 1 | 1 | 100.00 |
CONT_ASSIGN | 365 | 1 | 1 | 100.00 |
CONT_ASSIGN | 366 | 1 | 1 | 100.00 |
ALWAYS | 369 | 3 | 3 | 100.00 |
110 // selects empty data or real data
111 1/1 assign pack_data = (data_sel == Actual) ? data_i[BusWidth-1:0] : {BusWidth{1'b1}};
Tests: T1 T2 T3
112
113 logic data_intg_ok;
114 logic data_err;
115
116 // use the tlul integrity module directly for bus integrity
117 // SEC_CM: MEM.BUS.INTEGRITY
118 tlul_data_integ_dec u_data_intg_chk (
119 .data_intg_i(data_i),
120 .data_err_o(data_err)
121 );
122 1/1 assign data_intg_ok = ~data_err;
Tests: T1 T2 T3
123
124 logic data_invalid_q, data_invalid_d;
125 // hold on integrity failure indication until reset
126 1/1 assign data_invalid_d = data_invalid_q |
Tests: T1 T2 T3
127 (pack_valid & ~data_intg_ok);
128
129 always_ff @(posedge clk_i or negedge rst_ni) begin
130 1/1 if (!rst_ni) begin
Tests: T1 T2 T3
131 1/1 data_invalid_q <= '0;
Tests: T1 T2 T3
132 end else begin
133 1/1 data_invalid_q <= data_invalid_d;
Tests: T1 T2 T3
134 end
135 end
136
137 // indication to upper layer presence of error
138 1/1 assign intg_err_o = data_invalid_q;
Tests: T1 T2 T3
139
140 // if integrity failure is seen, fake communication with flash
141 // and simply terminate
142 logic ack, done;
143 1/1 assign ack = ack_i | data_invalid_q;
Tests: T1 T2 T3
144 1/1 assign done = done_i | data_invalid_q;
Tests: T1 T2 T3
145
146 // next idx will be aligned
147 1/1 assign idx_sub_one = idx - 1'b1;
Tests: T1 T2 T3
148 1/1 assign align_next = (idx > '0) ? (idx_sub_one == sel_i) : 1'b0;
Tests: T1 T2 T3
149
150 always_ff @(posedge clk_i or negedge rst_ni) begin
151 1/1 if (!rst_ni) begin
Tests: T1 T2 T3
152 1/1 idx <= '0;
Tests: T1 T2 T3
153 1/1 end else if (pack_valid && idx == MaxIdx) begin
Tests: T1 T2 T3
154 // when a flash word is packed full, return index to 0
155 1/1 idx <= '0;
Tests: T1 T4 T5
156 1/1 end else if (pack_valid) begin
Tests: T1 T2 T3
157 // increment otherwise
158 1/1 idx <= idx + 1'b1;
Tests: T1 T4 T5
159 end
MISSING_ELSE
160 end
161
162
163 // SEC_CM: PHY_PROG.FSM.SPARSE
164 3/3 `PRIM_FLOP_SPARSE_FSM(u_state_regs, state_d, state_q, state_e, StIdle)
Tests: T1 T2 T3 | T1 T2 T3 | T1 T2 T3
PRIM_FLOP_SPARSE_FSM(u_state_regs, state_d, state_q, state_e, StIdle):
164.1 `ifdef SIMULATION
164.2 prim_sparse_fsm_flop #(
164.3 .StateEnumT(state_e),
164.4 .Width($bits(state_e)),
164.5 .ResetValue($bits(state_e)'(StIdle)),
164.6 .EnableAlertTriggerSVA(1),
164.7 .CustomForceName("state_q")
164.8 ) u_state_regs (
164.9 .clk_i ( clk_i ),
164.10 .rst_ni ( rst_ni ),
164.11 .state_i ( state_d ),
164.12 .state_o ( )
164.13 );
164.14 always_ff @(posedge clk_i or negedge rst_ni) begin
164.15 1/1 if (!rst_ni) begin
Tests: T1 T2 T3
164.16 1/1 state_q <= StIdle;
Tests: T1 T2 T3
164.17 end else begin
164.18 1/1 state_q <= state_d;
Tests: T1 T2 T3
164.19 end
164.20 end
164.21 u_state_regs_A: assert property (@(posedge clk_i) disable iff ((!rst_ni) !== '0) (state_q === u_state_regs.state_o))
164.22 else begin
164.23 `ifdef UVM
164.24 uvm_pkg::uvm_report_error("ASSERT FAILED", "u_state_regs_A", uvm_pkg::UVM_NONE,
164.25 "../src/lowrisc_opentitan_top_earlgrey_flash_ctrl_0.1/rtl/flash_phy_prog.sv", 164, "", 1);
164.26 `else
164.27 $error("%0t: (%0s:%0d) [%m] [ASSERT FAILED] %0s", $time, `__FILE__, `__LINE__,
164.28 `PRIM_STRINGIFY(u_state_regs_A));
164.29 `endif
164.30 end
164.31 `else
164.32 prim_sparse_fsm_flop #(
164.33 .StateEnumT(state_e),
164.34 .Width($bits(state_e)),
164.35 .ResetValue($bits(state_e)'(StIdle)),
164.36 .EnableAlertTriggerSVA(1)
164.37 ) u_state_regs (
164.38 .clk_i ( `PRIM_FLOP_CLK ),
164.39 .rst_ni ( `PRIM_FLOP_RST ),
164.40 .state_i ( state_d ),
164.41 .state_o ( state_q )
164.42 );
164.43 `endif165
166 // If the first beat of an incoming transaction is not aligned to word boundary (for example
167 // if each flash word is 4 bus words wide, and the first word to program starts at index 1),
168 // the fsm pre-packs the flash word with empty words until the supplied index.
169 // Once at the index, real data supplied from the flash controller is packed until the last
170 // beat of data. At the last beat of data, if it is not also aligned (index 3 in this example),
171 // more empty words are packed at the end to fill out the word.
172 //
173 always_comb begin
174 1/1 state_d = state_q;
Tests: T1 T2 T3
175
176 1/1 pack_valid = 1'b0;
Tests: T1 T2 T3
177 1/1 data_sel = Filler;
Tests: T1 T2 T3
178 1/1 plain_ecc_en = 1'b0;
Tests: T1 T2 T3
179 1/1 req_o = 1'b0;
Tests: T1 T2 T3
180 1/1 ack_o = 1'b0;
Tests: T1 T2 T3
181 1/1 last_o = 1'b0;
Tests: T1 T2 T3
182 1/1 calc_req_o = 1'b0;
Tests: T1 T2 T3
183 1/1 scramble_req_o = 1'b0;
Tests: T1 T2 T3
184 1/1 fsm_err_o = 1'b0;
Tests: T1 T2 T3
185
186 1/1 unique case (state_q)
Tests: T1 T2 T3
187 StIdle: begin
188 // if first beat of a transaction is not aligned, prepack with empty bits
189 1/1 if (prim_mubi_pkg::mubi4_test_true_loose(disable_i)) begin
Tests: T1 T2 T3
190 // only disable during idle state to ensure program is able to gracefully complete
191 // this is important as we do not want to accidentally disturb any electrical procedure
192 // internal to the flash macro
193 1/1 state_d = StDisabled;
Tests: T5 T6 T7
194 1/1 end else if (req_i && |sel_i) begin
Tests: T1 T2 T3
195 1/1 state_d = StPrePack;
Tests: T34 T103 T201
196 1/1 end else if (req_i) begin
Tests: T1 T2 T3
197 1/1 state_d = StPackData;
Tests: T1 T4 T5
198 end
MISSING_ELSE
199 end
200
201 StPrePack: begin
202 // pack until currently supplied data
203 1/1 pack_valid = (idx < sel_i);
Tests: T34 T103 T201
204 1/1 if (idx == align_next) begin
Tests: T34 T103 T201
205 1/1 state_d = StPackData;
Tests: T34 T103 T201
206 end
==> MISSING_ELSE
207 end
208
209 StPackData: begin
210 1/1 pack_valid = req_i;
Tests: T1 T4 T5
211 1/1 data_sel = Actual;
Tests: T1 T4 T5
212
213 1/1 if (req_i && idx == MaxIdx) begin
Tests: T1 T4 T5
214 // last beat of a flash word
215 1/1 state_d = StCalcPlainEcc;
Tests: T1 T4 T5
216 1/1 end else if (req_i && last_i) begin
Tests: T1 T4 T5
217 // last beat is not aligned with the last entry of flash word
218 1/1 state_d = StPostPack;
Tests: T34 T103 T201
219 1/1 end else if (req_i) begin
Tests: T1 T4 T5
220 1/1 ack_o = 1'b1;
Tests: T1 T4 T5
221 end
MISSING_ELSE
222 end
223
224 StPostPack: begin
225 // supply filler data
226 1/1 pack_valid = 1'b1;
Tests: T34 T103 T201
227 1/1 data_sel = Filler;
Tests: T34 T103 T201
228
229 // finish packing remaining entries
230 1/1 if (idx == MaxIdx) begin
Tests: T34 T103 T201
231 1/1 state_d = StCalcPlainEcc;
Tests: T34 T103 T201
232 end
==> MISSING_ELSE
233 end
234
235 StCalcPlainEcc: begin
236 1/1 plain_ecc_en = 1'b1;
Tests: T1 T4 T5
237 1/1 state_d = scramble_i ? StCalcMask : StReqFlash;
Tests: T1 T4 T5
238 end
239
240 StCalcMask: begin
241 1/1 calc_req_o = 1'b1;
Tests: T5 T11 T8
242
243 1/1 if (calc_ack_i) begin
Tests: T5 T11 T8
244 1/1 state_d = StScrambleData;
Tests: T5 T11 T8
245 end
MISSING_ELSE
246 end
247
248 StScrambleData: begin
249 1/1 scramble_req_o = 1'b1;
Tests: T5 T11 T8
250
251 1/1 if (scramble_ack_i) begin
Tests: T5 T11 T8
252 1/1 state_d = StCalcEcc;
Tests: T5 T11 T8
253 end
MISSING_ELSE
254 end
255
256 StCalcEcc: begin
257 1/1 state_d = StReqFlash;
Tests: T5 T11 T8
258 end
259
260 StReqFlash: begin
261 // only request flash if data integrity was valid
262 1/1 req_o = ~data_invalid_q;
Tests: T1 T4 T5
263 1/1 last_o = last_i;
Tests: T1 T4 T5
264
265 // if this is the last beat of the program burst
266 // - wait for done
267 // if this is NOT the last beat
268 // - ack the upstream request and accept more beats
269 1/1 if (last_i) begin
Tests: T1 T4 T5
270 1/1 state_d = ack ? StWaitFlash : StReqFlash;
Tests: T1 T4 T5
271 end else begin
272 1/1 ack_o = ack;
Tests: T1 T4 T5
273 1/1 state_d = ack ? StIdle : StReqFlash;
Tests: T1 T4 T5
274 end
275 end
276
277 StWaitFlash: begin
278 1/1 if (done) begin
Tests: T1 T4 T5
279 1/1 ack_o = 1'b1;
Tests: T1 T4 T5
280 1/1 state_d = StIdle;
Tests: T1 T4 T5
281 end
MISSING_ELSE
282 end
283
284 StDisabled: begin
285 1/1 state_d = StDisabled;
Tests: T5 T6 T7
286 end
287
288 default: begin
289 fsm_err_o = 1'b1;
290 end
291
292 endcase // unique case (state_q)
293
294 end
295
296 logic [DataWidth-1:0] mask_q;
297
298 always_ff @(posedge clk_i or negedge rst_ni) begin
299 1/1 if (!rst_ni) begin
Tests: T1 T2 T3
300 1/1 packed_data <= '0;
Tests: T1 T2 T3
301 1/1 mask_q <= '0;
Tests: T1 T2 T3
302 1/1 end else if (req_o && ack) begin
Tests: T1 T2 T3
303 1/1 packed_data <= '0;
Tests: T1 T4 T5
304 1/1 end else if (calc_req_o && calc_ack_i) begin
Tests: T1 T2 T3
305 1/1 packed_data <= packed_data ^ mask_i;
Tests: T5 T11 T8
306 1/1 mask_q <= mask_i;
Tests: T5 T11 T8
307 1/1 end else if (scramble_req_o && scramble_ack_i) begin
Tests: T1 T2 T3
308 1/1 packed_data <= scrambled_data_i[DataWidth-1:0] ^ mask_q;
Tests: T5 T11 T8
309 1/1 end else if (pack_valid) begin
Tests: T1 T2 T3
310 1/1 packed_data[idx] <= pack_data;
Tests: T1 T4 T5
311 end
MISSING_ELSE
312 end
313
314 1/1 assign block_data_o = packed_data;
Tests: T1 T2 T3
315
316 // ECC handling
317 localparam int PlainDataEccWidth = DataWidth + 8;
318
319 logic [FullDataWidth-1:0] ecc_data;
320 logic [PlainDataEccWidth-1:0] plain_data_w_ecc;
321 logic [PlainIntgWidth-1:0] plain_data_ecc;
322 always_ff @(posedge clk_i or negedge rst_ni) begin
323 1/1 if (!rst_ni) begin
Tests: T1 T2 T3
324 1/1 plain_data_ecc <= '1;
Tests: T1 T2 T3
325 1/1 end else if (plain_ecc_en) begin
Tests: T1 T2 T3
326 1/1 plain_data_ecc <= plain_data_w_ecc[DataWidth +: PlainIntgWidth];
Tests: T1 T4 T5
327 end
MISSING_ELSE
328 end
329
330 logic [PlainDataWidth-1:0] ecc_data_in;
331 1/1 assign ecc_data_in = {plain_data_ecc, packed_data};
Tests: T1 T2 T3
332
333 // reliability ECC calculation
334 prim_secded_hamming_76_68_enc u_enc (
335 .data_i(ecc_data_in),
336 .data_o(ecc_data)
337 );
338
339 // integrity ECC calculation
340 // This instance can technically be merged with the instance above, but is
341 // kept separate for the sake of convenience
342 // The plain data ecc is calculated continuously from packed data (which changes
343 // from packed data to masked/scrambled data based on software configuration).
344 // The actual plain data ECC is explicitly captured during this process when
345 // it is required.
346 prim_secded_hamming_72_64_enc u_plain_enc (
347 .data_i(packed_data),
348 .data_o(plain_data_w_ecc)
349 );
350
351 logic unused_data;
352 1/1 assign unused_data = |plain_data_w_ecc;
Tests: T1 T2 T3
353
354 // pad the remaining bits with '1' if ecc is not used.
355 1/1 assign data_o = ecc_i ? ecc_data : {{EccWidth{1'b1}}, ecc_data_in};
Tests: T1 T2 T3
356
357 /////////////////////////////////
358 // Assertions
359 /////////////////////////////////
360
361 `ifdef INC_ASSERT
362 logic txn_done;
363 logic [15:0] done_cnt_d, done_cnt_q;
364
365 1/1 assign txn_done = req_i && ack_o && last_i;
Tests: T1 T2 T3
366 1/1 assign done_cnt_d = txn_done ? '0 : (done ? done_cnt_q + 16'h1 : done_cnt_q);
Tests: T1 T2 T3
367
368 always_ff @(posedge clk_i or negedge rst_ni) begin
369 1/1 if (!rst_ni) begin
Tests: T1 T2 T3
370 1/1 done_cnt_q <= '0;
Tests: T1 T2 T3
371 end else begin
372 1/1 done_cnt_q <= done_cnt_d;
Tests: T1 T2 T3
Cond Coverage for Instance : tb.dut.u_eflash.gen_flash_cores[0].u_core.gen_prog_data.u_prog
| Total | Covered | Percent |
Conditions | 65 | 61 | 93.85 |
Logical | 65 | 61 | 93.85 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 111
EXPRESSION ((data_sel == Actual) ? data_i[(flash_phy_pkg::BusWidth - 1):0] : ({flash_phy_pkg::BusWidth {1'b1}}))
----------1---------
-1- | Status | Tests |
0 | Covered | T1,T2,T3 |
1 | Covered | T1,T4,T5 |
LINE 111
SUB-EXPRESSION (data_sel == Actual)
----------1---------
-1- | Status | Tests |
0 | Covered | T1,T2,T3 |
1 | Covered | T1,T4,T5 |
LINE 126
EXPRESSION (data_invalid_q | (pack_valid & ((~data_intg_ok))))
-------1------ ----------------2---------------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Covered | T8,T20,T134 |
1 | 0 | Covered | T8,T20,T134 |
LINE 126
SUB-EXPRESSION (pack_valid & ((~data_intg_ok)))
-----1---- --------2--------
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T1,T4,T5 |
1 | 1 | Covered | T8,T20,T134 |
LINE 143
EXPRESSION (ack_i | data_invalid_q)
--1-- -------2------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Not Covered | |
1 | 0 | Covered | T1,T2,T3 |
LINE 144
EXPRESSION (done_i | data_invalid_q)
---1-- -------2------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Covered | T8,T20,T134 |
1 | 0 | Covered | T1,T2,T3 |
LINE 148
EXPRESSION ((idx > '0) ? (idx_sub_one == sel_i) : 1'b0)
-----1----
-1- | Status | Tests |
0 | Covered | T1,T2,T3 |
1 | Covered | T1,T4,T5 |
LINE 148
SUB-EXPRESSION (idx_sub_one == sel_i)
-----------1----------
-1- | Status | Tests |
0 | Covered | T1,T4,T5 |
1 | Covered | T34,T103,T201 |
LINE 153
EXPRESSION (pack_valid && (idx == MaxIdx))
-----1---- -------2-------
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T4,T5 |
1 | 0 | Covered | T1,T4,T5 |
1 | 1 | Covered | T1,T4,T5 |
LINE 153
SUB-EXPRESSION (idx == MaxIdx)
-------1-------
-1- | Status | Tests |
0 | Covered | T1,T2,T3 |
1 | Covered | T1,T4,T5 |
LINE 194
EXPRESSION (req_i && ((|sel_i)))
--1-- -----2----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T1,T4,T5 |
1 | 1 | Covered | T34,T103,T201 |
LINE 204
EXPRESSION (idx == align_next)
---------1---------
-1- | Status | Tests |
0 | Not Covered | |
1 | Covered | T34,T103,T201 |
LINE 213
EXPRESSION (req_i && (idx == MaxIdx))
--1-- -------2-------
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T4,T5 |
1 | 0 | Covered | T1,T4,T5 |
1 | 1 | Covered | T1,T4,T5 |
LINE 213
SUB-EXPRESSION (idx == MaxIdx)
-------1-------
-1- | Status | Tests |
0 | Covered | T1,T4,T5 |
1 | Covered | T1,T4,T5 |
LINE 216
EXPRESSION (req_i && last_i)
--1-- ---2--
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T4,T5 |
1 | 0 | Covered | T1,T4,T5 |
1 | 1 | Covered | T34,T103,T201 |
LINE 230
EXPRESSION (idx == MaxIdx)
-------1-------
-1- | Status | Tests |
0 | Not Covered | |
1 | Covered | T34,T103,T201 |
LINE 237
EXPRESSION (scramble_i ? StCalcMask : StReqFlash)
-----1----
-1- | Status | Tests |
0 | Covered | T1,T4,T53 |
1 | Covered | T5,T22,T11 |
LINE 270
EXPRESSION (ack ? StWaitFlash : StReqFlash)
-1-
-1- | Status | Tests |
0 | Covered | T1,T4,T55 |
1 | Covered | T1,T4,T5 |
LINE 273
EXPRESSION (ack ? StIdle : StReqFlash)
-1-
-1- | Status | Tests |
0 | Covered | T1,T4,T11 |
1 | Covered | T1,T4,T5 |
LINE 302
EXPRESSION (req_o && ack)
--1-- -2-
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T1,T4,T11 |
1 | 1 | Covered | T1,T4,T5 |
LINE 304
EXPRESSION (calc_req_o && calc_ack_i)
-----1---- -----2----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T5,T11,T8 |
1 | 1 | Covered | T5,T11,T8 |
LINE 307
EXPRESSION (scramble_req_o && scramble_ack_i)
-------1------ -------2------
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T5,T11,T8 |
1 | 1 | Covered | T5,T11,T8 |
LINE 355
EXPRESSION (ecc_i ? ecc_data : ({{flash_phy_pkg::EccWidth {1'b1}}, ecc_data_in}))
--1--
-1- | Status | Tests |
0 | Covered | T1,T2,T3 |
1 | Covered | T1,T2,T3 |
LINE 365
EXPRESSION (req_i && ack_o && last_i)
--1-- --2-- ---3--
-1- | -2- | -3- | Status | Tests |
0 | 1 | 1 | Not Covered | |
1 | 0 | 1 | Covered | T1,T4,T5 |
1 | 1 | 0 | Covered | T1,T4,T5 |
1 | 1 | 1 | Covered | T1,T4,T5 |
LINE 366
EXPRESSION (txn_done ? '0 : (done ? ((done_cnt_q + 16'b1)) : done_cnt_q))
----1---
-1- | Status | Tests |
0 | Covered | T1,T2,T3 |
1 | Covered | T1,T4,T5 |
LINE 366
SUB-EXPRESSION (done ? ((done_cnt_q + 16'b1)) : done_cnt_q)
--1-
-1- | Status | Tests |
0 | Covered | T1,T2,T3 |
1 | Covered | T1,T2,T3 |
FSM Coverage for Instance : tb.dut.u_eflash.gen_flash_cores[0].u_core.gen_prog_data.u_prog
Summary for FSM :: state_q
| Total | Covered | Percent | |
States |
11 |
11 |
100.00 |
(Not included in score) |
Transitions |
15 |
15 |
100.00 |
|
Sequences |
0 |
0 |
|
|
State, Transition and Sequence Details for FSM :: state_q
states | Line No. | Covered | Tests |
StCalcEcc |
252 |
Covered |
T5,T11,T8 |
StCalcMask |
237 |
Covered |
T5,T11,T8 |
StCalcPlainEcc |
215 |
Covered |
T1,T4,T5 |
StDisabled |
193 |
Covered |
T5,T6,T7 |
StIdle |
273 |
Covered |
T1,T2,T3 |
StPackData |
197 |
Covered |
T1,T4,T5 |
StPostPack |
218 |
Covered |
T34,T103,T201 |
StPrePack |
195 |
Covered |
T34,T103,T201 |
StReqFlash |
237 |
Covered |
T1,T4,T5 |
StScrambleData |
244 |
Covered |
T5,T11,T8 |
StWaitFlash |
270 |
Covered |
T1,T4,T5 |
transitions | Line No. | Covered | Tests |
StCalcEcc->StReqFlash |
257 |
Covered |
T5,T11,T8 |
StCalcMask->StScrambleData |
244 |
Covered |
T5,T11,T8 |
StCalcPlainEcc->StCalcMask |
237 |
Covered |
T5,T11,T8 |
StCalcPlainEcc->StReqFlash |
237 |
Covered |
T1,T4,T53 |
StIdle->StDisabled |
193 |
Covered |
T5,T6,T7 |
StIdle->StPackData |
197 |
Covered |
T1,T4,T5 |
StIdle->StPrePack |
195 |
Covered |
T34,T103,T201 |
StPackData->StCalcPlainEcc |
215 |
Covered |
T1,T4,T5 |
StPackData->StPostPack |
218 |
Covered |
T34,T103,T201 |
StPostPack->StCalcPlainEcc |
231 |
Covered |
T34,T103,T201 |
StPrePack->StPackData |
205 |
Covered |
T34,T103,T201 |
StReqFlash->StIdle |
273 |
Covered |
T1,T4,T5 |
StReqFlash->StWaitFlash |
270 |
Covered |
T1,T4,T5 |
StScrambleData->StCalcEcc |
252 |
Covered |
T5,T11,T8 |
StWaitFlash->StIdle |
280 |
Covered |
T1,T4,T5 |
Branch Coverage for Instance : tb.dut.u_eflash.gen_flash_cores[0].u_core.gen_prog_data.u_prog
| Line No. | Total | Covered | Percent |
Branches |
|
55 |
53 |
96.36 |
TERNARY |
111 |
2 |
2 |
100.00 |
TERNARY |
148 |
2 |
2 |
100.00 |
TERNARY |
355 |
2 |
2 |
100.00 |
TERNARY |
366 |
3 |
3 |
100.00 |
IF |
130 |
2 |
2 |
100.00 |
IF |
151 |
4 |
4 |
100.00 |
IF |
164 |
2 |
2 |
100.00 |
CASE |
186 |
27 |
25 |
92.59 |
IF |
299 |
6 |
6 |
100.00 |
IF |
323 |
3 |
3 |
100.00 |
IF |
369 |
2 |
2 |
100.00 |
111 assign pack_data = (data_sel == Actual) ? data_i[BusWidth-1:0] : {BusWidth{1'b1}};
-1-
==>
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T1,T4,T5 |
0 |
Covered |
T1,T2,T3 |
148 assign align_next = (idx > '0) ? (idx_sub_one == sel_i) : 1'b0;
-1-
==>
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T1,T4,T5 |
0 |
Covered |
T1,T2,T3 |
355 assign data_o = ecc_i ? ecc_data : {{EccWidth{1'b1}}, ecc_data_in};
-1-
==>
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T1,T2,T3 |
0 |
Covered |
T1,T2,T3 |
366 assign done_cnt_d = txn_done ? '0 : (done ? done_cnt_q + 16'h1 : done_cnt_q);
-1- -2-
==> ==>
==>
Branches:
-1- | -2- | Status | Tests |
1 |
- |
Covered |
T1,T4,T5 |
0 |
1 |
Covered |
T1,T2,T3 |
0 |
0 |
Covered |
T1,T2,T3 |
130 if (!rst_ni) begin
-1-
131 data_invalid_q <= '0;
==>
132 end else begin
133 data_invalid_q <= data_invalid_d;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T1,T2,T3 |
0 |
Covered |
T1,T2,T3 |
151 if (!rst_ni) begin
-1-
152 idx <= '0;
==>
153 end else if (pack_valid && idx == MaxIdx) begin
-2-
154 // when a flash word is packed full, return index to 0
155 idx <= '0;
==>
156 end else if (pack_valid) begin
-3-
157 // increment otherwise
158 idx <= idx + 1'b1;
==>
159 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T1,T4,T5 |
0 |
0 |
1 |
Covered |
T1,T4,T5 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
164 `PRIM_FLOP_SPARSE_FSM(u_state_regs, state_d, state_q, state_e, StIdle)
-1-
==>
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T1,T2,T3 |
0 |
Covered |
T1,T2,T3 |
186 unique case (state_q)
-1-
187 StIdle: begin
188 // if first beat of a transaction is not aligned, prepack with empty bits
189 if (prim_mubi_pkg::mubi4_test_true_loose(disable_i)) begin
-2-
190 // only disable during idle state to ensure program is able to gracefully complete
191 // this is important as we do not want to accidentally disturb any electrical procedure
192 // internal to the flash macro
193 state_d = StDisabled;
==>
194 end else if (req_i && |sel_i) begin
-3-
195 state_d = StPrePack;
==>
196 end else if (req_i) begin
-4-
197 state_d = StPackData;
==>
198 end
MISSING_ELSE
==>
199 end
200
201 StPrePack: begin
202 // pack until currently supplied data
203 pack_valid = (idx < sel_i);
204 if (idx == align_next) begin
-5-
205 state_d = StPackData;
==>
206 end
MISSING_ELSE
==>
207 end
208
209 StPackData: begin
210 pack_valid = req_i;
211 data_sel = Actual;
212
213 if (req_i && idx == MaxIdx) begin
-6-
214 // last beat of a flash word
215 state_d = StCalcPlainEcc;
==>
216 end else if (req_i && last_i) begin
-7-
217 // last beat is not aligned with the last entry of flash word
218 state_d = StPostPack;
==>
219 end else if (req_i) begin
-8-
220 ack_o = 1'b1;
==>
221 end
MISSING_ELSE
==>
222 end
223
224 StPostPack: begin
225 // supply filler data
226 pack_valid = 1'b1;
227 data_sel = Filler;
228
229 // finish packing remaining entries
230 if (idx == MaxIdx) begin
-9-
231 state_d = StCalcPlainEcc;
==>
232 end
MISSING_ELSE
==>
233 end
234
235 StCalcPlainEcc: begin
236 plain_ecc_en = 1'b1;
237 state_d = scramble_i ? StCalcMask : StReqFlash;
-10-
==>
==>
238 end
239
240 StCalcMask: begin
241 calc_req_o = 1'b1;
242
243 if (calc_ack_i) begin
-11-
244 state_d = StScrambleData;
==>
245 end
MISSING_ELSE
==>
246 end
247
248 StScrambleData: begin
249 scramble_req_o = 1'b1;
250
251 if (scramble_ack_i) begin
-12-
252 state_d = StCalcEcc;
==>
253 end
MISSING_ELSE
==>
254 end
255
256 StCalcEcc: begin
257 state_d = StReqFlash;
==>
258 end
259
260 StReqFlash: begin
261 // only request flash if data integrity was valid
262 req_o = ~data_invalid_q;
263 last_o = last_i;
264
265 // if this is the last beat of the program burst
266 // - wait for done
267 // if this is NOT the last beat
268 // - ack the upstream request and accept more beats
269 if (last_i) begin
-13-
270 state_d = ack ? StWaitFlash : StReqFlash;
-14-
==>
==>
271 end else begin
272 ack_o = ack;
273 state_d = ack ? StIdle : StReqFlash;
-15-
==>
==>
274 end
275 end
276
277 StWaitFlash: begin
278 if (done) begin
-16-
279 ack_o = 1'b1;
==>
280 state_d = StIdle;
281 end
MISSING_ELSE
==>
282 end
283
284 StDisabled: begin
285 state_d = StDisabled;
==>
286 end
287
288 default: begin
289 fsm_err_o = 1'b1;
==>
Branches:
-1- | -2- | -3- | -4- | -5- | -6- | -7- | -8- | -9- | -10- | -11- | -12- | -13- | -14- | -15- | -16- | Status | Tests |
StIdle |
1 |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T5,T6,T7 |
StIdle |
0 |
1 |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T34,T103,T201 |
StIdle |
0 |
0 |
1 |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T1,T4,T5 |
StIdle |
0 |
0 |
0 |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T1,T2,T3 |
StPrePack |
- |
- |
- |
1 |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T34,T103,T201 |
StPrePack |
- |
- |
- |
0 |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
Not Covered |
|
StPackData |
- |
- |
- |
- |
1 |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T1,T4,T5 |
StPackData |
- |
- |
- |
- |
0 |
1 |
- |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T34,T103,T201 |
StPackData |
- |
- |
- |
- |
0 |
0 |
1 |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T1,T4,T5 |
StPackData |
- |
- |
- |
- |
0 |
0 |
0 |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T1,T4,T5 |
StPostPack |
- |
- |
- |
- |
- |
- |
- |
1 |
- |
- |
- |
- |
- |
- |
- |
Covered |
T34,T103,T201 |
StPostPack |
- |
- |
- |
- |
- |
- |
- |
0 |
- |
- |
- |
- |
- |
- |
- |
Not Covered |
|
StCalcPlainEcc |
- |
- |
- |
- |
- |
- |
- |
- |
1 |
- |
- |
- |
- |
- |
- |
Covered |
T5,T22,T11 |
StCalcPlainEcc |
- |
- |
- |
- |
- |
- |
- |
- |
0 |
- |
- |
- |
- |
- |
- |
Covered |
T1,T4,T53 |
StCalcMask |
- |
- |
- |
- |
- |
- |
- |
- |
- |
1 |
- |
- |
- |
- |
- |
Covered |
T5,T11,T8 |
StCalcMask |
- |
- |
- |
- |
- |
- |
- |
- |
- |
0 |
- |
- |
- |
- |
- |
Covered |
T5,T11,T8 |
StScrambleData |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
1 |
- |
- |
- |
- |
Covered |
T5,T11,T8 |
StScrambleData |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
0 |
- |
- |
- |
- |
Covered |
T5,T11,T8 |
StCalcEcc |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T5,T11,T8 |
StReqFlash |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
1 |
1 |
- |
- |
Covered |
T1,T4,T5 |
StReqFlash |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
1 |
0 |
- |
- |
Covered |
T1,T4,T55 |
StReqFlash |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
0 |
- |
1 |
- |
Covered |
T1,T4,T5 |
StReqFlash |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
0 |
- |
0 |
- |
Covered |
T1,T4,T11 |
StWaitFlash |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
1 |
Covered |
T1,T4,T5 |
StWaitFlash |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
0 |
Covered |
T1,T4,T5 |
StDisabled |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T5,T6,T7 |
default |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T13,T14,T15 |
299 if (!rst_ni) begin
-1-
300 packed_data <= '0;
==>
301 mask_q <= '0;
302 end else if (req_o && ack) begin
-2-
303 packed_data <= '0;
==>
304 end else if (calc_req_o && calc_ack_i) begin
-3-
305 packed_data <= packed_data ^ mask_i;
==>
306 mask_q <= mask_i;
307 end else if (scramble_req_o && scramble_ack_i) begin
-4-
308 packed_data <= scrambled_data_i[DataWidth-1:0] ^ mask_q;
==>
309 end else if (pack_valid) begin
-5-
310 packed_data[idx] <= pack_data;
==>
311 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | -4- | -5- | Status | Tests |
1 |
- |
- |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
- |
- |
Covered |
T1,T4,T5 |
0 |
0 |
1 |
- |
- |
Covered |
T5,T11,T8 |
0 |
0 |
0 |
1 |
- |
Covered |
T5,T11,T8 |
0 |
0 |
0 |
0 |
1 |
Covered |
T1,T4,T5 |
0 |
0 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
323 if (!rst_ni) begin
-1-
324 plain_data_ecc <= '1;
==>
325 end else if (plain_ecc_en) begin
-2-
326 plain_data_ecc <= plain_data_w_ecc[DataWidth +: PlainIntgWidth];
==>
327 end
MISSING_ELSE
==>
Branches:
-1- | -2- | Status | Tests |
1 |
- |
Covered |
T1,T2,T3 |
0 |
1 |
Covered |
T1,T4,T5 |
0 |
0 |
Covered |
T1,T2,T3 |
369 if (!rst_ni) begin
-1-
370 done_cnt_q <= '0;
==>
371 end else begin
372 done_cnt_q <= done_cnt_d;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T1,T2,T3 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.u_eflash.gen_flash_cores[0].u_core.gen_prog_data.u_prog
Assertion Details
OneDonePerTxn_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
356085925 |
1192847 |
0 |
0 |
T1 |
3968 |
14 |
0 |
0 |
T2 |
2197 |
0 |
0 |
0 |
T3 |
14398 |
0 |
0 |
0 |
T4 |
2284 |
1 |
0 |
0 |
T5 |
967 |
1 |
0 |
0 |
T8 |
0 |
1 |
0 |
0 |
T10 |
1608 |
0 |
0 |
0 |
T16 |
2149 |
0 |
0 |
0 |
T17 |
2075 |
0 |
0 |
0 |
T18 |
1552 |
0 |
0 |
0 |
T19 |
1174 |
0 |
0 |
0 |
T32 |
0 |
1 |
0 |
0 |
T33 |
0 |
47 |
0 |
0 |
T37 |
0 |
1 |
0 |
0 |
T38 |
0 |
1 |
0 |
0 |
T53 |
0 |
1 |
0 |
0 |
T55 |
0 |
118 |
0 |
0 |
PostPackRule_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
356085925 |
854 |
0 |
0 |
T28 |
0 |
3 |
0 |
0 |
T29 |
0 |
1 |
0 |
0 |
T30 |
0 |
5 |
0 |
0 |
T34 |
95577 |
18 |
0 |
0 |
T40 |
240866 |
0 |
0 |
0 |
T51 |
63656 |
0 |
0 |
0 |
T60 |
0 |
13 |
0 |
0 |
T61 |
0 |
19 |
0 |
0 |
T66 |
59946 |
0 |
0 |
0 |
T68 |
1717 |
0 |
0 |
0 |
T69 |
10945 |
0 |
0 |
0 |
T70 |
48523 |
0 |
0 |
0 |
T103 |
2828 |
2 |
0 |
0 |
T127 |
1564 |
0 |
0 |
0 |
T200 |
2088 |
0 |
0 |
0 |
T201 |
0 |
4 |
0 |
0 |
T219 |
0 |
1 |
0 |
0 |
T221 |
0 |
3 |
0 |
0 |
PrePackRule_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
356085925 |
569 |
0 |
0 |
T28 |
0 |
3 |
0 |
0 |
T29 |
0 |
1 |
0 |
0 |
T30 |
0 |
3 |
0 |
0 |
T34 |
95577 |
14 |
0 |
0 |
T40 |
240866 |
0 |
0 |
0 |
T51 |
63656 |
0 |
0 |
0 |
T60 |
0 |
20 |
0 |
0 |
T61 |
0 |
14 |
0 |
0 |
T66 |
59946 |
0 |
0 |
0 |
T68 |
1717 |
0 |
0 |
0 |
T69 |
10945 |
0 |
0 |
0 |
T70 |
48523 |
0 |
0 |
0 |
T103 |
2828 |
1 |
0 |
0 |
T127 |
1564 |
0 |
0 |
0 |
T200 |
2088 |
0 |
0 |
0 |
T201 |
0 |
3 |
0 |
0 |
T219 |
0 |
1 |
0 |
0 |
T222 |
0 |
1 |
0 |
0 |
WidthCheck_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1047 |
1047 |
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 |
T10 |
1 |
1 |
0 |
0 |
T16 |
1 |
1 |
0 |
0 |
T17 |
1 |
1 |
0 |
0 |
T18 |
1 |
1 |
0 |
0 |
T19 |
1 |
1 |
0 |
0 |
u_state_regs_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
356085925 |
355255060 |
0 |
0 |
T1 |
3968 |
3880 |
0 |
0 |
T2 |
2197 |
2106 |
0 |
0 |
T3 |
14398 |
14311 |
0 |
0 |
T4 |
2284 |
2224 |
0 |
0 |
T5 |
967 |
871 |
0 |
0 |
T10 |
1608 |
1525 |
0 |
0 |
T16 |
2149 |
2059 |
0 |
0 |
T17 |
2075 |
1991 |
0 |
0 |
T18 |
1552 |
1490 |
0 |
0 |
T19 |
1174 |
1104 |
0 |
0 |
Line Coverage for Instance : tb.dut.u_eflash.gen_flash_cores[1].u_core.gen_prog_data.u_prog
| Line No. | Total | Covered | Percent |
TOTAL | | 96 | 96 | 100.00 |
CONT_ASSIGN | 111 | 1 | 1 | 100.00 |
CONT_ASSIGN | 122 | 1 | 1 | 100.00 |
CONT_ASSIGN | 126 | 1 | 1 | 100.00 |
ALWAYS | 130 | 3 | 3 | 100.00 |
CONT_ASSIGN | 138 | 1 | 1 | 100.00 |
CONT_ASSIGN | 143 | 1 | 1 | 100.00 |
CONT_ASSIGN | 144 | 1 | 1 | 100.00 |
CONT_ASSIGN | 147 | 1 | 1 | 100.00 |
CONT_ASSIGN | 148 | 1 | 1 | 100.00 |
ALWAYS | 151 | 6 | 6 | 100.00 |
ALWAYS | 164 | 3 | 3 | 100.00 |
ALWAYS | 174 | 51 | 51 | 100.00 |
ALWAYS | 299 | 12 | 12 | 100.00 |
CONT_ASSIGN | 314 | 1 | 1 | 100.00 |
ALWAYS | 323 | 4 | 4 | 100.00 |
CONT_ASSIGN | 331 | 1 | 1 | 100.00 |
CONT_ASSIGN | 352 | 1 | 1 | 100.00 |
CONT_ASSIGN | 355 | 1 | 1 | 100.00 |
CONT_ASSIGN | 365 | 1 | 1 | 100.00 |
CONT_ASSIGN | 366 | 1 | 1 | 100.00 |
ALWAYS | 369 | 3 | 3 | 100.00 |
110 // selects empty data or real data
111 1/1 assign pack_data = (data_sel == Actual) ? data_i[BusWidth-1:0] : {BusWidth{1'b1}};
Tests: T1 T2 T3
112
113 logic data_intg_ok;
114 logic data_err;
115
116 // use the tlul integrity module directly for bus integrity
117 // SEC_CM: MEM.BUS.INTEGRITY
118 tlul_data_integ_dec u_data_intg_chk (
119 .data_intg_i(data_i),
120 .data_err_o(data_err)
121 );
122 1/1 assign data_intg_ok = ~data_err;
Tests: T1 T2 T3
123
124 logic data_invalid_q, data_invalid_d;
125 // hold on integrity failure indication until reset
126 1/1 assign data_invalid_d = data_invalid_q |
Tests: T1 T2 T3
127 (pack_valid & ~data_intg_ok);
128
129 always_ff @(posedge clk_i or negedge rst_ni) begin
130 1/1 if (!rst_ni) begin
Tests: T1 T2 T3
131 1/1 data_invalid_q <= '0;
Tests: T1 T2 T3
132 end else begin
133 1/1 data_invalid_q <= data_invalid_d;
Tests: T1 T2 T3
134 end
135 end
136
137 // indication to upper layer presence of error
138 1/1 assign intg_err_o = data_invalid_q;
Tests: T1 T2 T3
139
140 // if integrity failure is seen, fake communication with flash
141 // and simply terminate
142 logic ack, done;
143 1/1 assign ack = ack_i | data_invalid_q;
Tests: T1 T2 T3
144 1/1 assign done = done_i | data_invalid_q;
Tests: T1 T2 T3
145
146 // next idx will be aligned
147 1/1 assign idx_sub_one = idx - 1'b1;
Tests: T1 T2 T3
148 1/1 assign align_next = (idx > '0) ? (idx_sub_one == sel_i) : 1'b0;
Tests: T1 T2 T3
149
150 always_ff @(posedge clk_i or negedge rst_ni) begin
151 1/1 if (!rst_ni) begin
Tests: T1 T2 T3
152 1/1 idx <= '0;
Tests: T1 T2 T3
153 1/1 end else if (pack_valid && idx == MaxIdx) begin
Tests: T1 T2 T3
154 // when a flash word is packed full, return index to 0
155 1/1 idx <= '0;
Tests: T8 T31 T32
156 1/1 end else if (pack_valid) begin
Tests: T1 T2 T3
157 // increment otherwise
158 1/1 idx <= idx + 1'b1;
Tests: T8 T31 T32
159 end
MISSING_ELSE
160 end
161
162
163 // SEC_CM: PHY_PROG.FSM.SPARSE
164 3/3 `PRIM_FLOP_SPARSE_FSM(u_state_regs, state_d, state_q, state_e, StIdle)
Tests: T1 T2 T3 | T1 T2 T3 | T1 T2 T3
PRIM_FLOP_SPARSE_FSM(u_state_regs, state_d, state_q, state_e, StIdle):
164.1 `ifdef SIMULATION
164.2 prim_sparse_fsm_flop #(
164.3 .StateEnumT(state_e),
164.4 .Width($bits(state_e)),
164.5 .ResetValue($bits(state_e)'(StIdle)),
164.6 .EnableAlertTriggerSVA(1),
164.7 .CustomForceName("state_q")
164.8 ) u_state_regs (
164.9 .clk_i ( clk_i ),
164.10 .rst_ni ( rst_ni ),
164.11 .state_i ( state_d ),
164.12 .state_o ( )
164.13 );
164.14 always_ff @(posedge clk_i or negedge rst_ni) begin
164.15 1/1 if (!rst_ni) begin
Tests: T1 T2 T3
164.16 1/1 state_q <= StIdle;
Tests: T1 T2 T3
164.17 end else begin
164.18 1/1 state_q <= state_d;
Tests: T1 T2 T3
164.19 end
164.20 end
164.21 u_state_regs_A: assert property (@(posedge clk_i) disable iff ((!rst_ni) !== '0) (state_q === u_state_regs.state_o))
164.22 else begin
164.23 `ifdef UVM
164.24 uvm_pkg::uvm_report_error("ASSERT FAILED", "u_state_regs_A", uvm_pkg::UVM_NONE,
164.25 "../src/lowrisc_opentitan_top_earlgrey_flash_ctrl_0.1/rtl/flash_phy_prog.sv", 164, "", 1);
164.26 `else
164.27 $error("%0t: (%0s:%0d) [%m] [ASSERT FAILED] %0s", $time, `__FILE__, `__LINE__,
164.28 `PRIM_STRINGIFY(u_state_regs_A));
164.29 `endif
164.30 end
164.31 `else
164.32 prim_sparse_fsm_flop #(
164.33 .StateEnumT(state_e),
164.34 .Width($bits(state_e)),
164.35 .ResetValue($bits(state_e)'(StIdle)),
164.36 .EnableAlertTriggerSVA(1)
164.37 ) u_state_regs (
164.38 .clk_i ( `PRIM_FLOP_CLK ),
164.39 .rst_ni ( `PRIM_FLOP_RST ),
164.40 .state_i ( state_d ),
164.41 .state_o ( state_q )
164.42 );
164.43 `endif165
166 // If the first beat of an incoming transaction is not aligned to word boundary (for example
167 // if each flash word is 4 bus words wide, and the first word to program starts at index 1),
168 // the fsm pre-packs the flash word with empty words until the supplied index.
169 // Once at the index, real data supplied from the flash controller is packed until the last
170 // beat of data. At the last beat of data, if it is not also aligned (index 3 in this example),
171 // more empty words are packed at the end to fill out the word.
172 //
173 always_comb begin
174 1/1 state_d = state_q;
Tests: T1 T2 T3
175
176 1/1 pack_valid = 1'b0;
Tests: T1 T2 T3
177 1/1 data_sel = Filler;
Tests: T1 T2 T3
178 1/1 plain_ecc_en = 1'b0;
Tests: T1 T2 T3
179 1/1 req_o = 1'b0;
Tests: T1 T2 T3
180 1/1 ack_o = 1'b0;
Tests: T1 T2 T3
181 1/1 last_o = 1'b0;
Tests: T1 T2 T3
182 1/1 calc_req_o = 1'b0;
Tests: T1 T2 T3
183 1/1 scramble_req_o = 1'b0;
Tests: T1 T2 T3
184 1/1 fsm_err_o = 1'b0;
Tests: T1 T2 T3
185
186 1/1 unique case (state_q)
Tests: T1 T2 T3
187 StIdle: begin
188 // if first beat of a transaction is not aligned, prepack with empty bits
189 1/1 if (prim_mubi_pkg::mubi4_test_true_loose(disable_i)) begin
Tests: T1 T2 T3
190 // only disable during idle state to ensure program is able to gracefully complete
191 // this is important as we do not want to accidentally disturb any electrical procedure
192 // internal to the flash macro
193 1/1 state_d = StDisabled;
Tests: T5 T6 T7
194 1/1 end else if (req_i && |sel_i) begin
Tests: T1 T2 T3
195 1/1 state_d = StPrePack;
Tests: T34 T103 T60
196 1/1 end else if (req_i) begin
Tests: T1 T2 T3
197 1/1 state_d = StPackData;
Tests: T8 T31 T32
198 end
MISSING_ELSE
199 end
200
201 StPrePack: begin
202 // pack until currently supplied data
203 1/1 pack_valid = (idx < sel_i);
Tests: T34 T103 T60
204 1/1 if (idx == align_next) begin
Tests: T34 T103 T60
205 1/1 state_d = StPackData;
Tests: T34 T103 T60
206 end
==> MISSING_ELSE
207 end
208
209 StPackData: begin
210 1/1 pack_valid = req_i;
Tests: T8 T31 T32
211 1/1 data_sel = Actual;
Tests: T8 T31 T32
212
213 1/1 if (req_i && idx == MaxIdx) begin
Tests: T8 T31 T32
214 // last beat of a flash word
215 1/1 state_d = StCalcPlainEcc;
Tests: T8 T31 T32
216 1/1 end else if (req_i && last_i) begin
Tests: T8 T31 T32
217 // last beat is not aligned with the last entry of flash word
218 1/1 state_d = StPostPack;
Tests: T36 T34 T103
219 1/1 end else if (req_i) begin
Tests: T8 T31 T32
220 1/1 ack_o = 1'b1;
Tests: T8 T31 T32
221 end
MISSING_ELSE
222 end
223
224 StPostPack: begin
225 // supply filler data
226 1/1 pack_valid = 1'b1;
Tests: T36 T34 T103
227 1/1 data_sel = Filler;
Tests: T36 T34 T103
228
229 // finish packing remaining entries
230 1/1 if (idx == MaxIdx) begin
Tests: T36 T34 T103
231 1/1 state_d = StCalcPlainEcc;
Tests: T36 T34 T103
232 end
==> MISSING_ELSE
233 end
234
235 StCalcPlainEcc: begin
236 1/1 plain_ecc_en = 1'b1;
Tests: T8 T31 T32
237 1/1 state_d = scramble_i ? StCalcMask : StReqFlash;
Tests: T8 T31 T32
238 end
239
240 StCalcMask: begin
241 1/1 calc_req_o = 1'b1;
Tests: T8 T31 T32
242
243 1/1 if (calc_ack_i) begin
Tests: T8 T31 T32
244 1/1 state_d = StScrambleData;
Tests: T8 T31 T32
245 end
MISSING_ELSE
246 end
247
248 StScrambleData: begin
249 1/1 scramble_req_o = 1'b1;
Tests: T8 T31 T32
250
251 1/1 if (scramble_ack_i) begin
Tests: T8 T31 T32
252 1/1 state_d = StCalcEcc;
Tests: T8 T31 T32
253 end
MISSING_ELSE
254 end
255
256 StCalcEcc: begin
257 1/1 state_d = StReqFlash;
Tests: T8 T31 T32
258 end
259
260 StReqFlash: begin
261 // only request flash if data integrity was valid
262 1/1 req_o = ~data_invalid_q;
Tests: T8 T31 T32
263 1/1 last_o = last_i;
Tests: T8 T31 T32
264
265 // if this is the last beat of the program burst
266 // - wait for done
267 // if this is NOT the last beat
268 // - ack the upstream request and accept more beats
269 1/1 if (last_i) begin
Tests: T8 T31 T32
270 1/1 state_d = ack ? StWaitFlash : StReqFlash;
Tests: T31 T32 T33
271 end else begin
272 1/1 ack_o = ack;
Tests: T8 T31 T32
273 1/1 state_d = ack ? StIdle : StReqFlash;
Tests: T8 T31 T32
274 end
275 end
276
277 StWaitFlash: begin
278 1/1 if (done) begin
Tests: T31 T32 T33
279 1/1 ack_o = 1'b1;
Tests: T31 T32 T33
280 1/1 state_d = StIdle;
Tests: T31 T32 T33
281 end
MISSING_ELSE
282 end
283
284 StDisabled: begin
285 1/1 state_d = StDisabled;
Tests: T5 T6 T7
286 end
287
288 default: begin
289 fsm_err_o = 1'b1;
290 end
291
292 endcase // unique case (state_q)
293
294 end
295
296 logic [DataWidth-1:0] mask_q;
297
298 always_ff @(posedge clk_i or negedge rst_ni) begin
299 1/1 if (!rst_ni) begin
Tests: T1 T2 T3
300 1/1 packed_data <= '0;
Tests: T1 T2 T3
301 1/1 mask_q <= '0;
Tests: T1 T2 T3
302 1/1 end else if (req_o && ack) begin
Tests: T1 T2 T3
303 1/1 packed_data <= '0;
Tests: T31 T32 T33
304 1/1 end else if (calc_req_o && calc_ack_i) begin
Tests: T1 T2 T3
305 1/1 packed_data <= packed_data ^ mask_i;
Tests: T8 T31 T32
306 1/1 mask_q <= mask_i;
Tests: T8 T31 T32
307 1/1 end else if (scramble_req_o && scramble_ack_i) begin
Tests: T1 T2 T3
308 1/1 packed_data <= scrambled_data_i[DataWidth-1:0] ^ mask_q;
Tests: T8 T31 T32
309 1/1 end else if (pack_valid) begin
Tests: T1 T2 T3
310 1/1 packed_data[idx] <= pack_data;
Tests: T8 T31 T32
311 end
MISSING_ELSE
312 end
313
314 1/1 assign block_data_o = packed_data;
Tests: T1 T2 T3
315
316 // ECC handling
317 localparam int PlainDataEccWidth = DataWidth + 8;
318
319 logic [FullDataWidth-1:0] ecc_data;
320 logic [PlainDataEccWidth-1:0] plain_data_w_ecc;
321 logic [PlainIntgWidth-1:0] plain_data_ecc;
322 always_ff @(posedge clk_i or negedge rst_ni) begin
323 1/1 if (!rst_ni) begin
Tests: T1 T2 T3
324 1/1 plain_data_ecc <= '1;
Tests: T1 T2 T3
325 1/1 end else if (plain_ecc_en) begin
Tests: T1 T2 T3
326 1/1 plain_data_ecc <= plain_data_w_ecc[DataWidth +: PlainIntgWidth];
Tests: T8 T31 T32
327 end
MISSING_ELSE
328 end
329
330 logic [PlainDataWidth-1:0] ecc_data_in;
331 1/1 assign ecc_data_in = {plain_data_ecc, packed_data};
Tests: T1 T2 T3
332
333 // reliability ECC calculation
334 prim_secded_hamming_76_68_enc u_enc (
335 .data_i(ecc_data_in),
336 .data_o(ecc_data)
337 );
338
339 // integrity ECC calculation
340 // This instance can technically be merged with the instance above, but is
341 // kept separate for the sake of convenience
342 // The plain data ecc is calculated continuously from packed data (which changes
343 // from packed data to masked/scrambled data based on software configuration).
344 // The actual plain data ECC is explicitly captured during this process when
345 // it is required.
346 prim_secded_hamming_72_64_enc u_plain_enc (
347 .data_i(packed_data),
348 .data_o(plain_data_w_ecc)
349 );
350
351 logic unused_data;
352 1/1 assign unused_data = |plain_data_w_ecc;
Tests: T1 T2 T3
353
354 // pad the remaining bits with '1' if ecc is not used.
355 1/1 assign data_o = ecc_i ? ecc_data : {{EccWidth{1'b1}}, ecc_data_in};
Tests: T1 T2 T3
356
357 /////////////////////////////////
358 // Assertions
359 /////////////////////////////////
360
361 `ifdef INC_ASSERT
362 logic txn_done;
363 logic [15:0] done_cnt_d, done_cnt_q;
364
365 1/1 assign txn_done = req_i && ack_o && last_i;
Tests: T1 T2 T3
366 1/1 assign done_cnt_d = txn_done ? '0 : (done ? done_cnt_q + 16'h1 : done_cnt_q);
Tests: T1 T2 T3
367
368 always_ff @(posedge clk_i or negedge rst_ni) begin
369 1/1 if (!rst_ni) begin
Tests: T1 T2 T3
370 1/1 done_cnt_q <= '0;
Tests: T1 T2 T3
371 end else begin
372 1/1 done_cnt_q <= done_cnt_d;
Tests: T1 T2 T3
Cond Coverage for Instance : tb.dut.u_eflash.gen_flash_cores[1].u_core.gen_prog_data.u_prog
| Total | Covered | Percent |
Conditions | 65 | 61 | 93.85 |
Logical | 65 | 61 | 93.85 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 111
EXPRESSION ((data_sel == Actual) ? data_i[(flash_phy_pkg::BusWidth - 1):0] : ({flash_phy_pkg::BusWidth {1'b1}}))
----------1---------
-1- | Status | Tests |
0 | Covered | T1,T2,T3 |
1 | Covered | T8,T31,T32 |
LINE 111
SUB-EXPRESSION (data_sel == Actual)
----------1---------
-1- | Status | Tests |
0 | Covered | T1,T2,T3 |
1 | Covered | T8,T31,T32 |
LINE 126
EXPRESSION (data_invalid_q | (pack_valid & ((~data_intg_ok))))
-------1------ ----------------2---------------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Covered | T8,T20,T21 |
1 | 0 | Covered | T8,T20,T21 |
LINE 126
SUB-EXPRESSION (pack_valid & ((~data_intg_ok)))
-----1---- --------2--------
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T8,T31,T32 |
1 | 1 | Covered | T8,T20,T21 |
LINE 143
EXPRESSION (ack_i | data_invalid_q)
--1-- -------2------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Not Covered | |
1 | 0 | Covered | T1,T2,T3 |
LINE 144
EXPRESSION (done_i | data_invalid_q)
---1-- -------2------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T1,T2,T3 |
0 | 1 | Covered | T8,T20,T21 |
1 | 0 | Covered | T3,T17,T11 |
LINE 148
EXPRESSION ((idx > '0) ? (idx_sub_one == sel_i) : 1'b0)
-----1----
-1- | Status | Tests |
0 | Covered | T1,T2,T3 |
1 | Covered | T8,T31,T32 |
LINE 148
SUB-EXPRESSION (idx_sub_one == sel_i)
-----------1----------
-1- | Status | Tests |
0 | Covered | T8,T31,T32 |
1 | Covered | T36,T34,T103 |
LINE 153
EXPRESSION (pack_valid && (idx == MaxIdx))
-----1---- -------2-------
-1- | -2- | Status | Tests |
0 | 1 | Covered | T8,T31,T32 |
1 | 0 | Covered | T8,T31,T32 |
1 | 1 | Covered | T8,T31,T32 |
LINE 153
SUB-EXPRESSION (idx == MaxIdx)
-------1-------
-1- | Status | Tests |
0 | Covered | T1,T2,T3 |
1 | Covered | T8,T31,T32 |
LINE 194
EXPRESSION (req_i && ((|sel_i)))
--1-- -----2----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T8,T31,T32 |
1 | 1 | Covered | T34,T103,T60 |
LINE 204
EXPRESSION (idx == align_next)
---------1---------
-1- | Status | Tests |
0 | Not Covered | |
1 | Covered | T34,T103,T60 |
LINE 213
EXPRESSION (req_i && (idx == MaxIdx))
--1-- -------2-------
-1- | -2- | Status | Tests |
0 | 1 | Covered | T8,T31,T32 |
1 | 0 | Covered | T8,T31,T32 |
1 | 1 | Covered | T8,T31,T32 |
LINE 213
SUB-EXPRESSION (idx == MaxIdx)
-------1-------
-1- | Status | Tests |
0 | Covered | T8,T31,T32 |
1 | Covered | T8,T31,T32 |
LINE 216
EXPRESSION (req_i && last_i)
--1-- ---2--
-1- | -2- | Status | Tests |
0 | 1 | Covered | T31,T32,T33 |
1 | 0 | Covered | T8,T31,T32 |
1 | 1 | Covered | T36,T34,T103 |
LINE 230
EXPRESSION (idx == MaxIdx)
-------1-------
-1- | Status | Tests |
0 | Not Covered | |
1 | Covered | T36,T34,T103 |
LINE 237
EXPRESSION (scramble_i ? StCalcMask : StReqFlash)
-----1----
-1- | Status | Tests |
0 | Covered | T33,T36,T50 |
1 | Covered | T8,T31,T32 |
LINE 270
EXPRESSION (ack ? StWaitFlash : StReqFlash)
-1-
-1- | Status | Tests |
0 | Covered | T31,T33,T36 |
1 | Covered | T31,T32,T33 |
LINE 273
EXPRESSION (ack ? StIdle : StReqFlash)
-1-
-1- | Status | Tests |
0 | Covered | T31,T33,T36 |
1 | Covered | T8,T31,T32 |
LINE 302
EXPRESSION (req_o && ack)
--1-- -2-
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T31,T33,T36 |
1 | 1 | Covered | T31,T32,T33 |
LINE 304
EXPRESSION (calc_req_o && calc_ack_i)
-----1---- -----2----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T17,T11,T32 |
1 | 0 | Covered | T8,T31,T32 |
1 | 1 | Covered | T8,T31,T32 |
LINE 307
EXPRESSION (scramble_req_o && scramble_ack_i)
-------1------ -------2------
-1- | -2- | Status | Tests |
0 | 1 | Covered | T17,T37,T49 |
1 | 0 | Covered | T8,T31,T32 |
1 | 1 | Covered | T8,T31,T32 |
LINE 355
EXPRESSION (ecc_i ? ecc_data : ({{flash_phy_pkg::EccWidth {1'b1}}, ecc_data_in}))
--1--
-1- | Status | Tests |
0 | Covered | T1,T2,T3 |
1 | Covered | T1,T2,T3 |
LINE 365
EXPRESSION (req_i && ack_o && last_i)
--1-- --2-- ---3--
-1- | -2- | -3- | Status | Tests |
0 | 1 | 1 | Not Covered | |
1 | 0 | 1 | Covered | T31,T32,T33 |
1 | 1 | 0 | Covered | T8,T31,T32 |
1 | 1 | 1 | Covered | T31,T32,T33 |
LINE 366
EXPRESSION (txn_done ? '0 : (done ? ((done_cnt_q + 16'b1)) : done_cnt_q))
----1---
-1- | Status | Tests |
0 | Covered | T1,T2,T3 |
1 | Covered | T31,T32,T33 |
LINE 366
SUB-EXPRESSION (done ? ((done_cnt_q + 16'b1)) : done_cnt_q)
--1-
-1- | Status | Tests |
0 | Covered | T1,T2,T3 |
1 | Covered | T3,T17,T11 |
FSM Coverage for Instance : tb.dut.u_eflash.gen_flash_cores[1].u_core.gen_prog_data.u_prog
Summary for FSM :: state_q
| Total | Covered | Percent | |
States |
11 |
11 |
100.00 |
(Not included in score) |
Transitions |
15 |
15 |
100.00 |
|
Sequences |
0 |
0 |
|
|
State, Transition and Sequence Details for FSM :: state_q
states | Line No. | Covered | Tests |
StCalcEcc |
252 |
Covered |
T8,T31,T32 |
StCalcMask |
237 |
Covered |
T8,T31,T32 |
StCalcPlainEcc |
215 |
Covered |
T8,T31,T32 |
StDisabled |
193 |
Covered |
T5,T6,T7 |
StIdle |
273 |
Covered |
T1,T2,T3 |
StPackData |
197 |
Covered |
T8,T31,T32 |
StPostPack |
218 |
Covered |
T36,T34,T103 |
StPrePack |
195 |
Covered |
T34,T103,T60 |
StReqFlash |
237 |
Covered |
T8,T31,T32 |
StScrambleData |
244 |
Covered |
T8,T31,T32 |
StWaitFlash |
270 |
Covered |
T31,T32,T33 |
transitions | Line No. | Covered | Tests |
StCalcEcc->StReqFlash |
257 |
Covered |
T8,T31,T32 |
StCalcMask->StScrambleData |
244 |
Covered |
T8,T31,T32 |
StCalcPlainEcc->StCalcMask |
237 |
Covered |
T8,T31,T32 |
StCalcPlainEcc->StReqFlash |
237 |
Covered |
T33,T36,T50 |
StIdle->StDisabled |
193 |
Covered |
T5,T6,T7 |
StIdle->StPackData |
197 |
Covered |
T8,T31,T32 |
StIdle->StPrePack |
195 |
Covered |
T34,T103,T60 |
StPackData->StCalcPlainEcc |
215 |
Covered |
T8,T31,T32 |
StPackData->StPostPack |
218 |
Covered |
T36,T34,T103 |
StPostPack->StCalcPlainEcc |
231 |
Covered |
T36,T34,T103 |
StPrePack->StPackData |
205 |
Covered |
T34,T103,T60 |
StReqFlash->StIdle |
273 |
Covered |
T8,T31,T32 |
StReqFlash->StWaitFlash |
270 |
Covered |
T31,T32,T33 |
StScrambleData->StCalcEcc |
252 |
Covered |
T8,T31,T32 |
StWaitFlash->StIdle |
280 |
Covered |
T31,T32,T33 |
Branch Coverage for Instance : tb.dut.u_eflash.gen_flash_cores[1].u_core.gen_prog_data.u_prog
| Line No. | Total | Covered | Percent |
Branches |
|
55 |
53 |
96.36 |
TERNARY |
111 |
2 |
2 |
100.00 |
TERNARY |
148 |
2 |
2 |
100.00 |
TERNARY |
355 |
2 |
2 |
100.00 |
TERNARY |
366 |
3 |
3 |
100.00 |
IF |
130 |
2 |
2 |
100.00 |
IF |
151 |
4 |
4 |
100.00 |
IF |
164 |
2 |
2 |
100.00 |
CASE |
186 |
27 |
25 |
92.59 |
IF |
299 |
6 |
6 |
100.00 |
IF |
323 |
3 |
3 |
100.00 |
IF |
369 |
2 |
2 |
100.00 |
111 assign pack_data = (data_sel == Actual) ? data_i[BusWidth-1:0] : {BusWidth{1'b1}};
-1-
==>
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T8,T31,T32 |
0 |
Covered |
T1,T2,T3 |
148 assign align_next = (idx > '0) ? (idx_sub_one == sel_i) : 1'b0;
-1-
==>
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T8,T31,T32 |
0 |
Covered |
T1,T2,T3 |
355 assign data_o = ecc_i ? ecc_data : {{EccWidth{1'b1}}, ecc_data_in};
-1-
==>
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T1,T2,T3 |
0 |
Covered |
T1,T2,T3 |
366 assign done_cnt_d = txn_done ? '0 : (done ? done_cnt_q + 16'h1 : done_cnt_q);
-1- -2-
==> ==>
==>
Branches:
-1- | -2- | Status | Tests |
1 |
- |
Covered |
T31,T32,T33 |
0 |
1 |
Covered |
T3,T17,T11 |
0 |
0 |
Covered |
T1,T2,T3 |
130 if (!rst_ni) begin
-1-
131 data_invalid_q <= '0;
==>
132 end else begin
133 data_invalid_q <= data_invalid_d;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T1,T2,T3 |
0 |
Covered |
T1,T2,T3 |
151 if (!rst_ni) begin
-1-
152 idx <= '0;
==>
153 end else if (pack_valid && idx == MaxIdx) begin
-2-
154 // when a flash word is packed full, return index to 0
155 idx <= '0;
==>
156 end else if (pack_valid) begin
-3-
157 // increment otherwise
158 idx <= idx + 1'b1;
==>
159 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
Covered |
T8,T31,T32 |
0 |
0 |
1 |
Covered |
T8,T31,T32 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
164 `PRIM_FLOP_SPARSE_FSM(u_state_regs, state_d, state_q, state_e, StIdle)
-1-
==>
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T1,T2,T3 |
0 |
Covered |
T1,T2,T3 |
186 unique case (state_q)
-1-
187 StIdle: begin
188 // if first beat of a transaction is not aligned, prepack with empty bits
189 if (prim_mubi_pkg::mubi4_test_true_loose(disable_i)) begin
-2-
190 // only disable during idle state to ensure program is able to gracefully complete
191 // this is important as we do not want to accidentally disturb any electrical procedure
192 // internal to the flash macro
193 state_d = StDisabled;
==>
194 end else if (req_i && |sel_i) begin
-3-
195 state_d = StPrePack;
==>
196 end else if (req_i) begin
-4-
197 state_d = StPackData;
==>
198 end
MISSING_ELSE
==>
199 end
200
201 StPrePack: begin
202 // pack until currently supplied data
203 pack_valid = (idx < sel_i);
204 if (idx == align_next) begin
-5-
205 state_d = StPackData;
==>
206 end
MISSING_ELSE
==>
207 end
208
209 StPackData: begin
210 pack_valid = req_i;
211 data_sel = Actual;
212
213 if (req_i && idx == MaxIdx) begin
-6-
214 // last beat of a flash word
215 state_d = StCalcPlainEcc;
==>
216 end else if (req_i && last_i) begin
-7-
217 // last beat is not aligned with the last entry of flash word
218 state_d = StPostPack;
==>
219 end else if (req_i) begin
-8-
220 ack_o = 1'b1;
==>
221 end
MISSING_ELSE
==>
222 end
223
224 StPostPack: begin
225 // supply filler data
226 pack_valid = 1'b1;
227 data_sel = Filler;
228
229 // finish packing remaining entries
230 if (idx == MaxIdx) begin
-9-
231 state_d = StCalcPlainEcc;
==>
232 end
MISSING_ELSE
==>
233 end
234
235 StCalcPlainEcc: begin
236 plain_ecc_en = 1'b1;
237 state_d = scramble_i ? StCalcMask : StReqFlash;
-10-
==>
==>
238 end
239
240 StCalcMask: begin
241 calc_req_o = 1'b1;
242
243 if (calc_ack_i) begin
-11-
244 state_d = StScrambleData;
==>
245 end
MISSING_ELSE
==>
246 end
247
248 StScrambleData: begin
249 scramble_req_o = 1'b1;
250
251 if (scramble_ack_i) begin
-12-
252 state_d = StCalcEcc;
==>
253 end
MISSING_ELSE
==>
254 end
255
256 StCalcEcc: begin
257 state_d = StReqFlash;
==>
258 end
259
260 StReqFlash: begin
261 // only request flash if data integrity was valid
262 req_o = ~data_invalid_q;
263 last_o = last_i;
264
265 // if this is the last beat of the program burst
266 // - wait for done
267 // if this is NOT the last beat
268 // - ack the upstream request and accept more beats
269 if (last_i) begin
-13-
270 state_d = ack ? StWaitFlash : StReqFlash;
-14-
==>
==>
271 end else begin
272 ack_o = ack;
273 state_d = ack ? StIdle : StReqFlash;
-15-
==>
==>
274 end
275 end
276
277 StWaitFlash: begin
278 if (done) begin
-16-
279 ack_o = 1'b1;
==>
280 state_d = StIdle;
281 end
MISSING_ELSE
==>
282 end
283
284 StDisabled: begin
285 state_d = StDisabled;
==>
286 end
287
288 default: begin
289 fsm_err_o = 1'b1;
==>
Branches:
-1- | -2- | -3- | -4- | -5- | -6- | -7- | -8- | -9- | -10- | -11- | -12- | -13- | -14- | -15- | -16- | Status | Tests |
StIdle |
1 |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T5,T6,T7 |
StIdle |
0 |
1 |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T34,T103,T60 |
StIdle |
0 |
0 |
1 |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T8,T31,T32 |
StIdle |
0 |
0 |
0 |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T1,T2,T3 |
StPrePack |
- |
- |
- |
1 |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T34,T103,T60 |
StPrePack |
- |
- |
- |
0 |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
Not Covered |
|
StPackData |
- |
- |
- |
- |
1 |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T8,T31,T32 |
StPackData |
- |
- |
- |
- |
0 |
1 |
- |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T36,T34,T103 |
StPackData |
- |
- |
- |
- |
0 |
0 |
1 |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T8,T31,T32 |
StPackData |
- |
- |
- |
- |
0 |
0 |
0 |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T8,T31,T32 |
StPostPack |
- |
- |
- |
- |
- |
- |
- |
1 |
- |
- |
- |
- |
- |
- |
- |
Covered |
T36,T34,T103 |
StPostPack |
- |
- |
- |
- |
- |
- |
- |
0 |
- |
- |
- |
- |
- |
- |
- |
Not Covered |
|
StCalcPlainEcc |
- |
- |
- |
- |
- |
- |
- |
- |
1 |
- |
- |
- |
- |
- |
- |
Covered |
T8,T31,T32 |
StCalcPlainEcc |
- |
- |
- |
- |
- |
- |
- |
- |
0 |
- |
- |
- |
- |
- |
- |
Covered |
T33,T36,T50 |
StCalcMask |
- |
- |
- |
- |
- |
- |
- |
- |
- |
1 |
- |
- |
- |
- |
- |
Covered |
T8,T31,T32 |
StCalcMask |
- |
- |
- |
- |
- |
- |
- |
- |
- |
0 |
- |
- |
- |
- |
- |
Covered |
T8,T31,T32 |
StScrambleData |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
1 |
- |
- |
- |
- |
Covered |
T8,T31,T32 |
StScrambleData |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
0 |
- |
- |
- |
- |
Covered |
T8,T31,T32 |
StCalcEcc |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T8,T31,T32 |
StReqFlash |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
1 |
1 |
- |
- |
Covered |
T31,T32,T33 |
StReqFlash |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
1 |
0 |
- |
- |
Covered |
T31,T33,T36 |
StReqFlash |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
0 |
- |
1 |
- |
Covered |
T8,T31,T32 |
StReqFlash |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
0 |
- |
0 |
- |
Covered |
T31,T33,T36 |
StWaitFlash |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
1 |
Covered |
T31,T32,T33 |
StWaitFlash |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
0 |
Covered |
T31,T32,T33 |
StDisabled |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T5,T6,T7 |
default |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
Covered |
T13,T14,T15 |
299 if (!rst_ni) begin
-1-
300 packed_data <= '0;
==>
301 mask_q <= '0;
302 end else if (req_o && ack) begin
-2-
303 packed_data <= '0;
==>
304 end else if (calc_req_o && calc_ack_i) begin
-3-
305 packed_data <= packed_data ^ mask_i;
==>
306 mask_q <= mask_i;
307 end else if (scramble_req_o && scramble_ack_i) begin
-4-
308 packed_data <= scrambled_data_i[DataWidth-1:0] ^ mask_q;
==>
309 end else if (pack_valid) begin
-5-
310 packed_data[idx] <= pack_data;
==>
311 end
MISSING_ELSE
==>
Branches:
-1- | -2- | -3- | -4- | -5- | Status | Tests |
1 |
- |
- |
- |
- |
Covered |
T1,T2,T3 |
0 |
1 |
- |
- |
- |
Covered |
T31,T32,T33 |
0 |
0 |
1 |
- |
- |
Covered |
T8,T31,T32 |
0 |
0 |
0 |
1 |
- |
Covered |
T8,T31,T32 |
0 |
0 |
0 |
0 |
1 |
Covered |
T8,T31,T32 |
0 |
0 |
0 |
0 |
0 |
Covered |
T1,T2,T3 |
323 if (!rst_ni) begin
-1-
324 plain_data_ecc <= '1;
==>
325 end else if (plain_ecc_en) begin
-2-
326 plain_data_ecc <= plain_data_w_ecc[DataWidth +: PlainIntgWidth];
==>
327 end
MISSING_ELSE
==>
Branches:
-1- | -2- | Status | Tests |
1 |
- |
Covered |
T1,T2,T3 |
0 |
1 |
Covered |
T8,T31,T32 |
0 |
0 |
Covered |
T1,T2,T3 |
369 if (!rst_ni) begin
-1-
370 done_cnt_q <= '0;
==>
371 end else begin
372 done_cnt_q <= done_cnt_d;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T1,T2,T3 |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.u_eflash.gen_flash_cores[1].u_core.gen_prog_data.u_prog
Assertion Details
OneDonePerTxn_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
356085925 |
1163972 |
0 |
0 |
T26 |
5068 |
0 |
0 |
0 |
T31 |
1686 |
1 |
0 |
0 |
T32 |
38012 |
8 |
0 |
0 |
T33 |
0 |
33 |
0 |
0 |
T34 |
0 |
30 |
0 |
0 |
T36 |
0 |
2 |
0 |
0 |
T37 |
1755 |
0 |
0 |
0 |
T38 |
2047 |
0 |
0 |
0 |
T40 |
0 |
729 |
0 |
0 |
T49 |
6237 |
0 |
0 |
0 |
T50 |
0 |
44 |
0 |
0 |
T51 |
0 |
217 |
0 |
0 |
T53 |
1913 |
0 |
0 |
0 |
T55 |
162052 |
0 |
0 |
0 |
T66 |
0 |
126 |
0 |
0 |
T103 |
0 |
1 |
0 |
0 |
T114 |
4267 |
0 |
0 |
0 |
T126 |
1497 |
0 |
0 |
0 |
PostPackRule_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
356085925 |
812 |
0 |
0 |
T27 |
0 |
3 |
0 |
0 |
T28 |
0 |
8 |
0 |
0 |
T29 |
0 |
1 |
0 |
0 |
T34 |
95577 |
17 |
0 |
0 |
T35 |
0 |
2 |
0 |
0 |
T36 |
2996 |
1 |
0 |
0 |
T40 |
240866 |
0 |
0 |
0 |
T43 |
31354 |
0 |
0 |
0 |
T50 |
32980 |
0 |
0 |
0 |
T51 |
63656 |
0 |
0 |
0 |
T52 |
30677 |
0 |
0 |
0 |
T57 |
1977 |
0 |
0 |
0 |
T60 |
0 |
16 |
0 |
0 |
T61 |
0 |
17 |
0 |
0 |
T66 |
59946 |
0 |
0 |
0 |
T68 |
1717 |
0 |
0 |
0 |
T103 |
0 |
1 |
0 |
0 |
T220 |
0 |
1 |
0 |
0 |
PrePackRule_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
356085925 |
560 |
0 |
0 |
T27 |
0 |
3 |
0 |
0 |
T28 |
0 |
3 |
0 |
0 |
T30 |
0 |
2 |
0 |
0 |
T34 |
95577 |
20 |
0 |
0 |
T35 |
0 |
4 |
0 |
0 |
T40 |
240866 |
0 |
0 |
0 |
T51 |
63656 |
0 |
0 |
0 |
T60 |
0 |
16 |
0 |
0 |
T61 |
0 |
10 |
0 |
0 |
T66 |
59946 |
0 |
0 |
0 |
T68 |
1717 |
0 |
0 |
0 |
T69 |
10945 |
0 |
0 |
0 |
T70 |
48523 |
0 |
0 |
0 |
T103 |
2828 |
1 |
0 |
0 |
T127 |
1564 |
0 |
0 |
0 |
T200 |
2088 |
0 |
0 |
0 |
T220 |
0 |
1 |
0 |
0 |
T221 |
0 |
2 |
0 |
0 |
WidthCheck_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1047 |
1047 |
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 |
T10 |
1 |
1 |
0 |
0 |
T16 |
1 |
1 |
0 |
0 |
T17 |
1 |
1 |
0 |
0 |
T18 |
1 |
1 |
0 |
0 |
T19 |
1 |
1 |
0 |
0 |
u_state_regs_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
356085925 |
355255060 |
0 |
0 |
T1 |
3968 |
3880 |
0 |
0 |
T2 |
2197 |
2106 |
0 |
0 |
T3 |
14398 |
14311 |
0 |
0 |
T4 |
2284 |
2224 |
0 |
0 |
T5 |
967 |
871 |
0 |
0 |
T10 |
1608 |
1525 |
0 |
0 |
T16 |
2149 |
2059 |
0 |
0 |
T17 |
2075 |
1991 |
0 |
0 |
T18 |
1552 |
1490 |
0 |
0 |
T19 |
1174 |
1104 |
0 |
0 |