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
96.14 98.32 95.61 90.91 95.83 100.00


Instance's subtree :
SCORELINECONDTOGGLEFSMBRANCHASSERT
96.14 98.32 95.61 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: T30 T31 T32  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: T30 T31 T32  217 218 1/1 if (in_ep_iso_i[in_ep_index]) begin Tests: T30 T31 T32  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: T30 T6 T111  224 1/1 tx_pid_o = {UsbPidData0}; Tests: T30 T6 T111  225 1/1 end else if (in_ep_stall_i[in_ep_index]) begin Tests: T31 T32 T34  226 1/1 in_xact_state_next = StIdle; Tests: T31 T112 T113  227 1/1 tx_pid_o = {UsbPidStall}; // STALL Tests: T31 T112 T113  228 1/1 end else if (has_data_q) begin Tests: T32 T34 T35  229 1/1 in_xact_state_next = StSendData; Tests: T32 T34 T35  230 1/1 tx_pid_o = {data_toggle_q[in_ep_index], 1'b0, {UsbPidTypeData}}; // DATA0/1 Tests: T32 T34 T35  231 end else begin 232 1/1 in_xact_state_next = StIdle; Tests: T4 T5 T114  233 1/1 tx_pid_o = {UsbPidNak}; // NAK Tests: T4 T5 T114  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: T30 T32 T34  240 1/1 if (in_ep_iso_i[in_ep_index]) begin Tests: T30 T32 T34  241 1/1 in_xact_state_next = StIdle; // no ACK for ISO EPs Tests: T30 T6 T111  242 1/1 in_xact_end = has_data_q; Tests: T30 T6 T111  243 end else begin 244 1/1 if (tx_pkt_end_i) begin Tests: T32 T34 T35  245 0/1 ==> in_xact_state_next = StWaitAckStart; 246 end else begin 247 1/1 in_xact_state_next = StWaitTxEnd; Tests: T32 T34 T35  248 end 249 end 250 end else begin 251 1/1 in_xact_state_next = StSendData; Tests: T30 T32 T34  252 end 253 end 254 255 StWaitTxEnd: begin 256 1/1 if (tx_pkt_end_i) begin Tests: T32 T34 T35  257 1/1 in_xact_state_next = StWaitAckStart; Tests: T32 T34 T35  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: T32 T34 T35  266 267 1/1 if (rx_pkt_start_i) begin Tests: T32 T34 T35  268 1/1 in_xact_state_next = StWaitAck; Tests: T32 T34 T35  269 1/1 end else if (timeout_cntdown_q == '0) begin Tests: T32 T34 T35  270 1/1 in_xact_state_next = StIdle; Tests: T37 T65 T71  271 1/1 rollback_in_xact = 1'b1; Tests: T37 T65 T71  272 end else begin 273 1/1 in_xact_state_next = StWaitAckStart; Tests: T32 T34 T35  274 end 275 end 276 277 StWaitAck: begin 278 1/1 if (ack_received) begin Tests: T32 T34 T35  279 1/1 in_xact_state_next = StIdle; Tests: T32 T34 T37  280 1/1 in_xact_end = 1'b1; Tests: T32 T34 T37  281 1/1 end else if (in_token_received) begin Tests: T32 T34 T35  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: T32 T34 T35  286 // Includes NAK 287 1/1 in_xact_state_next = StIdle; Tests: T35 T37 T115  288 1/1 rollback_in_xact = 1'b1; Tests: T35 T37 T115  289 end else begin 290 1/1 in_xact_state_next = StWaitAck; Tests: T32 T34 T35  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: T30 T31 T32  338 1/1 in_ep_get_addr_o <= in_ep_get_addr_o + 1'b1; Tests: T30 T32 T34  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: T30 T31 T32  351 1/1 in_ep_newpkt_o <= 1'b1; Tests: T30 T31 T32  352 1/1 has_data_q <= in_ep_has_data_i[in_ep_index_d]; Tests: T30 T31 T32  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: T91 T48 T50  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: T32 T34 T37  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: T1 T37 T116  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: T30 T32 T34  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
Conditions11510994.78
Logical11510994.78
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,T3
1011CoveredT79,T80,T81
1101CoveredT1,T2,T3
1110CoveredT40,T43,T87
1111CoveredT1,T2,T3

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

 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,T3,T28
