Line Coverage for Module :
i2c_fifo_sync_sram_adapter ( parameter Width=13,Depth=64,SramAw=9,SramBaseAddr,DepthW=7,OupBufDepth=2,InpBufDepthW=2,OupBufDepthW=2,SramPtrW=6,SramDepthW=6,SramAddrLeadingZeros=3 )
Line Coverage for Module self-instances :
| Line No. | Total | Covered | Percent |
TOTAL | | 44 | 44 | 100.00 |
CONT_ASSIGN | 120 | 1 | 1 | 100.00 |
CONT_ASSIGN | 121 | 1 | 1 | 100.00 |
CONT_ASSIGN | 125 | 1 | 1 | 100.00 |
CONT_ASSIGN | 150 | 1 | 1 | 100.00 |
CONT_ASSIGN | 151 | 1 | 1 | 100.00 |
CONT_ASSIGN | 153 | 1 | 1 | 100.00 |
CONT_ASSIGN | 154 | 1 | 1 | 100.00 |
CONT_ASSIGN | 162 | 1 | 1 | 100.00 |
ALWAYS | 164 | 3 | 3 | 100.00 |
ALWAYS | 174 | 28 | 28 | 100.00 |
CONT_ASSIGN | 228 | 1 | 1 | 100.00 |
CONT_ASSIGN | 236 | 1 | 1 | 100.00 |
CONT_ASSIGN | 240 | 1 | 1 | 100.00 |
CONT_ASSIGN | 244 | 1 | 1 | 100.00 |
CONT_ASSIGN | 249 | 1 | 1 | 100.00 |
119 );
120 1/1 assign inp_buf_wvalid = fifo_wvalid_i && fifo_wready_o;
Tests: T1 T2 T3
121 1/1 assign oup_buf_almost_full = oup_buf_depth >= OupBufDepthW'(OupBufDepth - 1);
Tests: T1 T2 T3
122
123 // Signal whether we access the SRAM in this cycle
124 logic sram_access;
125 1/1 assign sram_access = sram_req_o && sram_gnt_i;
Tests: T1 T2 T3
126
127 // SRAM read and write addresses
128 logic [SramAw-1:0] sram_wr_addr, sram_rd_addr;
129 logic [SramPtrW-1:0] sram_wr_ptr, sram_rd_ptr;
130 logic [SramDepthW-1:0] sram_depth;
131 logic sram_incr_wr_ptr, sram_incr_rd_ptr;
132 logic sram_full, sram_empty;
133 logic sram_ptrs_err;
134 prim_fifo_sync_cnt #(
135 .Depth (SramFifoDepth),
136 .Secure(1'b0)
137 ) u_sram_ptrs (
138 .clk_i,
139 .rst_ni,
140 .clr_i,
141 .incr_wptr_i(sram_incr_wr_ptr),
142 .incr_rptr_i(sram_incr_rd_ptr),
143 .wptr_o (sram_wr_ptr),
144 .rptr_o (sram_rd_ptr),
145 .full_o (sram_full),
146 .empty_o (sram_empty),
147 .depth_o (sram_depth),
148 .err_o (sram_ptrs_err)
149 );
150 1/1 assign sram_incr_wr_ptr = sram_access && sram_write_o;
Tests: T1 T2 T3
151 1/1 assign sram_incr_rd_ptr = sram_access && !sram_write_o;
Tests: T1 T2 T3
152 if (SramAddrLeadingZeros > 0) begin : gen_zero_extend_sram_addrs
153 1/1 assign sram_wr_addr = {{SramAddrLeadingZeros{1'b0}}, sram_wr_ptr} + SramBaseAddr;
Tests: T1 T2 T3
154 1/1 assign sram_rd_addr = {{SramAddrLeadingZeros{1'b0}}, sram_rd_ptr} + SramBaseAddr;
Tests: T1 T2 T3
155 end else begin : gen_no_zero_extend_sram_addrs
156 assign sram_wr_addr = sram_wr_ptr + SramBaseAddr;
157 assign sram_rd_addr = sram_rd_ptr + SramBaseAddr;
158 end
159
160 // FF to remember whether we read from the SRAM in the previous clock cycle.
161 logic sram_read_in_prev_cyc_d, sram_read_in_prev_cyc_q;
162 1/1 assign sram_read_in_prev_cyc_d = clr_i ? 1'b0 : sram_incr_rd_ptr;
Tests: T1 T2 T3
163 always_ff @(posedge clk_i or negedge rst_ni) begin
164 1/1 if (!rst_ni) begin
Tests: T1 T2 T3
165 1/1 sram_read_in_prev_cyc_q <= 1'b0;
Tests: T1 T2 T3
166 end else begin
167 1/1 sram_read_in_prev_cyc_q <= sram_read_in_prev_cyc_d;
Tests: T1 T2 T3
168 end
169 end
170
171 // Control logic for FIFO interface wready, output buffer writes, and SRAM requests
172 logic state_err;
173 always_comb begin
174 1/1 inp_buf_rready = 1'b0;
Tests: T1 T2 T3
175 1/1 oup_buf_wvalid = 1'b0;
Tests: T1 T2 T3
176 1/1 oup_buf_wdata = inp_buf_rdata;
Tests: T1 T2 T3
177 1/1 sram_req_o = 1'b0;
Tests: T1 T2 T3
178 1/1 sram_write_o = 1'b0;
Tests: T1 T2 T3
179 1/1 sram_addr_o = sram_wr_addr;
Tests: T1 T2 T3
180 1/1 state_err = 1'b0;
Tests: T1 T2 T3
181
182 // If the SRAM was read in the previous cycle, write the read data to the output buffer.
183 1/1 if (sram_read_in_prev_cyc_q) begin
Tests: T1 T2 T3
184 1/1 oup_buf_wvalid = 1'b1;
Tests: T5 T8 T17
185 1/1 oup_buf_wdata = sram_rdata_i;
Tests: T5 T8 T17
186 // The output buffer must be ready; otherwise we are in an erroneous state.
187 1/1 state_err = !oup_buf_wready;
Tests: T5 T8 T17
188 end
MISSING_ELSE
189
190 // If the SRAM is not empty, data from the input buffer must flow via the SRAM.
191 1/1 if (!sram_empty) begin
Tests: T1 T2 T3
192
193 // Prioritize refilling of the output buffer: if the output buffer is not being filled to the
194 // last slot in the current cycle or it is being read in the current cycle, read from the SRAM
195 // so the output buffer can be written in the next cycle.
196 1/1 if (!((oup_buf_almost_full && oup_buf_wvalid) || oup_buf_full)
Tests: T2 T4 T5
197 || (fifo_rvalid_o && fifo_rready_i)) begin
198 1/1 sram_req_o = 1'b1;
Tests: T5 T8 T17
199 1/1 sram_write_o = 1'b0;
Tests: T5 T8 T17
200 1/1 sram_addr_o = sram_rd_addr;
Tests: T5 T8 T17
201
202 // If the output buffer is full (and not being read), drain the input buffer into the SRAM.
203 end else begin
204 1/1 sram_req_o = !sram_full && inp_buf_rvalid;
Tests: T2 T4 T5
205 1/1 sram_write_o = 1'b1;
Tests: T2 T4 T5
206 1/1 sram_addr_o = sram_wr_addr;
Tests: T2 T4 T5
207 1/1 inp_buf_rready = !sram_full && sram_gnt_i;
Tests: T2 T4 T5
208 end
209
210 // If the SRAM is empty, data must flow from the input buffer to the output buffer if the output
211 // buffer is ready and is not receiving data read from the SRAM in the previous cycle
212 1/1 end else if (oup_buf_wready && !sram_read_in_prev_cyc_q) begin
Tests: T1 T2 T3
213 1/1 oup_buf_wvalid = inp_buf_rvalid;
Tests: T1 T2 T3
214 1/1 oup_buf_wdata = inp_buf_rdata;
Tests: T1 T2 T3
215 1/1 inp_buf_rready = oup_buf_wready;
Tests: T1 T2 T3
216
217 // Otherwise the SRAM is empty but the output buffer cannot take the data from the input buffer,
218 // so drain the input buffer into the SRAM.
219 end else begin
220 1/1 sram_req_o = !sram_full && inp_buf_rvalid;
Tests: T1 T2 T3
221 1/1 sram_write_o = 1'b1;
Tests: T1 T2 T3
222 1/1 sram_addr_o = sram_wr_addr;
Tests: T1 T2 T3
223 1/1 inp_buf_rready = !sram_full && sram_gnt_i;
Tests: T1 T2 T3
224 end
225 end
226
227 // Error output is high if any of the internal errors is high
228 1/1 assign err_o = |{inp_buf_err, oup_buf_err, sram_ptrs_err, state_err};
Tests: T1 T2 T3
229
230 // The SRAM and the output buffer together form the entire architectural capacity of the FIFO.
231 // Thus, when both are full, the FIFO is no longer ready to receive writes even though the input
232 // buffer could store one additional entry. This ensures that in the cycle after an entry has
233 // been read from the full FIFO, the next entry can be written to the FIFO.
234 // (It may be possible that all input buffer slots except one can be counted to the architectural
235 // capacity of the FIFO, but this is a relatively small optimization left for future work.)
236 1/1 assign fifo_wready_o = inp_buf_wready && !(sram_full && oup_buf_full);
Tests: T1 T2 T3
237
238 // The current depth of the FIFO represented by this module is the depth of all buffers plus the
239 // FIFO in the SRAM plus one if there's an entry in transition between SRAM and output buffer.
240 1/1 assign fifo_depth_o = DepthW'(inp_buf_depth) + DepthW'(sram_depth) + DepthW'(oup_buf_depth) +
Tests: T1 T2 T3
241 DepthW'(sram_read_in_prev_cyc_q);
242
243 // SRAM write data always comes from the input buffer.
244 1/1 assign sram_wdata_o = inp_buf_rdata;
Tests: T1 T2 T3
245 assign sram_wmask_o = '1;
246
247 // `sram_rvalid_i` is only used for assertions.
248 logic unused_sram_rvalid;
249 1/1 assign unused_sram_rvalid = sram_rvalid_i;
Tests: T1 T2 T3
Line Coverage for Module :
i2c_fifo_sync_sram_adapter ( parameter Width=13,Depth=268,SramAw=9,SramBaseAddr=192,DepthW=9,OupBufDepth=2,InpBufDepthW=2,OupBufDepthW=2,SramPtrW=9,SramDepthW=9,SramAddrLeadingZeros=0 )
Line Coverage for Module self-instances :
| Line No. | Total | Covered | Percent |
TOTAL | | 44 | 44 | 100.00 |
CONT_ASSIGN | 120 | 1 | 1 | 100.00 |
CONT_ASSIGN | 121 | 1 | 1 | 100.00 |
CONT_ASSIGN | 125 | 1 | 1 | 100.00 |
CONT_ASSIGN | 150 | 1 | 1 | 100.00 |
CONT_ASSIGN | 151 | 1 | 1 | 100.00 |
CONT_ASSIGN | 156 | 1 | 1 | 100.00 |
CONT_ASSIGN | 157 | 1 | 1 | 100.00 |
CONT_ASSIGN | 162 | 1 | 1 | 100.00 |
ALWAYS | 164 | 3 | 3 | 100.00 |
ALWAYS | 174 | 28 | 28 | 100.00 |
CONT_ASSIGN | 228 | 1 | 1 | 100.00 |
CONT_ASSIGN | 236 | 1 | 1 | 100.00 |
CONT_ASSIGN | 240 | 1 | 1 | 100.00 |
CONT_ASSIGN | 244 | 1 | 1 | 100.00 |
CONT_ASSIGN | 249 | 1 | 1 | 100.00 |
119 );
120 1/1 assign inp_buf_wvalid = fifo_wvalid_i && fifo_wready_o;
Tests: T1 T2 T3
121 1/1 assign oup_buf_almost_full = oup_buf_depth >= OupBufDepthW'(OupBufDepth - 1);
Tests: T1 T2 T3
122
123 // Signal whether we access the SRAM in this cycle
124 logic sram_access;
125 1/1 assign sram_access = sram_req_o && sram_gnt_i;
Tests: T1 T2 T3
126
127 // SRAM read and write addresses
128 logic [SramAw-1:0] sram_wr_addr, sram_rd_addr;
129 logic [SramPtrW-1:0] sram_wr_ptr, sram_rd_ptr;
130 logic [SramDepthW-1:0] sram_depth;
131 logic sram_incr_wr_ptr, sram_incr_rd_ptr;
132 logic sram_full, sram_empty;
133 logic sram_ptrs_err;
134 prim_fifo_sync_cnt #(
135 .Depth (SramFifoDepth),
136 .Secure(1'b0)
137 ) u_sram_ptrs (
138 .clk_i,
139 .rst_ni,
140 .clr_i,
141 .incr_wptr_i(sram_incr_wr_ptr),
142 .incr_rptr_i(sram_incr_rd_ptr),
143 .wptr_o (sram_wr_ptr),
144 .rptr_o (sram_rd_ptr),
145 .full_o (sram_full),
146 .empty_o (sram_empty),
147 .depth_o (sram_depth),
148 .err_o (sram_ptrs_err)
149 );
150 1/1 assign sram_incr_wr_ptr = sram_access && sram_write_o;
Tests: T1 T2 T3
151 1/1 assign sram_incr_rd_ptr = sram_access && !sram_write_o;
Tests: T1 T2 T3
152 if (SramAddrLeadingZeros > 0) begin : gen_zero_extend_sram_addrs
153 assign sram_wr_addr = {{SramAddrLeadingZeros{1'b0}}, sram_wr_ptr} + SramBaseAddr;
154 assign sram_rd_addr = {{SramAddrLeadingZeros{1'b0}}, sram_rd_ptr} + SramBaseAddr;
155 end else begin : gen_no_zero_extend_sram_addrs
156 1/1 assign sram_wr_addr = sram_wr_ptr + SramBaseAddr;
Tests: T1 T2 T3
157 1/1 assign sram_rd_addr = sram_rd_ptr + SramBaseAddr;
Tests: T1 T2 T3
158 end
159
160 // FF to remember whether we read from the SRAM in the previous clock cycle.
161 logic sram_read_in_prev_cyc_d, sram_read_in_prev_cyc_q;
162 1/1 assign sram_read_in_prev_cyc_d = clr_i ? 1'b0 : sram_incr_rd_ptr;
Tests: T1 T2 T3
163 always_ff @(posedge clk_i or negedge rst_ni) begin
164 1/1 if (!rst_ni) begin
Tests: T1 T2 T3
165 1/1 sram_read_in_prev_cyc_q <= 1'b0;
Tests: T1 T2 T3
166 end else begin
167 1/1 sram_read_in_prev_cyc_q <= sram_read_in_prev_cyc_d;
Tests: T1 T2 T3
168 end
169 end
170
171 // Control logic for FIFO interface wready, output buffer writes, and SRAM requests
172 logic state_err;
173 always_comb begin
174 1/1 inp_buf_rready = 1'b0;
Tests: T1 T2 T3
175 1/1 oup_buf_wvalid = 1'b0;
Tests: T1 T2 T3
176 1/1 oup_buf_wdata = inp_buf_rdata;
Tests: T1 T2 T3
177 1/1 sram_req_o = 1'b0;
Tests: T1 T2 T3
178 1/1 sram_write_o = 1'b0;
Tests: T1 T2 T3
179 1/1 sram_addr_o = sram_wr_addr;
Tests: T1 T2 T3
180 1/1 state_err = 1'b0;
Tests: T1 T2 T3
181
182 // If the SRAM was read in the previous cycle, write the read data to the output buffer.
183 1/1 if (sram_read_in_prev_cyc_q) begin
Tests: T1 T2 T3
184 1/1 oup_buf_wvalid = 1'b1;
Tests: T5 T7 T9
185 1/1 oup_buf_wdata = sram_rdata_i;
Tests: T5 T7 T9
186 // The output buffer must be ready; otherwise we are in an erroneous state.
187 1/1 state_err = !oup_buf_wready;
Tests: T5 T7 T9
188 end
MISSING_ELSE
189
190 // If the SRAM is not empty, data from the input buffer must flow via the SRAM.
191 1/1 if (!sram_empty) begin
Tests: T1 T2 T3
192
193 // Prioritize refilling of the output buffer: if the output buffer is not being filled to the
194 // last slot in the current cycle or it is being read in the current cycle, read from the SRAM
195 // so the output buffer can be written in the next cycle.
196 1/1 if (!((oup_buf_almost_full && oup_buf_wvalid) || oup_buf_full)
Tests: T5 T7 T9
197 || (fifo_rvalid_o && fifo_rready_i)) begin
198 1/1 sram_req_o = 1'b1;
Tests: T5 T7 T9
199 1/1 sram_write_o = 1'b0;
Tests: T5 T7 T9
200 1/1 sram_addr_o = sram_rd_addr;
Tests: T5 T7 T9
201
202 // If the output buffer is full (and not being read), drain the input buffer into the SRAM.
203 end else begin
204 1/1 sram_req_o = !sram_full && inp_buf_rvalid;
Tests: T5 T7 T9
205 1/1 sram_write_o = 1'b1;
Tests: T5 T7 T9
206 1/1 sram_addr_o = sram_wr_addr;
Tests: T5 T7 T9
207 1/1 inp_buf_rready = !sram_full && sram_gnt_i;
Tests: T5 T7 T9
208 end
209
210 // If the SRAM is empty, data must flow from the input buffer to the output buffer if the output
211 // buffer is ready and is not receiving data read from the SRAM in the previous cycle
212 1/1 end else if (oup_buf_wready && !sram_read_in_prev_cyc_q) begin
Tests: T1 T2 T3
213 1/1 oup_buf_wvalid = inp_buf_rvalid;
Tests: T1 T2 T3
214 1/1 oup_buf_wdata = inp_buf_rdata;
Tests: T1 T2 T3
215 1/1 inp_buf_rready = oup_buf_wready;
Tests: T1 T2 T3
216
217 // Otherwise the SRAM is empty but the output buffer cannot take the data from the input buffer,
218 // so drain the input buffer into the SRAM.
219 end else begin
220 1/1 sram_req_o = !sram_full && inp_buf_rvalid;
Tests: T1 T2 T3
221 1/1 sram_write_o = 1'b1;
Tests: T1 T2 T3
222 1/1 sram_addr_o = sram_wr_addr;
Tests: T1 T2 T3
223 1/1 inp_buf_rready = !sram_full && sram_gnt_i;
Tests: T1 T2 T3
224 end
225 end
226
227 // Error output is high if any of the internal errors is high
228 1/1 assign err_o = |{inp_buf_err, oup_buf_err, sram_ptrs_err, state_err};
Tests: T1 T2 T3
229
230 // The SRAM and the output buffer together form the entire architectural capacity of the FIFO.
231 // Thus, when both are full, the FIFO is no longer ready to receive writes even though the input
232 // buffer could store one additional entry. This ensures that in the cycle after an entry has
233 // been read from the full FIFO, the next entry can be written to the FIFO.
234 // (It may be possible that all input buffer slots except one can be counted to the architectural
235 // capacity of the FIFO, but this is a relatively small optimization left for future work.)
236 1/1 assign fifo_wready_o = inp_buf_wready && !(sram_full && oup_buf_full);
Tests: T1 T2 T3
237
238 // The current depth of the FIFO represented by this module is the depth of all buffers plus the
239 // FIFO in the SRAM plus one if there's an entry in transition between SRAM and output buffer.
240 1/1 assign fifo_depth_o = DepthW'(inp_buf_depth) + DepthW'(sram_depth) + DepthW'(oup_buf_depth) +
Tests: T1 T2 T3
241 DepthW'(sram_read_in_prev_cyc_q);
242
243 // SRAM write data always comes from the input buffer.
244 1/1 assign sram_wdata_o = inp_buf_rdata;
Tests: T1 T2 T3
245 assign sram_wmask_o = '1;
246
247 // `sram_rvalid_i` is only used for assertions.
248 logic unused_sram_rvalid;
249 1/1 assign unused_sram_rvalid = sram_rvalid_i;
Tests: T1 T2 T3
Cond Coverage for Module :
i2c_fifo_sync_sram_adapter
| Total | Covered | Percent |
Conditions | 51 | 42 | 82.35 |
Logical | 51 | 42 | 82.35 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 120
EXPRESSION (fifo_wvalid_i && fifo_wready_o)
------1------ ------2------
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T53,T69,T82 |
1 | 1 | Covered | T2,T3,T4 |
LINE 125
EXPRESSION (sram_req_o && sram_gnt_i)
-----1---- -----2----
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Not Covered | |
1 | 1 | Covered | T2,T4,T5 |
LINE 150
EXPRESSION (sram_access && sram_write_o)
-----1----- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T5,T8,T17 |
1 | 1 | Covered | T2,T4,T5 |
LINE 151
EXPRESSION (sram_access && ((!sram_write_o)))
-----1----- --------2--------
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T2,T4,T5 |
1 | 1 | Covered | T5,T8,T17 |
LINE 162
EXPRESSION (clr_i ? 1'b0 : sram_incr_rd_ptr)
--1--
-1- | Status | Tests |
0 | Covered | T1,T2,T3 |
1 | Covered | T1,T2,T3 |
LINE 196
EXPRESSION (( ! ((oup_buf_almost_full && oup_buf_wvalid) || oup_buf_full) ) || (fifo_rvalid_o && fifo_rready_i))
-------------------------------1------------------------------- ----------------2---------------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T2,T4,T5 |
0 | 1 | Covered | T5,T8,T17 |
1 | 0 | Covered | T53,T69,T155 |
LINE 196
SUB-EXPRESSION ( ! ((oup_buf_almost_full && oup_buf_wvalid) || oup_buf_full) )
----------------------------1----------------------------
-1- | Status | Tests |
0 | Covered | T53,T69,T155 |
1 | Covered | T2,T4,T5 |
LINE 196
SUB-EXPRESSION ((oup_buf_almost_full && oup_buf_wvalid) || oup_buf_full)
-------------------1------------------- ------2-----
-1- | -2- | Status | Tests |
0 | 0 | Covered | T53,T69,T155 |
0 | 1 | Covered | T2,T4,T5 |
1 | 0 | Covered | T5,T8,T17 |
LINE 196
SUB-EXPRESSION (oup_buf_almost_full && oup_buf_wvalid)
---------1--------- -------2------
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T2,T4,T5 |
1 | 1 | Covered | T5,T8,T17 |
LINE 196
SUB-EXPRESSION (fifo_rvalid_o && fifo_rready_i)
------1------ ------2------
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T2,T4,T5 |
1 | 1 | Covered | T5,T8,T17 |
LINE 204
EXPRESSION (((!sram_full)) && inp_buf_rvalid)
-------1------ -------2------
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T2,T4,T5 |
1 | 1 | Covered | T2,T4,T5 |
LINE 207
EXPRESSION (((!sram_full)) && sram_gnt_i)
-------1------ -----2----
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T2,T4,T5 |
1 | 1 | Covered | T2,T4,T5 |
LINE 212
EXPRESSION (oup_buf_wready && ((!sram_read_in_prev_cyc_q)))
-------1------ --------------2-------------
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T7,T8,T17 |
1 | 1 | Covered | T1,T2,T3 |
LINE 220
EXPRESSION (((!sram_full)) && inp_buf_rvalid)
-------1------ -------2------
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T1,T2,T3 |
1 | 1 | Covered | T2,T4,T5 |
LINE 223
EXPRESSION (((!sram_full)) && sram_gnt_i)
-------1------ -----2----
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T1,T2,T3 |
1 | 1 | Covered | T2,T4,T5 |
LINE 236
EXPRESSION (inp_buf_wready && ( ! (sram_full && oup_buf_full) ))
-------1------ ----------------2----------------
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T4,T59,T46 |
1 | 1 | Covered | T1,T2,T3 |
LINE 236
SUB-EXPRESSION ( ! (sram_full && oup_buf_full) )
-------------1-------------
-1- | Status | Tests |
0 | Covered | T1,T2,T3 |
1 | Covered | T4,T59,T46 |
LINE 236
SUB-EXPRESSION (sram_full && oup_buf_full)
----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T2,T3,T4 |
1 | 0 | Not Covered | |
1 | 1 | Covered | T4,T59,T46 |
Branch Coverage for Module :
i2c_fifo_sync_sram_adapter
| Line No. | Total | Covered | Percent |
Branches |
|
10 |
10 |
100.00 |
TERNARY |
162 |
2 |
2 |
100.00 |
IF |
164 |
2 |
2 |
100.00 |
IF |
183 |
2 |
2 |
100.00 |
IF |
191 |
4 |
4 |
100.00 |
162 assign sram_read_in_prev_cyc_d = clr_i ? 1'b0 : sram_incr_rd_ptr;
-1-
==>
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T1,T2,T3 |
0 |
Covered |
T1,T2,T3 |
164 if (!rst_ni) begin
-1-
165 sram_read_in_prev_cyc_q <= 1'b0;
==>
166 end else begin
167 sram_read_in_prev_cyc_q <= sram_read_in_prev_cyc_d;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T1,T2,T3 |
0 |
Covered |
T1,T2,T3 |
183 if (sram_read_in_prev_cyc_q) begin
-1-
184 oup_buf_wvalid = 1'b1;
==>
185 oup_buf_wdata = sram_rdata_i;
186 // The output buffer must be ready; otherwise we are in an erroneous state.
187 state_err = !oup_buf_wready;
188 end
MISSING_ELSE
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T5,T8,T17 |
0 |
Covered |
T1,T2,T3 |
191 if (!sram_empty) begin
-1-
192
193 // Prioritize refilling of the output buffer: if the output buffer is not being filled to the
194 // last slot in the current cycle or it is being read in the current cycle, read from the SRAM
195 // so the output buffer can be written in the next cycle.
196 if (!((oup_buf_almost_full && oup_buf_wvalid) || oup_buf_full)
-2-
197 || (fifo_rvalid_o && fifo_rready_i)) begin
198 sram_req_o = 1'b1;
==>
199 sram_write_o = 1'b0;
200 sram_addr_o = sram_rd_addr;
201
202 // If the output buffer is full (and not being read), drain the input buffer into the SRAM.
203 end else begin
204 sram_req_o = !sram_full && inp_buf_rvalid;
==>
205 sram_write_o = 1'b1;
206 sram_addr_o = sram_wr_addr;
207 inp_buf_rready = !sram_full && sram_gnt_i;
208 end
209
210 // If the SRAM is empty, data must flow from the input buffer to the output buffer if the output
211 // buffer is ready and is not receiving data read from the SRAM in the previous cycle
212 end else if (oup_buf_wready && !sram_read_in_prev_cyc_q) begin
-3-
213 oup_buf_wvalid = inp_buf_rvalid;
==>
214 oup_buf_wdata = inp_buf_rdata;
215 inp_buf_rready = oup_buf_wready;
216
217 // Otherwise the SRAM is empty but the output buffer cannot take the data from the input buffer,
218 // so drain the input buffer into the SRAM.
219 end else begin
220 sram_req_o = !sram_full && inp_buf_rvalid;
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
1 |
- |
Covered |
T5,T8,T17 |
1 |
0 |
- |
Covered |
T2,T4,T5 |
0 |
- |
1 |
Covered |
T1,T2,T3 |
0 |
- |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Module :
i2c_fifo_sync_sram_adapter
Assertion Details
MinimalSramAw_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
6752 |
6752 |
0 |
0 |
T1 |
4 |
4 |
0 |
0 |
T2 |
4 |
4 |
0 |
0 |
T3 |
4 |
4 |
0 |
0 |
T4 |
4 |
4 |
0 |
0 |
T5 |
4 |
4 |
0 |
0 |
T6 |
4 |
4 |
0 |
0 |
T7 |
4 |
4 |
0 |
0 |
T8 |
4 |
4 |
0 |
0 |
T9 |
4 |
4 |
0 |
0 |
T10 |
4 |
4 |
0 |
0 |
MinimalSramFifoDepth_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
6752 |
6752 |
0 |
0 |
T1 |
4 |
4 |
0 |
0 |
T2 |
4 |
4 |
0 |
0 |
T3 |
4 |
4 |
0 |
0 |
T4 |
4 |
4 |
0 |
0 |
T5 |
4 |
4 |
0 |
0 |
T6 |
4 |
4 |
0 |
0 |
T7 |
4 |
4 |
0 |
0 |
T8 |
4 |
4 |
0 |
0 |
T9 |
4 |
4 |
0 |
0 |
T10 |
4 |
4 |
0 |
0 |
NoErr_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1651995604 |
1651318308 |
0 |
0 |
T1 |
9272 |
8924 |
0 |
0 |
T2 |
37564 |
37192 |
0 |
0 |
T3 |
28928 |
28556 |
0 |
0 |
T4 |
55288 |
54912 |
0 |
0 |
T5 |
54888 |
54492 |
0 |
0 |
T6 |
57092 |
56840 |
0 |
0 |
T7 |
470804 |
470580 |
0 |
0 |
T8 |
84604 |
81128 |
0 |
0 |
T9 |
224856 |
224460 |
0 |
0 |
T10 |
372148 |
371764 |
0 |
0 |
NoSramReadWhenEmpty_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1651995604 |
1312412879 |
0 |
0 |
T1 |
9272 |
8924 |
0 |
0 |
T2 |
37564 |
31862 |
0 |
0 |
T3 |
28928 |
28556 |
0 |
0 |
T4 |
55288 |
42822 |
0 |
0 |
T5 |
54888 |
48443 |
0 |
0 |
T6 |
57092 |
55455 |
0 |
0 |
T7 |
470804 |
377025 |
0 |
0 |
T8 |
84604 |
76865 |
0 |
0 |
T9 |
224856 |
182350 |
0 |
0 |
T10 |
372148 |
294075 |
0 |
0 |
NoSramWriteWhenFull_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1651995604 |
25806895 |
0 |
0 |
T4 |
13822 |
12 |
0 |
0 |
T18 |
13240 |
0 |
0 |
0 |
T25 |
159430 |
0 |
0 |
0 |
T30 |
0 |
110007 |
0 |
0 |
T38 |
11147 |
0 |
0 |
0 |
T46 |
14103 |
0 |
0 |
0 |
T52 |
57000 |
5 |
0 |
0 |
T53 |
220661 |
27 |
0 |
0 |
T55 |
0 |
3 |
0 |
0 |
T60 |
12847 |
0 |
0 |
0 |
T62 |
57893 |
1271 |
0 |
0 |
T63 |
0 |
1414 |
0 |
0 |
T64 |
0 |
12 |
0 |
0 |
T68 |
0 |
1553 |
0 |
0 |
T69 |
0 |
14 |
0 |
0 |
T72 |
5324 |
0 |
0 |
0 |
T74 |
93630 |
0 |
0 |
0 |
T75 |
63317 |
0 |
0 |
0 |
T77 |
119692 |
0 |
0 |
0 |
T82 |
172634 |
0 |
0 |
0 |
T83 |
0 |
8 |
0 |
0 |
T153 |
48655 |
0 |
0 |
0 |
T156 |
17518 |
2289 |
0 |
0 |
T157 |
0 |
22 |
0 |
0 |
T158 |
0 |
3387 |
0 |
0 |
T159 |
0 |
118569 |
0 |
0 |
T160 |
0 |
735 |
0 |
0 |
T161 |
0 |
92657 |
0 |
0 |
T162 |
0 |
107495 |
0 |
0 |
T163 |
0 |
180316 |
0 |
0 |
T164 |
0 |
44547 |
0 |
0 |
T165 |
0 |
165956 |
0 |
0 |
T166 |
266843 |
0 |
0 |
0 |
T167 |
36608 |
0 |
0 |
0 |
T168 |
23734 |
0 |
0 |
0 |
T169 |
184742 |
0 |
0 |
0 |
T170 |
101675 |
0 |
0 |
0 |
OupBufWreadyAfterSramRead_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1651995604 |
640011 |
0 |
0 |
T5 |
13722 |
10 |
0 |
0 |
T6 |
14273 |
0 |
0 |
0 |
T7 |
117701 |
389 |
0 |
0 |
T8 |
42302 |
17 |
0 |
0 |
T9 |
112428 |
168 |
0 |
0 |
T10 |
186074 |
355 |
0 |
0 |
T11 |
0 |
72 |
0 |
0 |
T17 |
122150 |
139 |
0 |
0 |
T18 |
0 |
29 |
0 |
0 |
T19 |
0 |
2 |
0 |
0 |
T25 |
0 |
30 |
0 |
0 |
T26 |
69304 |
120 |
0 |
0 |
T45 |
0 |
28 |
0 |
0 |
T47 |
0 |
42 |
0 |
0 |
T48 |
19230 |
0 |
0 |
0 |
T52 |
0 |
266 |
0 |
0 |
T53 |
0 |
33 |
0 |
0 |
T60 |
12847 |
0 |
0 |
0 |
T65 |
0 |
146 |
0 |
0 |
T67 |
94873 |
0 |
0 |
0 |
T70 |
47092 |
264 |
0 |
0 |
T71 |
10639 |
0 |
0 |
0 |
T73 |
184714 |
25 |
0 |
0 |
T74 |
0 |
361 |
0 |
0 |
T77 |
119692 |
0 |
0 |
0 |
T82 |
172634 |
868 |
0 |
0 |
T99 |
1544 |
0 |
0 |
0 |
T101 |
1425 |
0 |
0 |
0 |
T169 |
184742 |
0 |
0 |
0 |
T170 |
101675 |
0 |
0 |
0 |
T171 |
0 |
72 |
0 |
0 |
T172 |
4320 |
0 |
0 |
0 |
SramRvalidAfterRead_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1651995604 |
640011 |
0 |
0 |
T5 |
13722 |
10 |
0 |
0 |
T6 |
14273 |
0 |
0 |
0 |
T7 |
117701 |
389 |
0 |
0 |
T8 |
42302 |
17 |
0 |
0 |
T9 |
112428 |
168 |
0 |
0 |
T10 |
186074 |
355 |
0 |
0 |
T11 |
0 |
72 |
0 |
0 |
T17 |
122150 |
139 |
0 |
0 |
T18 |
0 |
29 |
0 |
0 |
T19 |
0 |
2 |
0 |
0 |
T25 |
0 |
30 |
0 |
0 |
T26 |
69304 |
120 |
0 |
0 |
T45 |
0 |
28 |
0 |
0 |
T47 |
0 |
42 |
0 |
0 |
T48 |
19230 |
0 |
0 |
0 |
T52 |
0 |
266 |
0 |
0 |
T53 |
0 |
33 |
0 |
0 |
T60 |
12847 |
0 |
0 |
0 |
T65 |
0 |
146 |
0 |
0 |
T67 |
94873 |
0 |
0 |
0 |
T70 |
47092 |
264 |
0 |
0 |
T71 |
10639 |
0 |
0 |
0 |
T73 |
184714 |
25 |
0 |
0 |
T74 |
0 |
361 |
0 |
0 |
T77 |
119692 |
0 |
0 |
0 |
T82 |
172634 |
868 |
0 |
0 |
T99 |
1544 |
0 |
0 |
0 |
T101 |
1425 |
0 |
0 |
0 |
T169 |
184742 |
0 |
0 |
0 |
T170 |
101675 |
0 |
0 |
0 |
T171 |
0 |
72 |
0 |
0 |
T172 |
4320 |
0 |
0 |
0 |
Line Coverage for Instance : tb.dut.i2c_core.u_fifos.u_fmt_fifo_sram_adapter
| Line No. | Total | Covered | Percent |
TOTAL | | 44 | 44 | 100.00 |
CONT_ASSIGN | 120 | 1 | 1 | 100.00 |
CONT_ASSIGN | 121 | 1 | 1 | 100.00 |
CONT_ASSIGN | 125 | 1 | 1 | 100.00 |
CONT_ASSIGN | 150 | 1 | 1 | 100.00 |
CONT_ASSIGN | 151 | 1 | 1 | 100.00 |
CONT_ASSIGN | 153 | 1 | 1 | 100.00 |
CONT_ASSIGN | 154 | 1 | 1 | 100.00 |
CONT_ASSIGN | 162 | 1 | 1 | 100.00 |
ALWAYS | 164 | 3 | 3 | 100.00 |
ALWAYS | 174 | 28 | 28 | 100.00 |
CONT_ASSIGN | 228 | 1 | 1 | 100.00 |
CONT_ASSIGN | 236 | 1 | 1 | 100.00 |
CONT_ASSIGN | 240 | 1 | 1 | 100.00 |
CONT_ASSIGN | 244 | 1 | 1 | 100.00 |
CONT_ASSIGN | 249 | 1 | 1 | 100.00 |
119 );
120 1/1 assign inp_buf_wvalid = fifo_wvalid_i && fifo_wready_o;
Tests: T1 T2 T3
121 1/1 assign oup_buf_almost_full = oup_buf_depth >= OupBufDepthW'(OupBufDepth - 1);
Tests: T1 T2 T3
122
123 // Signal whether we access the SRAM in this cycle
124 logic sram_access;
125 1/1 assign sram_access = sram_req_o && sram_gnt_i;
Tests: T1 T2 T3
126
127 // SRAM read and write addresses
128 logic [SramAw-1:0] sram_wr_addr, sram_rd_addr;
129 logic [SramPtrW-1:0] sram_wr_ptr, sram_rd_ptr;
130 logic [SramDepthW-1:0] sram_depth;
131 logic sram_incr_wr_ptr, sram_incr_rd_ptr;
132 logic sram_full, sram_empty;
133 logic sram_ptrs_err;
134 prim_fifo_sync_cnt #(
135 .Depth (SramFifoDepth),
136 .Secure(1'b0)
137 ) u_sram_ptrs (
138 .clk_i,
139 .rst_ni,
140 .clr_i,
141 .incr_wptr_i(sram_incr_wr_ptr),
142 .incr_rptr_i(sram_incr_rd_ptr),
143 .wptr_o (sram_wr_ptr),
144 .rptr_o (sram_rd_ptr),
145 .full_o (sram_full),
146 .empty_o (sram_empty),
147 .depth_o (sram_depth),
148 .err_o (sram_ptrs_err)
149 );
150 1/1 assign sram_incr_wr_ptr = sram_access && sram_write_o;
Tests: T1 T2 T3
151 1/1 assign sram_incr_rd_ptr = sram_access && !sram_write_o;
Tests: T1 T2 T3
152 if (SramAddrLeadingZeros > 0) begin : gen_zero_extend_sram_addrs
153 1/1 assign sram_wr_addr = {{SramAddrLeadingZeros{1'b0}}, sram_wr_ptr} + SramBaseAddr;
Tests: T1 T2 T3
154 1/1 assign sram_rd_addr = {{SramAddrLeadingZeros{1'b0}}, sram_rd_ptr} + SramBaseAddr;
Tests: T1 T2 T3
155 end else begin : gen_no_zero_extend_sram_addrs
156 assign sram_wr_addr = sram_wr_ptr + SramBaseAddr;
157 assign sram_rd_addr = sram_rd_ptr + SramBaseAddr;
158 end
159
160 // FF to remember whether we read from the SRAM in the previous clock cycle.
161 logic sram_read_in_prev_cyc_d, sram_read_in_prev_cyc_q;
162 1/1 assign sram_read_in_prev_cyc_d = clr_i ? 1'b0 : sram_incr_rd_ptr;
Tests: T1 T2 T3
163 always_ff @(posedge clk_i or negedge rst_ni) begin
164 1/1 if (!rst_ni) begin
Tests: T1 T2 T3
165 1/1 sram_read_in_prev_cyc_q <= 1'b0;
Tests: T1 T2 T3
166 end else begin
167 1/1 sram_read_in_prev_cyc_q <= sram_read_in_prev_cyc_d;
Tests: T1 T2 T3
168 end
169 end
170
171 // Control logic for FIFO interface wready, output buffer writes, and SRAM requests
172 logic state_err;
173 always_comb begin
174 1/1 inp_buf_rready = 1'b0;
Tests: T1 T2 T3
175 1/1 oup_buf_wvalid = 1'b0;
Tests: T1 T2 T3
176 1/1 oup_buf_wdata = inp_buf_rdata;
Tests: T1 T2 T3
177 1/1 sram_req_o = 1'b0;
Tests: T1 T2 T3
178 1/1 sram_write_o = 1'b0;
Tests: T1 T2 T3
179 1/1 sram_addr_o = sram_wr_addr;
Tests: T1 T2 T3
180 1/1 state_err = 1'b0;
Tests: T1 T2 T3
181
182 // If the SRAM was read in the previous cycle, write the read data to the output buffer.
183 1/1 if (sram_read_in_prev_cyc_q) begin
Tests: T1 T2 T3
184 1/1 oup_buf_wvalid = 1'b1;
Tests: T8 T17 T26
185 1/1 oup_buf_wdata = sram_rdata_i;
Tests: T8 T17 T26
186 // The output buffer must be ready; otherwise we are in an erroneous state.
187 1/1 state_err = !oup_buf_wready;
Tests: T8 T17 T26
188 end
MISSING_ELSE
189
190 // If the SRAM is not empty, data from the input buffer must flow via the SRAM.
191 1/1 if (!sram_empty) begin
Tests: T1 T2 T3
192
193 // Prioritize refilling of the output buffer: if the output buffer is not being filled to the
194 // last slot in the current cycle or it is being read in the current cycle, read from the SRAM
195 // so the output buffer can be written in the next cycle.
196 1/1 if (!((oup_buf_almost_full && oup_buf_wvalid) || oup_buf_full)
Tests: T2 T8 T17
197 || (fifo_rvalid_o && fifo_rready_i)) begin
198 1/1 sram_req_o = 1'b1;
Tests: T8 T17 T26
199 1/1 sram_write_o = 1'b0;
Tests: T8 T17 T26
200 1/1 sram_addr_o = sram_rd_addr;
Tests: T8 T17 T26
201
202 // If the output buffer is full (and not being read), drain the input buffer into the SRAM.
203 end else begin
204 1/1 sram_req_o = !sram_full && inp_buf_rvalid;
Tests: T2 T8 T17
205 1/1 sram_write_o = 1'b1;
Tests: T2 T8 T17
206 1/1 sram_addr_o = sram_wr_addr;
Tests: T2 T8 T17
207 1/1 inp_buf_rready = !sram_full && sram_gnt_i;
Tests: T2 T8 T17
208 end
209
210 // If the SRAM is empty, data must flow from the input buffer to the output buffer if the output
211 // buffer is ready and is not receiving data read from the SRAM in the previous cycle
212 1/1 end else if (oup_buf_wready && !sram_read_in_prev_cyc_q) begin
Tests: T1 T2 T3
213 1/1 oup_buf_wvalid = inp_buf_rvalid;
Tests: T1 T2 T3
214 1/1 oup_buf_wdata = inp_buf_rdata;
Tests: T1 T2 T3
215 1/1 inp_buf_rready = oup_buf_wready;
Tests: T1 T2 T3
216
217 // Otherwise the SRAM is empty but the output buffer cannot take the data from the input buffer,
218 // so drain the input buffer into the SRAM.
219 end else begin
220 1/1 sram_req_o = !sram_full && inp_buf_rvalid;
Tests: T1 T2 T3
221 1/1 sram_write_o = 1'b1;
Tests: T1 T2 T3
222 1/1 sram_addr_o = sram_wr_addr;
Tests: T1 T2 T3
223 1/1 inp_buf_rready = !sram_full && sram_gnt_i;
Tests: T1 T2 T3
224 end
225 end
226
227 // Error output is high if any of the internal errors is high
228 1/1 assign err_o = |{inp_buf_err, oup_buf_err, sram_ptrs_err, state_err};
Tests: T1 T2 T3
229
230 // The SRAM and the output buffer together form the entire architectural capacity of the FIFO.
231 // Thus, when both are full, the FIFO is no longer ready to receive writes even though the input
232 // buffer could store one additional entry. This ensures that in the cycle after an entry has
233 // been read from the full FIFO, the next entry can be written to the FIFO.
234 // (It may be possible that all input buffer slots except one can be counted to the architectural
235 // capacity of the FIFO, but this is a relatively small optimization left for future work.)
236 1/1 assign fifo_wready_o = inp_buf_wready && !(sram_full && oup_buf_full);
Tests: T1 T2 T3
237
238 // The current depth of the FIFO represented by this module is the depth of all buffers plus the
239 // FIFO in the SRAM plus one if there's an entry in transition between SRAM and output buffer.
240 1/1 assign fifo_depth_o = DepthW'(inp_buf_depth) + DepthW'(sram_depth) + DepthW'(oup_buf_depth) +
Tests: T1 T2 T3
241 DepthW'(sram_read_in_prev_cyc_q);
242
243 // SRAM write data always comes from the input buffer.
244 1/1 assign sram_wdata_o = inp_buf_rdata;
Tests: T1 T2 T3
245 assign sram_wmask_o = '1;
246
247 // `sram_rvalid_i` is only used for assertions.
248 logic unused_sram_rvalid;
249 1/1 assign unused_sram_rvalid = sram_rvalid_i;
Tests: T1 T2 T3
Cond Coverage for Instance : tb.dut.i2c_core.u_fifos.u_fmt_fifo_sram_adapter
| Total | Covered | Percent |
Conditions | 51 | 38 | 74.51 |
Logical | 51 | 38 | 74.51 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 120
EXPRESSION (fifo_wvalid_i && fifo_wready_o)
------1------ ------2------
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Not Covered | |
1 | 1 | Covered | T2,T3,T4 |
LINE 125
EXPRESSION (sram_req_o && sram_gnt_i)
-----1---- -----2----
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Not Covered | |
1 | 1 | Covered | T2,T8,T17 |
LINE 150
EXPRESSION (sram_access && sram_write_o)
-----1----- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T8,T17,T26 |
1 | 1 | Covered | T2,T8,T17 |
LINE 151
EXPRESSION (sram_access && ((!sram_write_o)))
-----1----- --------2--------
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T2,T8,T17 |
1 | 1 | Covered | T8,T17,T26 |
LINE 162
EXPRESSION (clr_i ? 1'b0 : sram_incr_rd_ptr)
--1--
-1- | Status | Tests |
0 | Covered | T1,T2,T3 |
1 | Covered | T1,T2,T3 |
LINE 196
EXPRESSION (( ! ((oup_buf_almost_full && oup_buf_wvalid) || oup_buf_full) ) || (fifo_rvalid_o && fifo_rready_i))
-------------------------------1------------------------------- ----------------2---------------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T2,T8,T17 |
0 | 1 | Covered | T8,T17,T26 |
1 | 0 | Not Covered | |
LINE 196
SUB-EXPRESSION ( ! ((oup_buf_almost_full && oup_buf_wvalid) || oup_buf_full) )
----------------------------1----------------------------
-1- | Status | Tests |
0 | Not Covered | |
1 | Covered | T2,T8,T17 |
LINE 196
SUB-EXPRESSION ((oup_buf_almost_full && oup_buf_wvalid) || oup_buf_full)
-------------------1------------------- ------2-----
-1- | -2- | Status | Tests |
0 | 0 | Not Covered | |
0 | 1 | Covered | T2,T8,T17 |
1 | 0 | Covered | T8,T17,T26 |
LINE 196
SUB-EXPRESSION (oup_buf_almost_full && oup_buf_wvalid)
---------1--------- -------2------
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T2,T8,T17 |
1 | 1 | Covered | T8,T17,T26 |
LINE 196
SUB-EXPRESSION (fifo_rvalid_o && fifo_rready_i)
------1------ ------2------
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T2,T8,T17 |
1 | 1 | Covered | T8,T17,T26 |
LINE 204
EXPRESSION (((!sram_full)) && inp_buf_rvalid)
-------1------ -------2------
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T2,T8,T17 |
1 | 1 | Covered | T2,T8,T17 |
LINE 207
EXPRESSION (((!sram_full)) && sram_gnt_i)
-------1------ -----2----
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T2,T8,T17 |
1 | 1 | Covered | T2,T8,T17 |
LINE 212
EXPRESSION (oup_buf_wready && ((!sram_read_in_prev_cyc_q)))
-------1------ --------------2-------------
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T8,T17,T26 |
1 | 1 | Covered | T1,T2,T3 |
LINE 220
EXPRESSION (((!sram_full)) && inp_buf_rvalid)
-------1------ -------2------
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T1,T2,T3 |
1 | 1 | Covered | T2,T8,T17 |
LINE 223
EXPRESSION (((!sram_full)) && sram_gnt_i)
-------1------ -----2----
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T1,T2,T3 |
1 | 1 | Covered | T2,T8,T17 |
LINE 236
EXPRESSION (inp_buf_wready && ( ! (sram_full && oup_buf_full) ))
-------1------ ----------------2----------------
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T156,T158,T159 |
1 | 1 | Covered | T1,T2,T3 |
LINE 236
SUB-EXPRESSION ( ! (sram_full && oup_buf_full) )
-------------1-------------
-1- | Status | Tests |
0 | Covered | T1,T2,T3 |
1 | Covered | T156,T158,T159 |
LINE 236
SUB-EXPRESSION (sram_full && oup_buf_full)
----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T2,T3,T4 |
1 | 0 | Not Covered | |
1 | 1 | Covered | T156,T158,T159 |
Branch Coverage for Instance : tb.dut.i2c_core.u_fifos.u_fmt_fifo_sram_adapter
| Line No. | Total | Covered | Percent |
Branches |
|
10 |
10 |
100.00 |
TERNARY |
162 |
2 |
2 |
100.00 |
IF |
164 |
2 |
2 |
100.00 |
IF |
183 |
2 |
2 |
100.00 |
IF |
191 |
4 |
4 |
100.00 |
162 assign sram_read_in_prev_cyc_d = clr_i ? 1'b0 : sram_incr_rd_ptr;
-1-
==>
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T1,T2,T3 |
0 |
Covered |
T1,T2,T3 |
164 if (!rst_ni) begin
-1-
165 sram_read_in_prev_cyc_q <= 1'b0;
==>
166 end else begin
167 sram_read_in_prev_cyc_q <= sram_read_in_prev_cyc_d;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T1,T2,T3 |
0 |
Covered |
T1,T2,T3 |
183 if (sram_read_in_prev_cyc_q) begin
-1-
184 oup_buf_wvalid = 1'b1;
==>
185 oup_buf_wdata = sram_rdata_i;
186 // The output buffer must be ready; otherwise we are in an erroneous state.
187 state_err = !oup_buf_wready;
188 end
MISSING_ELSE
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T8,T17,T26 |
0 |
Covered |
T1,T2,T3 |
191 if (!sram_empty) begin
-1-
192
193 // Prioritize refilling of the output buffer: if the output buffer is not being filled to the
194 // last slot in the current cycle or it is being read in the current cycle, read from the SRAM
195 // so the output buffer can be written in the next cycle.
196 if (!((oup_buf_almost_full && oup_buf_wvalid) || oup_buf_full)
-2-
197 || (fifo_rvalid_o && fifo_rready_i)) begin
198 sram_req_o = 1'b1;
==>
199 sram_write_o = 1'b0;
200 sram_addr_o = sram_rd_addr;
201
202 // If the output buffer is full (and not being read), drain the input buffer into the SRAM.
203 end else begin
204 sram_req_o = !sram_full && inp_buf_rvalid;
==>
205 sram_write_o = 1'b1;
206 sram_addr_o = sram_wr_addr;
207 inp_buf_rready = !sram_full && sram_gnt_i;
208 end
209
210 // If the SRAM is empty, data must flow from the input buffer to the output buffer if the output
211 // buffer is ready and is not receiving data read from the SRAM in the previous cycle
212 end else if (oup_buf_wready && !sram_read_in_prev_cyc_q) begin
-3-
213 oup_buf_wvalid = inp_buf_rvalid;
==>
214 oup_buf_wdata = inp_buf_rdata;
215 inp_buf_rready = oup_buf_wready;
216
217 // Otherwise the SRAM is empty but the output buffer cannot take the data from the input buffer,
218 // so drain the input buffer into the SRAM.
219 end else begin
220 sram_req_o = !sram_full && inp_buf_rvalid;
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
1 |
- |
Covered |
T8,T17,T26 |
1 |
0 |
- |
Covered |
T2,T8,T17 |
0 |
- |
1 |
Covered |
T1,T2,T3 |
0 |
- |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.i2c_core.u_fifos.u_fmt_fifo_sram_adapter
Assertion Details
MinimalSramAw_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1688 |
1688 |
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 |
T8 |
1 |
1 |
0 |
0 |
T9 |
1 |
1 |
0 |
0 |
T10 |
1 |
1 |
0 |
0 |
MinimalSramFifoDepth_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1688 |
1688 |
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 |
T8 |
1 |
1 |
0 |
0 |
T9 |
1 |
1 |
0 |
0 |
T10 |
1 |
1 |
0 |
0 |
NoErr_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
412998901 |
412829577 |
0 |
0 |
T1 |
2318 |
2231 |
0 |
0 |
T2 |
9391 |
9298 |
0 |
0 |
T3 |
7232 |
7139 |
0 |
0 |
T4 |
13822 |
13728 |
0 |
0 |
T5 |
13722 |
13623 |
0 |
0 |
T6 |
14273 |
14210 |
0 |
0 |
T7 |
117701 |
117645 |
0 |
0 |
T8 |
21151 |
20282 |
0 |
0 |
T9 |
56214 |
56115 |
0 |
0 |
T10 |
93037 |
92941 |
0 |
0 |
NoSramReadWhenEmpty_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
412998901 |
349503311 |
0 |
0 |
T1 |
2318 |
2231 |
0 |
0 |
T2 |
9391 |
3968 |
0 |
0 |
T3 |
7232 |
7139 |
0 |
0 |
T4 |
13822 |
13728 |
0 |
0 |
T5 |
13722 |
13623 |
0 |
0 |
T6 |
14273 |
14210 |
0 |
0 |
T7 |
117701 |
117645 |
0 |
0 |
T8 |
21151 |
16019 |
0 |
0 |
T9 |
56214 |
56115 |
0 |
0 |
T10 |
93037 |
92941 |
0 |
0 |
NoSramWriteWhenFull_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
412998901 |
25231657 |
0 |
0 |
T30 |
0 |
110007 |
0 |
0 |
T60 |
12847 |
0 |
0 |
0 |
T72 |
5324 |
0 |
0 |
0 |
T77 |
119692 |
0 |
0 |
0 |
T82 |
172634 |
0 |
0 |
0 |
T83 |
0 |
8 |
0 |
0 |
T156 |
17518 |
2289 |
0 |
0 |
T158 |
0 |
3387 |
0 |
0 |
T159 |
0 |
118569 |
0 |
0 |
T161 |
0 |
92657 |
0 |
0 |
T162 |
0 |
107495 |
0 |
0 |
T163 |
0 |
180316 |
0 |
0 |
T164 |
0 |
44547 |
0 |
0 |
T165 |
0 |
165956 |
0 |
0 |
T166 |
266843 |
0 |
0 |
0 |
T167 |
36608 |
0 |
0 |
0 |
T168 |
23734 |
0 |
0 |
0 |
T169 |
184742 |
0 |
0 |
0 |
T170 |
101675 |
0 |
0 |
0 |
OupBufWreadyAfterSramRead_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
412998901 |
171659 |
0 |
0 |
T8 |
21151 |
17 |
0 |
0 |
T9 |
56214 |
0 |
0 |
0 |
T10 |
93037 |
0 |
0 |
0 |
T11 |
0 |
72 |
0 |
0 |
T17 |
61075 |
139 |
0 |
0 |
T18 |
0 |
29 |
0 |
0 |
T19 |
0 |
2 |
0 |
0 |
T25 |
0 |
30 |
0 |
0 |
T26 |
34652 |
120 |
0 |
0 |
T45 |
0 |
28 |
0 |
0 |
T47 |
0 |
42 |
0 |
0 |
T48 |
9615 |
0 |
0 |
0 |
T70 |
47092 |
0 |
0 |
0 |
T71 |
10639 |
0 |
0 |
0 |
T73 |
92357 |
0 |
0 |
0 |
T99 |
1544 |
0 |
0 |
0 |
T171 |
0 |
72 |
0 |
0 |
SramRvalidAfterRead_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
412998901 |
171659 |
0 |
0 |
T8 |
21151 |
17 |
0 |
0 |
T9 |
56214 |
0 |
0 |
0 |
T10 |
93037 |
0 |
0 |
0 |
T11 |
0 |
72 |
0 |
0 |
T17 |
61075 |
139 |
0 |
0 |
T18 |
0 |
29 |
0 |
0 |
T19 |
0 |
2 |
0 |
0 |
T25 |
0 |
30 |
0 |
0 |
T26 |
34652 |
120 |
0 |
0 |
T45 |
0 |
28 |
0 |
0 |
T47 |
0 |
42 |
0 |
0 |
T48 |
9615 |
0 |
0 |
0 |
T70 |
47092 |
0 |
0 |
0 |
T71 |
10639 |
0 |
0 |
0 |
T73 |
92357 |
0 |
0 |
0 |
T99 |
1544 |
0 |
0 |
0 |
T171 |
0 |
72 |
0 |
0 |
Line Coverage for Instance : tb.dut.i2c_core.u_fifos.u_tx_fifo_sram_adapter
| Line No. | Total | Covered | Percent |
TOTAL | | 44 | 44 | 100.00 |
CONT_ASSIGN | 120 | 1 | 1 | 100.00 |
CONT_ASSIGN | 121 | 1 | 1 | 100.00 |
CONT_ASSIGN | 125 | 1 | 1 | 100.00 |
CONT_ASSIGN | 150 | 1 | 1 | 100.00 |
CONT_ASSIGN | 151 | 1 | 1 | 100.00 |
CONT_ASSIGN | 153 | 1 | 1 | 100.00 |
CONT_ASSIGN | 154 | 1 | 1 | 100.00 |
CONT_ASSIGN | 162 | 1 | 1 | 100.00 |
ALWAYS | 164 | 3 | 3 | 100.00 |
ALWAYS | 174 | 28 | 28 | 100.00 |
CONT_ASSIGN | 228 | 1 | 1 | 100.00 |
CONT_ASSIGN | 236 | 1 | 1 | 100.00 |
CONT_ASSIGN | 240 | 1 | 1 | 100.00 |
CONT_ASSIGN | 244 | 1 | 1 | 100.00 |
CONT_ASSIGN | 249 | 1 | 1 | 100.00 |
119 );
120 1/1 assign inp_buf_wvalid = fifo_wvalid_i && fifo_wready_o;
Tests: T1 T2 T3
121 1/1 assign oup_buf_almost_full = oup_buf_depth >= OupBufDepthW'(OupBufDepth - 1);
Tests: T1 T2 T3
122
123 // Signal whether we access the SRAM in this cycle
124 logic sram_access;
125 1/1 assign sram_access = sram_req_o && sram_gnt_i;
Tests: T1 T2 T3
126
127 // SRAM read and write addresses
128 logic [SramAw-1:0] sram_wr_addr, sram_rd_addr;
129 logic [SramPtrW-1:0] sram_wr_ptr, sram_rd_ptr;
130 logic [SramDepthW-1:0] sram_depth;
131 logic sram_incr_wr_ptr, sram_incr_rd_ptr;
132 logic sram_full, sram_empty;
133 logic sram_ptrs_err;
134 prim_fifo_sync_cnt #(
135 .Depth (SramFifoDepth),
136 .Secure(1'b0)
137 ) u_sram_ptrs (
138 .clk_i,
139 .rst_ni,
140 .clr_i,
141 .incr_wptr_i(sram_incr_wr_ptr),
142 .incr_rptr_i(sram_incr_rd_ptr),
143 .wptr_o (sram_wr_ptr),
144 .rptr_o (sram_rd_ptr),
145 .full_o (sram_full),
146 .empty_o (sram_empty),
147 .depth_o (sram_depth),
148 .err_o (sram_ptrs_err)
149 );
150 1/1 assign sram_incr_wr_ptr = sram_access && sram_write_o;
Tests: T1 T2 T3
151 1/1 assign sram_incr_rd_ptr = sram_access && !sram_write_o;
Tests: T1 T2 T3
152 if (SramAddrLeadingZeros > 0) begin : gen_zero_extend_sram_addrs
153 1/1 assign sram_wr_addr = {{SramAddrLeadingZeros{1'b0}}, sram_wr_ptr} + SramBaseAddr;
Tests: T1 T2 T3
154 1/1 assign sram_rd_addr = {{SramAddrLeadingZeros{1'b0}}, sram_rd_ptr} + SramBaseAddr;
Tests: T1 T2 T3
155 end else begin : gen_no_zero_extend_sram_addrs
156 assign sram_wr_addr = sram_wr_ptr + SramBaseAddr;
157 assign sram_rd_addr = sram_rd_ptr + SramBaseAddr;
158 end
159
160 // FF to remember whether we read from the SRAM in the previous clock cycle.
161 logic sram_read_in_prev_cyc_d, sram_read_in_prev_cyc_q;
162 1/1 assign sram_read_in_prev_cyc_d = clr_i ? 1'b0 : sram_incr_rd_ptr;
Tests: T1 T2 T3
163 always_ff @(posedge clk_i or negedge rst_ni) begin
164 1/1 if (!rst_ni) begin
Tests: T1 T2 T3
165 1/1 sram_read_in_prev_cyc_q <= 1'b0;
Tests: T1 T2 T3
166 end else begin
167 1/1 sram_read_in_prev_cyc_q <= sram_read_in_prev_cyc_d;
Tests: T1 T2 T3
168 end
169 end
170
171 // Control logic for FIFO interface wready, output buffer writes, and SRAM requests
172 logic state_err;
173 always_comb begin
174 1/1 inp_buf_rready = 1'b0;
Tests: T1 T2 T3
175 1/1 oup_buf_wvalid = 1'b0;
Tests: T1 T2 T3
176 1/1 oup_buf_wdata = inp_buf_rdata;
Tests: T1 T2 T3
177 1/1 sram_req_o = 1'b0;
Tests: T1 T2 T3
178 1/1 sram_write_o = 1'b0;
Tests: T1 T2 T3
179 1/1 sram_addr_o = sram_wr_addr;
Tests: T1 T2 T3
180 1/1 state_err = 1'b0;
Tests: T1 T2 T3
181
182 // If the SRAM was read in the previous cycle, write the read data to the output buffer.
183 1/1 if (sram_read_in_prev_cyc_q) begin
Tests: T1 T2 T3
184 1/1 oup_buf_wvalid = 1'b1;
Tests: T5 T6 T7
185 1/1 oup_buf_wdata = sram_rdata_i;
Tests: T5 T6 T7
186 // The output buffer must be ready; otherwise we are in an erroneous state.
187 1/1 state_err = !oup_buf_wready;
Tests: T5 T6 T7
188 end
MISSING_ELSE
189
190 // If the SRAM is not empty, data from the input buffer must flow via the SRAM.
191 1/1 if (!sram_empty) begin
Tests: T1 T2 T3
192
193 // Prioritize refilling of the output buffer: if the output buffer is not being filled to the
194 // last slot in the current cycle or it is being read in the current cycle, read from the SRAM
195 // so the output buffer can be written in the next cycle.
196 1/1 if (!((oup_buf_almost_full && oup_buf_wvalid) || oup_buf_full)
Tests: T5 T6 T7
197 || (fifo_rvalid_o && fifo_rready_i)) begin
198 1/1 sram_req_o = 1'b1;
Tests: T5 T6 T7
199 1/1 sram_write_o = 1'b0;
Tests: T5 T6 T7
200 1/1 sram_addr_o = sram_rd_addr;
Tests: T5 T6 T7
201
202 // If the output buffer is full (and not being read), drain the input buffer into the SRAM.
203 end else begin
204 1/1 sram_req_o = !sram_full && inp_buf_rvalid;
Tests: T5 T6 T7
205 1/1 sram_write_o = 1'b1;
Tests: T5 T6 T7
206 1/1 sram_addr_o = sram_wr_addr;
Tests: T5 T6 T7
207 1/1 inp_buf_rready = !sram_full && sram_gnt_i;
Tests: T5 T6 T7
208 end
209
210 // If the SRAM is empty, data must flow from the input buffer to the output buffer if the output
211 // buffer is ready and is not receiving data read from the SRAM in the previous cycle
212 1/1 end else if (oup_buf_wready && !sram_read_in_prev_cyc_q) begin
Tests: T1 T2 T3
213 1/1 oup_buf_wvalid = inp_buf_rvalid;
Tests: T1 T2 T3
214 1/1 oup_buf_wdata = inp_buf_rdata;
Tests: T1 T2 T3
215 1/1 inp_buf_rready = oup_buf_wready;
Tests: T1 T2 T3
216
217 // Otherwise the SRAM is empty but the output buffer cannot take the data from the input buffer,
218 // so drain the input buffer into the SRAM.
219 end else begin
220 1/1 sram_req_o = !sram_full && inp_buf_rvalid;
Tests: T1 T2 T3
221 1/1 sram_write_o = 1'b1;
Tests: T1 T2 T3
222 1/1 sram_addr_o = sram_wr_addr;
Tests: T1 T2 T3
223 1/1 inp_buf_rready = !sram_full && sram_gnt_i;
Tests: T1 T2 T3
224 end
225 end
226
227 // Error output is high if any of the internal errors is high
228 1/1 assign err_o = |{inp_buf_err, oup_buf_err, sram_ptrs_err, state_err};
Tests: T1 T2 T3
229
230 // The SRAM and the output buffer together form the entire architectural capacity of the FIFO.
231 // Thus, when both are full, the FIFO is no longer ready to receive writes even though the input
232 // buffer could store one additional entry. This ensures that in the cycle after an entry has
233 // been read from the full FIFO, the next entry can be written to the FIFO.
234 // (It may be possible that all input buffer slots except one can be counted to the architectural
235 // capacity of the FIFO, but this is a relatively small optimization left for future work.)
236 1/1 assign fifo_wready_o = inp_buf_wready && !(sram_full && oup_buf_full);
Tests: T1 T2 T3
237
238 // The current depth of the FIFO represented by this module is the depth of all buffers plus the
239 // FIFO in the SRAM plus one if there's an entry in transition between SRAM and output buffer.
240 1/1 assign fifo_depth_o = DepthW'(inp_buf_depth) + DepthW'(sram_depth) + DepthW'(oup_buf_depth) +
Tests: T1 T2 T3
241 DepthW'(sram_read_in_prev_cyc_q);
242
243 // SRAM write data always comes from the input buffer.
244 1/1 assign sram_wdata_o = inp_buf_rdata;
Tests: T1 T2 T3
245 assign sram_wmask_o = '1;
246
247 // `sram_rvalid_i` is only used for assertions.
248 logic unused_sram_rvalid;
249 1/1 assign unused_sram_rvalid = sram_rvalid_i;
Tests: T1 T2 T3
Cond Coverage for Instance : tb.dut.i2c_core.u_fifos.u_tx_fifo_sram_adapter
| Total | Covered | Percent |
Conditions | 51 | 38 | 74.51 |
Logical | 51 | 38 | 74.51 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 120
EXPRESSION (fifo_wvalid_i && fifo_wready_o)
------1------ ------2------
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Not Covered | |
1 | 1 | Covered | T5,T6,T7 |
LINE 125
EXPRESSION (sram_req_o && sram_gnt_i)
-----1---- -----2----
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Not Covered | |
1 | 1 | Covered | T5,T6,T7 |
LINE 150
EXPRESSION (sram_access && sram_write_o)
-----1----- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T5,T6,T7 |
1 | 1 | Covered | T5,T6,T7 |
LINE 151
EXPRESSION (sram_access && ((!sram_write_o)))
-----1----- --------2--------
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T5,T6,T7 |
1 | 1 | Covered | T5,T6,T7 |
LINE 162
EXPRESSION (clr_i ? 1'b0 : sram_incr_rd_ptr)
--1--
-1- | Status | Tests |
0 | Covered | T1,T2,T3 |
1 | Covered | T1,T2,T3 |
LINE 196
EXPRESSION (( ! ((oup_buf_almost_full && oup_buf_wvalid) || oup_buf_full) ) || (fifo_rvalid_o && fifo_rready_i))
-------------------------------1------------------------------- ----------------2---------------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T5,T6,T7 |
0 | 1 | Covered | T5,T6,T7 |
1 | 0 | Not Covered | |
LINE 196
SUB-EXPRESSION ( ! ((oup_buf_almost_full && oup_buf_wvalid) || oup_buf_full) )
----------------------------1----------------------------
-1- | Status | Tests |
0 | Not Covered | |
1 | Covered | T5,T6,T7 |
LINE 196
SUB-EXPRESSION ((oup_buf_almost_full && oup_buf_wvalid) || oup_buf_full)
-------------------1------------------- ------2-----
-1- | -2- | Status | Tests |
0 | 0 | Not Covered | |
0 | 1 | Covered | T5,T6,T7 |
1 | 0 | Covered | T5,T6,T7 |
LINE 196
SUB-EXPRESSION (oup_buf_almost_full && oup_buf_wvalid)
---------1--------- -------2------
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T5,T6,T7 |
1 | 1 | Covered | T5,T6,T7 |
LINE 196
SUB-EXPRESSION (fifo_rvalid_o && fifo_rready_i)
------1------ ------2------
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T5,T6,T7 |
1 | 1 | Covered | T5,T6,T7 |
LINE 204
EXPRESSION (((!sram_full)) && inp_buf_rvalid)
-------1------ -------2------
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T5,T6,T7 |
1 | 1 | Covered | T5,T6,T7 |
LINE 207
EXPRESSION (((!sram_full)) && sram_gnt_i)
-------1------ -----2----
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T5,T6,T7 |
1 | 1 | Covered | T5,T6,T7 |
LINE 212
EXPRESSION (oup_buf_wready && ((!sram_read_in_prev_cyc_q)))
-------1------ --------------2-------------
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T7,T9,T10 |
1 | 1 | Covered | T1,T2,T3 |
LINE 220
EXPRESSION (((!sram_full)) && inp_buf_rvalid)
-------1------ -------2------
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T1,T2,T3 |
1 | 1 | Covered | T5,T6,T7 |
LINE 223
EXPRESSION (((!sram_full)) && sram_gnt_i)
-------1------ -----2----
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T1,T2,T3 |
1 | 1 | Covered | T5,T6,T7 |
LINE 236
EXPRESSION (inp_buf_wready && ( ! (sram_full && oup_buf_full) ))
-------1------ ----------------2----------------
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T59,T60,T61 |
1 | 1 | Covered | T1,T2,T3 |
LINE 236
SUB-EXPRESSION ( ! (sram_full && oup_buf_full) )
-------------1-------------
-1- | Status | Tests |
0 | Covered | T1,T2,T3 |
1 | Covered | T59,T60,T61 |
LINE 236
SUB-EXPRESSION (sram_full && oup_buf_full)
----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T5,T6,T7 |
1 | 0 | Not Covered | |
1 | 1 | Covered | T59,T60,T61 |
Branch Coverage for Instance : tb.dut.i2c_core.u_fifos.u_tx_fifo_sram_adapter
| Line No. | Total | Covered | Percent |
Branches |
|
10 |
10 |
100.00 |
TERNARY |
162 |
2 |
2 |
100.00 |
IF |
164 |
2 |
2 |
100.00 |
IF |
183 |
2 |
2 |
100.00 |
IF |
191 |
4 |
4 |
100.00 |
162 assign sram_read_in_prev_cyc_d = clr_i ? 1'b0 : sram_incr_rd_ptr;
-1-
==>
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T1,T2,T3 |
0 |
Covered |
T1,T2,T3 |
164 if (!rst_ni) begin
-1-
165 sram_read_in_prev_cyc_q <= 1'b0;
==>
166 end else begin
167 sram_read_in_prev_cyc_q <= sram_read_in_prev_cyc_d;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T1,T2,T3 |
0 |
Covered |
T1,T2,T3 |
183 if (sram_read_in_prev_cyc_q) begin
-1-
184 oup_buf_wvalid = 1'b1;
==>
185 oup_buf_wdata = sram_rdata_i;
186 // The output buffer must be ready; otherwise we are in an erroneous state.
187 state_err = !oup_buf_wready;
188 end
MISSING_ELSE
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T5,T6,T7 |
0 |
Covered |
T1,T2,T3 |
191 if (!sram_empty) begin
-1-
192
193 // Prioritize refilling of the output buffer: if the output buffer is not being filled to the
194 // last slot in the current cycle or it is being read in the current cycle, read from the SRAM
195 // so the output buffer can be written in the next cycle.
196 if (!((oup_buf_almost_full && oup_buf_wvalid) || oup_buf_full)
-2-
197 || (fifo_rvalid_o && fifo_rready_i)) begin
198 sram_req_o = 1'b1;
==>
199 sram_write_o = 1'b0;
200 sram_addr_o = sram_rd_addr;
201
202 // If the output buffer is full (and not being read), drain the input buffer into the SRAM.
203 end else begin
204 sram_req_o = !sram_full && inp_buf_rvalid;
==>
205 sram_write_o = 1'b1;
206 sram_addr_o = sram_wr_addr;
207 inp_buf_rready = !sram_full && sram_gnt_i;
208 end
209
210 // If the SRAM is empty, data must flow from the input buffer to the output buffer if the output
211 // buffer is ready and is not receiving data read from the SRAM in the previous cycle
212 end else if (oup_buf_wready && !sram_read_in_prev_cyc_q) begin
-3-
213 oup_buf_wvalid = inp_buf_rvalid;
==>
214 oup_buf_wdata = inp_buf_rdata;
215 inp_buf_rready = oup_buf_wready;
216
217 // Otherwise the SRAM is empty but the output buffer cannot take the data from the input buffer,
218 // so drain the input buffer into the SRAM.
219 end else begin
220 sram_req_o = !sram_full && inp_buf_rvalid;
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
1 |
- |
Covered |
T5,T6,T7 |
1 |
0 |
- |
Covered |
T5,T6,T7 |
0 |
- |
1 |
Covered |
T1,T2,T3 |
0 |
- |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.i2c_core.u_fifos.u_tx_fifo_sram_adapter
Assertion Details
MinimalSramAw_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1688 |
1688 |
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 |
T8 |
1 |
1 |
0 |
0 |
T9 |
1 |
1 |
0 |
0 |
T10 |
1 |
1 |
0 |
0 |
MinimalSramFifoDepth_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1688 |
1688 |
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 |
T8 |
1 |
1 |
0 |
0 |
T9 |
1 |
1 |
0 |
0 |
T10 |
1 |
1 |
0 |
0 |
NoErr_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
412998901 |
412829577 |
0 |
0 |
T1 |
2318 |
2231 |
0 |
0 |
T2 |
9391 |
9298 |
0 |
0 |
T3 |
7232 |
7139 |
0 |
0 |
T4 |
13822 |
13728 |
0 |
0 |
T5 |
13722 |
13623 |
0 |
0 |
T6 |
14273 |
14210 |
0 |
0 |
T7 |
117701 |
117645 |
0 |
0 |
T8 |
21151 |
20282 |
0 |
0 |
T9 |
56214 |
56115 |
0 |
0 |
T10 |
93037 |
92941 |
0 |
0 |
NoSramReadWhenEmpty_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
412998901 |
391096142 |
0 |
0 |
T1 |
2318 |
2231 |
0 |
0 |
T2 |
9391 |
9298 |
0 |
0 |
T3 |
7232 |
7139 |
0 |
0 |
T4 |
13822 |
13728 |
0 |
0 |
T5 |
13722 |
10567 |
0 |
0 |
T6 |
14273 |
12825 |
0 |
0 |
T7 |
117701 |
85795 |
0 |
0 |
T8 |
21151 |
20282 |
0 |
0 |
T9 |
56214 |
34178 |
0 |
0 |
T10 |
93037 |
77723 |
0 |
0 |
NoSramWriteWhenFull_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
412998901 |
310795 |
0 |
0 |
T25 |
159430 |
0 |
0 |
0 |
T38 |
11147 |
0 |
0 |
0 |
T52 |
57000 |
0 |
0 |
0 |
T53 |
220661 |
0 |
0 |
0 |
T59 |
13486 |
8672 |
0 |
0 |
T60 |
0 |
10056 |
0 |
0 |
T61 |
0 |
5087 |
0 |
0 |
T62 |
57893 |
0 |
0 |
0 |
T65 |
92620 |
0 |
0 |
0 |
T102 |
1388 |
0 |
0 |
0 |
T153 |
48655 |
0 |
0 |
0 |
T173 |
0 |
348 |
0 |
0 |
T174 |
0 |
4464 |
0 |
0 |
T175 |
0 |
8137 |
0 |
0 |
T176 |
0 |
405 |
0 |
0 |
T177 |
0 |
3010 |
0 |
0 |
T178 |
0 |
13105 |
0 |
0 |
T179 |
0 |
1043 |
0 |
0 |
T180 |
3185 |
0 |
0 |
0 |
OupBufWreadyAfterSramRead_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
412998901 |
113069 |
0 |
0 |
T5 |
13722 |
6 |
0 |
0 |
T6 |
14273 |
8 |
0 |
0 |
T7 |
117701 |
175 |
0 |
0 |
T8 |
21151 |
0 |
0 |
0 |
T9 |
56214 |
182 |
0 |
0 |
T10 |
93037 |
76 |
0 |
0 |
T17 |
61075 |
0 |
0 |
0 |
T26 |
34652 |
0 |
0 |
0 |
T48 |
9615 |
58 |
0 |
0 |
T65 |
0 |
166 |
0 |
0 |
T71 |
0 |
37 |
0 |
0 |
T73 |
92357 |
229 |
0 |
0 |
T74 |
0 |
213 |
0 |
0 |
SramRvalidAfterRead_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
412998901 |
113069 |
0 |
0 |
T5 |
13722 |
6 |
0 |
0 |
T6 |
14273 |
8 |
0 |
0 |
T7 |
117701 |
175 |
0 |
0 |
T8 |
21151 |
0 |
0 |
0 |
T9 |
56214 |
182 |
0 |
0 |
T10 |
93037 |
76 |
0 |
0 |
T17 |
61075 |
0 |
0 |
0 |
T26 |
34652 |
0 |
0 |
0 |
T48 |
9615 |
58 |
0 |
0 |
T65 |
0 |
166 |
0 |
0 |
T71 |
0 |
37 |
0 |
0 |
T73 |
92357 |
229 |
0 |
0 |
T74 |
0 |
213 |
0 |
0 |
Line Coverage for Instance : tb.dut.i2c_core.u_fifos.u_rx_fifo_sram_adapter
| Line No. | Total | Covered | Percent |
TOTAL | | 44 | 44 | 100.00 |
CONT_ASSIGN | 120 | 1 | 1 | 100.00 |
CONT_ASSIGN | 121 | 1 | 1 | 100.00 |
CONT_ASSIGN | 125 | 1 | 1 | 100.00 |
CONT_ASSIGN | 150 | 1 | 1 | 100.00 |
CONT_ASSIGN | 151 | 1 | 1 | 100.00 |
CONT_ASSIGN | 153 | 1 | 1 | 100.00 |
CONT_ASSIGN | 154 | 1 | 1 | 100.00 |
CONT_ASSIGN | 162 | 1 | 1 | 100.00 |
ALWAYS | 164 | 3 | 3 | 100.00 |
ALWAYS | 174 | 28 | 28 | 100.00 |
CONT_ASSIGN | 228 | 1 | 1 | 100.00 |
CONT_ASSIGN | 236 | 1 | 1 | 100.00 |
CONT_ASSIGN | 240 | 1 | 1 | 100.00 |
CONT_ASSIGN | 244 | 1 | 1 | 100.00 |
CONT_ASSIGN | 249 | 1 | 1 | 100.00 |
119 );
120 1/1 assign inp_buf_wvalid = fifo_wvalid_i && fifo_wready_o;
Tests: T1 T2 T3
121 1/1 assign oup_buf_almost_full = oup_buf_depth >= OupBufDepthW'(OupBufDepth - 1);
Tests: T1 T2 T3
122
123 // Signal whether we access the SRAM in this cycle
124 logic sram_access;
125 1/1 assign sram_access = sram_req_o && sram_gnt_i;
Tests: T1 T2 T3
126
127 // SRAM read and write addresses
128 logic [SramAw-1:0] sram_wr_addr, sram_rd_addr;
129 logic [SramPtrW-1:0] sram_wr_ptr, sram_rd_ptr;
130 logic [SramDepthW-1:0] sram_depth;
131 logic sram_incr_wr_ptr, sram_incr_rd_ptr;
132 logic sram_full, sram_empty;
133 logic sram_ptrs_err;
134 prim_fifo_sync_cnt #(
135 .Depth (SramFifoDepth),
136 .Secure(1'b0)
137 ) u_sram_ptrs (
138 .clk_i,
139 .rst_ni,
140 .clr_i,
141 .incr_wptr_i(sram_incr_wr_ptr),
142 .incr_rptr_i(sram_incr_rd_ptr),
143 .wptr_o (sram_wr_ptr),
144 .rptr_o (sram_rd_ptr),
145 .full_o (sram_full),
146 .empty_o (sram_empty),
147 .depth_o (sram_depth),
148 .err_o (sram_ptrs_err)
149 );
150 1/1 assign sram_incr_wr_ptr = sram_access && sram_write_o;
Tests: T1 T2 T3
151 1/1 assign sram_incr_rd_ptr = sram_access && !sram_write_o;
Tests: T1 T2 T3
152 if (SramAddrLeadingZeros > 0) begin : gen_zero_extend_sram_addrs
153 1/1 assign sram_wr_addr = {{SramAddrLeadingZeros{1'b0}}, sram_wr_ptr} + SramBaseAddr;
Tests: T1 T2 T3
154 1/1 assign sram_rd_addr = {{SramAddrLeadingZeros{1'b0}}, sram_rd_ptr} + SramBaseAddr;
Tests: T1 T2 T3
155 end else begin : gen_no_zero_extend_sram_addrs
156 assign sram_wr_addr = sram_wr_ptr + SramBaseAddr;
157 assign sram_rd_addr = sram_rd_ptr + SramBaseAddr;
158 end
159
160 // FF to remember whether we read from the SRAM in the previous clock cycle.
161 logic sram_read_in_prev_cyc_d, sram_read_in_prev_cyc_q;
162 1/1 assign sram_read_in_prev_cyc_d = clr_i ? 1'b0 : sram_incr_rd_ptr;
Tests: T1 T2 T3
163 always_ff @(posedge clk_i or negedge rst_ni) begin
164 1/1 if (!rst_ni) begin
Tests: T1 T2 T3
165 1/1 sram_read_in_prev_cyc_q <= 1'b0;
Tests: T1 T2 T3
166 end else begin
167 1/1 sram_read_in_prev_cyc_q <= sram_read_in_prev_cyc_d;
Tests: T1 T2 T3
168 end
169 end
170
171 // Control logic for FIFO interface wready, output buffer writes, and SRAM requests
172 logic state_err;
173 always_comb begin
174 1/1 inp_buf_rready = 1'b0;
Tests: T1 T2 T3
175 1/1 oup_buf_wvalid = 1'b0;
Tests: T1 T2 T3
176 1/1 oup_buf_wdata = inp_buf_rdata;
Tests: T1 T2 T3
177 1/1 sram_req_o = 1'b0;
Tests: T1 T2 T3
178 1/1 sram_write_o = 1'b0;
Tests: T1 T2 T3
179 1/1 sram_addr_o = sram_wr_addr;
Tests: T1 T2 T3
180 1/1 state_err = 1'b0;
Tests: T1 T2 T3
181
182 // If the SRAM was read in the previous cycle, write the read data to the output buffer.
183 1/1 if (sram_read_in_prev_cyc_q) begin
Tests: T1 T2 T3
184 1/1 oup_buf_wvalid = 1'b1;
Tests: T82 T103 T104
185 1/1 oup_buf_wdata = sram_rdata_i;
Tests: T82 T103 T104
186 // The output buffer must be ready; otherwise we are in an erroneous state.
187 1/1 state_err = !oup_buf_wready;
Tests: T82 T103 T104
188 end
MISSING_ELSE
189
190 // If the SRAM is not empty, data from the input buffer must flow via the SRAM.
191 1/1 if (!sram_empty) begin
Tests: T1 T2 T3
192
193 // Prioritize refilling of the output buffer: if the output buffer is not being filled to the
194 // last slot in the current cycle or it is being read in the current cycle, read from the SRAM
195 // so the output buffer can be written in the next cycle.
196 1/1 if (!((oup_buf_almost_full && oup_buf_wvalid) || oup_buf_full)
Tests: T4 T46 T82
197 || (fifo_rvalid_o && fifo_rready_i)) begin
198 1/1 sram_req_o = 1'b1;
Tests: T82 T103 T104
199 1/1 sram_write_o = 1'b0;
Tests: T82 T103 T104
200 1/1 sram_addr_o = sram_rd_addr;
Tests: T82 T103 T104
201
202 // If the output buffer is full (and not being read), drain the input buffer into the SRAM.
203 end else begin
204 1/1 sram_req_o = !sram_full && inp_buf_rvalid;
Tests: T4 T46 T82
205 1/1 sram_write_o = 1'b1;
Tests: T4 T46 T82
206 1/1 sram_addr_o = sram_wr_addr;
Tests: T4 T46 T82
207 1/1 inp_buf_rready = !sram_full && sram_gnt_i;
Tests: T4 T46 T82
208 end
209
210 // If the SRAM is empty, data must flow from the input buffer to the output buffer if the output
211 // buffer is ready and is not receiving data read from the SRAM in the previous cycle
212 1/1 end else if (oup_buf_wready && !sram_read_in_prev_cyc_q) begin
Tests: T1 T2 T3
213 1/1 oup_buf_wvalid = inp_buf_rvalid;
Tests: T1 T2 T3
214 1/1 oup_buf_wdata = inp_buf_rdata;
Tests: T1 T2 T3
215 1/1 inp_buf_rready = oup_buf_wready;
Tests: T1 T2 T3
216
217 // Otherwise the SRAM is empty but the output buffer cannot take the data from the input buffer,
218 // so drain the input buffer into the SRAM.
219 end else begin
220 1/1 sram_req_o = !sram_full && inp_buf_rvalid;
Tests: T1 T2 T3
221 1/1 sram_write_o = 1'b1;
Tests: T1 T2 T3
222 1/1 sram_addr_o = sram_wr_addr;
Tests: T1 T2 T3
223 1/1 inp_buf_rready = !sram_full && sram_gnt_i;
Tests: T1 T2 T3
224 end
225 end
226
227 // Error output is high if any of the internal errors is high
228 1/1 assign err_o = |{inp_buf_err, oup_buf_err, sram_ptrs_err, state_err};
Tests: T1 T2 T3
229
230 // The SRAM and the output buffer together form the entire architectural capacity of the FIFO.
231 // Thus, when both are full, the FIFO is no longer ready to receive writes even though the input
232 // buffer could store one additional entry. This ensures that in the cycle after an entry has
233 // been read from the full FIFO, the next entry can be written to the FIFO.
234 // (It may be possible that all input buffer slots except one can be counted to the architectural
235 // capacity of the FIFO, but this is a relatively small optimization left for future work.)
236 1/1 assign fifo_wready_o = inp_buf_wready && !(sram_full && oup_buf_full);
Tests: T1 T2 T3
237
238 // The current depth of the FIFO represented by this module is the depth of all buffers plus the
239 // FIFO in the SRAM plus one if there's an entry in transition between SRAM and output buffer.
240 1/1 assign fifo_depth_o = DepthW'(inp_buf_depth) + DepthW'(sram_depth) + DepthW'(oup_buf_depth) +
Tests: T1 T2 T3
241 DepthW'(sram_read_in_prev_cyc_q);
242
243 // SRAM write data always comes from the input buffer.
244 1/1 assign sram_wdata_o = inp_buf_rdata;
Tests: T1 T2 T3
245 assign sram_wmask_o = '1;
246
247 // `sram_rvalid_i` is only used for assertions.
248 logic unused_sram_rvalid;
249 1/1 assign unused_sram_rvalid = sram_rvalid_i;
Tests: T1 T2 T3
Cond Coverage for Instance : tb.dut.i2c_core.u_fifos.u_rx_fifo_sram_adapter
| Total | Covered | Percent |
Conditions | 51 | 39 | 76.47 |
Logical | 51 | 39 | 76.47 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 120
EXPRESSION (fifo_wvalid_i && fifo_wready_o)
------1------ ------2------
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T82,T103,T104 |
1 | 1 | Covered | T3,T4,T8 |
LINE 125
EXPRESSION (sram_req_o && sram_gnt_i)
-----1---- -----2----
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Not Covered | |
1 | 1 | Covered | T4,T46,T82 |
LINE 150
EXPRESSION (sram_access && sram_write_o)
-----1----- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T82,T103,T104 |
1 | 1 | Covered | T4,T46,T82 |
LINE 151
EXPRESSION (sram_access && ((!sram_write_o)))
-----1----- --------2--------
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T4,T46,T82 |
1 | 1 | Covered | T82,T103,T104 |
LINE 162
EXPRESSION (clr_i ? 1'b0 : sram_incr_rd_ptr)
--1--
-1- | Status | Tests |
0 | Covered | T1,T2,T3 |
1 | Covered | T1,T2,T3 |
LINE 196
EXPRESSION (( ! ((oup_buf_almost_full && oup_buf_wvalid) || oup_buf_full) ) || (fifo_rvalid_o && fifo_rready_i))
-------------------------------1------------------------------- ----------------2---------------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T4,T46,T82 |
0 | 1 | Covered | T82,T103,T104 |
1 | 0 | Not Covered | |
LINE 196
SUB-EXPRESSION ( ! ((oup_buf_almost_full && oup_buf_wvalid) || oup_buf_full) )
----------------------------1----------------------------
-1- | Status | Tests |
0 | Not Covered | |
1 | Covered | T4,T46,T82 |
LINE 196
SUB-EXPRESSION ((oup_buf_almost_full && oup_buf_wvalid) || oup_buf_full)
-------------------1------------------- ------2-----
-1- | -2- | Status | Tests |
0 | 0 | Not Covered | |
0 | 1 | Covered | T4,T46,T82 |
1 | 0 | Covered | T82,T103,T104 |
LINE 196
SUB-EXPRESSION (oup_buf_almost_full && oup_buf_wvalid)
---------1--------- -------2------
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T4,T46,T82 |
1 | 1 | Covered | T82,T103,T104 |
LINE 196
SUB-EXPRESSION (fifo_rvalid_o && fifo_rready_i)
------1------ ------2------
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T4,T46,T82 |
1 | 1 | Covered | T82,T103,T104 |
LINE 204
EXPRESSION (((!sram_full)) && inp_buf_rvalid)
-------1------ -------2------
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T4,T46,T82 |
1 | 1 | Covered | T4,T46,T82 |
LINE 207
EXPRESSION (((!sram_full)) && sram_gnt_i)
-------1------ -----2----
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T4,T46,T82 |
1 | 1 | Covered | T4,T46,T82 |
LINE 212
EXPRESSION (oup_buf_wready && ((!sram_read_in_prev_cyc_q)))
-------1------ --------------2-------------
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T82,T103,T104 |
1 | 1 | Covered | T1,T2,T3 |
LINE 220
EXPRESSION (((!sram_full)) && inp_buf_rvalid)
-------1------ -------2------
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T1,T2,T3 |
1 | 1 | Covered | T4,T46,T82 |
LINE 223
EXPRESSION (((!sram_full)) && sram_gnt_i)
-------1------ -----2----
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T1,T2,T3 |
1 | 1 | Covered | T4,T46,T82 |
LINE 236
EXPRESSION (inp_buf_wready && ( ! (sram_full && oup_buf_full) ))
-------1------ ----------------2----------------
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T4,T46,T82 |
1 | 1 | Covered | T1,T2,T3 |
LINE 236
SUB-EXPRESSION ( ! (sram_full && oup_buf_full) )
-------------1-------------
-1- | Status | Tests |
0 | Covered | T1,T2,T3 |
1 | Covered | T4,T46,T82 |
LINE 236
SUB-EXPRESSION (sram_full && oup_buf_full)
----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T4,T46,T82 |
1 | 0 | Not Covered | |
1 | 1 | Covered | T4,T46,T82 |
Branch Coverage for Instance : tb.dut.i2c_core.u_fifos.u_rx_fifo_sram_adapter
| Line No. | Total | Covered | Percent |
Branches |
|
10 |
10 |
100.00 |
TERNARY |
162 |
2 |
2 |
100.00 |
IF |
164 |
2 |
2 |
100.00 |
IF |
183 |
2 |
2 |
100.00 |
IF |
191 |
4 |
4 |
100.00 |
162 assign sram_read_in_prev_cyc_d = clr_i ? 1'b0 : sram_incr_rd_ptr;
-1-
==>
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T1,T2,T3 |
0 |
Covered |
T1,T2,T3 |
164 if (!rst_ni) begin
-1-
165 sram_read_in_prev_cyc_q <= 1'b0;
==>
166 end else begin
167 sram_read_in_prev_cyc_q <= sram_read_in_prev_cyc_d;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T1,T2,T3 |
0 |
Covered |
T1,T2,T3 |
183 if (sram_read_in_prev_cyc_q) begin
-1-
184 oup_buf_wvalid = 1'b1;
==>
185 oup_buf_wdata = sram_rdata_i;
186 // The output buffer must be ready; otherwise we are in an erroneous state.
187 state_err = !oup_buf_wready;
188 end
MISSING_ELSE
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T82,T103,T104 |
0 |
Covered |
T1,T2,T3 |
191 if (!sram_empty) begin
-1-
192
193 // Prioritize refilling of the output buffer: if the output buffer is not being filled to the
194 // last slot in the current cycle or it is being read in the current cycle, read from the SRAM
195 // so the output buffer can be written in the next cycle.
196 if (!((oup_buf_almost_full && oup_buf_wvalid) || oup_buf_full)
-2-
197 || (fifo_rvalid_o && fifo_rready_i)) begin
198 sram_req_o = 1'b1;
==>
199 sram_write_o = 1'b0;
200 sram_addr_o = sram_rd_addr;
201
202 // If the output buffer is full (and not being read), drain the input buffer into the SRAM.
203 end else begin
204 sram_req_o = !sram_full && inp_buf_rvalid;
==>
205 sram_write_o = 1'b1;
206 sram_addr_o = sram_wr_addr;
207 inp_buf_rready = !sram_full && sram_gnt_i;
208 end
209
210 // If the SRAM is empty, data must flow from the input buffer to the output buffer if the output
211 // buffer is ready and is not receiving data read from the SRAM in the previous cycle
212 end else if (oup_buf_wready && !sram_read_in_prev_cyc_q) begin
-3-
213 oup_buf_wvalid = inp_buf_rvalid;
==>
214 oup_buf_wdata = inp_buf_rdata;
215 inp_buf_rready = oup_buf_wready;
216
217 // Otherwise the SRAM is empty but the output buffer cannot take the data from the input buffer,
218 // so drain the input buffer into the SRAM.
219 end else begin
220 sram_req_o = !sram_full && inp_buf_rvalid;
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
1 |
- |
Covered |
T82,T103,T104 |
1 |
0 |
- |
Covered |
T4,T46,T82 |
0 |
- |
1 |
Covered |
T1,T2,T3 |
0 |
- |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.i2c_core.u_fifos.u_rx_fifo_sram_adapter
Assertion Details
MinimalSramAw_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1688 |
1688 |
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 |
T8 |
1 |
1 |
0 |
0 |
T9 |
1 |
1 |
0 |
0 |
T10 |
1 |
1 |
0 |
0 |
MinimalSramFifoDepth_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1688 |
1688 |
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 |
T8 |
1 |
1 |
0 |
0 |
T9 |
1 |
1 |
0 |
0 |
T10 |
1 |
1 |
0 |
0 |
NoErr_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
412998901 |
412829577 |
0 |
0 |
T1 |
2318 |
2231 |
0 |
0 |
T2 |
9391 |
9298 |
0 |
0 |
T3 |
7232 |
7139 |
0 |
0 |
T4 |
13822 |
13728 |
0 |
0 |
T5 |
13722 |
13623 |
0 |
0 |
T6 |
14273 |
14210 |
0 |
0 |
T7 |
117701 |
117645 |
0 |
0 |
T8 |
21151 |
20282 |
0 |
0 |
T9 |
56214 |
56115 |
0 |
0 |
T10 |
93037 |
92941 |
0 |
0 |
NoSramReadWhenEmpty_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
412998901 |
390760408 |
0 |
0 |
T1 |
2318 |
2231 |
0 |
0 |
T2 |
9391 |
9298 |
0 |
0 |
T3 |
7232 |
7139 |
0 |
0 |
T4 |
13822 |
1638 |
0 |
0 |
T5 |
13722 |
13623 |
0 |
0 |
T6 |
14273 |
14210 |
0 |
0 |
T7 |
117701 |
117645 |
0 |
0 |
T8 |
21151 |
20282 |
0 |
0 |
T9 |
56214 |
56115 |
0 |
0 |
T10 |
93037 |
92941 |
0 |
0 |
NoSramWriteWhenFull_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
412998901 |
203562 |
0 |
0 |
T4 |
13822 |
12 |
0 |
0 |
T5 |
13722 |
0 |
0 |
0 |
T6 |
14273 |
0 |
0 |
0 |
T7 |
117701 |
0 |
0 |
0 |
T8 |
21151 |
0 |
0 |
0 |
T9 |
56214 |
0 |
0 |
0 |
T10 |
93037 |
0 |
0 |
0 |
T17 |
61075 |
0 |
0 |
0 |
T46 |
0 |
13 |
0 |
0 |
T48 |
9615 |
0 |
0 |
0 |
T73 |
92357 |
0 |
0 |
0 |
T82 |
0 |
2807 |
0 |
0 |
T103 |
0 |
2345 |
0 |
0 |
T104 |
0 |
1870 |
0 |
0 |
T181 |
0 |
3 |
0 |
0 |
T182 |
0 |
20 |
0 |
0 |
T183 |
0 |
13 |
0 |
0 |
T184 |
0 |
4 |
0 |
0 |
T185 |
0 |
3171 |
0 |
0 |
OupBufWreadyAfterSramRead_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
412998901 |
109182 |
0 |
0 |
T12 |
44616 |
0 |
0 |
0 |
T13 |
26836 |
0 |
0 |
0 |
T60 |
12847 |
0 |
0 |
0 |
T67 |
94873 |
0 |
0 |
0 |
T77 |
119692 |
0 |
0 |
0 |
T82 |
172634 |
868 |
0 |
0 |
T83 |
0 |
620 |
0 |
0 |
T84 |
0 |
992 |
0 |
0 |
T85 |
0 |
930 |
0 |
0 |
T101 |
1425 |
0 |
0 |
0 |
T103 |
0 |
682 |
0 |
0 |
T104 |
0 |
620 |
0 |
0 |
T115 |
0 |
992 |
0 |
0 |
T125 |
0 |
1054 |
0 |
0 |
T169 |
184742 |
0 |
0 |
0 |
T170 |
101675 |
0 |
0 |
0 |
T172 |
4320 |
0 |
0 |
0 |
T185 |
0 |
868 |
0 |
0 |
T186 |
0 |
744 |
0 |
0 |
SramRvalidAfterRead_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
412998901 |
109182 |
0 |
0 |
T12 |
44616 |
0 |
0 |
0 |
T13 |
26836 |
0 |
0 |
0 |
T60 |
12847 |
0 |
0 |
0 |
T67 |
94873 |
0 |
0 |
0 |
T77 |
119692 |
0 |
0 |
0 |
T82 |
172634 |
868 |
0 |
0 |
T83 |
0 |
620 |
0 |
0 |
T84 |
0 |
992 |
0 |
0 |
T85 |
0 |
930 |
0 |
0 |
T101 |
1425 |
0 |
0 |
0 |
T103 |
0 |
682 |
0 |
0 |
T104 |
0 |
620 |
0 |
0 |
T115 |
0 |
992 |
0 |
0 |
T125 |
0 |
1054 |
0 |
0 |
T169 |
184742 |
0 |
0 |
0 |
T170 |
101675 |
0 |
0 |
0 |
T172 |
4320 |
0 |
0 |
0 |
T185 |
0 |
868 |
0 |
0 |
T186 |
0 |
744 |
0 |
0 |
Line Coverage for Instance : tb.dut.i2c_core.u_fifos.u_acq_fifo_sram_adapter
| Line No. | Total | Covered | Percent |
TOTAL | | 44 | 44 | 100.00 |
CONT_ASSIGN | 120 | 1 | 1 | 100.00 |
CONT_ASSIGN | 121 | 1 | 1 | 100.00 |
CONT_ASSIGN | 125 | 1 | 1 | 100.00 |
CONT_ASSIGN | 150 | 1 | 1 | 100.00 |
CONT_ASSIGN | 151 | 1 | 1 | 100.00 |
CONT_ASSIGN | 156 | 1 | 1 | 100.00 |
CONT_ASSIGN | 157 | 1 | 1 | 100.00 |
CONT_ASSIGN | 162 | 1 | 1 | 100.00 |
ALWAYS | 164 | 3 | 3 | 100.00 |
ALWAYS | 174 | 28 | 28 | 100.00 |
CONT_ASSIGN | 228 | 1 | 1 | 100.00 |
CONT_ASSIGN | 236 | 1 | 1 | 100.00 |
CONT_ASSIGN | 240 | 1 | 1 | 100.00 |
CONT_ASSIGN | 244 | 1 | 1 | 100.00 |
CONT_ASSIGN | 249 | 1 | 1 | 100.00 |
119 );
120 1/1 assign inp_buf_wvalid = fifo_wvalid_i && fifo_wready_o;
Tests: T1 T2 T3
121 1/1 assign oup_buf_almost_full = oup_buf_depth >= OupBufDepthW'(OupBufDepth - 1);
Tests: T1 T2 T3
122
123 // Signal whether we access the SRAM in this cycle
124 logic sram_access;
125 1/1 assign sram_access = sram_req_o && sram_gnt_i;
Tests: T1 T2 T3
126
127 // SRAM read and write addresses
128 logic [SramAw-1:0] sram_wr_addr, sram_rd_addr;
129 logic [SramPtrW-1:0] sram_wr_ptr, sram_rd_ptr;
130 logic [SramDepthW-1:0] sram_depth;
131 logic sram_incr_wr_ptr, sram_incr_rd_ptr;
132 logic sram_full, sram_empty;
133 logic sram_ptrs_err;
134 prim_fifo_sync_cnt #(
135 .Depth (SramFifoDepth),
136 .Secure(1'b0)
137 ) u_sram_ptrs (
138 .clk_i,
139 .rst_ni,
140 .clr_i,
141 .incr_wptr_i(sram_incr_wr_ptr),
142 .incr_rptr_i(sram_incr_rd_ptr),
143 .wptr_o (sram_wr_ptr),
144 .rptr_o (sram_rd_ptr),
145 .full_o (sram_full),
146 .empty_o (sram_empty),
147 .depth_o (sram_depth),
148 .err_o (sram_ptrs_err)
149 );
150 1/1 assign sram_incr_wr_ptr = sram_access && sram_write_o;
Tests: T1 T2 T3
151 1/1 assign sram_incr_rd_ptr = sram_access && !sram_write_o;
Tests: T1 T2 T3
152 if (SramAddrLeadingZeros > 0) begin : gen_zero_extend_sram_addrs
153 assign sram_wr_addr = {{SramAddrLeadingZeros{1'b0}}, sram_wr_ptr} + SramBaseAddr;
154 assign sram_rd_addr = {{SramAddrLeadingZeros{1'b0}}, sram_rd_ptr} + SramBaseAddr;
155 end else begin : gen_no_zero_extend_sram_addrs
156 1/1 assign sram_wr_addr = sram_wr_ptr + SramBaseAddr;
Tests: T1 T2 T3
157 1/1 assign sram_rd_addr = sram_rd_ptr + SramBaseAddr;
Tests: T1 T2 T3
158 end
159
160 // FF to remember whether we read from the SRAM in the previous clock cycle.
161 logic sram_read_in_prev_cyc_d, sram_read_in_prev_cyc_q;
162 1/1 assign sram_read_in_prev_cyc_d = clr_i ? 1'b0 : sram_incr_rd_ptr;
Tests: T1 T2 T3
163 always_ff @(posedge clk_i or negedge rst_ni) begin
164 1/1 if (!rst_ni) begin
Tests: T1 T2 T3
165 1/1 sram_read_in_prev_cyc_q <= 1'b0;
Tests: T1 T2 T3
166 end else begin
167 1/1 sram_read_in_prev_cyc_q <= sram_read_in_prev_cyc_d;
Tests: T1 T2 T3
168 end
169 end
170
171 // Control logic for FIFO interface wready, output buffer writes, and SRAM requests
172 logic state_err;
173 always_comb begin
174 1/1 inp_buf_rready = 1'b0;
Tests: T1 T2 T3
175 1/1 oup_buf_wvalid = 1'b0;
Tests: T1 T2 T3
176 1/1 oup_buf_wdata = inp_buf_rdata;
Tests: T1 T2 T3
177 1/1 sram_req_o = 1'b0;
Tests: T1 T2 T3
178 1/1 sram_write_o = 1'b0;
Tests: T1 T2 T3
179 1/1 sram_addr_o = sram_wr_addr;
Tests: T1 T2 T3
180 1/1 state_err = 1'b0;
Tests: T1 T2 T3
181
182 // If the SRAM was read in the previous cycle, write the read data to the output buffer.
183 1/1 if (sram_read_in_prev_cyc_q) begin
Tests: T1 T2 T3
184 1/1 oup_buf_wvalid = 1'b1;
Tests: T5 T7 T9
185 1/1 oup_buf_wdata = sram_rdata_i;
Tests: T5 T7 T9
186 // The output buffer must be ready; otherwise we are in an erroneous state.
187 1/1 state_err = !oup_buf_wready;
Tests: T5 T7 T9
188 end
MISSING_ELSE
189
190 // If the SRAM is not empty, data from the input buffer must flow via the SRAM.
191 1/1 if (!sram_empty) begin
Tests: T1 T2 T3
192
193 // Prioritize refilling of the output buffer: if the output buffer is not being filled to the
194 // last slot in the current cycle or it is being read in the current cycle, read from the SRAM
195 // so the output buffer can be written in the next cycle.
196 1/1 if (!((oup_buf_almost_full && oup_buf_wvalid) || oup_buf_full)
Tests: T5 T7 T9
197 || (fifo_rvalid_o && fifo_rready_i)) begin
198 1/1 sram_req_o = 1'b1;
Tests: T5 T7 T9
199 1/1 sram_write_o = 1'b0;
Tests: T5 T7 T9
200 1/1 sram_addr_o = sram_rd_addr;
Tests: T5 T7 T9
201
202 // If the output buffer is full (and not being read), drain the input buffer into the SRAM.
203 end else begin
204 1/1 sram_req_o = !sram_full && inp_buf_rvalid;
Tests: T5 T7 T9
205 1/1 sram_write_o = 1'b1;
Tests: T5 T7 T9
206 1/1 sram_addr_o = sram_wr_addr;
Tests: T5 T7 T9
207 1/1 inp_buf_rready = !sram_full && sram_gnt_i;
Tests: T5 T7 T9
208 end
209
210 // If the SRAM is empty, data must flow from the input buffer to the output buffer if the output
211 // buffer is ready and is not receiving data read from the SRAM in the previous cycle
212 1/1 end else if (oup_buf_wready && !sram_read_in_prev_cyc_q) begin
Tests: T1 T2 T3
213 1/1 oup_buf_wvalid = inp_buf_rvalid;
Tests: T1 T2 T3
214 1/1 oup_buf_wdata = inp_buf_rdata;
Tests: T1 T2 T3
215 1/1 inp_buf_rready = oup_buf_wready;
Tests: T1 T2 T3
216
217 // Otherwise the SRAM is empty but the output buffer cannot take the data from the input buffer,
218 // so drain the input buffer into the SRAM.
219 end else begin
220 1/1 sram_req_o = !sram_full && inp_buf_rvalid;
Tests: T1 T2 T3
221 1/1 sram_write_o = 1'b1;
Tests: T1 T2 T3
222 1/1 sram_addr_o = sram_wr_addr;
Tests: T1 T2 T3
223 1/1 inp_buf_rready = !sram_full && sram_gnt_i;
Tests: T1 T2 T3
224 end
225 end
226
227 // Error output is high if any of the internal errors is high
228 1/1 assign err_o = |{inp_buf_err, oup_buf_err, sram_ptrs_err, state_err};
Tests: T1 T2 T3
229
230 // The SRAM and the output buffer together form the entire architectural capacity of the FIFO.
231 // Thus, when both are full, the FIFO is no longer ready to receive writes even though the input
232 // buffer could store one additional entry. This ensures that in the cycle after an entry has
233 // been read from the full FIFO, the next entry can be written to the FIFO.
234 // (It may be possible that all input buffer slots except one can be counted to the architectural
235 // capacity of the FIFO, but this is a relatively small optimization left for future work.)
236 1/1 assign fifo_wready_o = inp_buf_wready && !(sram_full && oup_buf_full);
Tests: T1 T2 T3
237
238 // The current depth of the FIFO represented by this module is the depth of all buffers plus the
239 // FIFO in the SRAM plus one if there's an entry in transition between SRAM and output buffer.
240 1/1 assign fifo_depth_o = DepthW'(inp_buf_depth) + DepthW'(sram_depth) + DepthW'(oup_buf_depth) +
Tests: T1 T2 T3
241 DepthW'(sram_read_in_prev_cyc_q);
242
243 // SRAM write data always comes from the input buffer.
244 1/1 assign sram_wdata_o = inp_buf_rdata;
Tests: T1 T2 T3
245 assign sram_wmask_o = '1;
246
247 // `sram_rvalid_i` is only used for assertions.
248 logic unused_sram_rvalid;
249 1/1 assign unused_sram_rvalid = sram_rvalid_i;
Tests: T1 T2 T3
Cond Coverage for Instance : tb.dut.i2c_core.u_fifos.u_acq_fifo_sram_adapter
| Total | Covered | Percent |
Conditions | 51 | 42 | 82.35 |
Logical | 51 | 42 | 82.35 |
Non-Logical | 0 | 0 | |
Event | 0 | 0 | |
LINE 120
EXPRESSION (fifo_wvalid_i && fifo_wready_o)
------1------ ------2------
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T53,T69 |
1 | 1 | Covered | T5,T6,T7 |
LINE 125
EXPRESSION (sram_req_o && sram_gnt_i)
-----1---- -----2----
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Not Covered | |
1 | 1 | Covered | T5,T7,T9 |
LINE 150
EXPRESSION (sram_access && sram_write_o)
-----1----- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T5,T7,T9 |
1 | 1 | Covered | T5,T7,T9 |
LINE 151
EXPRESSION (sram_access && ((!sram_write_o)))
-----1----- --------2--------
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T5,T7,T9 |
1 | 1 | Covered | T5,T7,T9 |
LINE 162
EXPRESSION (clr_i ? 1'b0 : sram_incr_rd_ptr)
--1--
-1- | Status | Tests |
0 | Covered | T1,T2,T3 |
1 | Covered | T1,T2,T3 |
LINE 196
EXPRESSION (( ! ((oup_buf_almost_full && oup_buf_wvalid) || oup_buf_full) ) || (fifo_rvalid_o && fifo_rready_i))
-------------------------------1------------------------------- ----------------2---------------
-1- | -2- | Status | Tests |
0 | 0 | Covered | T5,T7,T9 |
0 | 1 | Covered | T5,T7,T9 |
1 | 0 | Covered | T53,T69,T155 |
LINE 196
SUB-EXPRESSION ( ! ((oup_buf_almost_full && oup_buf_wvalid) || oup_buf_full) )
----------------------------1----------------------------
-1- | Status | Tests |
0 | Covered | T53,T69,T155 |
1 | Covered | T5,T7,T9 |
LINE 196
SUB-EXPRESSION ((oup_buf_almost_full && oup_buf_wvalid) || oup_buf_full)
-------------------1------------------- ------2-----
-1- | -2- | Status | Tests |
0 | 0 | Covered | T53,T69,T155 |
0 | 1 | Covered | T5,T7,T9 |
1 | 0 | Covered | T5,T7,T9 |
LINE 196
SUB-EXPRESSION (oup_buf_almost_full && oup_buf_wvalid)
---------1--------- -------2------
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T5,T7,T9 |
1 | 1 | Covered | T5,T7,T9 |
LINE 196
SUB-EXPRESSION (fifo_rvalid_o && fifo_rready_i)
------1------ ------2------
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T5,T7,T9 |
1 | 1 | Covered | T5,T7,T9 |
LINE 204
EXPRESSION (((!sram_full)) && inp_buf_rvalid)
-------1------ -------2------
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T5,T7,T9 |
1 | 1 | Covered | T5,T7,T9 |
LINE 207
EXPRESSION (((!sram_full)) && sram_gnt_i)
-------1------ -----2----
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T5,T7,T9 |
1 | 1 | Covered | T5,T7,T9 |
LINE 212
EXPRESSION (oup_buf_wready && ((!sram_read_in_prev_cyc_q)))
-------1------ --------------2-------------
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T5,T7,T9 |
1 | 1 | Covered | T1,T2,T3 |
LINE 220
EXPRESSION (((!sram_full)) && inp_buf_rvalid)
-------1------ -------2------
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T1,T2,T3 |
1 | 1 | Covered | T5,T7,T9 |
LINE 223
EXPRESSION (((!sram_full)) && sram_gnt_i)
-------1------ -----2----
-1- | -2- | Status | Tests |
0 | 1 | Not Covered | |
1 | 0 | Covered | T1,T2,T3 |
1 | 1 | Covered | T5,T7,T9 |
LINE 236
EXPRESSION (inp_buf_wready && ( ! (sram_full && oup_buf_full) ))
-------1------ ----------------2----------------
-1- | -2- | Status | Tests |
0 | 1 | Covered | T1,T2,T3 |
1 | 0 | Covered | T52,T62,T53 |
1 | 1 | Covered | T1,T2,T3 |
LINE 236
SUB-EXPRESSION ( ! (sram_full && oup_buf_full) )
-------------1-------------
-1- | Status | Tests |
0 | Covered | T1,T2,T3 |
1 | Covered | T52,T62,T53 |
LINE 236
SUB-EXPRESSION (sram_full && oup_buf_full)
----1---- ------2-----
-1- | -2- | Status | Tests |
0 | 1 | Covered | T5,T6,T7 |
1 | 0 | Not Covered | |
1 | 1 | Covered | T52,T62,T53 |
Branch Coverage for Instance : tb.dut.i2c_core.u_fifos.u_acq_fifo_sram_adapter
| Line No. | Total | Covered | Percent |
Branches |
|
10 |
10 |
100.00 |
TERNARY |
162 |
2 |
2 |
100.00 |
IF |
164 |
2 |
2 |
100.00 |
IF |
183 |
2 |
2 |
100.00 |
IF |
191 |
4 |
4 |
100.00 |
162 assign sram_read_in_prev_cyc_d = clr_i ? 1'b0 : sram_incr_rd_ptr;
-1-
==>
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T1,T2,T3 |
0 |
Covered |
T1,T2,T3 |
164 if (!rst_ni) begin
-1-
165 sram_read_in_prev_cyc_q <= 1'b0;
==>
166 end else begin
167 sram_read_in_prev_cyc_q <= sram_read_in_prev_cyc_d;
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T1,T2,T3 |
0 |
Covered |
T1,T2,T3 |
183 if (sram_read_in_prev_cyc_q) begin
-1-
184 oup_buf_wvalid = 1'b1;
==>
185 oup_buf_wdata = sram_rdata_i;
186 // The output buffer must be ready; otherwise we are in an erroneous state.
187 state_err = !oup_buf_wready;
188 end
MISSING_ELSE
==>
Branches:
-1- | Status | Tests |
1 |
Covered |
T5,T7,T9 |
0 |
Covered |
T1,T2,T3 |
191 if (!sram_empty) begin
-1-
192
193 // Prioritize refilling of the output buffer: if the output buffer is not being filled to the
194 // last slot in the current cycle or it is being read in the current cycle, read from the SRAM
195 // so the output buffer can be written in the next cycle.
196 if (!((oup_buf_almost_full && oup_buf_wvalid) || oup_buf_full)
-2-
197 || (fifo_rvalid_o && fifo_rready_i)) begin
198 sram_req_o = 1'b1;
==>
199 sram_write_o = 1'b0;
200 sram_addr_o = sram_rd_addr;
201
202 // If the output buffer is full (and not being read), drain the input buffer into the SRAM.
203 end else begin
204 sram_req_o = !sram_full && inp_buf_rvalid;
==>
205 sram_write_o = 1'b1;
206 sram_addr_o = sram_wr_addr;
207 inp_buf_rready = !sram_full && sram_gnt_i;
208 end
209
210 // If the SRAM is empty, data must flow from the input buffer to the output buffer if the output
211 // buffer is ready and is not receiving data read from the SRAM in the previous cycle
212 end else if (oup_buf_wready && !sram_read_in_prev_cyc_q) begin
-3-
213 oup_buf_wvalid = inp_buf_rvalid;
==>
214 oup_buf_wdata = inp_buf_rdata;
215 inp_buf_rready = oup_buf_wready;
216
217 // Otherwise the SRAM is empty but the output buffer cannot take the data from the input buffer,
218 // so drain the input buffer into the SRAM.
219 end else begin
220 sram_req_o = !sram_full && inp_buf_rvalid;
==>
Branches:
-1- | -2- | -3- | Status | Tests |
1 |
1 |
- |
Covered |
T5,T7,T9 |
1 |
0 |
- |
Covered |
T5,T7,T9 |
0 |
- |
1 |
Covered |
T1,T2,T3 |
0 |
- |
0 |
Covered |
T1,T2,T3 |
Assert Coverage for Instance : tb.dut.i2c_core.u_fifos.u_acq_fifo_sram_adapter
Assertion Details
MinimalSramAw_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1688 |
1688 |
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 |
T8 |
1 |
1 |
0 |
0 |
T9 |
1 |
1 |
0 |
0 |
T10 |
1 |
1 |
0 |
0 |
MinimalSramFifoDepth_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
1688 |
1688 |
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 |
T8 |
1 |
1 |
0 |
0 |
T9 |
1 |
1 |
0 |
0 |
T10 |
1 |
1 |
0 |
0 |
NoErr_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
412998901 |
412829577 |
0 |
0 |
T1 |
2318 |
2231 |
0 |
0 |
T2 |
9391 |
9298 |
0 |
0 |
T3 |
7232 |
7139 |
0 |
0 |
T4 |
13822 |
13728 |
0 |
0 |
T5 |
13722 |
13623 |
0 |
0 |
T6 |
14273 |
14210 |
0 |
0 |
T7 |
117701 |
117645 |
0 |
0 |
T8 |
21151 |
20282 |
0 |
0 |
T9 |
56214 |
56115 |
0 |
0 |
T10 |
93037 |
92941 |
0 |
0 |
NoSramReadWhenEmpty_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
412998901 |
181053018 |
0 |
0 |
T1 |
2318 |
2231 |
0 |
0 |
T2 |
9391 |
9298 |
0 |
0 |
T3 |
7232 |
7139 |
0 |
0 |
T4 |
13822 |
13728 |
0 |
0 |
T5 |
13722 |
10630 |
0 |
0 |
T6 |
14273 |
14210 |
0 |
0 |
T7 |
117701 |
55940 |
0 |
0 |
T8 |
21151 |
20282 |
0 |
0 |
T9 |
56214 |
35942 |
0 |
0 |
T10 |
93037 |
30470 |
0 |
0 |
NoSramWriteWhenFull_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
412998901 |
60881 |
0 |
0 |
T18 |
13240 |
0 |
0 |
0 |
T25 |
159430 |
0 |
0 |
0 |
T38 |
11147 |
0 |
0 |
0 |
T46 |
14103 |
0 |
0 |
0 |
T52 |
57000 |
5 |
0 |
0 |
T53 |
220661 |
27 |
0 |
0 |
T55 |
0 |
3 |
0 |
0 |
T62 |
57893 |
1271 |
0 |
0 |
T63 |
0 |
1414 |
0 |
0 |
T64 |
0 |
12 |
0 |
0 |
T68 |
0 |
1553 |
0 |
0 |
T69 |
0 |
14 |
0 |
0 |
T74 |
93630 |
0 |
0 |
0 |
T75 |
63317 |
0 |
0 |
0 |
T153 |
48655 |
0 |
0 |
0 |
T157 |
0 |
22 |
0 |
0 |
T160 |
0 |
735 |
0 |
0 |
OupBufWreadyAfterSramRead_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
412998901 |
246101 |
0 |
0 |
T5 |
13722 |
10 |
0 |
0 |
T6 |
14273 |
0 |
0 |
0 |
T7 |
117701 |
389 |
0 |
0 |
T8 |
21151 |
0 |
0 |
0 |
T9 |
56214 |
168 |
0 |
0 |
T10 |
93037 |
355 |
0 |
0 |
T17 |
61075 |
0 |
0 |
0 |
T26 |
34652 |
0 |
0 |
0 |
T48 |
9615 |
0 |
0 |
0 |
T52 |
0 |
266 |
0 |
0 |
T53 |
0 |
33 |
0 |
0 |
T65 |
0 |
146 |
0 |
0 |
T70 |
0 |
264 |
0 |
0 |
T73 |
92357 |
25 |
0 |
0 |
T74 |
0 |
361 |
0 |
0 |
SramRvalidAfterRead_A
Name | Attempts | Real Successes | Failures | Incomplete |
Total |
412998901 |
246101 |
0 |
0 |
T5 |
13722 |
10 |
0 |
0 |
T6 |
14273 |
0 |
0 |
0 |
T7 |
117701 |
389 |
0 |
0 |
T8 |
21151 |
0 |
0 |
0 |
T9 |
56214 |
168 |
0 |
0 |
T10 |
93037 |
355 |
0 |
0 |
T17 |
61075 |
0 |
0 |
0 |
T26 |
34652 |
0 |
0 |
0 |
T48 |
9615 |
0 |
0 |
0 |
T52 |
0 |
266 |
0 |
0 |
T53 |
0 |
33 |
0 |
0 |
T65 |
0 |
146 |
0 |
0 |
T70 |
0 |
264 |
0 |
0 |
T73 |
92357 |
25 |
0 |
0 |
T74 |
0 |
361 |
0 |
0 |