feat(telemetry): add XADC system telemetry (Phase 1)#15
Draft
steve007iii wants to merge 1 commit into
Draft
Conversation
New module xadc_telemetry.v wraps the Artix-7 internal XADC primitive
to continuously sample junction temperature and supply voltages
(Vccint, Vccaux, Vbram). A small DRP read state machine latches the
12-bit raw values into registered outputs after each end-of-sequence
pulse. The XADC OT_OUT and ALM[7:0] signals are exposed combinationally.
Phase 1 integration in libresdr_b210.v:
- Module instantiated with bus_clk (100 MHz) as DRP clock
- over_temp signal ORd into LED_USER_R so the user LED also lights
when junction temperature exceeds the XADC OT threshold (~125 degC
by default), in addition to the existing ref-unlocked indication.
Future work (Phase 2, separate PR):
- Wire the latched 12-bit values into the b200_core register read
path so they are accessible via UHD as mboard sensors.
Resource cost (estimated, pending synthesis):
- LUTs: ~200 (DRP state machine)
- DSPs: 0
- BRAM: 0
- FPGA pins: 0 (XADC is internal)
Configuration of the XADC primitive:
- Continuous sequence mode (INIT_41 = 0x2EF0)
- DCLK divider = 8 -> 12.5 MHz ADCCLK from 100 MHz DRP clock
- Internal sensors: TEMP, VCCINT, VCCAUX, VBRAM
- Calibration channels (CAL0/1/3) enabled
- Default alarm thresholds (~85 degC warning, ~125 degC OT)
References: Xilinx UG480 (XADC User Guide, 7-Series).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds FPGA system telemetry using the Artix-7 internal XADC primitive. Continuously samples junction temperature and supply voltages (Vccint, Vccaux, Vbram) and exposes them as registered outputs. The XADC
OT_OUT(over-temperature) signal is also routed to the user LED so the panel visibly reflects thermal conditions.Motivation
The B210mini design currently has no on-FPGA monitoring of:
The Artix-7
XADCprimitive is free (already in the silicon, costs no LUTs or DSPs) and provides this telemetry natively. Adding it is a clear value-add with minimal cost.What's in this PR
New module:
xadc_telemetry.vA thin wrapper around the
XADCprimitive:bus_clk)validpulse marks a fresh full sweepover_tempandalarm[7:0]exposed combinationallyConversions (per UG480):
Temp [°C] = (raw * 503.975 / 4096) - 273.15Voltage [V] = (raw * 3.0) / 4096Integration in
libresdr_b210.vbus_clk/bus_rstover_tempinto the existingLED_USER_Rdriver:This means the user LED lights up on either "ref unlocked" (existing behavior) or "FPGA over temperature" (new). The two states aren't distinguishable at the LED, but the failure modes are both "needs attention" and a stuck-on LED post-power-cycle is a useful diagnostic.
The 12-bit values (
xadc_temp_raw,xadc_vccint_raw, etc.) are wired up internally but not yet routed to UHD-readable registers. That's intentional — it's "Phase 2" follow-up work that needs hardware testing.Resource impact (estimated)
Phase 2 (separate PR, requires hardware testing)
To make the telemetry visible from the UHD host side:
b200_core.vxadc_temp_rawetc. through the readback pathThis part is deliberately omitted here because it requires:
I'd rather land Phase 1 cleanly first and then iterate on Phase 2 with feedback.
Testing status
Compatibility
libresdr_b210moduleb200_core.v,radio_legacy.v, or any DSP/comms pathsNotes for reviewers
xadc_telemetry.vmay need to be added to the Vivado project's source list if it's not auto-discovered. One click in Vivado:Add Sources → Add or Create Design Sources → select xadc_telemetry.v.SIM_DEVICE("7SERIES")parameter on the XADC primitive is set for Artix-7. Other 7-Series families also work with this value.