Skip to content

ofb_pa_gty: Verification Plan

1. Overview

The adapter is verified with the encrypted transceiver model of the AMD simulation libraries and the AMD simulator (xsim): python tools/run_xsim.py. The script creates the transceiver wizard instance with Vivado, exports its simulation sources, compiles them with Open Logic and the OpenFibre sources and runs the testbenches. The GHDL regression cannot compile the transceiver model; all other tests use the behavioural Physical adapter model (tb/ofb_tb_pa_model.vhd).

The testbenches use plain VHDL checks (report with "FAIL", "Simulation done" at the end) because the support of UVVM in xsim is limited; the runner evaluates the log.

2. Test configuration

Testbench DUT and environment
ofb_pa_gty_tb ofb_pa_gty with four lanes, serial lines looped back (transmitter of each lane to its receiver), 156.25 MHz reference clock, 100 MHz free-running clock; a word generator per lane (data words counting up, IDLE words, SKIP words) and a checker per lane
ofb_pa_gty_cc_tb Two ofb_pa_gty A and B with four lanes, serial lines crossed; per lane a word generator (counting data words, an IDLE word every 8 words, a SKIP word every 16 words) and a checker; counters of the clock corrections and receive buffer errors. Test run cc: reference clock of B 1000 ppm slower than that of A (exaggerated to reach many clock corrections in a short simulation). Test run far: same reference clock frequency, then far-end serial loopback at B
ofb_pa_gty_core_tb Two ends A and B, each ofb_core (4 VCs, 4 lanes, all core clocks = LaneClk) with ofb_pa_gty, serial lines crossed; reference clocks 156.25 MHz at A and 200 ppm slower at B (the limit of 5.4.2.3a at both ends); AXI4-Lite access to both MIBs, packet generator and checker per VC and end, broadcast generator and checker, counter of the clock corrections per end

3. Test cases

