PLM Interface (XilPLMI) - 2024.1 English

Versal Adaptive SoC System Software Developers Guide (UG1304)

Document ID
UG1304
Release Date
2024-05-30
Version
2024.1 English

The PLM Interface (XilPLMI) is a low-level interface layer for the PLM main application and other PLM modules. XilPLMI provides the common functionality required for the modules that run with PLM. Each new module can register itself with the supported command handlers. These command handlers are executed based on the request received from other modules or from other subsystems.

XilPLMI also includes the CDO parser that parses and executes any CDO commands. XilPLMI implements the Generic Module that includes generic commands to be used by all other modules. The XilPLMI layer provides:

  • Interface for parsing CDO files
  • Implementation for general PLM CDO commands
  • Interface to register handlers for commands that can be part of CDO and IPI
  • Interface to set error actions and register notifications for error events
  • Interface to schedule timer events
  • Debug print levels and common utilities
  • Interface to register interrupt events
  • Interface to SSI-based PLM to PLM communication
  • Interface to execute device secure lockdown for tamper events, halt on boot failures and over IPI request from any master (APU/RPU)
Task Dispatcher Loop
XilPLMI uses a very simple run-to-completion, time-limited priority task loop model, to get real-time behavior. The main program is a simple loop that looks up the next task from a queue of tasks, and calls the function to execute the task.

This model is simple in the sense that because all tasks are executed until they are done, there are no critical regions and no locking needed. Any code in the PLM can access any global data without having to worry about any other tasks being in the middle of updating the data.

Figure 1. Task Dispatch Loop

Modules
XilPLMI provides an interface layer for modules to register the commands for PLM. Commands can come from the CDO or IPI.
Configurable Parameters
Modules
Configurable to include or exclude modules, boot drivers based on your needs.
Debug Prints
Configurable to include multiple levels of print statements. For more information, refer to PLM Build Flags.
CDO
The CDO file contains the configuration information generated by the tools in the form of CDO commands. The module that supports the CDO registers itself to the PLM during the module initialization phase. XilPLMI provides the API to parse the CDO file and propagates the commands and its payload to the respective modules.
IPI Handling
The PLM handles IPI interrupts, so that messages can be exchanged between the PLM and other processor on the Versal device. Data that is sent through IPI follows the CDO format.
Scheduler
This is a simple timer-based function scheduler to support execution of periodic tasks. A scheduler is required by modules such as XilSEM to support periodic tasks such as SEU detection scan operations.
Note: Accuracy of the PMC IRO clock affects the scheduler accuracy.
PLM Watchdog Timer
PLM has the framework to update the PLM health periodically. PLM toggles multiplexed I/Os (MIO) to update health to an external watchdog timer (WDT). The PMC MIO is preferred but if an LPD MIO is used, then it is important to note that this WDT will be disabled when the PS LPD goes down.

The WDT can be enabled in the Vivado CIPS, and CIPS generates all the preceding required commands to enable WDT in PLM.

The PLM WDT can be enabled by using the SetWdt CDO command with the parameters MIO PIN and periodicity. Before running the SetWdt CDO command, ensure that MIO is configured as GPIO and load the corresponding PMC / LPD CDO. The minimum periodicity is 20 ms.

The PLM implementation is as follows:

Normal Context
  • PLM will set a variable to indicate ALIVE in between every task.
  • During PDI load, the PLM Alive bit is set at different places in the flow where a delay or wait time is seen. Few examples of when this Alive bit is set: after every chunk of CDO processing, secure operations on a partition, delays/waits in boot drivers, and mask polls.
  • If the LPD MIO is used, the WDT is disabled during LPD shutdown.
  • If any task takes longer than the WDT periodicity, the ALIVE bit will be set and external WDT can reset the device.
Interrupt Context
  • Current scheduler period is 10 ms. This period indicates that for every 10 ms, the PLM gets a timer interrupt to schedule the tasks.
  • The WDT handler is called in the scheduler.
  • When the WDT is enabled, the WDT handler performs following operation periodically based on configured periodicity (for example, for a periodicity of 100 ms, the following tasks run ~10 ms before expiry of periodicity). The WDT handler toggles the MIO pin only when PLM alive status is set and clear the PLM alive status.
Table 1. Set PLM WDT
Command: Set PLM WDT
Reserved [31:24]=0 Length [23:16]=2 PLM=1 CMD_SET_PLM_WDT=22
Node IDx - PMC MIO PIN / LPD MIO PIN
[31:16] Reserved [15:0] Periodicity in ms - Default = 100 ms
Note: For safety applications, to enable WDT on PMC MIO0 (whose node ID is 0x1410801B) with periodicity of 150 ms, add the set_plm_wdt 0x1410801B 150 command in the CDO. This CDO command should be added in a user CDO to enable the external WDT in the PLM. This user CDO can be placed anywhere after the PMC CDO in the bif. For a list of all MIO node IDs, refer to the xpm_nodeid.h file in the XilPM library.