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



Module Instance : tb.dut.usbdev_impl.u_usb_fs_nb_pe.u_usb_fs_nb_in_pe

Instance :
SCORELINECONDTOGGLEFSMBRANCHASSERT
95.96 98.32 94.74 90.91 95.83 100.00


Instance's subtree :
SCORELINECONDTOGGLEFSMBRANCHASSERT
95.96 98.32 94.74 90.91 95.83 100.00


Parent :
SCORELINECONDTOGGLEFSMBRANCHASSERTNAME
100.00 100.00 100.00 100.00 u_usb_fs_nb_pe


Subtrees :
NAMESCORELINECONDTOGGLEFSMBRANCHASSERT
no children

Line Coverage for Module : usb_fs_nb_in_pe
Line No.TotalCoveredPercent
TOTAL12011797.50
CONT_ASSIGN11811100.00
CONT_ASSIGN13211100.00
CONT_ASSIGN13311100.00
CONT_ASSIGN13511100.00
CONT_ASSIGN14111100.00
CONT_ASSIGN14511100.00
CONT_ASSIGN14911100.00
CONT_ASSIGN15411100.00
CONT_ASSIGN16011100.00
CONT_ASSIGN16111100.00
CONT_ASSIGN16811100.00
CONT_ASSIGN16911100.00
CONT_ASSIGN17211100.00
CONT_ASSIGN17811100.00
CONT_ASSIGN18011100.00
CONT_ASSIGN18611100.00
CONT_ASSIGN18811100.00
CONT_ASSIGN18911100.00
ALWAYS199494693.88
ALWAYS30333100.00
ALWAYS31133100.00
ALWAYS31988100.00
ALWAYS33266100.00
ALWAYS34499100.00
ALWAYS36177100.00
CONT_ASSIGN37511100.00
ALWAYS37855100.00
ALWAYS38855100.00
CONT_ASSIGN40511100.00
CONT_ASSIGN41211100.00
ALWAYS42233100.00
CONT_ASSIGN42511100.00

