PLM Interface (XilPLMI) - 2020.2 English

Versal ACAP System Software Developers Guide (UG1304)

Document ID
Release Date
2020.2 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
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.

The complexity with the run-to-completion model comes when a particular task needs to run longer than for the maximum allowed time limit (GTL). If that happens, split the tasks into multiple events.

Figure 1. Task Dispatch Loop
XilPLMI provides an interface layer for modules to register the commands for PLM. Commands can come from the CDO or IPI.
Configurable Parameters
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.
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.
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) for this purpose when you use an external Watchdog Timer (WDT). PMC MIO is preferred but if you use a LPD MIO, then the WDT will be disabled when the PS is going down.

You can enable the PLM WDT by using the SetWdt CDO command with the parameters MIO PIN and periodicity. Before running the SetWdt CDO command, ensure that you configure MIO as GPIO and load the corresponding PMC / LPD CDO. PDI loading is considered as Configuration mode and WDT is not supported during Configuration mode for the 2020.2 release. Other operations considered as configuration mode are boot, partial PDI loading, and subsystem restart/resume. The minimum scheduler period is 15 ms.

The implementation is as follows:

Normal Context
  • PLM will set a variable to indicate ALIVE in between every task.
  • During PDI load, PLM mode is set to Configuration mode, and then reset to Operational mode when PDI is loaded.
  • If LPD MIO is used, 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)
    • When in configuration mode, the WDT handler toggles the MIO pin irrespective of the PLM alive status.
    • When in operation mode, the WDT handler toggles the MIO pin only when PLM alive status is set and clear the PLM alive status.
Command: Set PLM WDT
Reserved[31:24]=0 Length[23:16]=2 PLM=1 CMD_SET_PLM_WDT=22
[31:16] Reserved [15:0]Periodicity in ms - Default = 100ms