Request

Low-level USB transceiver gateware – control request components.

class sol_usb.gateware.usb.usb2.request.RequestHandlerInterface

Record representing a connection between a control endpoint and a request handler.

Components (I = input to request handler; O = output to control interface):

*: setup - Carries the most recent setup request to the handler. *: tokenizer - Carries information about any incoming token packets.

# Control request status signals. I: data_requested - Pulsed to indicate that a data-phase IN token has been issued,

and it’s now time to respond (post-inter-packet delay).

I: status_requested - Pulsed to indicate that a response to our status phase has been

requested.

# Address / configuration connections. O: address_changed - Strobe; pulses high when the device’s address should be changed. O: new_address[7] - When address_changed is high, this field contains the address that

should be adopted.

I: active_config - The configuration number of the active configuration. O: config_changed - Strobe; pulses high when the device’s configuration should be changed. O: new_config[8] - When config_changed is high, this field contains the configuration that

should be applied.

# Data rx signals. *: rx - The receive stream for any data packets received. I: handshakes_in - Inputs that indicate when handshakes are detected from the host. I: rx_ready_for_response - Strobe that indicates that we’re ready to respond to a complete transmission.

Indicates that an interpacket delay has passed after an rx_complete strobe.

I: rx_invalid: - Strobe that indicates an invalid data receipt. Indicates that the most recently

received packet was corrupted; and should be discarded as invalid.

# Data tx signals. *: tx - The transmit stream for any packets generated by the handler. O: handshakes_out - Carries handshake generation requests.

class sol_usb.gateware.usb.usb2.request.USBRequestHandler(*args, src_loc_at: int = 0, **kwargs)

Base class for USB request handler modules.

I/O port:

*: interface – The RequestHandlerInterface we’ll use.

send_zlp()

Returns the statements necessary to send a zero-length packet.

class sol_usb.gateware.usb.usb2.request.USBSetupDecoder(*args, src_loc_at: int = 0, **kwargs)

Gateware responsible for detecting Setup transactions.

I/O port:

*: data_crc – Interface to the device’s data-CRC generator. *: tokenizer – Interface to the device’s token detector. *: timer – Interface to the device’s interpacket timer.

I: speed – The device’s current operating speed. Should be a USBSpeed

enumeration value – 0 for high, 1 for full, 2 for low.

*: packet – The SetupPacket record carrying our parsed output. I: ack – True when we’re requesting that an ACK be generated.

class sol_usb.gateware.usb.usb2.request.USBRequestHandlerMultiplexer(*args, src_loc_at: int = 0, **kwargs)

Multiplexes multiple RequestHandlers down to a single interface.

Interfaces are added using .add_interface().

I/O port:

*: shared – The post-multiplexer RequestHandler interface.

add_interface(interface: RequestHandlerInterface)

Adds a RequestHandlerInterface to the multiplexer.

Arbitration is not performed; it’s expected only one handler will be driving requests at a time.

class sol_usb.gateware.usb.usb2.request.StallOnlyRequestHandler(*args, src_loc_at: int = 0, **kwargs)

Simple gateware request handler that only conditionally stalls requests.

I/O port:
*: interface – The RequestHandlerInterface used to handle requests.

See its record definition for signal definitions.