Test ID Description Requirements
TC-PA-01 (ofb_pa_gty_tb) Reset sequence: transmitter and receiver ready, LaneClk running; every lane aligned; 300 data words per lane received in order with K flags clear, IDLE and SKIP words with the K flag of symbol 0, no code or disparity error, no other lane's words PA-IF-01, PA-SE-01, PA-SE-02, PA-SY-01, PA-CK-01, PA-RS-01, PA-RS-02, PA-ST-01
TC-PA-04 (ofb_pa_gty_tb) After TC-PA-01: external loopback removed (static lines), near-end serial loopback on every lane: 300 more data words per lane received in order without error PA-LB-01
TC-PA-06 (ofb_pa_gty_tb) After TC-PA-04, external loopback again: PRBS-31 generator and checker of every channel: all checkers locked after the checker reset, no error during 5 us; the line of one lane inverted for 1 ns (about six bits): errors on that lane only, checker still locked, no error afterwards; a PRBS-7 checker on the PRBS-31 pattern detects errors PA-PR-01
TC-PA-05 (ofb_pa_gty_cc_tb, run far) Both reference clocks at 156.25 MHz: words in order at both ends, then far-end serial loopback on every lane of B: A receives its own words, 3000 data words per lane in order without error PA-LB-01
TC-PA-03 (ofb_pa_gty_cc_tb, run cc) At least 4 clock corrections at each end (SKIP words inserted at A, removed at B), no receive buffer error, 3000 data words per lane and end received in order without loss or repetition PA-CC-01, PA-ST-01
TC-PA-07 (ofb_pa_gty_cc_tb, run buferr) No SKIP words, reference clock of B 1000 ppm slower, 250 us after the receivers are ready: receive buffer errors occur; every error indication ends within 1000 LaneClk cycles (the buffer reset); the receivers stay ready; at least 3000 data words per lane and end in order, at most 8 words with errors per buffer error and lane (the words of the reset window are not valid, so no word of the reset appears as data) PA-RS-03, PA-CC-01
TC-PA-02 (ofb_pa_gty_core_tb) Both cores reset with the reset pulse of the adapters, Phy_TxReady from Stat_TxReady (link held in Near-End Reset until the transmitters are ready); LaneStart at A, AutoStart at B: lane initialisation through the transceivers (ClearLine with electrical idle and CDR hold, polarity control), alignment of the four lanes, link initialised at both ends; a first burst of 12 packets per VC (1 to 40 words) and 4 broadcast messages in both directions; clock corrections at both ends (SKIP words inserted at one end, removed at the other); a second burst of 12 packets per VC; all delivered in order, no error flag in DL_ERRORS (bits 12:0, TX_LOST 0 after the start), no retry; throughout the run Stat_TxReady of each end is 1 only while its LaneClk runs, and every edge of Stat_TxReady and the first LaneClk edge are reported; then the adapter of A alone is reset with the link up: LaneClk of A stops (no edge for 1 us), the MIB of A reads TX_READY 0 and TX_LOST 1 while it stands still, both ends initialise the link again after the transmitters are ready, a third burst is delivered in order and TX_LOST stays set PA-IF-01 to 03, PA-CC-01, PA-RS-02, PA-SE-01, PA-SE-02, PA-SY-01, CORE-PL-04, CORE-SY-01, CORE-SY-02, PA-ST-02
TC-PA-02 with 1 to 3 lanes (runs ofb_pa_gty_core_tb.lanes1 to .lanes3: Lanes_g = 1 to 3, Short_g) Cores and adapters with one, two and three lanes, the other channels of the quad idle: link initialised at both ends with all lanes data-sending and data-receiving, first burst delivered in order, no error flag PA-IF-01, PA-SY-01, CORE-SY-01
TC-PA-02 lane restart (run ofb_pa_gty_core_tb.relock: Lanes_g = 1, Short_g, Relock_g) After the first burst the transmitter of the lane of B is disabled at its adapter for 5 us (CutNs_g; the core of B is not told): the lane of A loses the signal and restarts (fails if lane 0 of A does not leave Active), B follows; with the reset of the receive buffer (default) the idle line resets the buffer of A, and after the window the words drive the RXERR counter of A to its overflow (PA-RS-03); reported: loss and return of the signal at each receiver, the first lane word decoded and the first 1023 words without error after the return, the lane states, LANE_TIMEOUT_COUNT of both ends; the restart of lane 0 resets its receiver (PA-RS-04, the adapters and cores connected as in the VCK190 design): reported per end the start and end of each receiver reset with its duration and RXRESETDONE, and during the relock phase every change of the electrical idle and the CDR lock of the receiver (PA-IF-04); fails without a completed receiver reset of lane 0 of A (RX_RESETS) or with a receiver reset timeout at either end (LANE_EVENTS bit 7); the lane is Active again at both ends within 300 us and a second burst is delivered in order without error PA-IF-02, PA-IF-04, PA-RS-04, PA-RS-05, LN-INIT-03, LN-INIT-07
TC-PA-02 lane restart with the settings of the VCK190 design (run ofb_pa_gty_core_tb.relock_vck190: as relock, no gap between two receiver resets, initialisation timeout 468750 words) As the run relock: every restart of a lane resets its receiver, the lane stays in Started (3 ms) while the receiver resets; the lane is Active again at both ends within 3 ms and the second burst is delivered in order without error PA-RS-04, LN-INIT-03

Behavioural model

ofb_pa_gty_model_tb (VUnit, GHDL and QuestaSim): two ofb_pa_gty(mdl) A and B, pins crossed, 10 cycles of reset stretching, configurations lanes1 to lanes4 with equal reference clocks and, for TC-PA-11 and TC-PA-18, lanes4_ppm1000 and lanes1_ppmm1000 (reference clock of B 1000 ppm slower or faster). Per end and lane a generator of numbered data words, a SKIP word every 8 words and an IDLE word every 32 words (or the PRBS pattern), and a checker of the order and source of the data words, the error flags, the clock corrections and the buffer errors.

