Protocol

USB3 Protocol-Layer modules

class sol_usb.gateware.usb.usb3.protocol.USB3ProtocolLayer(*args, src_loc_at: int = 0, **kwargs)

Abstraction encapsulating the USB3 protocol layer hardware.

Data

Data header handling gateware.

This file currently contains very little logic; the actual transmission framing is handled at the link layer; and the generation of our packets is handled by our endpoint.

class sol_usb.gateware.usb.usb3.protocol.data.DataHeaderReceiver(*args, src_loc_at: int = 0, **kwargs)

Gateware that handles received Data Header packets.

Variables:

header_sink (HeaderQueue(), input stream) – Stream that brings up header packets for handling.

Endpoint

Endpoint abstractions for USB3.

class sol_usb.gateware.usb.usb3.protocol.endpoint.SuperSpeedEndpointInterface

Interface that connects a USB3 endpoint module to a USB device.

Many non-control endpoints won’t need to use the latter half of this structure; it will be automatically removed by the relevant synthesis tool.

Variables:
  • rx (SuperSpeedStreamInterface(), input stream to endpoint) – Receive interface for this endpoint. This stream’s ready signal is ignored.

  • rx_header (DataHeaderPacket(), input to endpoint) – The header associated with the packet currently being received.

  • rx_complete (Signal(), input to endpoint) – Strobe that indicates that the concluding rx-stream was valid (CRC check passed).

  • rx_invalid (Signal(), input to endpoint) – Strobe that indicates that the concluding rx-stream was invalid (CRC check failed).

  • rx_new_header (Signal(), input to endpoint) – Strobe; indicates that a new header is available on rx_header.

  • tx (SuperSpeedStreamInterface(), output stream from endpoint) – Transmit interface for this endpoint. This stream’s valid must remain high for an entire packet; and it must respect the transmitter’s ready signal.

  • tx_zlp (Signal(), output from endpoint) – Strobe; when pulsed, triggers sending of a zero-length packet.

  • tx_length (Signal(range(1024 + 1)), output from endpoint) – The length of the packet to be transmitted; required for generating its header.

  • tx_endpoint_number (Signal(4), output from endpoint) – The endpoint number associated with the active transmission.

  • tx_sequence_number (Signal(4), output from endpoint) – The sequence number associated with the active transmission.

  • tx_direction (Signal(), output from endpoint) – The direction associated with the active transmission; used for control endpoints.

  • active_address (Signal(7), input to endpoint) – Contains the device’s current address.

  • address_changed (Signal(), output from endpoint.) – Strobe; pulses high when the device’s address should be changed.

  • new_address (Signal(7), output from endpoint) – When address_changed is high, this field contains the address that should be adopted.

  • active_config (Signal(8), input to endpoint) – The configuration number of the active configuration.

  • config_changed (Signal(), output from endpoint) – Strobe; pulses high when the device’s configuration should be changed.

  • new_config (Signal(8)) – When config_changed is high, this field contains the configuration that should be applied.

class sol_usb.gateware.usb.usb3.protocol.endpoint.SuperSpeedEndpointMultiplexer(*args, src_loc_at: int = 0, **kwargs)

Multiplexes access to the resources shared between multiple endpoint interfaces.

Interfaces are added using add_interface.

Variables:

shared (SuperSpeedEndpointInterface) – The post-multiplexer endpoint interface.

add_interface(interface: SuperSpeedEndpointInterface)

Adds a EndpointInterface to the multiplexer.

Arbitration is not performed; it’s expected only one endpoint will be driving the transmit lines at a time.

Layer

USB3 link-layer abstraction.

class sol_usb.gateware.usb.usb3.protocol.layer.USB3ProtocolLayer(*args, src_loc_at: int = 0, **kwargs)

Abstraction encapsulating the USB3 protocol layer hardware.

Timestamp

Isochronous Timestamp Packet (ITP)-related gateware.

class sol_usb.gateware.usb.usb3.protocol.timestamp.TimestampPacketReceiver(*args, src_loc_at: int = 0, **kwargs)

Gateware that receives Isochronous Timestamp Packets, and keeps time.

Variables:
  • header_sink (HeaderQueue(), input stream) – Input stream carrying header packets from the link layer.

  • bus_interval_counter (Signal(14), output) – The currently timestamp, expressed in a number of 125uS bus intervals.

  • delta (Signal(13)) – The delta from the aligned bus interval and ITP transmission.

Transaction

Protocol-level Transaction Packet (flow control header) generation.

class sol_usb.gateware.usb.usb3.protocol.transaction.HandshakeGeneratorInterface

Interface used by an endpoint to generate transaction packets.

Variables:
  • endpoint_number (Signal(7), input to handshake generator) – The endpoint number associated with the transaction packet to be generated.

  • retry_required (Signal(), input to handshake generator) – If set, an ACK will be interpreted as a request to re-send the relevant packet.

  • next_sequence (Signal(5), input to handshake generator) – Reports the next expected data packet sequence number to the host.

  • send_ack (Signal(), input to handshake generator) – Strobe; requests generation of an ACK packet.

  • ready (Signal(), output from handshake generator) – Asserted when the handshake generator is ready to accept new signals.

  • done (Signal(), output from handshake generator.) – Strobe; pulsed when a requested send is complete.

class sol_usb.gateware.usb.usb3.protocol.transaction.HandshakeReceiverInterface

Interface used by an endpoint to generate transaction packets.

Variables:
  • endpoint_number (Signal(7), input to handshake generator) – The endpoint number associated with the transaction packet to be generated.

  • retry_required (Signal(), input to handshake generator) – If set, an ACK will be interpreted as a request to re-send the relevant packet.

  • next_sequence (Signal(5), input to handshake generator) – Reports the next expected data packet sequence number to the host.

  • send_ack (Signal(), input to handshake generator) – Strobe; requests generation of an ACK packet.

  • ready (Signal(), output from handshake generator) – Asserted when the handshake generator is ready to accept new signals.

  • done (Signal(), output from handshake geneartor.) – Strobe; pulsed when a requested send is complete.

class sol_usb.gateware.usb.usb3.protocol.transaction.TransactionHeaderPacket
class sol_usb.gateware.usb.usb3.protocol.transaction.ACKHeaderPacket
class sol_usb.gateware.usb.usb3.protocol.transaction.NRDYHeaderPacket
class sol_usb.gateware.usb.usb3.protocol.transaction.ERDYHeaderPacket
class sol_usb.gateware.usb.usb3.protocol.transaction.STALLHeaderPacket
class sol_usb.gateware.usb.usb3.protocol.transaction.StatusHeaderPacket
class sol_usb.gateware.usb.usb3.protocol.transaction.TransactionPacketGenerator(*args, src_loc_at: int = 0, **kwargs)

Module responsible for generating Token Packets, for flow control.

Variables:
  • header_source (HeaderQueue(), output stream) – The stream that carries any generated header packet requests.

  • interface (HandshakeGeneratorInterface(), to/from endpoint) – The control interface for our packet; meant to be carried to various endpoints.

  • address (Signal(7), input) – The address associated with the device; used to fill in header packet fields.

class sol_usb.gateware.usb.usb3.protocol.transaction.TransactionPacketReceiver(*args, src_loc_at: int = 0, **kwargs)

Module responsible for receiving Transaction Packets from the host.

Variables:
  • header_sink (HeaderQueue(), input stream) – The stream that carries received header packets up from the host.

  • interface (HandshakeReceiverInterface(), output to endpoint) – Interface that detects transaction packets and reports them to the endpoint.