117 118 1/1 assign in_ep_xact_end_o = in_xact_end; Tests: T1 T2 T3  119 120 // data toggle state 121 logic [NumInEps-1:0] data_toggle_q, data_toggle_d; 122 123 // endpoint data buffer 124 logic token_received, setup_token_received, in_token_received, ack_received, nak_received; 125 logic more_data_to_send; 126 logic ep_in_hw, ep_active; 127 logic [3:0] in_ep_current_d; 128 129 // More syntax so can compare with enum 130 usb_pid_type_e rx_pid_type; 131 usb_pid_e rx_pid; 132 1/1 assign rx_pid_type = usb_pid_type_e'(rx_pid_i[1:0]); Tests: T1 T2 T3  133 1/1 assign rx_pid = usb_pid_e'(rx_pid_i); Tests: T1 T2 T3  134 135 1/1 assign token_received = Tests: T1 T2 T3  136 rx_pkt_end_i && 137 rx_pkt_valid_i && 138 rx_pid_type == UsbPidTypeToken && 139 rx_addr_i == dev_addr_i; 140 141 1/1 assign setup_token_received = Tests: T1 T2 T3  142 token_received && 143 rx_pid == UsbPidSetup; 144 145 1/1 assign in_token_received = Tests: T1 T2 T3  146 token_received && 147 rx_pid == UsbPidIn; 148 149 1/1 assign ack_received = Tests: T1 T2 T3  150 rx_pkt_end_i && 151 rx_pkt_valid_i && 152 rx_pid == UsbPidAck; 153 154 1/1 assign nak_received = Tests: T1 T2 T3  155 rx_pkt_end_i && 156 rx_pkt_valid_i && 157 rx_pid == UsbPidNak; 158 159 // Is the specified endpoint actually implemented in hardware? 160 1/1 assign ep_in_hw = {1'b0, rx_endp_i} < NumInEps; Tests: T1 T2 T3  161 1/1 assign in_ep_current_d = ep_in_hw ? rx_endp_i : '0; Tests: T1 T2 T3  162 163 // Make widths work - in_ep_current_d/in_ep_current_o only hold implemented endpoint IDs. 164 // These signals can be used to index signals of NumInEps width. 165 // They are only valid if ep_active is set, i.e., if the specified endpoint is implemented. 166 logic [InEpW-1:0] in_ep_index; 167 logic [InEpW-1:0] in_ep_index_d; 168 1/1 assign in_ep_index = in_ep_current_o[0 +: InEpW]; Tests: T1 T2 T3  169 1/1 assign in_ep_index_d = in_ep_current_d[0 +: InEpW]; Tests: T1 T2 T3  170 171 // Is the endpoint active? 172 1/1 assign ep_active = in_ep_enabled_i[in_ep_index_d] & ep_in_hw; Tests: T1 T2 T3  173 174 // Retain whether the current IN transmission has associated data; an Isochronous transaction 175 // for which there was no packet data available must not raise a 'pkt_sent' interrupt. 176 logic has_data_q; 177 178 1/1 assign more_data_to_send = has_data_q & ~in_ep_data_done_i[in_ep_index]; Tests: T1 T2 T3  179 180 1/1 assign tx_data_avail_o = logic'(in_xact_state == StSendData) & more_data_to_send; Tests: T1 T2 T3  181 182 //////////////////////////////////////////////////////////////////////////////// 183 // Transaction is starting on this IN endpoint; capture the packet details. 184 //////////////////////////////////////////////////////////////////////////////// 185 logic in_starting; 186 1/1 assign in_starting = (in_xact_state == StIdle || in_xact_state == StWaitAck) && in_token_received; Tests: T1 T2 T3  187 188 1/1 assign in_xact_starting_o = in_starting & ep_active; Tests: T1 T2 T3  189 1/1 assign in_xact_start_ep_o = in_ep_current_d; Tests: T1 T2 T3  190 191 //////////////////////////////////////////////////////////////////////////////// 192 // in transaction state machine 193 //////////////////////////////////////////////////////////////////////////////// 194 195 logic [AckTimeoutCntW-1:0] timeout_cntdown_d, timeout_cntdown_q; 196 logic rollback_in_xact; 197 198 always_comb begin 199 1/1 in_xact_state_next = in_xact_state; Tests: T1 T2 T3  200 1/1 in_xact_end = 1'b0; Tests: T1 T2 T3  201 1/1 tx_pkt_start_o = 1'b0; Tests: T1 T2 T3  202 1/1 tx_pid_o = 4'b0000; Tests: T1 T2 T3  203 1/1 rollback_in_xact = 1'b0; Tests: T1 T2 T3  204 1/1 timeout_cntdown_d = AckTimeoutCnt[AckTimeoutCntW-1:0]; Tests: T1 T2 T3  205 1/1 unique case (in_xact_state) Tests: T1 T2 T3  206 StIdle: begin 207 1/1 if (ep_active && in_token_received) begin Tests: T1 T2 T3  208 1/1 in_xact_state_next = StRcvdIn; Tests: T18 T19 T29  209 end else begin 210 // Ignore tokens to inactive endpoints. Send no response. 211 1/1 in_xact_state_next = StIdle; Tests: T1 T2 T3  212 end 213 end 214 215 StRcvdIn: begin 216 1/1 tx_pkt_start_o = 1'b1; // Need to transmit NAK/STALL or DATA Tests: T18 T19 T29  217 218 1/1 if (in_ep_iso_i[in_ep_index]) begin Tests: T18 T19 T29  219 // ISO endpoint 220 // We always need to transmit. When no data is available, we send 221 // a zero-length packet. 222 // DATA0 always for full-speed isochronous endpoints 223 1/1 in_xact_state_next = StSendData; Tests: T31 T6 T102  224 1/1 tx_pid_o = {UsbPidData0}; Tests: T31 T6 T102  225 1/1 end else if (in_ep_stall_i[in_ep_index]) begin Tests: T18 T19 T29  226 1/1 in_xact_state_next = StIdle; Tests: T32 T103 T104  227 1/1 tx_pid_o = {UsbPidStall}; // STALL Tests: T32 T103 T104  228 1/1 end else if (has_data_q) begin Tests: T18 T19 T29  229 1/1 in_xact_state_next = StSendData; Tests: T18 T19 T29  230 1/1 tx_pid_o = {data_toggle_q[in_ep_index], 1'b0, {UsbPidTypeData}}; // DATA0/1 Tests: T18 T19 T29  231 end else begin 232 1/1 in_xact_state_next = StIdle; Tests: T4 T5 T6  233 1/1 tx_pid_o = {UsbPidNak}; // NAK Tests: T4 T5 T6  234 end 235 end 236 237 StSendData: begin 238 // Use &in_ep_get_addr so width can vary, looking for all ones 239 1/1 if ((!more_data_to_send) || ((&in_ep_get_addr_o) && tx_data_get_i)) begin Tests: T18 T19 T29  240 1/1 if (in_ep_iso_i[in_ep_index]) begin Tests: T18 T19 T29  241 1/1 in_xact_state_next = StIdle; // no ACK for ISO EPs Tests: T31 T6 T102  242 1/1 in_xact_end = has_data_q; Tests: T31 T6 T102  243 end else begin 244 1/1 if (tx_pkt_end_i) begin Tests: T18 T19 T29  245 0/1 ==> in_xact_state_next = StWaitAckStart; 246 end else begin 247 1/1 in_xact_state_next = StWaitTxEnd; Tests: T18 T19 T29  248 end 249 end 250 end else begin 251 1/1 in_xact_state_next = StSendData; Tests: T19 T29 T31  252 end 253 end 254 255 StWaitTxEnd: begin 256 1/1 if (tx_pkt_end_i) begin Tests: T18 T19 T29  257 1/1 in_xact_state_next = StWaitAckStart; Tests: T18 T19 T29  258 end MISSING_ELSE 259 end 260 261 StWaitAckStart: begin 262 // The spec says we have up to 18 bit times to wait for the host 263 // response. If it doesn't arrive in time, we must invalidate the 264 // transaction. 265 1/1 timeout_cntdown_d = timeout_cntdown_q - 1'b1; Tests: T18 T19 T29  266 267 1/1 if (rx_pkt_start_i) begin Tests: T18 T19 T29  268 1/1 in_xact_state_next = StWaitAck; Tests: T18 T19 T29  269 1/1 end else if (timeout_cntdown_q == '0) begin Tests: T18 T19 T29  270 1/1 in_xact_state_next = StIdle; Tests: T19 T35 T97  271 1/1 rollback_in_xact = 1'b1; Tests: T19 T35 T97  272 end else begin 273 1/1 in_xact_state_next = StWaitAckStart; Tests: T18 T19 T29  274 end 275 end 276 277 StWaitAck: begin 278 1/1 if (ack_received) begin Tests: T18 T19 T29  279 1/1 in_xact_state_next = StIdle; Tests: T18 T19 T29  280 1/1 in_xact_end = 1'b1; Tests: T18 T19 T29  281 1/1 end else if (in_token_received) begin Tests: T18 T19 T29  282 // Handshake response is missing. 283 0/1 ==> in_xact_state_next = ep_active ? StRcvdIn : StIdle; 284 0/1 ==> rollback_in_xact = 1'b1; 285 1/1 end else if (rx_pkt_end_i) begin Tests: T18 T19 T29  286 // Includes NAK 287 1/1 in_xact_state_next = StIdle; Tests: T19 T34 T105  288 1/1 rollback_in_xact = 1'b1; Tests: T19 T34 T105  289 end else begin 290 1/1 in_xact_state_next = StWaitAck; Tests: T18 T19 T29  291 end 292 end 293 294 default: in_xact_state_next = StIdle; 295 endcase 296 end 297 298 `ASSERT(InXactStateValid_A, 299 in_xact_state inside {StIdle, StRcvdIn, StSendData, StWaitTxEnd, StWaitAckStart, StWaitAck}, 300 clk_48mhz_i) 301 302 always_ff @(posedge clk_48mhz_i or negedge rst_ni) begin 303 1/1 if (!rst_ni) begin Tests: T1 T2 T3  304 1/1 timeout_cntdown_q <= AckTimeoutCnt[AckTimeoutCntW-1:0]; Tests: T1 T2 T3  305 end else begin 306 1/1 timeout_cntdown_q <= timeout_cntdown_d; Tests: T1 T2 T3  307 end 308 end 309 310 always_ff @(posedge clk_48mhz_i or negedge rst_ni) begin 311 1/1 if (!rst_ni) begin Tests: T1 T2 T3  312 1/1 tx_data_o <= '0; Tests: T1 T2 T3  313 end else begin 314 1/1 tx_data_o <= in_ep_data_i; Tests: T1 T2 T3  315 end 316 end 317 318 always_ff @(posedge clk_48mhz_i or negedge rst_ni) begin 319 1/1 if (!rst_ni) begin Tests: T1 T2 T3  320 1/1 in_xact_state <= StIdle; Tests: T1 T2 T3  321 1/1 in_ep_rollback_o <= 1'b0; Tests: T1 T2 T3  322 1/1 end else if (link_reset_i || !link_active_i) begin Tests: T1 T2 T3  323 1/1 in_xact_state <= StIdle; Tests: T1 T2 T3  324 1/1 in_ep_rollback_o <= 1'b0; Tests: T1 T2 T3  325 end else begin 326 1/1 in_xact_state <= in_xact_state_next; Tests: T1 T2 T3  327 1/1 in_ep_rollback_o <= rollback_in_xact; Tests: T1 T2 T3  328 end 329 end 330 331 always_ff @(posedge clk_48mhz_i or negedge rst_ni) begin 332 1/1 if (!rst_ni) begin Tests: T1 T2 T3  333 1/1 in_ep_get_addr_o <= '0; Tests: T1 T2 T3  334 end else begin 335 1/1 if (in_xact_state == StIdle) begin Tests: T1 T2 T3  336 1/1 in_ep_get_addr_o <= '0; Tests: T1 T2 T3  337 1/1 end else if ((in_xact_state == StSendData) && tx_data_get_i) begin Tests: T18 T19 T29  338 1/1 in_ep_get_addr_o <= in_ep_get_addr_o + 1'b1; Tests: T19 T29 T31  339 end MISSING_ELSE 340 end 341 end 342 343 always_ff @(posedge clk_48mhz_i or negedge rst_ni) begin 344 1/1 if (!rst_ni) begin Tests: T1 T2 T3  345 1/1 in_ep_newpkt_o <= 1'b0; Tests: T1 T2 T3  346 1/1 in_ep_current_o <= '0; Tests: T1 T2 T3  347 1/1 has_data_q <= 1'b0; Tests: T1 T2 T3  348 end else begin 349 1/1 if (in_token_received) begin Tests: T1 T2 T3  350 1/1 in_ep_current_o <= in_ep_current_d; Tests: T18 T19 T29  351 1/1 in_ep_newpkt_o <= 1'b1; Tests: T18 T19 T29  352 1/1 has_data_q <= in_ep_has_data_i[in_ep_index_d]; Tests: T18 T19 T29  353 end else begin 354 1/1 in_ep_newpkt_o <= 1'b0; Tests: T1 T2 T3  355 end 356 end 357 end 358 359 // Updating of data toggles 360 always_comb begin : proc_data_toggle_d 361 1/1 data_toggle_d = data_toggle_q; Tests: T1 T2 T3  362 363 1/1 if (setup_token_received && ep_active) begin Tests: T1 T2 T3  364 1/1 data_toggle_d[in_ep_index_d] = 1'b1; Tests: T20 T82 T43  365 1/1 end else if ((in_xact_state == StWaitAck) && ack_received) begin Tests: T1 T2 T3  366 1/1 data_toggle_d[in_ep_index] = ~data_toggle_q[in_ep_index]; Tests: T18 T19 T29  367 end MISSING_ELSE 368 // Selective modification by software 369 1/1 if (in_datatog_we_i) begin Tests: T1 T2 T3  370 1/1 data_toggle_d = (data_toggle_d & ~in_datatog_mask_i) | Tests: T18 T19 T106  371 (in_datatog_status_i & in_datatog_mask_i); 372 end MISSING_ELSE 373 end 374 // Supply current data toggles to register interface 375 1/1 assign in_data_toggle_o = data_toggle_q; Tests: T1 T2 T3  376 377 always_ff @(posedge clk_48mhz_i or negedge rst_ni) begin 378 1/1 if (!rst_ni) begin Tests: T1 T2 T3  379 1/1 data_toggle_q <= '0; // Clear for all endpoints Tests: T1 T2 T3  380 1/1 end else if (link_reset_i) begin Tests: T1 T2 T3  381 1/1 data_toggle_q <= '0; // Clear for all endpoints Tests: T1 T2 T3  382 end else begin 383 1/1 data_toggle_q <= data_toggle_d; Tests: T1 T2 T3  384 end 385 end 386 387 always_ff @(posedge clk_48mhz_i or negedge rst_ni) begin 388 1/1 if (!rst_ni) begin Tests: T1 T2 T3  389 1/1 in_ep_data_get_o <= 1'b0; Tests: T1 T2 T3  390 end else begin 391 1/1 if ((in_xact_state == StSendData) && tx_data_get_i) begin Tests: T1 T2 T3  392 1/1 in_ep_data_get_o <= 1'b1; Tests: T19 T29 T31  393 end else begin 394 1/1 in_ep_data_get_o <= 1'b0; Tests: T1 T2 T3  395 end 396 end 397 end 398 399 //////////////////////////////////////////////////////////////////////////////// 400 // Count non-Isochronous IN transactions not receiving a handshake response. 401 // 402 // - no handshake response within the timeout period 403 // - packet reception started within the timeout period but it was not ACK/NAK. 404 //////////////////////////////////////////////////////////////////////////////// 405 1/1 assign event_timeout_in_o = (in_xact_state == StWaitAckStart || Tests: T1 T2 T3  406 (in_xact_state == StWaitAck && rx_pkt_end_i && !nak_received)) 407 & rollback_in_xact; 408 409 //////////////////////////////////////////////////////////////////////////////// 410 // Count IN transactions that are actively NAKed by the host. 411 //////////////////////////////////////////////////////////////////////////////// 412 1/1 assign event_nak_in_o = (in_xact_state == StWaitAck) && nak_received; Tests: T1 T2 T3  413 414 //////////////////////////////////////////////////////////////////////////////// 415 // Count the number of IN requests for which data is not available, including 416 // endpoints which are supported but not presently enabled/configured. 417 // (These may be ignored using the event counter configuration if required.) 418 //////////////////////////////////////////////////////////////////////////////// 419 logic event_nodata_in_q; 420 // This event signal must be delayed by a single cycle so that 'in_ep_current_o' becomes valid. 421 always_ff @(posedge clk_48mhz_i or negedge rst_ni) begin 422 2/2 if (!rst_ni) event_nodata_in_q <= 1'b0; Tests: T1 T2 T3  | T1 T2 T3  423 1/1 else event_nodata_in_q <= in_starting & (ep_in_hw ? !in_ep_has_data_i[in_ep_index_d] : 1'b0); Tests: T1 T2 T3  424 end 425 1/1 assign event_nodata_in_o = event_nodata_in_q; Tests: T1 T2 T3 

Cond Coverage for Module : usb_fs_nb_in_pe
TotalCoveredPercent
Conditions11510893.91
Logical11510893.91
Non-Logical00
Event00

 LINE       135
 EXPRESSION (rx_pkt_end_i && rx_pkt_valid_i && (rx_pid_type == UsbPidTypeToken) && (rx_addr_i == dev_addr_i))
             ------1-----    -------2------    ----------------3---------------    ------------4------------
-1--2--3--4-StatusTests
0111CoveredT1,T2,T18
1011CoveredT69,T107,T73
1101CoveredT1,T2,T18
1110CoveredT20,T21,T23
1111CoveredT1,T2,T18

 LINE       135
 SUB-EXPRESSION (rx_pid_type == UsbPidTypeToken)
                ----------------1---------------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT1,T2,T17

 LINE       135
 SUB-EXPRESSION (rx_addr_i == dev_addr_i)
                ------------1------------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT1,T2,T3

 LINE       141
 EXPRESSION (token_received && (rx_pid == UsbPidSetup))
             -------1------    -----------2-----------
-1--2-StatusTests
01CoveredT2,T20,T23
10CoveredT1,T18,T19
11CoveredT2,T20,T24

 LINE       141
 SUB-EXPRESSION (rx_pid == UsbPidSetup)
                -----------1-----------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT2,T20,T23

 LINE       145
 EXPRESSION (token_received && (rx_pid == UsbPidIn))
             -------1------    ----------2---------
-1--2-StatusTests
01CoveredT18,T19,T20
10CoveredT1,T2,T18
11CoveredT18,T19,T29

 LINE       145
 SUB-EXPRESSION (rx_pid == UsbPidIn)
                ----------1---------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT18,T19,T20

 LINE       149
 EXPRESSION (rx_pkt_end_i && rx_pkt_valid_i && (rx_pid == UsbPidAck))
             ------1-----    -------2------    ----------3----------