Test ID Description Requirements
test_link (TC-PA-10) Default reset sequence at power-up, the stretched reset of B ending 5 us after that of A, both before PowerUpTime: LaneClk ClkDelay and TX ready of both ends at the same time TxReadyDelay after PowerUpTime, the reset done of the previous start (TxDoneStale) does not show as TX ready, LaneRst released after TX ready, Phy_NoSignal 0 on every lane of both ends after TX ready (NoSignalNever), RX ready after RxReadyDelay; every lane of B aligned CdrLockTime to CdrLockTime + 1 us after the transmitters of A are ready, and with signal; 2000 data words per lane and end in order, no error; no output of the lane clock domain changes in the delta cycle of a LaneClk edge (monitor at both ends over the whole test, which also counts the edges after which the received data changed); then a reset of A in operation: TX ready of A falls, LaneClk runs again ClkDelay and TX ready rises TxReadyDelay after the end of the stretched reset although TxDoneStale lasts beyond ClkDelay, every lane of B aligned again, 2000 data words per lane and end in order; then, with TxDoneStale 1 us, a second reset of A in each phase of its reset sequence (while the reset done of the previous start shows, before LaneClk starts, before TX ready, before RX ready; the phase is checked before the second reset): LaneClk, TX ready and RX ready follow the end of the second stretched reset with the full delays, and B aligns again PA-MD-01, PA-MD-02, PA-MD-03, PA-MD-05, PA-MD-11
test_clock_correction (TC-PA-11) 300 us of traffic: 30000 data words per lane and end in order without loss or repetition, no buffer error; with different reference clocks clock corrections at both ends PA-MD-04
test_align (TC-PA-12) Lane skew of 3, 10, 17 and 24 unit intervals: every lane aligned and in order; a shift of the bit stream of lane 0 by 45 unit intervals during traffic: realigned, in order again PA-MD-03, PA-MD-07
test_invert (TC-PA-13) Crossed pair at A: no correct words at B; with Phy_RxInvert at B: words in order PA-MD-03, PA-MD-07
test_errors (TC-PA-14) Ten single bit errors: 10 to 30 words with code or disparity errors; a dropout of 20 bits: error words; a bit error rate of 1e-5 for 1 ms: 50 to 200 error words; words in order afterwards PA-MD-03, PA-MD-07
test_idle (TC-PA-15) NoSignalLine at both ends: transmitter disabled: no signal at B after NoSignalDelay (+ 50 ns), lane not aligned; signal back; idle control: no signal; receiver disabled at B: no words; CDR enable low at B: words in order after the receiver reset that its falling edge starts (PA-IF-02); words in order afterwards; a reset of the adapter of B: no signal on every lane of B during the reset, lanes aligned and words in order after it. NoSignalNever at B: transmitter of A disabled: Phy_NoSignal stays 0, 13 words with code errors and then more than 200 words without errors within 2 us, lane not aligned; words in order after the signal returns PA-MD-06, PA-MD-07
test_loopback (TC-PA-16) Near-end serial loopback at A: A receives its own words on every lane; far-end serial loopback at B: A receives its own words through B PA-MD-08
test_prbs (TC-PA-17) Every pattern (1 to 5) on every lane from A to B: checker locked, no error for 5 us, a forced error counted (1 to 3 erroneous bits: the bit and the two taps of the checker), locked again after the checker reset; two resets of A with PRBS-31: the first 256 bits on the pins of lane 0 of A are the same after both (the generator restarts from its seed) PA-MD-09
test_buffer (TC-PA-18) Without SKIP words for 1 ms: receive buffer errors with different reference clocks, none with equal clocks; with RxBufReset_g every error restarts the buffer: at most 20 buffer errors per lane and end, at most one word out of order per buffer error, more than 10000 words in order PA-MD-04, PA-RS-03
test_rx_reset (TC-PA-25) Bounds of the model: wait for RXRESETDONE 30 us, gap 10 us, CDR-only wait 2 us. CDR enable of lane 0 at B falling: receiver reset of that lane starts within 2 us; RX ready of B low and RXRESETDONE of the lane low while it runs; it ends RxResetTime to RxResetTime + 1 us after its start; RXRESETDONE and RX ready back; one reset done event (the rising edge of CDR enable starts none), no timeout, no valid word of the lane during the reset; the other lanes of B and every lane of A receive more than 500 words in order without error meanwhile; words in order on every lane afterwards. With Cfg_RxResetOnDisc 0 the falling edge starts no reset and the words continue. The command resets the last lane of B (event, no valid word meanwhile). CDR-only mode: the reset lasts the pulse and CdrWaitCycles_g (2 us to 3 us), RXRESETDONE stays 1, reset done event. RxResetHang: the reset ends at the bound (30 us) with a timeout event and no reset done event, RXRESETDONE stays 0 and the lane delivers no word; after the gap the next command completes and the words return. A transmit buffer error at A: the error clears within 5 us (transmit buffer reset), no receiver reset at A, words in order PA-IF-02, PA-RS-04, PA-RS-05, PA-RS-06, PA-ST-03, PA-MD-12
TC-PA-02 (ofb_pa_gty_core_tb, GHDL with the model) The end-to-end test of TC-PA-02 with ofb_pa_gty(mdl) in GHDL: times of TX ready, link initialised and first burst compared with the AMD simulator run; the lane restart with the checks of the AMD simulator run, with Phy_NoSignal as the transceiver model (run lanes1_relock: the Lane layer detects the loss through its RXERR counter, also across the reset of the receive buffer that the idle line starts; the run fails when the words after a reset are withheld up to the first K character) and following the line (run lanes1_relock_line: Phy_NoSignal shows the loss) PA-MD-10, PA-MD-06, PA-RS-03

