USB-Based Integrated Logic Analyzer¶
This module provides the ILA as a streaming USB device, for use with the USB backhaul interface. It does this by wrapping the StreamILA
and providing the output stream of the ILA capture data as a USB device using the Torii-USB USBMultibyteStreamInEndpoint
- class torii_ila.usb.USBIntegratedLogicAnalyzer(*, signals=[], sample_depth=32, sampling_domain='sync', sample_rate=50000000.0, prologue_samples=1, bus=None, delayed_connect=False, max_pkt_size=512, discard_string_descriptors=False)¶
A simple ILA that produces samples over a USB bulk endpoint.
This shows up as a USB device with VID:PID of
04A0:ACA7
on the host with the Product string ofTorii ILA
and the Serial Number string of000000000
.- Parameters:
signals (Iterable[torii.Signal]) – The signals to capture with the ILA. (default: list())
sample_depth (int) – Number of samples we wish to capture. (default: 32)
sampling_domain (str) – The clock domain the ILA sampling will take place on. (default: sync)
sample_rate (float) – The outwards facing sample rate used for formatting output. This should be tied to the
sampling_domain
’s frequency if possible. (default:50e6
i.e50MHz
)prologue_samples (int) – The number of samples to capture before the trigger. (default: 1)
bus (str | tuple[str, int] | None) – The USB Bus resource to use. (default: None)
delayed_connect (bool) – Delay connection of the USB device. (default: False)
max_pkt_size (int) – Max packet size. (default: 512)
- discard_string_descriptorsbool
Discard the device Manufacturer, Product, and Serial Number string descriptors, this may help some devices which are having problems passing PnR timing with doing so, or devices that are under heavy BRAM pressure. (default: False)
- Attributes:
ila (StreamILA) – The inner ILA module used for actually ingesting the sample data.
sample_width (int) – The width of the sample vector in bits.
sample_depth (int) – The depth of the ILA sample buffer in samples.
sample_rate (float) – The outwards facing sample rate used for formatting output
sample_period (float) – The period of time between samples in nanoseconds, equivalent to
1 / sample_rate
.bits_per_sample (int) – The nearest power of 2 number of bits per sample.
bytes_per_sample (int) – The number of whole bytes per sample.
trigger (Signal, in) – ILA Sample start trigger strobe.
sampling (Signal, out) – Indicates when the ILA is actively sampling.
complete (Signal, out) – Indicates when sampling is completed and the buffer is full.
BULK_EP_NUM (int) – The fixed USB Bulk Endpoint number for the Torii-USB USB Device. Value is set to
1
.USB_VID (int) – The fixed USB Vendor ID for the Torii-USB USB Device. Value is set to
0x1D50
.USB_PID (int) – The fixed USB Product ID for the Torii-USB USB Device. Value is set to
0x6190
.
- get_backhaul()¶
Automatically construct a
USBIntegratedLogicAnalyzerBackhaul
from this ILA instance.- Returns:
The newly constructed backhaul interface or the already constructed instance.
- Return type:
- add_signal(sig)¶
Add a signal to the ILA capture list.
This can be used to internal module signals to the ILA, or add signals after construction.
Note
This method must not be called post elaboration, as we are unable to adjust the sample memory size after is it made concrete.
- Parameters:
sig (torii.Signal) – The signal to add to the ILA capture list.
- Raises:
RuntimeError – If called during the elaboration of the ILA module
- Return type:
- append_signals(signals)¶
Like
add_signal()
but allows for adding an array of signals to the ILA capture list.Note
This method must not be called post elaboration, as we are unable to adjust the sample memory size after is it made concrete.
- Parameters:
signals (Iterable[torii.Signal]) – The list of additional signals to capture with the ILA.
- Raises:
RuntimeError – If called during the elaboration of the ILA module
- Return type:
- add_fsm(fsm)¶
Add a Torii FSM state to the ILA.
with m.FSM(name = 'Thing') as fsm: ila.add_fsm(fsm)
This is effectively equivalent to:
with m.FSM(name = 'Thing') as fsm: ila.add_signal(fsm.state)
Note
The FSM you add to the ILA should be named, as to prevent name collisions.
Note
This method must not be called post elaboration, as we are unable to adjust the sample memory size after is it made concrete.
- Parameters:
fsm (torii.hdl.dsl.FSM) – The FSM to add to the ILA.
- Raises:
RuntimeError – If called during the elaboration of the ILA module
- Return type: