Validation and Testing
Summary
IPBridge validation spans RTL simulation testbenches (Vivado xsim), software validation scripts, and end-to-end hardware testing. Each RTL module has a dedicated testbench with pass/fail reporting. The test_e2e.sh script orchestrates live hardware validation by capturing RTP multicast output and running protocol analysis. The Phase 1 test plan defines seven test cases covering HDMI input detection, RTP correctness, PTP synchronization, packet loss, and compression ratio.
Current State
- All six RTL modules have dedicated testbenches with structured pass/fail checks.
- RTP validation script (
validate_rtp.py) checks 9 aspects: packet count, RTP version, payload type, SSRC consistency, MTU compliance, sequence continuity, timestamp consistency, marker bits, and inter-packet jitter. - End-to-end test script (
test_e2e.sh) automates prerequisite checks, SDP fetch, RTP capture via GStreamer, and validation. - Receive pipeline script (
receive_pipeline.sh) provides GStreamer-based capture and display modes. - Simulation runner (
run_sim.tcl) supports batch-mode Vivado simulation with automatic PASS/FAIL detection. - Phase 1 test plan documented with 7 test cases (TC-1 through TC-7).
Key Files
- sim/tb_adv7611_rx.sv - HDMI receiver testbench (1080p/720p resolution, pixel passthrough)
- sim/tb_wavelet_compress.sv - Compression testbench (lossy/lossless round-trip, PSNR)
- sim/tb_rtp_packetizer.sv - RTP packetizer testbench (segmentation, headers, backpressure)
- sim/tb_ptp_engine.sv - PTP engine testbench (accuracy, rollover, adjustments, RTP rate)
- sim/tb_eth_10g_wrapper.sv - Ethernet MAC testbench (loopback, data integrity)
- sim/tb_ipbridge_top.sv - Full pipeline integration testbench
- scripts/validate_rtp.py - RTP packet validation tool
- scripts/test_e2e.sh - End-to-end test orchestrator
- scripts/receive_pipeline.sh - GStreamer receive pipeline (capture/display)
- docs/phase1-test-plan.md - Phase 1 test plan document
Technical Details
RTL Testbench Summary
| Testbench | Tests | Key Checks |
|---|---|---|
| tb_adv7611_rx | 7 | 1080p/720p resolution detection, pixel data passthrough, frame_start pulse |
| tb_wavelet_compress | 10 | Lossy/lossless output production, compression ratio, round-trip PSNR, constant block quality |
| tb_rtp_packetizer | 20+ | Packet count (3000B → 3 pkts), Ethernet/IPv4/UDP/RTP headers, marker bit, payload integrity, backpressure |
| tb_ptp_engine | 11 | Free-running ns accuracy (+/-2ns), seconds rollover, absolute set, positive/negative offset, RTP rate (90kHz), frame capture, rollover RTP continuity |
| tb_eth_10g_wrapper | 7 | Link status, 100-byte loopback, SOF/EOF framing, data integrity, backpressure, idle behavior |
| tb_ipbridge_top | 13 | Link status, full pipeline packet output, RTP header validation (EtherType, IP version, UDP protocol, RTP version/PT), streaming status, 1080p resolution detection |
All testbenches use a common convention: $display("PASS") or $display("FAIL") followed by $finish. The simulation runner (run_sim.tcl) searches for these markers in the log.
Running Simulations
# Individual testbench
vivado -mode batch -source scripts/run_sim.tcl -tclargs tb_rtp_packetizer
# All testbenches (manual iteration)
for tb in tb_adv7611_rx tb_wavelet_compress tb_rtp_packetizer tb_ptp_engine tb_eth_10g_wrapper tb_ipbridge_top; do
vivado -mode batch -source scripts/run_sim.tcl -tclargs $tb
doneEnd-to-End Testing (test_e2e.sh)
The script runs on SERVER-PC against a live IPBridge device:
- Prerequisites: Checks for GStreamer, Python 3, curl, network interfaces, multicast routing, device reachability (ping).
- SDP Fetch: Downloads SDP from
http://<device>:8080/api/sdp, extracts multicast address and port. - RTP Capture: Runs
receive_pipeline.sh captureto capture packets via GStreamer udpsrc with GDP framing. - RTP Validation: Runs
validate_rtp.pyon the capture file. Reports PASS/FAIL with detailed check results.
Exit code 0 = all checks passed, 1 = one or more failed.
Phase 1 Test Cases
| ID | Name | Method | Automated |
|---|---|---|---|
| TC-1 | HDMI Input Detection | Web API query | Manual |
| TC-2 | RTP Stream Production | GStreamer capture | Yes (test_e2e.sh) |
| TC-3 | RTP Header Correctness | validate_rtp.py | Yes (test_e2e.sh) |
| TC-4 | Packet Timing/Timestamp | validate_rtp.py | Yes (test_e2e.sh) |
| TC-5 | PTP Synchronization | Web API query | Manual |
| TC-6 | Zero Packet Loss (60s) | validate_rtp.py | Yes (test_e2e.sh -d 60) |
| TC-7 | Compression Ratio | Bitrate calculation | Manual |
Known Limitations
- Custom compression codec prevents decoded image quality validation with standard tools.
- No NMOS IS-04/IS-05 for device discovery and connection management.
- SDP is hand-crafted, not auto-generated from stream parameters.
- Display mode in receive_pipeline.sh is a placeholder (no JPEG XS decoder available).
Sources
- sim/tb_adv7611_rx.sv
- sim/tb_wavelet_compress.sv
- sim/tb_rtp_packetizer.sv
- sim/tb_ptp_engine.sv
- sim/tb_eth_10g_wrapper.sv
- sim/tb_ipbridge_top.sv
- scripts/validate_rtp.py
- scripts/test_e2e.sh
- scripts/receive_pipeline.sh
- docs/phase1-test-plan.md