Reset sequencer

ofb_pa_gty_lane_rst_tb (VUnit, GHDL and QuestaSim): ofb_pa_gty_lane_rst with shortened intervals (setup 4, pulse 6, hold 10, holdoff 12, CDR wait 50, gap 300, bounds 100 and 400 cycles of 10 ns), a model of the channel (RXRESETDONE falls 2 cycles after the start of a GTRXRESET pulse in sequential mode and rises 150 cycles after its end, or never rises again, or never falls; single-mode pulses leave it unchanged; a transmit buffer error until GTTXRESET, or sticky) and a monitor of the port rules on every cycle: GTRXRESET, GTTXRESET and RXCDRRESET never together; PCSRSVDIN[10] exactly with GTRXRESET in sequential mode; during GTRXRESET in sequential mode all PMA and PCS masks and PCSRSVDIN[9:8] set, in single mode the masks of the elastic buffer and PCSRSVDIN 0; the masks unchanged for at least the setup time before a pulse and during it; after a sequential pulse unchanged while the reset is in progress, which ends with the reset done or the timeout event; after a single-mode pulse unchanged for the hold time; during GTTXRESET the transmit masks of the transmit buffer reset, PCSRSVDIN 0 and the receiver masks unchanged; pulse widths; events of one cycle and never together.

