Latency in a JESD 204 B Link What
Latency in a JESD 204 B Link
What is Latency? • Latency is defined as the total time (in seconds or clock cycles) it takes a signal to travel from Point A to Point B • In a system: – Point A might be the input to the ADC – Point B might be the output of the DAC • In a JESD 204 B link: – Point A is the input to the JESD 204 B transmitter – Point B is the output of the JESD 204 B receiver’s elastic buffer
JESD 204 B Latency Influencers • Device dependent – SYSREF propagation delay – JESD link layer – Serdes implementation • Board level – Channel (trace length, vias, connectors) – SYSREF propagation delay – Clock propagation delay
JESD 204 B System Diagram (Subclass 1) • Data is sent over serdes lanes • Each device receives a “SYSREF” signal to align LMFCs in each device • Each device receives a “device clock” which is essentially the sample clock • The device clock captures the SYSREF signal so setup and hold times must be met
Latency in a JESD 204 B Link
Latency Definitions Sample-to-Serial Out (S 2 SO) Latency—S 2 SO is the latency from when the signal is sampled at the ADC input until the sample appears in the serial stream at the ADC (TX) output.
Latency Definitions Link Delay—Link delay is the delay from when the sampled parallel data is input to the serializer at the transmitter (ADC) until the same data is presented at the input to the elastic buffer.
Latency Definitions Link Latency—Link latency is the latency from when the sampled parallel data is input to the serializer at the transmitter (ADC) until the same data is available in parallel form at the receiver.
Latency Definitions Sample-to-Parallel Out (S 2 PO) Latency—S 2 PO is the latency from when the signal is sampled at the ADC input until the sample is released on the parallel bus at the receiving device (RX).
Which one is Deterministic Latency referring to? Or?
Which block enables Deterministic Latency? Why?
Deterministic Latency Intro
What is Deterministic Latency? • Wikipedia: ”A deterministic system is a system in which no randomness is involved in the development of future states of the system. A deterministic model will thus always produce the same output from a given starting condition or initial state. ” • The most important aspect of deterministic latency is that the latency should stay constant from system startup to startup. • Having “deterministic latency” does not necessarily mean the latency is known • How do we achieve deterministic latency? – JESD 204 B defines two mechanisms for deterministic latency called “subclasses”
JESD 204 B Subclasses Subclass Mechanism for Deterministic Latency Subclass 0 No support for deterministic latency (backward compatible with JESD 204 A). Subclass 1 “SYSREF” signal is used to align LMFCs within all TX and RX devices. Subclass 2 “SYNC” signal is used to align LMFCs, eliminating the need for “SYSREF”. LMFC is aligned based on when the SYNC signal is received from each data converter device. Complex timing means that this will only work below 500 MSPS.
What Systems May Need Deterministic Latency? • Applications sensitive to latency – Digital pre-distortion (DPD) control loops – Automatic gain control loops (AGC) – Defensive counter measures • Any system that requires multi-device synchronization – Multi antenna transmit/receive – Phased array radar – Magnetic Resonance Imaging (MRI)
How Does JESD 204 B Achieve Deterministic Latency? • Sequence of events for subclass 1: 1. SYSREF is sent to all devices at the same point in time to align their local multi-frame clocks 2. All transmitters issue an /A/ character at the same point in time based on the LMFC clock edge. - Channel and device variations will skew the lanes relative to each other 3. As each RX receives the /A/ character, it starts to buffer it’s data 4. Once all RXs receive their /A/ character and the “buffer release point” has been reached (e. g. LMFC rising edge), all RXs release their data from the buffer which is now time aligned
Initial Lane Alignment Sequence • TX transmits ILA starting at an LMFC edge • ILA is 4 multi-frames, containing configuration parameters and alignment symbols (A) used for multiframe alignment • The /A/ or /R/ characters are the key for deterministic latency
Deterministic Latency Visual x 1. is used 4. All lanes are 2. SYSREF After SYNC is to align released on received, all the lanes 3. Each LMFCs lane starts next edge send. LMFC ILAS next buffering it’son data and are now LMFC when itedge receives aligned the trigger (R or A char)
How is Deterministic Latency Guaranteed?
How Do We Guarantee Deterministic Latency? 1. Guarantee the LMFCs in each device are aligned (or have constant phase difference) every time the system starts 2. Set release point to occur after the latest arriving lane by: • • Having total link delay less than the LMFC period Setting a buffer release point that occurs after all lanes have arrived This is what the standard expects, but it’s not always possible!
1. Aligning the LMFCs in Each Device • The LMFCs need to be aligned in each device to create a known timing reference point – All devices should receive SYSREF at the same time every time the system starts – SYSREF must meet setup and hold times relative to device clocks • Technically the LMFCs can be misaligned, but the phase difference needs to be the same every time the system starts
2. Set Release Point to Occur After the Latest Arriving Lane • The LMFC period is decided by the linerate, F (octets per frame), and K (frames per multi-frame) – LMFC period = 10 * F * K / Linerate – 10 = number of bits per octet – For example, if F = 8, K = 16, and the linerate is 7372. 8 Mbps, then the LMFC period is 173. 6 ns. • In the example, the total link delay should be less than 173. 6 ns
How do we set the release point? • Consider the following scenario: Why is there variation on the data delay? • The LMFC period is 50 ns • The delay for each lane is 100 ns +/- 10 ns (90 ns to 110 ns) • Assume the buffer release point is set to the LMFC clock rising edge
Release Point The latest arriving lane arrives at 90 ns 50 ns Data delay is 90 ns Total latency is 100 ns
Release Point The latest arriving lane arrives at 110 ns 50 ns Data delay is 110 ns Total latency is 150 ns
Incorrect Release Point • In this example, the latency IS NOT deterministic because it is not consistent from startup to startup • How do we avoid this scenario? 1. Calculate the expected maximum lane delay 2. Choose a release point that occurs after the maximum lane delay
Release Point occurs “RBD” frame cycles after the LMFC boundary Set RBD = K/2 Using RBD to shift the release point 50 ns Data delay is 110 ns Total latency is 125 ns RBD
Achieving Deterministic Latency
The Three Step Process 1. Determine Alignment of LMFCs 2. Calculate expected link delay (accounting for variation) 3. Choose release point that provides margin against error 4. Calculate total latency by adding ADC or DAC latency
Step 1: Determine Alignment of LMFCs • Things to consider: – Propagation delay of SYSREF and device clocks across board – Purposefully added delays to SYSREF, such as analog delays or dynamic digital delays (see LMK 04828) – Delays from SYSREF input pins to resetting of LMFC (internal to devices)
LMFC Alignment Between Devices • LMFC is not always reset as soon as SYSREF is captured. • The “SYSREF pin to LMFC reset” timing may be different for each device. • Some datasheets will specify SYSREF to LMFC timing for various modes (e. g. DAC 38 J 84) and this delay needs to be added to the LMFC delay.
DAC 38 J 84 SYSREF to LMFC Latency
Step Variations occur due to device variances (specified in datasheet) 2: Calculate Link Delay or due to PVT effects These delays will come from the datasheet or need to be measured or calculated Total Link Delay = t. TX_SER + t. LANE + t. RX_DESER +/- t. VARIANCE LMFC alignment between TX and RX has already been determined
Step 3: Choose Buffer Release Point Choose release point that guarantees enough margin around the expected lane arrival
Summary of Calculation • We have done the following: 1. Determined LMFC alignment between TX and RX 2. Calculated total link delay 3. Determined the appropriate buffer release point 2 1 3
Total Link Latency • The total link latency can be calculated using the following formula Link Latency = (n * K + RBD) * TFRAME + (t. RX_LMFC – t. TX_LMFC) • Where n is the number of whole RX multi-frames traversed n=2 1 2
Add ADC or DAC latency for Total Latency
How is Deterministic Latency Verified?
Example System Diagram
Test Setup 1. Generate a pulse with FPGA 2. Capture pulse with ADC 3. Output ADC’s MSB from FPGA 4. Observed relative timing on scope 5. Power up the system many times to confirm the relative timing stays constant
Device Setup • ADC = ADC 16 DX 370 (16 -bit, dual channel, 370 MSPS) – Device clock = 370 MHz (2. 7 ns) • JESD 204 B Parameters – L = 4, M = 2, F = 1, S = 1, K = 32 – Frame cycle = 10 * F / Linerate = 10 * 1 / 3700 Mbps = 2. 7 ns – LMFC cycle = Frame cycle * K = 2. 7 ns * 32 = 86. 4 ns • FPGA – Device clock = 92. 5 MHz (10. 8 ns)
Additional Delays in System
Latency Calculation • Per the previous slides, the latency is calculated as Link Latency = (n * K + RBD) * TFRAME + (t. RX_LMFC – t. TX_LMFC) • For this experiment the following parameters apply – All units in Frame clock cycles – t. RX_LMFC = 28, t. TX_LMFC = 3. 5, n = 2, K = 32, RBD=28 (RX_BUFFER_DELAY=4) – Link Latency = 116. 5 frame clock cycles • The following also extend the latency – ADC 16 DX 370 core latency = +12. 5 – DEVCLK routing skew and MSB output routing delay = +1. 4 – SYSREF/DEVCLK sampling skew = +1. 5 – Additional receiver processing delays • • • +3 rx_tdata release delay (for earliest sample in the 4 -sample set output each period of 92. 5 MHz clock. This delay may instead be +4) +4 latching MSBs before output (at Fs/4 rate) Total Calculated Latency = 116. 5 + 12. 5 + 1. 4 + 1. 5 + 7 = 138. 9 cycles
Result Latency=379. 6 ns • Calculated latency for this setup is 138. 9 frame cycles • Measured latency is 379. 6 ns / 2. 7 ns = 140. 4 cycles • Note: Would have been better to use a short pulse as test signal to avoid confusion over correct output pulse
Bonus!
What’s the easiest way to achieve deterministic latency? • Setup a test similar to the one shown to observe relative delays • Vary RBD until a 1 LMFC period jump is observed, then add the expected latency variation to that value (plus extra margin) Release Release Point Total Latency Optimal Release Point
- Slides: 46