-1--2--3-StatusTests
011CoveredT18,T19,T29
101CoveredT77,T108,T109
110CoveredT1,T2,T17
111CoveredT18,T19,T29

 LINE       149
 SUB-EXPRESSION (rx_pid == UsbPidAck)
                ----------1----------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT18,T19,T20

 LINE       154
 EXPRESSION (rx_pkt_end_i && rx_pkt_valid_i && (rx_pid == UsbPidNak))
             ------1-----    -------2------    ----------3----------
-1--2--3-StatusTests
011CoveredT19,T34,T105
101CoveredT110,T108,T109
110CoveredT1,T2,T17
111CoveredT19,T105,T111

 LINE       154
 SUB-EXPRESSION (rx_pid == UsbPidNak)
                ----------1----------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT18,T19,T29

 LINE       161
 EXPRESSION (ep_in_hw ? rx_endp_i : '0)
             ----1---
-1-StatusTests
0CoveredT21,T8,T112
1CoveredT1,T2,T3

 LINE       172
 EXPRESSION (in_ep_enabled_i[in_ep_index_d] & ep_in_hw)
             ---------------1--------------   ----2---
-1--2-StatusTests
01CoveredT1,T2,T3
10CoveredT113,T74,T114
11CoveredT18,T19,T20

 LINE       178
 EXPRESSION (has_data_q & ((~in_ep_data_done_i[in_ep_index])))
             -----1----   -----------------2-----------------
-1--2-StatusTests
01CoveredT90,T114,T115
10CoveredT18,T19,T29
11CoveredT19,T29,T31

 LINE       180
 EXPRESSION ((logic'((in_xact_state == StSendData))) & more_data_to_send)
             -------------------1-------------------   --------2--------
-1--2-StatusTests
01CoveredT19,T29,T31
10CoveredT18,T19,T29
11CoveredT19,T29,T31

 LINE       186
 EXPRESSION (((in_xact_state == StIdle) || (in_xact_state == StWaitAck)) && in_token_received)
             -----------------------------1-----------------------------    --------2--------
-1--2-StatusTests
01Not Covered
10CoveredT1,T2,T3
11CoveredT18,T19,T29

 LINE       186
 SUB-EXPRESSION ((in_xact_state == StIdle) || (in_xact_state == StWaitAck))
                 ------------1------------    --------------2-------------
-1--2-StatusTests
00CoveredT18,T19,T29
01CoveredT18,T19,T29
10CoveredT1,T2,T3

 LINE       186
 SUB-EXPRESSION (in_xact_state == StIdle)
                ------------1------------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT1,T2,T3

 LINE       186
 SUB-EXPRESSION (in_xact_state == StWaitAck)
                --------------1-------------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT18,T19,T29

 LINE       188
 EXPRESSION (in_starting & ep_active)
             -----1-----   ----2----
-1--2-StatusTests
01CoveredT18,T19,T20
10CoveredT114,T115,T116
11CoveredT18,T19,T29

 LINE       207
 EXPRESSION (ep_active && in_token_received)
             ----1----    --------2--------
-1--2-StatusTests
01CoveredT114,T115,T116
10CoveredT18,T19,T20
11CoveredT18,T19,T29

 LINE       239
 EXPRESSION (((!more_data_to_send)) || (((&in_ep_get_addr_o)) && tx_data_get_i))
             -----------1----------    --------------------2-------------------
-1--2-StatusTests
00CoveredT19,T29,T31
01CoveredT117,T4,T5
10CoveredT18,T19,T29

 LINE       239
 SUB-EXPRESSION (((&in_ep_get_addr_o)) && tx_data_get_i)
                 ----------1----------    ------2------
-1--2-StatusTests
01CoveredT19,T29,T31
10CoveredT117,T4,T5
11CoveredT117,T4,T5

 LINE       269
 EXPRESSION (timeout_cntdown_q == '0)
            ------------1------------
-1-StatusTests
0CoveredT18,T19,T29
1CoveredT19,T35,T97

 LINE       283
 EXPRESSION (ep_active ? StRcvdIn : StIdle)
             ----1----
-1-StatusTests
0Not Covered
1Not Covered

 LINE       322
 EXPRESSION (link_reset_i || ((!link_active_i)))
             ------1-----    ---------2--------
-1--2-StatusTests
00CoveredT1,T2,T3
01CoveredT1,T2,T3
10CoveredT1,T2,T3

 LINE       335
 EXPRESSION (in_xact_state == StIdle)
            ------------1------------
-1-StatusTests
0CoveredT18,T19,T29
1CoveredT1,T2,T3

 LINE       337
 EXPRESSION ((in_xact_state == StSendData) && tx_data_get_i)
             --------------1--------------    ------2------
-1--2-StatusTests
01Not Covered
10CoveredT18,T19,T29
11CoveredT19,T29,T31

 LINE       337
 SUB-EXPRESSION (in_xact_state == StSendData)
                --------------1--------------
-1-StatusTests
0CoveredT18,T19,T29
1CoveredT18,T19,T29

 LINE       363
 EXPRESSION (setup_token_received && ep_active)
             ----------1---------    ----2----
-1--2-StatusTests
01CoveredT18,T19,T20
10CoveredT2,T24,T72
11CoveredT20,T82,T43

 LINE       365
 EXPRESSION ((in_xact_state == StWaitAck) && ack_received)
             --------------1-------------    ------2-----
-1--2-StatusTests
01Not Covered
10CoveredT18,T19,T29
11CoveredT18,T19,T29

 LINE       365
 SUB-EXPRESSION (in_xact_state == StWaitAck)
                --------------1-------------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT18,T19,T29

 LINE       391
 EXPRESSION ((in_xact_state == StSendData) && tx_data_get_i)
             --------------1--------------    ------2------
-1--2-StatusTests
01Not Covered
10CoveredT18,T19,T29
11CoveredT19,T29,T31

 LINE       391
 SUB-EXPRESSION (in_xact_state == StSendData)
                --------------1--------------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT18,T19,T29

 LINE       405
 EXPRESSION (((in_xact_state == StWaitAckStart) || ((in_xact_state == StWaitAck) && rx_pkt_end_i && ((!nak_received)))) & rollback_in_xact)
             -----------------------------------------------------1----------------------------------------------------   --------2-------
-1--2-StatusTests
01CoveredT19,T105,T111
10CoveredT18,T19,T29
11CoveredT19,T34,T35

 LINE       405
 SUB-EXPRESSION ((in_xact_state == StWaitAckStart) || ((in_xact_state == StWaitAck) && rx_pkt_end_i && ((!nak_received))))
                 ----------------1----------------    ---------------------------------2---------------------------------
-1--2-StatusTests
00CoveredT1,T2,T3
01CoveredT18,T19,T29
10CoveredT18,T19,T29

 LINE       405
 SUB-EXPRESSION (in_xact_state == StWaitAckStart)
                ----------------1----------------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT18,T19,T29

 LINE       405
 SUB-EXPRESSION ((in_xact_state == StWaitAck) && rx_pkt_end_i && ((!nak_received)))
                 --------------1-------------    ------2-----    --------3--------
-1--2--3-StatusTests
011CoveredT1,T2,T17
101CoveredT18,T19,T29
110CoveredT19,T105,T111
111CoveredT18,T19,T29

 LINE       405
 SUB-EXPRESSION (in_xact_state == StWaitAck)
                --------------1-------------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT18,T19,T29

 LINE       412
 EXPRESSION ((in_xact_state == StWaitAck) && nak_received)
             --------------1-------------    ------2-----
-1--2-StatusTests
01Not Covered
10CoveredT18,T19,T29
11CoveredT19,T105,T111

 LINE       412
 SUB-EXPRESSION (in_xact_state == StWaitAck)
                --------------1-------------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT18,T19,T29

 LINE       423
 EXPRESSION (in_starting & (ep_in_hw ? ((!in_ep_has_data_i[in_ep_index_d])) : 1'b0))
             -----1-----   ----------------------------2---------------------------
-1--2-StatusTests
01CoveredT1,T2,T3
10CoveredT18,T19,T29
11CoveredT4,T5,T6

 LINE       423
 SUB-EXPRESSION (ep_in_hw ? ((!in_ep_has_data_i[in_ep_index_d])) : 1'b0)
                 ----1---
-1-StatusTests
0CoveredT21,T8,T112
1CoveredT1,T2,T3

FSM Coverage for Module : usb_fs_nb_in_pe
Summary for FSM :: in_xact_state
TotalCoveredPercent
States 6 6 100.00 (Not included in score)
Transitions 12 10 83.33
Sequences 0 0

State, Transition and Sequence Details for FSM :: in_xact_state
statesLine No.CoveredTests
StIdle 323 Covered T1,T2,T3
StRcvdIn 208 Covered T18,T19,T29
StSendData 223 Covered T18,T19,T29
StWaitAck 268 Covered T18,T19,T29
StWaitAckStart 245 Covered T18,T19,T29
StWaitTxEnd 247 Covered T18,T19,T29


transitionsLine No.CoveredTests
StIdle->StRcvdIn 208 Covered T18,T19,T29
StRcvdIn->StIdle 323 Covered T32,T4,T103
StRcvdIn->StSendData 223 Covered T18,T19,T29
StSendData->StIdle 323 Covered T31,T6,T102
StSendData->StWaitAckStart 245 Not Covered
StSendData->StWaitTxEnd 247 Covered T18,T19,T29
StWaitAck->StIdle 323 Covered T18,T19,T29
StWaitAck->StRcvdIn 283 Not Covered
StWaitAckStart->StIdle 323 Covered T19,T35,T97
StWaitAckStart->StWaitAck 268 Covered T18,T19,T29
StWaitTxEnd->StIdle 323 Covered T118,T119,T120
StWaitTxEnd->StWaitAckStart 257 Covered T18,T19,T29



Branch Coverage for Module : usb_fs_nb_in_pe
Line No.TotalCoveredPercent
Branches 50 46 92.00
TERNARY 161 2 2 100.00
CASE 205 21 17 80.95
IF 303 2 2 100.00
IF 311 2 2 100.00
IF 319 3 3 100.00
IF 332 4 4 100.00
IF 344 3 3 100.00
IF 363 3 3 100.00
IF 369 2 2 100.00
IF 378 3 3 100.00
IF 388 3 3 100.00
IF 422 2 2 100.00


161 assign in_ep_current_d = ep_in_hw ? rx_endp_i : '0; -1- ==> ==>

Branches:
-1-StatusTests
1 Covered T1,T2,T3
0 Covered T21,T8,T112


205 unique case (in_xact_state) -1- 206 StIdle: begin 207 if (ep_active && in_token_received) begin -2- 208 in_xact_state_next = StRcvdIn; ==> 209 end else begin 210 // Ignore tokens to inactive endpoints. Send no response. 211 in_xact_state_next = StIdle; ==> 212 end 213 end 214 215 StRcvdIn: begin 216 tx_pkt_start_o = 1'b1; // Need to transmit NAK/STALL or DATA 217 218 if (in_ep_iso_i[in_ep_index]) begin -3- 219 // ISO endpoint 220 // We always need to transmit. When no data is available, we send 221 // a zero-length packet. 222 // DATA0 always for full-speed isochronous endpoints 223 in_xact_state_next = StSendData; ==> 224 tx_pid_o = {UsbPidData0}; 225 end else if (in_ep_stall_i[in_ep_index]) begin -4- 226 in_xact_state_next = StIdle; ==> 227 tx_pid_o = {UsbPidStall}; // STALL 228 end else if (has_data_q) begin -5- 229 in_xact_state_next = StSendData; ==> 230 tx_pid_o = {data_toggle_q[in_ep_index], 1'b0, {UsbPidTypeData}}; // DATA0/1 231 end else begin 232 in_xact_state_next = StIdle; ==> 233 tx_pid_o = {UsbPidNak}; // NAK 234 end 235 end 236 237 StSendData: begin 238 // Use &in_ep_get_addr so width can vary, looking for all ones 239 if ((!more_data_to_send) || ((&in_ep_get_addr_o) && tx_data_get_i)) begin -6- 240 if (in_ep_iso_i[in_ep_index]) begin -7- 241 in_xact_state_next = StIdle; // no ACK for ISO EPs ==> 242 in_xact_end = has_data_q; 243 end else begin 244 if (tx_pkt_end_i) begin -8- 245 in_xact_state_next = StWaitAckStart; ==> 246 end else begin 247 in_xact_state_next = StWaitTxEnd; ==> 248 end 249 end 250 end else begin 251 in_xact_state_next = StSendData; ==> 252 end 253 end 254 255 StWaitTxEnd: begin 256 if (tx_pkt_end_i) begin -9- 257 in_xact_state_next = StWaitAckStart; ==> 258 end MISSING_ELSE ==> 259 end 260 261 StWaitAckStart: begin 262 // The spec says we have up to 18 bit times to wait for the host 263 // response. If it doesn't arrive in time, we must invalidate the 264 // transaction. 265 timeout_cntdown_d = timeout_cntdown_q - 1'b1; 266 267 if (rx_pkt_start_i) begin -10- 268 in_xact_state_next = StWaitAck; ==> 269 end else if (timeout_cntdown_q == '0) begin -11- 270 in_xact_state_next = StIdle; ==> 271 rollback_in_xact = 1'b1; 272 end else begin 273 in_xact_state_next = StWaitAckStart; ==> 274 end 275 end 276 277 StWaitAck: begin 278 if (ack_received) begin -12- 279 in_xact_state_next = StIdle; ==> 280 in_xact_end = 1'b1; 281 end else if (in_token_received) begin -13- 282 // Handshake response is missing. 283 in_xact_state_next = ep_active ? StRcvdIn : StIdle; -14- ==> ==> 284 rollback_in_xact = 1'b1; 285 end else if (rx_pkt_end_i) begin -15- 286 // Includes NAK 287 in_xact_state_next = StIdle; ==> 288 rollback_in_xact = 1'b1; 289 end else begin 290 in_xact_state_next = StWaitAck; ==> 291 end 292 end 293 294 default: in_xact_state_next = StIdle; ==>

Branches:
-1--2--3--4--5--6--7--8--9--10--11--12--13--14--15-StatusTests
StIdle 1 - - - - - - - - - - - - - Covered T18,T19,T29
StIdle 0 - - - - - - - - - - - - - Covered T1,T2,T3
StRcvdIn - 1 - - - - - - - - - - - - Covered T31,T6,T102
StRcvdIn - 0 1 - - - - - - - - - - - Covered T32,T103,T104
StRcvdIn - 0 0 1 - - - - - - - - - - Covered T18,T19,T29
StRcvdIn - 0 0 0 - - - - - - - - - - Covered T4,T5,T6
StSendData - - - - 1 1 - - - - - - - - Covered T31,T6,T102
StSendData - - - - 1 0 1 - - - - - - - Not Covered
StSendData - - - - 1 0 0 - - - - - - - Covered T18,T19,T29
StSendData - - - - 0 - - - - - - - - - Covered T19,T29,T31
StWaitTxEnd - - - - - - - 1 - - - - - - Covered T18,T19,T29
StWaitTxEnd - - - - - - - 0 - - - - - - Covered T18,T19,T29
StWaitAckStart - - - - - - - - 1 - - - - - Covered T18,T19,T29
StWaitAckStart - - - - - - - - 0 1 - - - - Covered T19,T35,T97
StWaitAckStart - - - - - - - - 0 0 - - - - Covered T18,T19,T29
StWaitAck - - - - - - - - - - 1 - - - Covered T18,T19,T29
StWaitAck - - - - - - - - - - 0 1 1 - Not Covered
StWaitAck - - - - - - - - - - 0 1 0 - Not Covered
StWaitAck - - - - - - - - - - 0 0 - 1 Covered T19,T34,T105
StWaitAck - - - - - - - - - - 0 0 - 0 Covered T18,T19,T29
default - - - - - - - - - - - - - - Not Covered


303 if (!rst_ni) begin -1- 304 timeout_cntdown_q <= AckTimeoutCnt[AckTimeoutCntW-1:0]; ==> 305 end else begin 306 timeout_cntdown_q <= timeout_cntdown_d; ==>

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


311 if (!rst_ni) begin -1- 312 tx_data_o <= '0; ==> 313 end else begin 314 tx_data_o <= in_ep_data_i; ==>

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


319 if (!rst_ni) begin -1- 320 in_xact_state <= StIdle; ==> 321 in_ep_rollback_o <= 1'b0; 322 end else if (link_reset_i || !link_active_i) begin -2- 323 in_xact_state <= StIdle; ==> 324 in_ep_rollback_o <= 1'b0; 325 end else begin 326 in_xact_state <= in_xact_state_next; ==>

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


332 if (!rst_ni) begin -1- 333 in_ep_get_addr_o <= '0; ==> 334 end else begin 335 if (in_xact_state == StIdle) begin -2- 336 in_ep_get_addr_o <= '0; ==> 337 end else if ((in_xact_state == StSendData) && tx_data_get_i) begin -3- 338 in_ep_get_addr_o <= in_ep_get_addr_o + 1'b1; ==> 339 end MISSING_ELSE ==>

Branches:
-1--2--3-StatusTests
1 - - Covered T1,T2,T3
0 1 - Covered T1,T2,T3
0 0 1 Covered T19,T29,T31
0 0 0 Covered T18,T19,T29


344 if (!rst_ni) begin -1- 345 in_ep_newpkt_o <= 1'b0; ==> 346 in_ep_current_o <= '0; 347 has_data_q <= 1'b0; 348 end else begin 349 if (in_token_received) begin -2- 350 in_ep_current_o <= in_ep_current_d; ==> 351 in_ep_newpkt_o <= 1'b1; 352 has_data_q <= in_ep_has_data_i[in_ep_index_d]; 353 end else begin 354 in_ep_newpkt_o <= 1'b0; ==>

Branches:
-1--2-StatusTests
1 - Covered T1,T2,T3
0 1 Covered T18,T19,T29
0 0 Covered T1,T2,T3


363 if (setup_token_received && ep_active) begin -1- 364 data_toggle_d[in_ep_index_d] = 1'b1; ==> 365 end else if ((in_xact_state == StWaitAck) && ack_received) begin -2- 366 data_toggle_d[in_ep_index] = ~data_toggle_q[in_ep_index]; ==> 367 end MISSING_ELSE ==>

Branches:
-1--2-StatusTests
1 - Covered T20,T82,T43
0 1 Covered T18,T19,T29
0 0 Covered T1,T2,T3


369 if (in_datatog_we_i) begin -1- 370 data_toggle_d = (data_toggle_d & ~in_datatog_mask_i) | ==> 371 (in_datatog_status_i & in_datatog_mask_i); 372 end MISSING_ELSE ==>

Branches:
-1-StatusTests
1 Covered T18,T19,T106
0 Covered T1,T2,T3


378 if (!rst_ni) begin -1- 379 data_toggle_q <= '0; // Clear for all endpoints ==> 380 end else if (link_reset_i) begin -2- 381 data_toggle_q <= '0; // Clear for all endpoints ==> 382 end else begin 383 data_toggle_q <= data_toggle_d; ==>

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


388 if (!rst_ni) begin -1- 389 in_ep_data_get_o <= 1'b0; ==> 390 end else begin 391 if ((in_xact_state == StSendData) && tx_data_get_i) begin -2- 392 in_ep_data_get_o <= 1'b1; ==> 393 end else begin 394 in_ep_data_get_o <= 1'b0; ==>

Branches:
-1--2-StatusTests
1 - Covered T1,T2,T3
0 1 Covered T19,T29,T31
0 0 Covered T1,T2,T3


422 if (!rst_ni) event_nodata_in_q <= 1'b0; -1- ==> 423 else event_nodata_in_q <= in_starting & (ep_in_hw ? !in_ep_has_data_i[in_ep_index_d] : 1'b0); ==>

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


Assert Coverage for Module : usb_fs_nb_in_pe
TotalAttemptedPercentSucceeded/MatchedPercent
Assertions 1 1 100.00 1 100.00
Cover properties 0 0 0
Cover sequences 0 0 0
Total 1 1 100.00 1 100.00




Assertion Details

NameAttemptsReal SuccessesFailuresIncomplete
InXactStateValid_A 578377389 578088936 0 0


InXactStateValid_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 578377389 578088936 0 0
T1 9647 9557 0 0
T2 8147 8076 0 0
T3 7219 7156 0 0
T7 279126 279033 0 0
T17 9642 9576 0 0
T18 23955 23883 0 0
T19 44812 44731 0 0
T20 27564 27485 0 0
T21 10864 10805 0 0
T22 1813 1750 0 0

Line Coverage for Instance : tb.dut.usbdev_impl.u_usb_fs_nb_pe.u_usb_fs_nb_in_pe
Line No.TotalCoveredPercent
TOTAL11911798.32
CONT_ASSIGN11811100.00
CONT_ASSIGN13211100.00
CONT_ASSIGN13311100.00
CONT_ASSIGN13511100.00
CONT_ASSIGN14111100.00
CONT_ASSIGN14511100.00
CONT_ASSIGN14911100.00
CONT_ASSIGN15411100.00
CONT_ASSIGN16011100.00
CONT_ASSIGN16111100.00
CONT_ASSIGN16811100.00
CONT_ASSIGN16911100.00
CONT_ASSIGN17211100.00
CONT_ASSIGN17811100.00
CONT_ASSIGN18011100.00
CONT_ASSIGN18611100.00
CONT_ASSIGN18811100.00
CONT_ASSIGN18911100.00
ALWAYS199484695.83
ALWAYS30333100.00
ALWAYS31133100.00
ALWAYS31988100.00
ALWAYS33266100.00
ALWAYS34499100.00
ALWAYS36177100.00
CONT_ASSIGN37511100.00
ALWAYS37855100.00
ALWAYS38855100.00
CONT_ASSIGN40511100.00
CONT_ASSIGN41211100.00
ALWAYS42233100.00
CONT_ASSIGN42511100.00

117 118 1/1 assign in_ep_xact_end_o = in_xact_end; Tests: T1 T2 T3  119 120 // data toggle state 121 logic [NumInEps-1:0] data_toggle_q, data_toggle_d; 122 123 // endpoint data buffer 124 logic token_received, setup_token_received, in_token_received, ack_received, nak_received; 125 logic more_data_to_send; 126 logic ep_in_hw, ep_active; 127 logic [3:0] in_ep_current_d; 128 129 // More syntax so can compare with enum 130 usb_pid_type_e rx_pid_type; 131 usb_pid_e rx_pid; 132 1/1 assign rx_pid_type = usb_pid_type_e'(rx_pid_i[1:0]); Tests: T1 T2 T3  133 1/1 assign rx_pid = usb_pid_e'(rx_pid_i); Tests: T1 T2 T3  134 135 1/1 assign token_received = Tests: T1 T2 T3  136 rx_pkt_end_i && 137 rx_pkt_valid_i && 138 rx_pid_type == UsbPidTypeToken && 139 rx_addr_i == dev_addr_i; 140 141 1/1 assign setup_token_received = Tests: T1 T2 T3  142 token_received && 143 rx_pid == UsbPidSetup; 144 145 1/1 assign in_token_received = Tests: T1 T2 T3  146 token_received && 147 rx_pid == UsbPidIn; 148 149 1/1 assign ack_received = Tests: T1 T2 T3  150 rx_pkt_end_i && 151 rx_pkt_valid_i && 152 rx_pid == UsbPidAck; 153 154 1/1 assign nak_received = Tests: T1 T2 T3  155 rx_pkt_end_i && 156 rx_pkt_valid_i && 157 rx_pid == UsbPidNak; 158 159 // Is the specified endpoint actually implemented in hardware? 160 1/1 assign ep_in_hw = {1'b0, rx_endp_i} < NumInEps; Tests: T1 T2 T3  161 1/1 assign in_ep_current_d = ep_in_hw ? rx_endp_i : '0; Tests: T1 T2 T3  162 163 // Make widths work - in_ep_current_d/in_ep_current_o only hold implemented endpoint IDs. 164 // These signals can be used to index signals of NumInEps width. 165 // They are only valid if ep_active is set, i.e., if the specified endpoint is implemented. 166 logic [InEpW-1:0] in_ep_index; 167 logic [InEpW-1:0] in_ep_index_d; 168 1/1 assign in_ep_index = in_ep_current_o[0 +: InEpW]; Tests: T1 T2 T3  169 1/1 assign in_ep_index_d = in_ep_current_d[0 +: InEpW]; Tests: T1 T2 T3  170 171 // Is the endpoint active? 172 1/1 assign ep_active = in_ep_enabled_i[in_ep_index_d] & ep_in_hw; Tests: T1 T2 T3  173 174 // Retain whether the current IN transmission has associated data; an Isochronous transaction 175 // for which there was no packet data available must not raise a 'pkt_sent' interrupt. 176 logic has_data_q; 177 178 1/1 assign more_data_to_send = has_data_q & ~in_ep_data_done_i[in_ep_index]; Tests: T1 T2 T3  179 180 1/1 assign tx_data_avail_o = logic'(in_xact_state == StSendData) & more_data_to_send; Tests: T1 T2 T3  181 182 //////////////////////////////////////////////////////////////////////////////// 183 // Transaction is starting on this IN endpoint; capture the packet details. 184 //////////////////////////////////////////////////////////////////////////////// 185 logic in_starting; 186 1/1 assign in_starting = (in_xact_state == StIdle || in_xact_state == StWaitAck) && in_token_received; Tests: T1 T2 T3  187 188 1/1 assign in_xact_starting_o = in_starting & ep_active; Tests: T1 T2 T3  189 1/1 assign in_xact_start_ep_o = in_ep_current_d; Tests: T1 T2 T3  190 191 //////////////////////////////////////////////////////////////////////////////// 192 // in transaction state machine 193 //////////////////////////////////////////////////////////////////////////////// 194 195 logic [AckTimeoutCntW-1:0] timeout_cntdown_d, timeout_cntdown_q; 196 logic rollback_in_xact; 197 198 always_comb begin 199 1/1 in_xact_state_next = in_xact_state; Tests: T1 T2 T3  200 1/1 in_xact_end = 1'b0; Tests: T1 T2 T3  201 1/1 tx_pkt_start_o = 1'b0; Tests: T1 T2 T3  202 1/1 tx_pid_o = 4'b0000; Tests: T1 T2 T3  203 1/1 rollback_in_xact = 1'b0; Tests: T1 T2 T3  204 1/1 timeout_cntdown_d = AckTimeoutCnt[AckTimeoutCntW-1:0]; Tests: T1 T2 T3  205 1/1 unique case (in_xact_state) Tests: T1 T2 T3  206 StIdle: begin 207 1/1 if (ep_active && in_token_received) begin Tests: T1 T2 T3  208 1/1 in_xact_state_next = StRcvdIn; Tests: T18 T19 T29  209 end else begin 210 // Ignore tokens to inactive endpoints. Send no response. 211 1/1 in_xact_state_next = StIdle; Tests: T1 T2 T3  212 end 213 end 214 215 StRcvdIn: begin 216 1/1 tx_pkt_start_o = 1'b1; // Need to transmit NAK/STALL or DATA Tests: T18 T19 T29  217 218 1/1 if (in_ep_iso_i[in_ep_index]) begin Tests: T18 T19 T29  219 // ISO endpoint 220 // We always need to transmit. When no data is available, we send 221 // a zero-length packet. 222 // DATA0 always for full-speed isochronous endpoints 223 1/1 in_xact_state_next = StSendData; Tests: T31 T6 T102  224 1/1 tx_pid_o = {UsbPidData0}; Tests: T31 T6 T102  225 1/1 end else if (in_ep_stall_i[in_ep_index]) begin Tests: T18 T19 T29  226 1/1 in_xact_state_next = StIdle; Tests: T32 T103 T104  227 1/1 tx_pid_o = {UsbPidStall}; // STALL Tests: T32 T103 T104  228 1/1 end else if (has_data_q) begin Tests: T18 T19 T29  229 1/1 in_xact_state_next = StSendData; Tests: T18 T19 T29  230 1/1 tx_pid_o = {data_toggle_q[in_ep_index], 1'b0, {UsbPidTypeData}}; // DATA0/1 Tests: T18 T19 T29  231 end else begin 232 1/1 in_xact_state_next = StIdle; Tests: T4 T5 T6  233 1/1 tx_pid_o = {UsbPidNak}; // NAK Tests: T4 T5 T6  234 end 235 end 236 237 StSendData: begin 238 // Use &in_ep_get_addr so width can vary, looking for all ones 239 1/1 if ((!more_data_to_send) || ((&in_ep_get_addr_o) && tx_data_get_i)) begin Tests: T18 T19 T29  240 1/1 if (in_ep_iso_i[in_ep_index]) begin Tests: T18 T19 T29  241 1/1 in_xact_state_next = StIdle; // no ACK for ISO EPs Tests: T31 T6 T102  242 1/1 in_xact_end = has_data_q; Tests: T31 T6 T102  243 end else begin 244 1/1 if (tx_pkt_end_i) begin Tests: T18 T19 T29  245 excluded in_xact_state_next = StWaitAckStart; Exclude Annotation: VC_COV_UNR 246 end else begin 247 1/1 in_xact_state_next = StWaitTxEnd; Tests: T18 T19 T29  248 end 249 end 250 end else begin 251 1/1 in_xact_state_next = StSendData; Tests: T19 T29 T31  252 end 253 end 254 255 StWaitTxEnd: begin 256 1/1 if (tx_pkt_end_i) begin Tests: T18 T19 T29  257 1/1 in_xact_state_next = StWaitAckStart; Tests: T18 T19 T29  258 end MISSING_ELSE 259 end 260 261 StWaitAckStart: begin 262 // The spec says we have up to 18 bit times to wait for the host 263 // response. If it doesn't arrive in time, we must invalidate the 264 // transaction. 265 1/1 timeout_cntdown_d = timeout_cntdown_q - 1'b1; Tests: T18 T19 T29  266 267 1/1 if (rx_pkt_start_i) begin Tests: T18 T19 T29  268 1/1 in_xact_state_next = StWaitAck; Tests: T18 T19 T29  269 1/1 end else if (timeout_cntdown_q == '0) begin Tests: T18 T19 T29  270 1/1 in_xact_state_next = StIdle; Tests: T19 T35 T97  271 1/1 rollback_in_xact = 1'b1; Tests: T19 T35 T97  272 end else begin 273 1/1 in_xact_state_next = StWaitAckStart; Tests: T18 T19 T29  274 end 275 end 276 277 StWaitAck: begin 278 1/1 if (ack_received) begin Tests: T18 T19 T29  279 1/1 in_xact_state_next = StIdle; Tests: T18 T19 T29  280 1/1 in_xact_end = 1'b1; Tests: T18 T19 T29  281 1/1 end else if (in_token_received) begin Tests: T18 T19 T29  282 // Handshake response is missing. 283 0/1 ==> in_xact_state_next = ep_active ? StRcvdIn : StIdle; 284 0/1 ==> rollback_in_xact = 1'b1; 285 1/1 end else if (rx_pkt_end_i) begin Tests: T18 T19 T29  286 // Includes NAK 287 1/1 in_xact_state_next = StIdle; Tests: T19 T34 T105  288 1/1 rollback_in_xact = 1'b1; Tests: T19 T34 T105  289 end else begin 290 1/1 in_xact_state_next = StWaitAck; Tests: T18 T19 T29  291 end 292 end 293 294 default: in_xact_state_next = StIdle; Exclude Annotation: VC_COV_UNR 295 endcase 296 end 297 298 `ASSERT(InXactStateValid_A, 299 in_xact_state inside {StIdle, StRcvdIn, StSendData, StWaitTxEnd, StWaitAckStart, StWaitAck}, 300 clk_48mhz_i) 301 302 always_ff @(posedge clk_48mhz_i or negedge rst_ni) begin 303 1/1 if (!rst_ni) begin Tests: T1 T2 T3  304 1/1 timeout_cntdown_q <= AckTimeoutCnt[AckTimeoutCntW-1:0]; Tests: T1 T2 T3  305 end else begin 306 1/1 timeout_cntdown_q <= timeout_cntdown_d; Tests: T1 T2 T3  307 end 308 end 309 310 always_ff @(posedge clk_48mhz_i or negedge rst_ni) begin 311 1/1 if (!rst_ni) begin Tests: T1 T2 T3  312 1/1 tx_data_o <= '0; Tests: T1 T2 T3  313 end else begin 314 1/1 tx_data_o <= in_ep_data_i; Tests: T1 T2 T3  315 end 316 end 317 318 always_ff @(posedge clk_48mhz_i or negedge rst_ni) begin 319 1/1 if (!rst_ni) begin Tests: T1 T2 T3  320 1/1 in_xact_state <= StIdle; Tests: T1 T2 T3  321 1/1 in_ep_rollback_o <= 1'b0; Tests: T1 T2 T3  322 1/1 end else if (link_reset_i || !link_active_i) begin Tests: T1 T2 T3  323 1/1 in_xact_state <= StIdle; Tests: T1 T2 T3  324 1/1 in_ep_rollback_o <= 1'b0; Tests: T1 T2 T3  325 end else begin 326 1/1 in_xact_state <= in_xact_state_next; Tests: T1 T2 T3  327 1/1 in_ep_rollback_o <= rollback_in_xact; Tests: T1 T2 T3  328 end 329 end 330 331 always_ff @(posedge clk_48mhz_i or negedge rst_ni) begin 332 1/1 if (!rst_ni) begin Tests: T1 T2 T3  333 1/1 in_ep_get_addr_o <= '0; Tests: T1 T2 T3  334 end else begin 335 1/1 if (in_xact_state == StIdle) begin Tests: T1 T2 T3  336 1/1 in_ep_get_addr_o <= '0; Tests: T1 T2 T3  337 1/1 end else if ((in_xact_state == StSendData) && tx_data_get_i) begin Tests: T18 T19 T29  338 1/1 in_ep_get_addr_o <= in_ep_get_addr_o + 1'b1; Tests: T19 T29 T31  339 end MISSING_ELSE 340 end 341 end 342 343 always_ff @(posedge clk_48mhz_i or negedge rst_ni) begin 344 1/1 if (!rst_ni) begin Tests: T1 T2 T3  345 1/1 in_ep_newpkt_o <= 1'b0; Tests: T1 T2 T3  346 1/1 in_ep_current_o <= '0; Tests: T1 T2 T3  347 1/1 has_data_q <= 1'b0; Tests: T1 T2 T3  348 end else begin 349 1/1 if (in_token_received) begin Tests: T1 T2 T3  350 1/1 in_ep_current_o <= in_ep_current_d; Tests: T18 T19 T29  351 1/1 in_ep_newpkt_o <= 1'b1; Tests: T18 T19 T29  352 1/1 has_data_q <= in_ep_has_data_i[in_ep_index_d]; Tests: T18 T19 T29  353 end else begin 354 1/1 in_ep_newpkt_o <= 1'b0; Tests: T1 T2 T3  355 end 356 end 357 end 358 359 // Updating of data toggles 360 always_comb begin : proc_data_toggle_d 361 1/1 data_toggle_d = data_toggle_q; Tests: T1 T2 T3  362 363 1/1 if (setup_token_received && ep_active) begin Tests: T1 T2 T3  364 1/1 data_toggle_d[in_ep_index_d] = 1'b1; Tests: T20 T82 T43  365 1/1 end else if ((in_xact_state == StWaitAck) && ack_received) begin Tests: T1 T2 T3  366 1/1 data_toggle_d[in_ep_index] = ~data_toggle_q[in_ep_index]; Tests: T18 T19 T29  367 end MISSING_ELSE 368 // Selective modification by software 369 1/1 if (in_datatog_we_i) begin Tests: T1 T2 T3  370 1/1 data_toggle_d = (data_toggle_d & ~in_datatog_mask_i) | Tests: T18 T19 T106  371 (in_datatog_status_i & in_datatog_mask_i); 372 end MISSING_ELSE 373 end 374 // Supply current data toggles to register interface 375 1/1 assign in_data_toggle_o = data_toggle_q; Tests: T1 T2 T3  376 377 always_ff @(posedge clk_48mhz_i or negedge rst_ni) begin 378 1/1 if (!rst_ni) begin Tests: T1 T2 T3  379 1/1 data_toggle_q <= '0; // Clear for all endpoints Tests: T1 T2 T3  380 1/1 end else if (link_reset_i) begin Tests: T1 T2 T3  381 1/1 data_toggle_q <= '0; // Clear for all endpoints Tests: T1 T2 T3  382 end else begin 383 1/1 data_toggle_q <= data_toggle_d; Tests: T1 T2 T3  384 end 385 end 386 387 always_ff @(posedge clk_48mhz_i or negedge rst_ni) begin 388 1/1 if (!rst_ni) begin Tests: T1 T2 T3  389 1/1 in_ep_data_get_o <= 1'b0; Tests: T1 T2 T3  390 end else begin 391 1/1 if ((in_xact_state == StSendData) && tx_data_get_i) begin Tests: T1 T2 T3  392 1/1 in_ep_data_get_o <= 1'b1; Tests: T19 T29 T31  393 end else begin 394 1/1 in_ep_data_get_o <= 1'b0; Tests: T1 T2 T3  395 end 396 end 397 end 398 399 //////////////////////////////////////////////////////////////////////////////// 400 // Count non-Isochronous IN transactions not receiving a handshake response. 401 // 402 // - no handshake response within the timeout period 403 // - packet reception started within the timeout period but it was not ACK/NAK. 404 //////////////////////////////////////////////////////////////////////////////// 405 1/1 assign event_timeout_in_o = (in_xact_state == StWaitAckStart || Tests: T1 T2 T3  406 (in_xact_state == StWaitAck && rx_pkt_end_i && !nak_received)) 407 & rollback_in_xact; 408 409 //////////////////////////////////////////////////////////////////////////////// 410 // Count IN transactions that are actively NAKed by the host. 411 //////////////////////////////////////////////////////////////////////////////// 412 1/1 assign event_nak_in_o = (in_xact_state == StWaitAck) && nak_received; Tests: T1 T2 T3  413 414 //////////////////////////////////////////////////////////////////////////////// 415 // Count the number of IN requests for which data is not available, including 416 // endpoints which are supported but not presently enabled/configured. 417 // (These may be ignored using the event counter configuration if required.) 418 //////////////////////////////////////////////////////////////////////////////// 419 logic event_nodata_in_q; 420 // This event signal must be delayed by a single cycle so that 'in_ep_current_o' becomes valid. 421 always_ff @(posedge clk_48mhz_i or negedge rst_ni) begin 422 2/2 if (!rst_ni) event_nodata_in_q <= 1'b0; Tests: T1 T2 T3  | T1 T2 T3  423 1/1 else event_nodata_in_q <= in_starting & (ep_in_hw ? !in_ep_has_data_i[in_ep_index_d] : 1'b0); Tests: T1 T2 T3  424 end 425 1/1 assign event_nodata_in_o = event_nodata_in_q; Tests: T1 T2 T3 

Cond Coverage for Instance : tb.dut.usbdev_impl.u_usb_fs_nb_pe.u_usb_fs_nb_in_pe
TotalCoveredPercent
Conditions11410894.74
Logical11410894.74
Non-Logical00
Event00

 LINE       135
 EXPRESSION (rx_pkt_end_i && rx_pkt_valid_i && (rx_pid_type == UsbPidTypeToken) && (rx_addr_i == dev_addr_i))
             ------1-----    -------2------    ----------------3---------------    ------------4------------
-1--2--3--4-StatusTests
0111CoveredT1,T2,T18
1011CoveredT69,T107,T73
1101CoveredT1,T2,T18
1110CoveredT20,T21,T23
1111CoveredT1,T2,T18

 LINE       135
 SUB-EXPRESSION (rx_pid_type == UsbPidTypeToken)
                ----------------1---------------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT1,T2,T17

 LINE       135
 SUB-EXPRESSION (rx_addr_i == dev_addr_i)
                ------------1------------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT1,T2,T3

 LINE       141
 EXPRESSION (token_received && (rx_pid == UsbPidSetup))
             -------1------    -----------2-----------
-1--2-StatusTests
01CoveredT2,T20,T23
10CoveredT1,T18,T19
11CoveredT2,T20,T24

 LINE       141
 SUB-EXPRESSION (rx_pid == UsbPidSetup)
                -----------1-----------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT2,T20,T23

 LINE       145
 EXPRESSION (token_received && (rx_pid == UsbPidIn))
             -------1------    ----------2---------
-1--2-StatusTests
01CoveredT18,T19,T20
10CoveredT1,T2,T18
11CoveredT18,T19,T29

 LINE       145
 SUB-EXPRESSION (rx_pid == UsbPidIn)
                ----------1---------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT18,T19,T20

 LINE       149
 EXPRESSION (rx_pkt_end_i && rx_pkt_valid_i && (rx_pid == UsbPidAck))
             ------1-----    -------2------    ----------3----------
-1--2--3-StatusTests
011CoveredT18,T19,T29
101CoveredT77,T108,T109
110CoveredT1,T2,T17
111CoveredT18,T19,T29

 LINE       149
 SUB-EXPRESSION (rx_pid == UsbPidAck)
                ----------1----------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT18,T19,T20

 LINE       154
 EXPRESSION (rx_pkt_end_i && rx_pkt_valid_i && (rx_pid == UsbPidNak))
             ------1-----    -------2------    ----------3----------
-1--2--3-StatusTests
011CoveredT19,T34,T105
101CoveredT110,T108,T109
110CoveredT1,T2,T17
111CoveredT19,T105,T111

 LINE       154
 SUB-EXPRESSION (rx_pid == UsbPidNak)
                ----------1----------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT18,T19,T29

 LINE       161
 EXPRESSION (ep_in_hw ? rx_endp_i : '0)
             ----1---
-1-StatusTests
0CoveredT21,T8,T112
1CoveredT1,T2,T3

 LINE       172
 EXPRESSION (in_ep_enabled_i[in_ep_index_d] & ep_in_hw)
             ---------------1--------------   ----2---
-1--2-StatusTests
01CoveredT1,T2,T3
10CoveredT113,T74,T114
11CoveredT18,T19,T20

 LINE       178
 EXPRESSION (has_data_q & ((~in_ep_data_done_i[in_ep_index])))
             -----1----   -----------------2-----------------
-1--2-StatusTests
01CoveredT90,T114,T115
10CoveredT18,T19,T29
11CoveredT19,T29,T31

 LINE       180
 EXPRESSION ((logic'((in_xact_state == StSendData))) & more_data_to_send)
             -------------------1-------------------   --------2--------
-1--2-StatusTests
01CoveredT19,T29,T31
10CoveredT18,T19,T29
11CoveredT19,T29,T31

 LINE       186
 EXPRESSION (((in_xact_state == StIdle) || (in_xact_state == StWaitAck)) && in_token_received)
             -----------------------------1-----------------------------    --------2--------
-1--2-StatusTests
01Not Covered
10CoveredT1,T2,T3
11CoveredT18,T19,T29

 LINE       186
 SUB-EXPRESSION ((in_xact_state == StIdle) || (in_xact_state == StWaitAck))
                 ------------1------------    --------------2-------------
-1--2-StatusTests
00CoveredT18,T19,T29
01CoveredT18,T19,T29
10CoveredT1,T2,T3

 LINE       186
 SUB-EXPRESSION (in_xact_state == StIdle)
                ------------1------------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT1,T2,T3

 LINE       186
 SUB-EXPRESSION (in_xact_state == StWaitAck)
                --------------1-------------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT18,T19,T29

 LINE       188
 EXPRESSION (in_starting & ep_active)
             -----1-----   ----2----
-1--2-StatusTests
01CoveredT18,T19,T20
10CoveredT114,T115,T116
11CoveredT18,T19,T29

 LINE       207
 EXPRESSION (ep_active && in_token_received)
             ----1----    --------2--------
-1--2-StatusTests
01CoveredT114,T115,T116
10CoveredT18,T19,T20
11CoveredT18,T19,T29

 LINE       239
 EXPRESSION (((!more_data_to_send)) || (((&in_ep_get_addr_o)) && tx_data_get_i))
             -----------1----------    --------------------2-------------------
-1--2-StatusTests
00CoveredT19,T29,T31
01CoveredT117,T4,T5
10CoveredT18,T19,T29

 LINE       239
 SUB-EXPRESSION (((&in_ep_get_addr_o)) && tx_data_get_i)
                 ----------1----------    ------2------
-1--2-StatusTests
01CoveredT19,T29,T31
10CoveredT117,T4,T5
11CoveredT117,T4,T5

 LINE       269
 EXPRESSION (timeout_cntdown_q == '0)
            ------------1------------
-1-StatusTests
0CoveredT18,T19,T29
1CoveredT19,T35,T97

 LINE       283
 EXPRESSION (ep_active ? StRcvdIn : StIdle)
             ----1----
-1-StatusTests
0Not Covered
1Not Covered

 LINE       322
 EXPRESSION (link_reset_i || ((!link_active_i)))
             ------1-----    ---------2--------
-1--2-StatusTests
00CoveredT1,T2,T3
01CoveredT1,T2,T3
10CoveredT1,T2,T3

 LINE       335
 EXPRESSION (in_xact_state == StIdle)
            ------------1------------
-1-StatusTests
0CoveredT18,T19,T29
1CoveredT1,T2,T3

 LINE       337
 EXPRESSION ((in_xact_state == StSendData) && tx_data_get_i)
             --------------1--------------    ------2------
-1--2-StatusTestsExclude Annotation
01Excluded VC_COV_UNR
10CoveredT18,T19,T29
11CoveredT19,T29,T31

 LINE       337
 SUB-EXPRESSION (in_xact_state == StSendData)
                --------------1--------------
-1-StatusTests
0CoveredT18,T19,T29
1CoveredT18,T19,T29

 LINE       363
 EXPRESSION (setup_token_received && ep_active)
             ----------1---------    ----2----
-1--2-StatusTests
01CoveredT18,T19,T20
10CoveredT2,T24,T72
11CoveredT20,T82,T43

 LINE       365
 EXPRESSION ((in_xact_state == StWaitAck) && ack_received)
             --------------1-------------    ------2-----
-1--2-StatusTests
01Not Covered
10CoveredT18,T19,T29
11CoveredT18,T19,T29

 LINE       365
 SUB-EXPRESSION (in_xact_state == StWaitAck)
                --------------1-------------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT18,T19,T29

 LINE       391
 EXPRESSION ((in_xact_state == StSendData) && tx_data_get_i)
             --------------1--------------    ------2------
-1--2-StatusTests
01Not Covered
10CoveredT18,T19,T29
11CoveredT19,T29,T31

 LINE       391
 SUB-EXPRESSION (in_xact_state == StSendData)
                --------------1--------------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT18,T19,T29

 LINE       405
 EXPRESSION (((in_xact_state == StWaitAckStart) || ((in_xact_state == StWaitAck) && rx_pkt_end_i && ((!nak_received)))) & rollback_in_xact)
             -----------------------------------------------------1----------------------------------------------------   --------2-------
-1--2-StatusTests
01CoveredT19,T105,T111
10CoveredT18,T19,T29
11CoveredT19,T34,T35

 LINE       405
 SUB-EXPRESSION ((in_xact_state == StWaitAckStart) || ((in_xact_state == StWaitAck) && rx_pkt_end_i && ((!nak_received))))
                 ----------------1----------------    ---------------------------------2---------------------------------
-1--2-StatusTests
00CoveredT1,T2,T3
01CoveredT18,T19,T29
10CoveredT18,T19,T29

 LINE       405
 SUB-EXPRESSION (in_xact_state == StWaitAckStart)
                ----------------1----------------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT18,T19,T29

 LINE       405
 SUB-EXPRESSION ((in_xact_state == StWaitAck) && rx_pkt_end_i && ((!nak_received)))
                 --------------1-------------    ------2-----    --------3--------
-1--2--3-StatusTests
011CoveredT1,T2,T17
101CoveredT18,T19,T29
110CoveredT19,T105,T111
111CoveredT18,T19,T29

 LINE       405
 SUB-EXPRESSION (in_xact_state == StWaitAck)
                --------------1-------------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT18,T19,T29

 LINE       412
 EXPRESSION ((in_xact_state == StWaitAck) && nak_received)
             --------------1-------------    ------2-----
-1--2-StatusTests
01Not Covered
10CoveredT18,T19,T29
11CoveredT19,T105,T111

 LINE       412
 SUB-EXPRESSION (in_xact_state == StWaitAck)
                --------------1-------------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT18,T19,T29

 LINE       423
 EXPRESSION (in_starting & (ep_in_hw ? ((!in_ep_has_data_i[in_ep_index_d])) : 1'b0))
             -----1-----   ----------------------------2---------------------------
-1--2-StatusTests
01CoveredT1,T2,T3
10CoveredT18,T19,T29
11CoveredT4,T5,T6

 LINE       423
 SUB-EXPRESSION (ep_in_hw ? ((!in_ep_has_data_i[in_ep_index_d])) : 1'b0)
                 ----1---
-1-StatusTests
0CoveredT21,T8,T112
1CoveredT1,T2,T3

FSM Coverage for Instance : tb.dut.usbdev_impl.u_usb_fs_nb_pe.u_usb_fs_nb_in_pe
Summary for FSM :: in_xact_state
TotalCoveredPercent
States 6 6 100.00 (Not included in score)
Transitions 11 10 90.91
Sequences 0 0

State, Transition and Sequence Details for FSM :: in_xact_state
statesLine No.CoveredTests
StIdle 323 Covered T1,T2,T3
StRcvdIn 208 Covered T18,T19,T29
StSendData 223 Covered T18,T19,T29
StWaitAck 268 Covered T18,T19,T29
StWaitAckStart 245 Covered T18,T19,T29
StWaitTxEnd 247 Covered T18,T19,T29


transitionsLine No.CoveredTestsExclude Annotation
StIdle->StRcvdIn 208 Covered T18,T19,T29
StRcvdIn->StIdle 323 Covered T32,T4,T103
StRcvdIn->StSendData 223 Covered T18,T19,T29
StSendData->StIdle 323 Covered T31,T6,T102
StSendData->StWaitAckStart 245 Excluded VC_COV_UNR
StSendData->StWaitTxEnd 247 Covered T18,T19,T29
StWaitAck->StIdle 323 Covered T18,T19,T29
StWaitAck->StRcvdIn 283 Not Covered
StWaitAckStart->StIdle 323 Covered T19,T35,T97
StWaitAckStart->StWaitAck 268 Covered T18,T19,T29
StWaitTxEnd->StIdle 323 Covered T118,T119,T120
StWaitTxEnd->StWaitAckStart 257 Covered T18,T19,T29



Branch Coverage for Instance : tb.dut.usbdev_impl.u_usb_fs_nb_pe.u_usb_fs_nb_in_pe
Line No.TotalCoveredPercent
Branches 48 46 95.83
TERNARY 161 2 2 100.00
CASE 205 19 17 89.47
IF 303 2 2 100.00
IF 311 2 2 100.00
IF 319 3 3 100.00
IF 332 4 4 100.00
IF 344 3 3 100.00
IF 363 3 3 100.00
IF 369 2 2 100.00
IF 378 3 3 100.00
IF 388 3 3 100.00
IF 422 2 2 100.00


161 assign in_ep_current_d = ep_in_hw ? rx_endp_i : '0; -1- ==> ==>

Branches:
-1-StatusTests
1 Covered T1,T2,T3
0 Covered T21,T8,T112


205 unique case (in_xact_state) -1- 206 StIdle: begin 207 if (ep_active && in_token_received) begin -2- 208 in_xact_state_next = StRcvdIn; ==> 209 end else begin 210 // Ignore tokens to inactive endpoints. Send no response. 211 in_xact_state_next = StIdle; ==> 212 end 213 end 214 215 StRcvdIn: begin 216 tx_pkt_start_o = 1'b1; // Need to transmit NAK/STALL or DATA 217 218 if (in_ep_iso_i[in_ep_index]) begin -3- 219 // ISO endpoint 220 // We always need to transmit. When no data is available, we send 221 // a zero-length packet. 222 // DATA0 always for full-speed isochronous endpoints 223 in_xact_state_next = StSendData; ==> 224 tx_pid_o = {UsbPidData0}; 225 end else if (in_ep_stall_i[in_ep_index]) begin -4- 226 in_xact_state_next = StIdle; ==> 227 tx_pid_o = {UsbPidStall}; // STALL 228 end else if (has_data_q) begin -5- 229 in_xact_state_next = StSendData; ==> 230 tx_pid_o = {data_toggle_q[in_ep_index], 1'b0, {UsbPidTypeData}}; // DATA0/1 231 end else begin 232 in_xact_state_next = StIdle; ==> 233 tx_pid_o = {UsbPidNak}; // NAK 234 end 235 end 236 237 StSendData: begin 238 // Use &in_ep_get_addr so width can vary, looking for all ones 239 if ((!more_data_to_send) || ((&in_ep_get_addr_o) && tx_data_get_i)) begin -6- 240 if (in_ep_iso_i[in_ep_index]) begin -7- 241 in_xact_state_next = StIdle; // no ACK for ISO EPs ==> 242 in_xact_end = has_data_q; 243 end else begin 244 if (tx_pkt_end_i) begin -8- 245 in_xact_state_next = StWaitAckStart; ==> (Excluded) Exclude Annotation: VC_COV_UNR 246 end else begin 247 in_xact_state_next = StWaitTxEnd; ==> 248 end 249 end 250 end else begin 251 in_xact_state_next = StSendData; ==> 252 end 253 end 254 255 StWaitTxEnd: begin 256 if (tx_pkt_end_i) begin -9- 257 in_xact_state_next = StWaitAckStart; ==> 258 end MISSING_ELSE ==> 259 end 260 261 StWaitAckStart: begin 262 // The spec says we have up to 18 bit times to wait for the host 263 // response. If it doesn't arrive in time, we must invalidate the 264 // transaction. 265 timeout_cntdown_d = timeout_cntdown_q - 1'b1; 266 267 if (rx_pkt_start_i) begin -10- 268 in_xact_state_next = StWaitAck; ==> 269 end else if (timeout_cntdown_q == '0) begin -11- 270 in_xact_state_next = StIdle; ==> 271 rollback_in_xact = 1'b1; 272 end else begin 273 in_xact_state_next = StWaitAckStart; ==> 274 end 275 end 276 277 StWaitAck: begin 278 if (ack_received) begin -12- 279 in_xact_state_next = StIdle; ==> 280 in_xact_end = 1'b1; 281 end else if (in_token_received) begin -13- 282 // Handshake response is missing. 283 in_xact_state_next = ep_active ? StRcvdIn : StIdle; -14- ==> ==> 284 rollback_in_xact = 1'b1; 285 end else if (rx_pkt_end_i) begin -15- 286 // Includes NAK 287 in_xact_state_next = StIdle; ==> 288 rollback_in_xact = 1'b1; 289 end else begin 290 in_xact_state_next = StWaitAck; ==> 291 end 292 end 293 294 default: in_xact_state_next = StIdle; ==> (Excluded) Exclude Annotation: VC_COV_UNR

Branches:
-1--2--3--4--5--6--7--8--9--10--11--12--13--14--15-StatusTestsExclude Annotation
StIdle 1 - - - - - - - - - - - - - Covered T18,T19,T29
StIdle 0 - - - - - - - - - - - - - Covered T1,T2,T3
StRcvdIn - 1 - - - - - - - - - - - - Covered T31,T6,T102
StRcvdIn - 0 1 - - - - - - - - - - - Covered T32,T103,T104
StRcvdIn - 0 0 1 - - - - - - - - - - Covered T18,T19,T29
StRcvdIn - 0 0 0 - - - - - - - - - - Covered T4,T5,T6
StSendData - - - - 1 1 - - - - - - - - Covered T31,T6,T102
StSendData - - - - 1 0 1 - - - - - - - Excluded VC_COV_UNR
StSendData - - - - 1 0 0 - - - - - - - Covered T18,T19,T29
StSendData - - - - 0 - - - - - - - - - Covered T19,T29,T31
StWaitTxEnd - - - - - - - 1 - - - - - - Covered T18,T19,T29
StWaitTxEnd - - - - - - - 0 - - - - - - Covered T18,T19,T29
StWaitAckStart - - - - - - - - 1 - - - - - Covered T18,T19,T29
StWaitAckStart - - - - - - - - 0 1 - - - - Covered T19,T35,T97
StWaitAckStart - - - - - - - - 0 0 - - - - Covered T18,T19,T29
StWaitAck - - - - - - - - - - 1 - - - Covered T18,T19,T29
StWaitAck - - - - - - - - - - 0 1 1 - Not Covered
StWaitAck - - - - - - - - - - 0 1 0 - Not Covered
StWaitAck - - - - - - - - - - 0 0 - 1 Covered T19,T34,T105
StWaitAck - - - - - - - - - - 0 0 - 0 Covered T18,T19,T29
default - - - - - - - - - - - - - - Excluded VC_COV_UNR


303 if (!rst_ni) begin -1- 304 timeout_cntdown_q <= AckTimeoutCnt[AckTimeoutCntW-1:0]; ==> 305 end else begin 306 timeout_cntdown_q <= timeout_cntdown_d; ==>

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


311 if (!rst_ni) begin -1- 312 tx_data_o <= '0; ==> 313 end else begin 314 tx_data_o <= in_ep_data_i; ==>

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


319 if (!rst_ni) begin -1- 320 in_xact_state <= StIdle; ==> 321 in_ep_rollback_o <= 1'b0; 322 end else if (link_reset_i || !link_active_i) begin -2- 323 in_xact_state <= StIdle; ==> 324 in_ep_rollback_o <= 1'b0; 325 end else begin 326 in_xact_state <= in_xact_state_next; ==>

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


332 if (!rst_ni) begin -1- 333 in_ep_get_addr_o <= '0; ==> 334 end else begin 335 if (in_xact_state == StIdle) begin -2- 336 in_ep_get_addr_o <= '0; ==> 337 end else if ((in_xact_state == StSendData) && tx_data_get_i) begin -3- 338 in_ep_get_addr_o <= in_ep_get_addr_o + 1'b1; ==> 339 end MISSING_ELSE ==>

Branches:
-1--2--3-StatusTests
1 - - Covered T1,T2,T3
0 1 - Covered T1,T2,T3
0 0 1 Covered T19,T29,T31
0 0 0 Covered T18,T19,T29


344 if (!rst_ni) begin -1- 345 in_ep_newpkt_o <= 1'b0; ==> 346 in_ep_current_o <= '0; 347 has_data_q <= 1'b0; 348 end else begin 349 if (in_token_received) begin -2- 350 in_ep_current_o <= in_ep_current_d; ==> 351 in_ep_newpkt_o <= 1'b1; 352 has_data_q <= in_ep_has_data_i[in_ep_index_d]; 353 end else begin 354 in_ep_newpkt_o <= 1'b0; ==>

Branches:
-1--2-StatusTests
1 - Covered T1,T2,T3
0 1 Covered T18,T19,T29
0 0 Covered T1,T2,T3


363 if (setup_token_received && ep_active) begin -1- 364 data_toggle_d[in_ep_index_d] = 1'b1; ==> 365 end else if ((in_xact_state == StWaitAck) && ack_received) begin -2- 366 data_toggle_d[in_ep_index] = ~data_toggle_q[in_ep_index]; ==> 367 end MISSING_ELSE ==>

Branches:
-1--2-StatusTests
1 - Covered T20,T82,T43
0 1 Covered T18,T19,T29
0 0 Covered T1,T2,T3


369 if (in_datatog_we_i) begin -1- 370 data_toggle_d = (data_toggle_d & ~in_datatog_mask_i) | ==> 371 (in_datatog_status_i & in_datatog_mask_i); 372 end MISSING_ELSE ==>

Branches:
-1-StatusTests
1 Covered T18,T19,T106
0 Covered T1,T2,T3


378 if (!rst_ni) begin -1- 379 data_toggle_q <= '0; // Clear for all endpoints ==> 380 end else if (link_reset_i) begin -2- 381 data_toggle_q <= '0; // Clear for all endpoints ==> 382 end else begin 383 data_toggle_q <= data_toggle_d; ==>

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


388 if (!rst_ni) begin -1- 389 in_ep_data_get_o <= 1'b0; ==> 390 end else begin 391 if ((in_xact_state == StSendData) && tx_data_get_i) begin -2- 392 in_ep_data_get_o <= 1'b1; ==> 393 end else begin 394 in_ep_data_get_o <= 1'b0; ==>

Branches:
-1--2-StatusTests
1 - Covered T1,T2,T3
0 1 Covered T19,T29,T31
0 0 Covered T1,T2,T3


422 if (!rst_ni) event_nodata_in_q <= 1'b0; -1- ==> 423 else event_nodata_in_q <= in_starting & (ep_in_hw ? !in_ep_has_data_i[in_ep_index_d] : 1'b0); ==>

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


Assert Coverage for Instance : tb.dut.usbdev_impl.u_usb_fs_nb_pe.u_usb_fs_nb_in_pe
TotalAttemptedPercentSucceeded/MatchedPercent
Assertions 1 1 100.00 1 100.00
Cover properties 0 0 0
Cover sequences 0 0 0
Total 1 1 100.00 1 100.00




Assertion Details

NameAttemptsReal SuccessesFailuresIncomplete
InXactStateValid_A 578377389 578088936 0 0


InXactStateValid_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 578377389 578088936 0 0
T1 9647 9557 0 0
T2 8147 8076 0 0
T3 7219 7156 0 0
T7 279126 279033 0 0
T17 9642 9576 0 0
T18 23955 23883 0 0
T19 44812 44731 0 0
T20 27564 27485 0 0
T21 10864 10805 0 0
T22 1813 1750 0 0

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