Test ID Description Requirements
test_full (TC-PA-19) After the reset: values outside the sequences with the default PCSRSVDIN 0x0360. A request while the receivers of the wizard are not ready waits; when they are ready the entire receiver reset starts with the configured base 0x0040: setup with PCSRSVDIN 0x0340 for exactly the setup time, GTRXRESET with PCSRSVDIN 0x0740 for exactly the pulse time, PCSRSVDIN 0x0340 and receiver reset in progress until RXRESETDONE rises (150 to 153 cycles after the pulse); one reset done event, no timeout; afterwards the values outside the sequences with the base 0x0040. A request level held high beyond the gap starts one reset only PA-RS-04, PA-ST-03
test_timeout (TC-PA-20) RXRESETDONE withheld after it fell: the timeout event 400 to 403 cycles after the pulse, no reset done event, the values outside the sequences; a request in the gap after the timeout is dropped, a request after the gap completes with a reset done event. RXRESETDONE never falling: the timeout event 100 to 103 cycles after the pulse PA-RS-05, PA-ST-03
test_cdr_only (TC-PA-21) CDR-only mode: RXCDRRESET with the start, no GTRXRESET, masks and PCSRSVDIN unchanged, receiver reset in progress for exactly the pulse and the wait, RXRESETDONE unaffected, a reset done event; a request in the following gap is dropped, one after it served PA-RS-04
test_tx_buffer (TC-PA-22) A transmit buffer error: one transmit buffer reset that clears it, no receiver reset event, the values outside the sequences afterwards; an error that stays: one reset per sequence and holdoff (5 to 7 in five sequence lengths) PA-RS-06
test_rx_buffer (TC-PA-23) A request: the buffer reset window for exactly the setup, pulse and hold time, PCSRSVDIN 0 from the setup, one buffer reset, no receiver reset event; a request level held high starts one reset; two rising edges during a buffer reset give one more reset PA-RS-03
test_priority (TC-PA-24) Receiver reset, transmit buffer error and buffer reset requested together while the receivers are not ready: the receiver reset first, the transmit buffer reset after the holdoff, the buffer request absorbed by the receiver reset (no buffer reset); a receiver reset request during the reset dropped; a receiver reset request in the gap dropped; a new PCSRSVDIN base taken at the start of the next sequence, a change during a sequence only at the following one; a buffer request during a receiver reset served after it and the holdoff, with the new base; a reset of the sequencer during a receiver reset gives the values outside the sequences with the default base at once and no event, and a request afterwards is served PA-RS-03, PA-RS-04, PA-RS-06
test_reset_states (TC-PA-26) A reset of the sequencer for one cycle in each state of the sequences: setup, pulse and the waits for RXRESETDONE falling and rising of the entire receiver reset, pulse and wait of the CDR-only reset, setup, pulse and hold of the transmit buffer reset and of the buffer reset; each state reached by its request and recognised by its port values. At the clock edge of the reset the values outside the sequences with the default PCSRSVDIN 0x0360, no event; afterwards a request of the same kind is served (a transmit buffer error that the reset left set without a new one) PA-RS-02, PA-RS-03, PA-RS-04, PA-RS-06
test_drop_in_reset (TC-PA-27) A receiver reset request (rising edge) in each state of the entire receiver reset other than the wait for RXRESETDONE rising (setup, pulse, wait for RXRESETDONE falling, ended by the timeout) and of the CDR-only reset (pulse, wait), each state recognised by its port values: the sequence completes with its event and no second receiver reset follows, also after the gap PA-RS-04

4. Coverage analysis

PA-IF-02 and PA-IF-03 are exercised by the lane initialisation of TC-PA-02 (the Lane layer drives line driver, line receiver and CDR enable in ClearLine; NoSignal is 0, so Wait ends at once); the entire receiver reset at the falling edge of CDR enable (PA-RS-04) runs on the transceiver model in the lane restart of TC-PA-02 and on the behavioural model in TC-PA-25 and TC-CORE-37. The CDR hold (PA-IF-04) depends on the electrical idle detection of the transceiver and is not modelled by the behavioural model; the lane restart of TC-PA-02 reports the electrical idle and the CDR lock of the transceiver model while the line is idle. The sequences of the reset ports (PA-RS-04 to PA-RS-06) are checked cycle by cycle in TC-PA-19 to TC-PA-24 on the sequencer that both architectures use; TC-PA-26 resets the sequencer in every state of the sequences, and TC-PA-27 sends a receiver reset request in every state of a receiver reset. A lane failure over the transceiver model is not simulated: the behavioural model covers it in the core testbench (TC-CORE-07).

The transceiver model does not insert the forced error of the PRBS generator (TXPRBSFORCEERR): TC-PA-06 tests the error detection of the checker with bit errors on the line instead. The path of the forced error from the register to the adapter port is tested in the core testbench (TC-CORE-18) and the forced error itself on the hardware (TC-VCK-HW-08).