USB3 control request handler gateware.


Standard, full-gateware control request handlers.

class sol_usb.gateware.usb.usb3.request.standard.StandardRequestHandler(*args, src_loc_at: int = 0, **kwargs)

Pure-gateware USB3 setup request handler. Implements the standard requests required for enumeration.

handle_register_write_request(m, new_value_signal, write_strobe, stall_condition=0)

Fills in the current state with a request handler meant to set a register.

  • new_value_signal (Signal of any size) – The signal to receive the new value to be applied to the relevant register.

  • write_strobe (Signal()) – The signal which will be pulsed when new_value_signal contains a update.

  • stall_condition – If provided, if this condition is true, the request will be STALL’d instead of acknowledged.

handle_simple_data_request(m, data, *, length=1)

Fills in a given current state with a request that returns a given short piece of data.

For e.g. GET_CONFIGURATION and GET_STATUS requests. The relevant data must fit within a word.

  • tx_stream (StreamInterface) – The transmit stream to drive.

  • data (Torii value, or equivalent, up to 32b) – The data to be transmitted.

  • valid_mask (Torii value, or equivalent, up to 4b) – The valid mask for the data to be transmitted. Should be 0b0001, 0b0011, 0b0111, or 0b1111.