| sysmon Vitis Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

sysmon Documentation

The XSysMon driver supports the Xilinx System Monitor/ADC device.The System Monitor/ADC device has the following features:

- 10-bit, 200-KSPS (kilo samples per second) Analog-to-Digital Converter (ADC)
- Monitoring of on-chip supply voltages and temperature
- 1 dedicated differential analog-input pair and 16 auxiliary differential analog-input pairs
- Automatic alarms based on user defined limits for the on-chip supply voltages and temperature
- Automatic Channel Sequencer, programmable averaging, programmable acquisition time for the external inputs, unipolar or differential input selection for the external inputs
- Inbuilt Calibration
- Optional interrupt request generation
- External Mux (7 Series and Zynq XADC)

The user should refer to the hardware device specification for detailed information about the device.

This header file contains the prototypes of driver functions that can be used to access the System Monitor/ADC device.

System Monitor Channel Sequencer Modes

The System Monitor Channel Sequencer supports the following operating modes:

- Default : This is the default mode after power up. In this mode of operation the System Monitor operates in a sequence mode, monitoring the on chip sensors: Temperature, VCCINT, and VCCAUX.
- One pass through sequence : In this mode the System Monitor converts the channels enabled in the Sequencer Channel Enable registers for a single pass and then stops.
- Continuous cycling of sequence : In this mode the System Monitor converts the channels enabled in the Sequencer Channel Enable registers continuously.
- Single channel mode: In this mode the System Monitor Channel Sequencer is disabled and the System Monitor operates in a Single Channel Mode. The System Monitor can operate either in a Continuous or Event driven sampling mode in the single channel mode.
- Simultaneous sampling mode: This mode is available only in 7 Series and Zynq XADC devices. In this mode both ADCs sample and digitizes two different analog input signals at the same time.
- Independent ADC mode: This mode is available only in 7 Series and Zynq XADC devices. In this mode ADC A is used to implement a fixed monitoring mode which is similar to default mode, but the fixed alarm functions are enabled. ADC B is available to be used with the external analog input channels only.

Initialization and Configuration

The device driver enables higher layer software (e.g., an application) to communicate to the System Monitor/ADC device.

XSysMon_CfgInitialize() API is used to initialize the System Monitor/ADC device. The user needs to first call the XSysMon_LookupConfig() API which returns the Configuration structure pointer which is passed as a parameter to the XSysMon_CfgInitialize() API.

Interrupts

The System Monitor/ADC device supports interrupt driven mode and the default operation mode is polling mode.

The interrupt mode is available only if hardware is configured to support interrupts.

This driver does not provide a Interrupt Service Routine (ISR) for the device. It is the responsibility of the application to provide one if needed. Refer to the interrupt example provided with this driver for details on using the device in interrupt mode.

Virtual Memory

This driver supports Virtual Memory. The RTOS is responsible for calculating the correct device base address in Virtual Memory space.

Threads

This driver is not thread safe. Any needs for threads or thread mutual exclusion must be satisfied by the layer above this driver.

Asserts

Asserts are used within all Xilinx drivers to enforce constraints on argument values. Asserts can be turned off on a system-wide basis by defining, at compile time, the NDEBUG identifier. By default, asserts are turned on and it is recommended that users leave asserts on during development.

Building the driver

The XSysMon driver is composed of several source files. This allows the user to build and link only those parts of the driver that are necessary.

Limitations of the driver

