Stream
Core stream definitions.
- class sol_usb.gateware.usb.stream.USBInStreamInterface(payload_width=8, valid_width=1, extra_fields=None)
Variant of SOL’s StreamInterface optimized for USB IN transmission.
This stream interface is nearly identical to StreamInterface, with the following restriction: the valid signal _must_ be held high for every packet between first and last, inclusively.
This means that the relevant interface can easily be translated to the UTMI transmit signals, with the following mappings:
Stream | UTMI ——–|———– valid | tx_valid payload | tx_data ready | tx_ready
- bridge_to(utmi_tx)
Generates a list of connections that connect this stream to the provided UTMITransmitInterface.
- class sol_usb.gateware.usb.stream.USBOutStreamInterface(payload_width=8)
Variant of SOL’s StreamInterface optimized for USB OUT receipt.
This is a heavily simplified version of our StreamInterface, which omits the ‘first’, ‘last’, and ‘ready’ signals. Instead, the streamer indicates when data is valid using the ‘next’ signal; and the receiver must keep time.
This is selected so the relevant interface can easily be translated to the UTMI receive signals, with the following mappings:
UTMI | Stream ——— |———– rx_active | valid rx_data | payload rx_valid | next
- bridge_to(utmi_rx)
Generates a list of connections that connect this stream to the provided UTMIReceiveInterface.
- stream_eq(other)
Generates a list of connections that connect this stream to the provided UTMIReceiveInterface.
- class sol_usb.gateware.usb.stream.USBOutStreamBoundaryDetector(*args, src_loc_at: int = 0, **kwargs)
Gateware that detects USBOutStream packet boundaries, and generates First and Last signals.
As UTMI/ULPI do not denote the last byte of a packet; this module injects two bytes of delay in order to correctly identify the last bytes.
- Variables:
unprocessed_stream (USBOutStreamInterface, input stream) – The stream to work with; will be processed and then output on :attr:
processed_stream
.processed_stream (USBOutStreamInterface, output stream) – The stream produced by this module. This stream is two bytes delayed from :attr:
unprocessed_stream
; and in-phase with the :attr::first
and :attr::last
signals.complete_in (Signal(), input, optional) – Input that accepts an RxComplete signal. If provided; a delayed version will be produced on :attr:
complete_out
after a :attr:processed_stream
packet terminates.invalid_in (Signal(), input, optional) – Input that accepts an RxInvalid signal. If provided; a delayed version will be produced on :attr:
complete_out
after a :attr:processed_stream
packet terminates.
- complete_out: Signal(), output
If :attr:
complete_in
is provided; this signal provides a delayed version of that signal timed so it is strobed after :attr:processed_stream
packets complete.- invalid_out: Signal(), output
If :attr:
invalid_out
is provided; this signal provides a delayed version of that signal timed so it is strobed after :attr:processed_stream
packets complete.- first: Signal(), output
Indicates that the byte present on :attr:
processed_stream
is the first byte of a packet.- last: Signal(), output
Indicates that the byte present on :attr:
processed_stream
is the last byte of a packet.
- Parameters:
domain (str) – The name of the domain the stream belongs to; defaults to ‘usb’.
- class sol_usb.gateware.usb.stream.USBRawSuperSpeedStream(payload_words=4)
Variant of SOL’s StreamInterface optimized for carrying raw USB3 data.
Low-level USB3 data-streams consist of both data bytes (‘data’) and control flags, which differentiate standard data bytes from data bytes used for control.
This variant comes implicitly with the relevant control flags; and is sized to allow gearing that makes USB3’s high-speed signals manageable.
- Parameters:
payload_words (int) – The number of payload words (1 byte data, 1 bit control) to include in the current stream.
- stream_eq(interface, *, endian_swap=False, omit=None, **kwargs)
Extend the global
stream_eq
operator to swap endianness.
- class sol_usb.gateware.usb.stream.SuperSpeedStreamArbiter(*args, src_loc_at: int = 0, **kwargs)
Convenience variant of our StreamArbiter that operates SuperSpeed streams in the
ss
domain.
- class sol_usb.gateware.usb.stream.SuperSpeedStreamInterface
Convenience variant of our StreamInterface sized to work with SuperSpeed streams.