10CoveredT1,T28,T29
11CoveredT2,T3,T28

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

 LINE       145
 EXPRESSION (token_received && (rx_pid == UsbPidIn))
             -------1------    ----------2---------
-1--2-StatusTests
01CoveredT43,T30,T31
10CoveredT1,T2,T3
11CoveredT30,T31,T32

 LINE       145
 SUB-EXPRESSION (rx_pid == UsbPidIn)
                ----------1---------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT43,T30,T31

 LINE       149
 EXPRESSION (rx_pkt_end_i && rx_pkt_valid_i && (rx_pid == UsbPidAck))
             ------1-----    -------2------    ----------3----------
-1--2--3-StatusTests
011CoveredT32,T34,T37
101CoveredT81,T117,T118
110CoveredT1,T2,T3
111CoveredT32,T34,T37

 LINE       149
 SUB-EXPRESSION (rx_pid == UsbPidAck)
                ----------1----------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT43,T32,T34

 LINE       154
 EXPRESSION (rx_pkt_end_i && rx_pkt_valid_i && (rx_pid == UsbPidNak))
             ------1-----    -------2------    ----------3----------
-1--2--3-StatusTests
011CoveredT35,T37,T115
101CoveredT84,T117,T118
110CoveredT1,T2,T3
111CoveredT37,T115,T119

 LINE       154
 SUB-EXPRESSION (rx_pid == UsbPidNak)
                ----------1----------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT32,T34,T35

 LINE       161
 EXPRESSION (ep_in_hw ? rx_endp_i : '0)
             ----1---
-1-StatusTests
0CoveredT43,T8,T120
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
10CoveredT43,T120,T108
11CoveredT43,T30,T31

 LINE       178
 EXPRESSION (has_data_q & ((~in_ep_data_done_i[in_ep_index])))
             -----1----   -----------------2-----------------
-1--2-StatusTests
01CoveredT6,T108,T121
10CoveredT30,T31,T32
11CoveredT30,T32,T34

 LINE       180
 EXPRESSION ((logic'((in_xact_state == StSendData))) & more_data_to_send)
             -------------------1-------------------   --------2--------
-1--2-StatusTests
01CoveredT30,T32,T34
10CoveredT30,T32,T34
11CoveredT30,T32,T34

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

 LINE       186
 SUB-EXPRESSION ((in_xact_state == StIdle) || (in_xact_state == StWaitAck))
                 ------------1------------    --------------2-------------
-1--2-StatusTests
00CoveredT30,T31,T32
01CoveredT32,T34,T35
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
1CoveredT32,T34,T35

 LINE       188
 EXPRESSION (in_starting & ep_active)
             -----1-----   ----2----
-1--2-StatusTests
01CoveredT43,T30,T31
10CoveredT108,T121,T122
11CoveredT30,T31,T32

 LINE       207
 EXPRESSION (ep_active && in_token_received)
             ----1----    --------2--------
-1--2-StatusTests
01CoveredT108,T121,T122
10CoveredT43,T30,T31
11CoveredT30,T31,T32

 LINE       239
 EXPRESSION (((!more_data_to_send)) || (((&in_ep_get_addr_o)) && tx_data_get_i))
             -----------1----------    --------------------2-------------------
-1--2-StatusTests
00CoveredT30,T32,T34
01CoveredT38,T6,T123
10CoveredT30,T32,T34

 LINE       239
 SUB-EXPRESSION (((&in_ep_get_addr_o)) && tx_data_get_i)
                 ----------1----------    ------2------
-1--2-StatusTests
01CoveredT30,T32,T34
10CoveredT38,T4,T6
11CoveredT38,T6,T123

 LINE       269
 EXPRESSION (timeout_cntdown_q == '0)
            ------------1------------
-1-StatusTests
0CoveredT32,T34,T35
1CoveredT37,T65,T71

 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
0CoveredT30,T31,T32
1CoveredT1,T2,T3

 LINE       337
 EXPRESSION ((in_xact_state == StSendData) && tx_data_get_i)
             --------------1--------------    ------2------
-1--2-StatusTests
01Not Covered
10CoveredT30,T32,T34
11CoveredT30,T32,T34

 LINE       337
 SUB-EXPRESSION (in_xact_state == StSendData)
                --------------1--------------
-1-StatusTests
0CoveredT30,T31,T32
1CoveredT30,T32,T34

 LINE       363
 EXPRESSION (setup_token_received && ep_active)
             ----------1---------    ----2----
-1--2-StatusTests
01CoveredT43,T30,T31
10CoveredT2,T3,T28
11CoveredT91,T48,T50

 LINE       365
 EXPRESSION ((in_xact_state == StWaitAck) && ack_received)
             --------------1-------------    ------2-----
-1--2-StatusTests
01Not Covered
10CoveredT32,T34,T35
11CoveredT32,T34,T37

 LINE       365
 SUB-EXPRESSION (in_xact_state == StWaitAck)
                --------------1-------------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT32,T34,T35

 LINE       391
 EXPRESSION ((in_xact_state == StSendData) && tx_data_get_i)
             --------------1--------------    ------2------
-1--2-StatusTests
01CoveredT124
10CoveredT30,T32,T34
11CoveredT30,T32,T34

 LINE       391
 SUB-EXPRESSION (in_xact_state == StSendData)
                --------------1--------------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT30,T32,T34

 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
01CoveredT37,T115,T119
10CoveredT32,T34,T35
11CoveredT35,T37,T65

 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
01CoveredT32,T34,T35
10CoveredT32,T34,T35

 LINE       405
 SUB-EXPRESSION (in_xact_state == StWaitAckStart)
                ----------------1----------------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT32,T34,T35

 LINE       405
 SUB-EXPRESSION ((in_xact_state == StWaitAck) && rx_pkt_end_i && ((!nak_received)))
                 --------------1-------------    ------2-----    --------3--------
-1--2--3-StatusTests
011CoveredT1,T2,T3
101CoveredT32,T34,T35
110CoveredT37,T115,T119
111CoveredT32,T34,T35

 LINE       405
 SUB-EXPRESSION (in_xact_state == StWaitAck)
                --------------1-------------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT32,T34,T35

 LINE       412
 EXPRESSION ((in_xact_state == StWaitAck) && nak_received)
             --------------1-------------    ------2-----
-1--2-StatusTests
01Not Covered
10CoveredT32,T34,T35
11CoveredT37,T115,T119

 LINE       412
 SUB-EXPRESSION (in_xact_state == StWaitAck)
                --------------1-------------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT32,T34,T35

 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
10CoveredT30,T31,T32
11CoveredT4,T5,T6

 LINE       423
 SUB-EXPRESSION (ep_in_hw ? ((!in_ep_has_data_i[in_ep_index_d])) : 1'b0)
                 ----1---
-1-StatusTests
0CoveredT43,T8,T120
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 T30,T31,T32
StSendData 223 Covered T30,T32,T34
StWaitAck 268 Covered T32,T34,T35
StWaitAckStart 245 Covered T32,T34,T35
StWaitTxEnd 247 Covered T32,T34,T35


transitionsLine No.CoveredTests
StIdle->StRcvdIn 208 Covered T30,T31,T32
StRcvdIn->StIdle 323 Covered T31,T4,T5
StRcvdIn->StSendData 223 Covered T30,T32,T34
StSendData->StIdle 323 Covered T30,T6,T111
StSendData->StWaitAckStart 245 Not Covered
StSendData->StWaitTxEnd 247 Covered T32,T34,T35
StWaitAck->StIdle 323 Covered T32,T34,T35
StWaitAck->StRcvdIn 283 Not Covered
StWaitAckStart->StIdle 323 Covered T37,T65,T71
StWaitAckStart->StWaitAck 268 Covered T32,T34,T35
StWaitTxEnd->StIdle 323 Covered T125,T126,T127
StWaitTxEnd->StWaitAckStart 257 Covered T32,T34,T35



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 T43,T8,T120


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 T30,T31,T32
StIdle 0 - - - - - - - - - - - - - Covered T1,T2,T3
StRcvdIn - 1 - - - - - - - - - - - - Covered T30,T6,T111
StRcvdIn - 0 1 - - - - - - - - - - - Covered T31,T112,T113
StRcvdIn - 0 0 1 - - - - - - - - - - Covered T32,T34,T35
StRcvdIn - 0 0 0 - - - - - - - - - - Covered T4,T5,T114
StSendData - - - - 1 1 - - - - - - - - Covered T30,T6,T111
StSendData - - - - 1 0 1 - - - - - - - Not Covered
StSendData - - - - 1 0 0 - - - - - - - Covered T32,T34,T35
StSendData - - - - 0 - - - - - - - - - Covered T30,T32,T34
StWaitTxEnd - - - - - - - 1 - - - - - - Covered T32,T34,T35
StWaitTxEnd - - - - - - - 0 - - - - - - Covered T32,T34,T35
StWaitAckStart - - - - - - - - 1 - - - - - Covered T32,T34,T35
StWaitAckStart - - - - - - - - 0 1 - - - - Covered T37,T65,T71
StWaitAckStart - - - - - - - - 0 0 - - - - Covered T32,T34,T35
StWaitAck - - - - - - - - - - 1 - - - Covered T32,T34,T37
StWaitAck - - - - - - - - - - 0 1 1 - Not Covered
StWaitAck - - - - - - - - - - 0 1 0 - Not Covered
StWaitAck - - - - - - - - - - 0 0 - 1 Covered T35,T37,T115
StWaitAck - - - - - - - - - - 0 0 - 0 Covered T32,T34,T35
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 T30,T32,T34
0 0 0 Covered T30,T31,T32


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 T30,T31,T32
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 T91,T48,T50
0 1 Covered T32,T34,T37
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 T1,T37,T116
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 T30,T32,T34
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 591786515 591486884 0 0


InXactStateValid_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 591786515 591486884 0 0
T1 9237 9178 0 0
T2 7111 7059 0 0
T3 7527 7468 0 0
T28 12177 12112 0 0
T29 23809 23728 0 0
T39 7379 7299 0 0
T40 8278 8201 0 0
T41 3742 3666 0 0
T42 10240 10183 0 0
T43 27403 27312 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: T30 T31 T32  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: T30 T31 T32  217 218 1/1 if (in_ep_iso_i[in_ep_index]) begin Tests: T30 T31 T32  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: T30 T6 T111  224 1/1 tx_pid_o = {UsbPidData0}; Tests: T30 T6 T111  225 1/1 end else if (in_ep_stall_i[in_ep_index]) begin Tests: T31 T32 T34  226 1/1 in_xact_state_next = StIdle; Tests: T31 T112 T113  227 1/1 tx_pid_o = {UsbPidStall}; // STALL Tests: T31 T112 T113  228 1/1 end else if (has_data_q) begin Tests: T32 T34 T35  229 1/1 in_xact_state_next = StSendData; Tests: T32 T34 T35  230 1/1 tx_pid_o = {data_toggle_q[in_ep_index], 1'b0, {UsbPidTypeData}}; // DATA0/1 Tests: T32 T34 T35  231 end else begin 232 1/1 in_xact_state_next = StIdle; Tests: T4 T5 T114  233 1/1 tx_pid_o = {UsbPidNak}; // NAK Tests: T4 T5 T114  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: T30 T32 T34  240 1/1 if (in_ep_iso_i[in_ep_index]) begin Tests: T30 T32 T34  241 1/1 in_xact_state_next = StIdle; // no ACK for ISO EPs Tests: T30 T6 T111  242 1/1 in_xact_end = has_data_q; Tests: T30 T6 T111  243 end else begin 244 1/1 if (tx_pkt_end_i) begin Tests: T32 T34 T35  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: T32 T34 T35  248 end 249 end 250 end else begin 251 1/1 in_xact_state_next = StSendData; Tests: T30 T32 T34  252 end 253 end 254 255 StWaitTxEnd: begin 256 1/1 if (tx_pkt_end_i) begin Tests: T32 T34 T35  257 1/1 in_xact_state_next = StWaitAckStart; Tests: T32 T34 T35  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: T32 T34 T35  266 267 1/1 if (rx_pkt_start_i) begin Tests: T32 T34 T35  268 1/1 in_xact_state_next = StWaitAck; Tests: T32 T34 T35  269 1/1 end else if (timeout_cntdown_q == '0) begin Tests: T32 T34 T35  270 1/1 in_xact_state_next = StIdle; Tests: T37 T65 T71  271 1/1 rollback_in_xact = 1'b1; Tests: T37 T65 T71  272 end else begin 273 1/1 in_xact_state_next = StWaitAckStart; Tests: T32 T34 T35  274 end 275 end 276 277 StWaitAck: begin 278 1/1 if (ack_received) begin Tests: T32 T34 T35  279 1/1 in_xact_state_next = StIdle; Tests: T32 T34 T37  280 1/1 in_xact_end = 1'b1; Tests: T32 T34 T37  281 1/1 end else if (in_token_received) begin Tests: T32 T34 T35  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: T32 T34 T35  286 // Includes NAK 287 1/1 in_xact_state_next = StIdle; Tests: T35 T37 T115  288 1/1 rollback_in_xact = 1'b1; Tests: T35 T37 T115  289 end else begin 290 1/1 in_xact_state_next = StWaitAck; Tests: T32 T34 T35  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: T30 T31 T32  338 1/1 in_ep_get_addr_o <= in_ep_get_addr_o + 1'b1; Tests: T30 T32 T34  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: T30 T31 T32  351 1/1 in_ep_newpkt_o <= 1'b1; Tests: T30 T31 T32  352 1/1 has_data_q <= in_ep_has_data_i[in_ep_index_d]; Tests: T30 T31 T32  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: T91 T48 T50  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: T32 T34 T37  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: T1 T37 T116  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: T30 T32 T34  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
Conditions11410995.61
Logical11410995.61
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,T3
1011CoveredT79,T80,T81
1101CoveredT1,T2,T3
1110CoveredT40,T43,T87
1111CoveredT1,T2,T3

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

 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,T3,T28
10CoveredT1,T28,T29
11CoveredT2,T3,T28

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

 LINE       145
 EXPRESSION (token_received && (rx_pid == UsbPidIn))
             -------1------    ----------2---------
-1--2-StatusTests
01CoveredT43,T30,T31
10CoveredT1,T2,T3
11CoveredT30,T31,T32

 LINE       145
 SUB-EXPRESSION (rx_pid == UsbPidIn)
                ----------1---------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT43,T30,T31

 LINE       149
 EXPRESSION (rx_pkt_end_i && rx_pkt_valid_i && (rx_pid == UsbPidAck))
             ------1-----    -------2------    ----------3----------
-1--2--3-StatusTests
011CoveredT32,T34,T37
101CoveredT81,T117,T118
110CoveredT1,T2,T3
111CoveredT32,T34,T37

 LINE       149
 SUB-EXPRESSION (rx_pid == UsbPidAck)
                ----------1----------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT43,T32,T34

 LINE       154
 EXPRESSION (rx_pkt_end_i && rx_pkt_valid_i && (rx_pid == UsbPidNak))
             ------1-----    -------2------    ----------3----------
-1--2--3-StatusTests
011CoveredT35,T37,T115
101CoveredT84,T117,T118
110CoveredT1,T2,T3
111CoveredT37,T115,T119

 LINE       154
 SUB-EXPRESSION (rx_pid == UsbPidNak)
                ----------1----------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT32,T34,T35

 LINE       161
 EXPRESSION (ep_in_hw ? rx_endp_i : '0)
             ----1---
-1-StatusTests
0CoveredT43,T8,T120
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
10CoveredT43,T120,T108
11CoveredT43,T30,T31

 LINE       178
 EXPRESSION (has_data_q & ((~in_ep_data_done_i[in_ep_index])))
             -----1----   -----------------2-----------------
-1--2-StatusTests
01CoveredT6,T108,T121
10CoveredT30,T31,T32
11CoveredT30,T32,T34

 LINE       180
 EXPRESSION ((logic'((in_xact_state == StSendData))) & more_data_to_send)
             -------------------1-------------------   --------2--------
-1--2-StatusTests
01CoveredT30,T32,T34
10CoveredT30,T32,T34
11CoveredT30,T32,T34

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

 LINE       186
 SUB-EXPRESSION ((in_xact_state == StIdle) || (in_xact_state == StWaitAck))
                 ------------1------------    --------------2-------------
-1--2-StatusTests
00CoveredT30,T31,T32
01CoveredT32,T34,T35
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
1CoveredT32,T34,T35

 LINE       188
 EXPRESSION (in_starting & ep_active)
             -----1-----   ----2----
-1--2-StatusTests
01CoveredT43,T30,T31
10CoveredT108,T121,T122
11CoveredT30,T31,T32

 LINE       207
 EXPRESSION (ep_active && in_token_received)
             ----1----    --------2--------
-1--2-StatusTests
01CoveredT108,T121,T122
10CoveredT43,T30,T31
11CoveredT30,T31,T32

 LINE       239
 EXPRESSION (((!more_data_to_send)) || (((&in_ep_get_addr_o)) && tx_data_get_i))
             -----------1----------    --------------------2-------------------
-1--2-StatusTests
00CoveredT30,T32,T34
01CoveredT38,T6,T123
10CoveredT30,T32,T34

 LINE       239
 SUB-EXPRESSION (((&in_ep_get_addr_o)) && tx_data_get_i)
                 ----------1----------    ------2------
-1--2-StatusTests
01CoveredT30,T32,T34
10CoveredT38,T4,T6
11CoveredT38,T6,T123

 LINE       269
 EXPRESSION (timeout_cntdown_q == '0)
            ------------1------------
-1-StatusTests
0CoveredT32,T34,T35
1CoveredT37,T65,T71

 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
0CoveredT30,T31,T32
1CoveredT1,T2,T3

 LINE       337
 EXPRESSION ((in_xact_state == StSendData) && tx_data_get_i)
             --------------1--------------    ------2------
-1--2-StatusTestsExclude Annotation
01Excluded VC_COV_UNR
10CoveredT30,T32,T34
11CoveredT30,T32,T34

 LINE       337
 SUB-EXPRESSION (in_xact_state == StSendData)
                --------------1--------------
-1-StatusTests
0CoveredT30,T31,T32
1CoveredT30,T32,T34

 LINE       363
 EXPRESSION (setup_token_received && ep_active)
             ----------1---------    ----2----
-1--2-StatusTests
01CoveredT43,T30,T31
10CoveredT2,T3,T28
11CoveredT91,T48,T50

 LINE       365
 EXPRESSION ((in_xact_state == StWaitAck) && ack_received)
             --------------1-------------    ------2-----
-1--2-StatusTests
01Not Covered
10CoveredT32,T34,T35
11CoveredT32,T34,T37

 LINE       365
 SUB-EXPRESSION (in_xact_state == StWaitAck)
                --------------1-------------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT32,T34,T35

 LINE       391
 EXPRESSION ((in_xact_state == StSendData) && tx_data_get_i)
             --------------1--------------    ------2------
-1--2-StatusTests
01CoveredT124
10CoveredT30,T32,T34
11CoveredT30,T32,T34

 LINE       391
 SUB-EXPRESSION (in_xact_state == StSendData)
                --------------1--------------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT30,T32,T34

 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
01CoveredT37,T115,T119
10CoveredT32,T34,T35
11CoveredT35,T37,T65

 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
01CoveredT32,T34,T35
10CoveredT32,T34,T35

 LINE       405
 SUB-EXPRESSION (in_xact_state == StWaitAckStart)
                ----------------1----------------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT32,T34,T35

 LINE       405
 SUB-EXPRESSION ((in_xact_state == StWaitAck) && rx_pkt_end_i && ((!nak_received)))
                 --------------1-------------    ------2-----    --------3--------
-1--2--3-StatusTests
011CoveredT1,T2,T3
101CoveredT32,T34,T35
110CoveredT37,T115,T119
111CoveredT32,T34,T35

 LINE       405
 SUB-EXPRESSION (in_xact_state == StWaitAck)
                --------------1-------------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT32,T34,T35

 LINE       412
 EXPRESSION ((in_xact_state == StWaitAck) && nak_received)
             --------------1-------------    ------2-----
-1--2-StatusTests
01Not Covered
10CoveredT32,T34,T35
11CoveredT37,T115,T119

 LINE       412
 SUB-EXPRESSION (in_xact_state == StWaitAck)
                --------------1-------------
-1-StatusTests
0CoveredT1,T2,T3
1CoveredT32,T34,T35

 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
10CoveredT30,T31,T32
11CoveredT4,T5,T6

 LINE       423
 SUB-EXPRESSION (ep_in_hw ? ((!in_ep_has_data_i[in_ep_index_d])) : 1'b0)
                 ----1---
-1-StatusTests
0CoveredT43,T8,T120
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 T30,T31,T32
StSendData 223 Covered T30,T32,T34
StWaitAck 268 Covered T32,T34,T35
StWaitAckStart 245 Covered T32,T34,T35
StWaitTxEnd 247 Covered T32,T34,T35


transitionsLine No.CoveredTestsExclude Annotation
StIdle->StRcvdIn 208 Covered T30,T31,T32
StRcvdIn->StIdle 323 Covered T31,T4,T5
StRcvdIn->StSendData 223 Covered T30,T32,T34
StSendData->StIdle 323 Covered T30,T6,T111
StSendData->StWaitAckStart 245 Excluded VC_COV_UNR
StSendData->StWaitTxEnd 247 Covered T32,T34,T35
StWaitAck->StIdle 323 Covered T32,T34,T35
StWaitAck->StRcvdIn 283 Not Covered
StWaitAckStart->StIdle 323 Covered T37,T65,T71
StWaitAckStart->StWaitAck 268 Covered T32,T34,T35
StWaitTxEnd->StIdle 323 Covered T125,T126,T127
StWaitTxEnd->StWaitAckStart 257 Covered T32,T34,T35



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 T43,T8,T120


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 T30,T31,T32
StIdle 0 - - - - - - - - - - - - - Covered T1,T2,T3
StRcvdIn - 1 - - - - - - - - - - - - Covered T30,T6,T111
StRcvdIn - 0 1 - - - - - - - - - - - Covered T31,T112,T113
StRcvdIn - 0 0 1 - - - - - - - - - - Covered T32,T34,T35
StRcvdIn - 0 0 0 - - - - - - - - - - Covered T4,T5,T114
StSendData - - - - 1 1 - - - - - - - - Covered T30,T6,T111
StSendData - - - - 1 0 1 - - - - - - - Excluded VC_COV_UNR
StSendData - - - - 1 0 0 - - - - - - - Covered T32,T34,T35
StSendData - - - - 0 - - - - - - - - - Covered T30,T32,T34
StWaitTxEnd - - - - - - - 1 - - - - - - Covered T32,T34,T35
StWaitTxEnd - - - - - - - 0 - - - - - - Covered T32,T34,T35
StWaitAckStart - - - - - - - - 1 - - - - - Covered T32,T34,T35
StWaitAckStart - - - - - - - - 0 1 - - - - Covered T37,T65,T71
StWaitAckStart - - - - - - - - 0 0 - - - - Covered T32,T34,T35
StWaitAck - - - - - - - - - - 1 - - - Covered T32,T34,T37
StWaitAck - - - - - - - - - - 0 1 1 - Not Covered
StWaitAck - - - - - - - - - - 0 1 0 - Not Covered
StWaitAck - - - - - - - - - - 0 0 - 1 Covered T35,T37,T115
StWaitAck - - - - - - - - - - 0 0 - 0 Covered T32,T34,T35
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 T30,T32,T34
0 0 0 Covered T30,T31,T32


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 T30,T31,T32
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 T91,T48,T50
0 1 Covered T32,T34,T37
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 T1,T37,T116
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 T30,T32,T34
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 591786515 591486884 0 0


InXactStateValid_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 591786515 591486884 0 0
T1 9237 9178 0 0
T2 7111 7059 0 0
T3 7527 7468 0 0
T28 12177 12112 0 0
T29 23809 23728 0 0
T39 7379 7299 0 0
T40 8278 8201 0 0
T41 3742 3666 0 0
T42 10240 10183 0 0
T43 27403 27312 0 0

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