System Monitor/ADC device can be accessed through the JTAG port and the AXI interface. The driver implementation does not support the simultaneous access of the device by both these interfaces. The user has to care of this situation in the user application code.

    MODIFICATION HISTORY:

    Ver   Who    Date     Changes

    1.00a xd/sv  05/22/07 First release
    2.00a sv     07/07/08 Added bit definitions for new Alarm Interrupts in the
                    Interrupt Registers. Changed the ADC data functions
                    to return 16 bits of data. Added macros for conversion
                    from Raw Data to Temperature/Voltage and vice-versa.
    3.00a sdm    02/09/09 Added APIs and bit definitions for V6 SysMon.
    4.00a ktn    10/22/09 Updated the driver to use the HAL Processor APIs/macros.
                    The macros have been renamed to remove _m from the name
                    in all the driver files.
    5.00a sdm    06/15/11 Added support for XADC 7 Series.
    5.01a bss    02/28/12 Added support for Zynq,
                    renamed XSM_ATR_BRAM_UPPER to XSM_ATR_VBRAM_UPPER
                    renamed XSM_ATR_BRAM_LOWER to XSM_ATR_VBRAM_LOWER
    5.02a bss    11/23/12 Added APIs and Macros to support Temperature Updation
                    over TEMP_OUT port(CR #679872)
    5.03a bss    04/25/13 Modified XSysMon_SetSeqChEnables,
                    XSysMon_SetSeqAvgEnables, XSysMon_SetSeqInputMode
                    and XSysMon_SetSeqAcqTime APIs to check for Safe Mode
                    instead of Single Channel mode(CR #703729) in xsysmon.c
                    Modified examples: xsysmon_polled_example.c,
                    xsysmon_low_level_example.c,
                    xsysmon_intr_printf_example.c, xsysmon_intr_example.c
                    xsysmon_extmux_example.c and
                    xsysmon_polled_printf_example.c to set Sequencer Mode
                    as Safe mode instead of Single channel mode before
                    configuring Sequencer registers.
    6.0   adk  19/12/13   Updated as per the New Tcl API's
    7.0   bss  7/25/14    To support Ultrascale:
                    Added XSM_CH_VUSR0 - XSMXSM_CH_VUSR3,XSM_MAX_VUSR0 -
                    XSM_MIN_VUSR3,XSM_ATR_VUSR0_UPPER -
                    XSM_ATR_VUSR3_LOWER macros.
                    Added XSM_IP_OFFSET macro(since register
                    offsets are different for Ultrascale compared to
                    earlier families),Offsets,Masks for VUSER0 to
                    VUSER3 channels, Configuration Register 3 and
                    Sequence Registers 8 and 9 in xsysmon_hw.h.
                    Modified XSysMon_GetAdcData,
                    XSysMon_GetMinMaxMeasurement,
                    XSysMon_SetSingleChParams, XSysMon_SetAlarmEnables,
                    XSysMon_GetAlarmEnables,XSysMon_SetSeqChEnables,
                    XSysMon_GetSeqChEnables,XSysMon_SetSeqAvgEnables,
                    XSysMon_GetSeqAvgEnables,XSysMon_SetAlarmThreshold
                    and XSysMon_GetAlarmThreshold in xsysmon.c.
                    Modified driver tcl to generate XPAR_SYSMON_0_IP_TYPE
                    parameter.
    7.1     bss  05/06/15 Modified temperature transfer function for
                                              for Ultrascale CR#859369
    7.2   sk   11/10/15 Used UINTPTR instead of u32 for Baseaddress CR# 867425.
                        Changed the prototype of XSysMon_CfgInitialize API.
    7.2  adk  29/02/16 Updated interrupt example to support Zynq and ZynqMP
                       CR#938326.
    7.2  asa  11/03/16  Made changes to use configuration register 3 only for
                                      Ultrascale. This fixes the CR#910905.
    7.2  adk  14/03/16 Fix compilation issues when sysmon is configured
                       with streaming interface CR#940976.
    7.3  vns  15/04/16 Corrected Ultrascale conversion formulae CR#949949
         ms   01/23/17 Added xil_printf statement in main function for all
                       examples to ensure that "Successfully ran" and "Failed"
                       strings are available in all examples. This is a fix
                       for CR-965028.
         ms   03/17/17 Added readme.txt file in examples folder for doxygen
                       generation.
         ms   04/05/17 Modified Comment lines in functions of sysmon
                       examples to recognize it as documentation block
                       for doxygen generation.
    7.4  ms   04/18/17 Modified tcl file to add suffix U for all macros
                       definitions of sysmon in xparameters.h
    7.6  aad  03/23/20 Aligned Macros to the documentation
    7.8  cog  07/20/23 Added support for SDT flow