RM_SAFETY_CHECKERS

RM safety checkers library APIs are integrated into the safety application to verify the RM modules configurations and validate the current RM modules configurations against golden reference.

Features Supported

The module supports below API’s for the application

  • API to get the configurations registers for RM modules such as IR, IA IMAP, Ring Accelerator and DMA config registers.

  • API to read RM module registers at run time and validate they are matching with golden state for modules in the safety loop.

SysConfig Features

  • None

Features NOT Supported

  • None

Important Usage Guidelines

  • None

Example Usage

The following shows an example of RM safety checkers API usage

Include the below file to access the APIs

#include "../../src/safety_checkers_rm.h"

return the rmRegCfg with register configuration for RM module.

SafetyCheckers_rmGetRegCfg(rmRegCfg, size);

compares the rmRegCfg (golden reference) with runtime RM configuration values and return success or failure.

if(gflag == 1)
{
    gflag = 0;
    retVal = SafetyCheckers_rmVerifyRegCfg(rmRegCfg, size);

    if(retVal != 0)
    {
        DebugP_log("Register Mismatch\r\n");
    } else{
        DebugP_log("No Register Mismatch\r\n");
    }
}

API Reference

This file contains RM safety checkers library interfaces and related data structures.

Defines

SAFETY_CHECKERS_RM_MAX_REG_PER_GROUP

Maximum number of registers in a register group.

Functions

int32_t SafetyCheckers_rmGetRegCfg(uintptr_t *rmRegCfg, uint32_t size)

API to get the register value for all the RM control modules E.g. When the RM register configuration is requested, SafetyCheckers_rmGetRegCfg collects the register configuration values for all the RM control module by getting the base address and the length from the structure. The collected dump shall be considered as a golden sample and shall be returned to the application. Register values from the RM control modules IR, IA, RA and DMA are used for taking the register dump.

Parameters:
  • rmRegCfg – [IN/OUT] Pointer to store the Register configuration

  • size – [IN] Size of reg cfg array

Returns:

SAFETY_CHECKERS_SOK in case of success,else failure.

int32_t SafetyCheckers_rmVerifyRegCfg(const uintptr_t *rmRegCfg, uint32_t size)

API to read back and compare the RM control module registers data

E.g. When the RM verify register dump is requested, SafetyCheckers_rmVerifyRegCfg API collects the value for RM registers and compares with the received register values. Register values from the RM control modules IR, IA, RA and DMA are used for verifying the register dump.

Parameters:
  • rmRegCfg – [IN] Pointer of the golden sample

  • size – [IN] Size of reg dump pointer

Returns:

SAFETY_CHECKERS_SOK in case of success else failure

struct SafetyCheckers_RmRegData
#include <safety_checkers_rm.h>

Structure to hold the base address and the register details of RM control module registers.

Public Members

uint32_t baseAddr
uint32_t regNum
uint32_t regArrayLen
uint32_t regStartOffset
uint32_t regOffsetArr[SAFETY_CHECKERS_RM_MAX_REG_PER_GROUP]