Document API IEC60730 Library
Macros | Functions | Variables
Program Counter Check

Verifies all tests have completed on time. More...

Macros

#define IEC60730_VMC_COMPLETE   (1 << 0)
 Mask bit used for Variable Memory Checks completed.
 
#define IEC60730_IMC_COMPLETE   (1 << 1)
 Mask bit used for Invariable Memory Checks completed.
 
#define IEC60730_CPU_CLOCKS_COMPLETE   (1 << 2)
 Mask bit used for CPU Clocks Checks completed.
 
#define IEC60730_CPU_REGS_COMPLETE   (1 << 3)
 Mask bit used for CPU Register Checks completed.
 
#define IEC60730_INTERRUPT_COMPLETE   (1 << 4)
 Mask bit used for Interrupt Checks completed.
 
#define IEC60730_GPIO_COMPLETE   (1 << 5)
 Mask bit used for GPIO Plausibility Checks completed.
 
#define IEC60730_ANALOG_COMPLETE   (1 << 6)
 Mask bit used for Analog Plausibility Checks completed.
 
#define IEC60730_COMMS_COMPLETE   (1 << 7)
 Mask bit used for Communications Plausibility Checks completed.
 
#define IEC60730_OEM0_COMPLETE   (1 << 8)
 Mask bit used for OEM Check 0 completed.
 
#define IEC60730_OEM1_COMPLETE   (1 << 9)
 Mask bit used for OEM Check 1 completed.
 
#define IEC60730_OEM2_COMPLETE   (1 << 10)
 Mask bit used for OEM Check 2 completed.
 
#define IEC60730_OEM3_COMPLETE   (1 << 11)
 Mask bit used for OEM Check 3 completed.
 
#define IEC60730_OEM4_COMPLETE   (1 << 12)
 Mask bit used for OEM Check 4 completed.
 
#define IEC60730_OEM5_COMPLETE   (1 << 13)
 Mask bit used for OEM Check 5 completed.
 
#define IEC60730_OEM6_COMPLETE   (1 << 14)
 Mask bit used for OEM Check 6 completed.
 
#define IEC60730_OEM7_COMPLETE   (1 << 15)
 Mask bit used for OEM Check 7 completed.
 
#define IEC60730_ALL_COMPLETE_BITS
 Mask used for checking that all bits are set. More...
 

Functions

void sl_iec60730_program_counter_test (void)
 

Variables

uint16_t sl_iec60730_program_counter_check
 

Detailed Description

Verifies all tests have completed on time.

The frequency of test execution must be checked to ensure that tests are being run in time.

Hardware Architecture

The Program counter check requires that each BIST test set a bit in a bit array whenever an iteration of testing completes. The Program counter check uses the test clock timer configured in the system clock plausibility test to determine when to execute. See System Clock Check for system clock plausibility details. The Program counter test executes at 1/10 the frequency of the system clock plausibility test. Best practice recommendations and example OEM code configure the system clock plausibility test to run at 100 ms intervals, resulting in BIST frequency check intervals of 1s.

Bits within sl_iec60730_program_counter_check are set as tests pass. OEMs can determine how fast their tests are running by checking this variable. If a bit is still clear, that test has not completed.

Suggested OEM Configuration

OEM configuration of this test is dependent on system clock plausibility configuration. Please see System Clock Check for details.

Failure Risks

The library's BIST execution frequency test will force entry into safe state if a period of time defined by 1/10 test clock test frequency passes without all BIST tests completing their test execution. It is the OEM's responsibility to call the BIST in the main() loop with enough frequency to execute all tests within the required time period.

If the system clock test's test timer is not configured as expected, so that 1/10 test clock frequency is unexpectedly fast, the system may fall into safe state because tests have not had enough time to execute to completion.

Software Architecture

For the IEC60730 implementation, see Figure 1

Figure 1 Program counter check flowchart

Macro Definition Documentation

◆ IEC60730_ALL_COMPLETE_BITS

#define IEC60730_ALL_COMPLETE_BITS

Function Documentation

◆ sl_iec60730_program_counter_test()

void sl_iec60730_program_counter_test ( void  )

public IEC60730 program counter test

Checks flags in sl_iec60730_program_counter_check set by each BIST test to determine if BIST is executing within a specified period.

Returns
sl_iec60730_test_result_t. If test fails, returns SL_IEC60730_TEST_FAILED;
otherwise SL_IEC60730_TEST_PASSED.

Variable Documentation

◆ sl_iec60730_program_counter_check

uint16_t sl_iec60730_program_counter_check

Global variable used by BIST to determine if modules are running frequently enough to meet maximum fault time.

sl_iec60730_program_counter_check equals 0 before BIST check. Each module then sets its assigned bit once it has completed testing. Before the maximum fault time, sl_iec60730_program_counter_test() verifies that the value is IEC60730_ALL_COMPLETE_BITS.

IEC60730_COMMS_COMPLETE
#define IEC60730_COMMS_COMPLETE
Mask bit used for Communications Plausibility Checks completed.
Definition: sl_iec60730.h:346
IEC60730_CPU_REGS_COMPLETE
#define IEC60730_CPU_REGS_COMPLETE
Mask bit used for CPU Register Checks completed.
Definition: sl_iec60730.h:338
IEC60730_GPIO_COMPLETE
#define IEC60730_GPIO_COMPLETE
Mask bit used for GPIO Plausibility Checks completed.
Definition: sl_iec60730.h:342
IEC60730_IMC_COMPLETE
#define IEC60730_IMC_COMPLETE
Mask bit used for Invariable Memory Checks completed.
Definition: sl_iec60730.h:334
IEC60730_CPU_CLOCKS_COMPLETE
#define IEC60730_CPU_CLOCKS_COMPLETE
Mask bit used for CPU Clocks Checks completed.
Definition: sl_iec60730.h:336
IEC60730_OEM7_COMPLETE
#define IEC60730_OEM7_COMPLETE
Mask bit used for OEM Check 7 completed.
Definition: sl_iec60730.h:362
IEC60730_OEM0_COMPLETE
#define IEC60730_OEM0_COMPLETE
Mask bit used for OEM Check 0 completed.
Definition: sl_iec60730.h:348
IEC60730_OEM6_COMPLETE
#define IEC60730_OEM6_COMPLETE
Mask bit used for OEM Check 6 completed.
Definition: sl_iec60730.h:360
IEC60730_ANALOG_COMPLETE
#define IEC60730_ANALOG_COMPLETE
Mask bit used for Analog Plausibility Checks completed.
Definition: sl_iec60730.h:344
IEC60730_VMC_COMPLETE
#define IEC60730_VMC_COMPLETE
Mask bit used for Variable Memory Checks completed.
Definition: sl_iec60730.h:332
IEC60730_INTERRUPT_COMPLETE
#define IEC60730_INTERRUPT_COMPLETE
Mask bit used for Interrupt Checks completed.
Definition: sl_iec60730.h:340
IEC60730_OEM2_COMPLETE
#define IEC60730_OEM2_COMPLETE
Mask bit used for OEM Check 2 completed.
Definition: sl_iec60730.h:352
IEC60730_OEM3_COMPLETE
#define IEC60730_OEM3_COMPLETE
Mask bit used for OEM Check 3 completed.
Definition: sl_iec60730.h:354
IEC60730_OEM4_COMPLETE
#define IEC60730_OEM4_COMPLETE
Mask bit used for OEM Check 4 completed.
Definition: sl_iec60730.h:356
IEC60730_OEM1_COMPLETE
#define IEC60730_OEM1_COMPLETE
Mask bit used for OEM Check 1 completed.
Definition: sl_iec60730.h:350
IEC60730_OEM5_COMPLETE
#define IEC60730_OEM5_COMPLETE
Mask bit used for OEM Check 5 completed.
Definition: sl_iec60730.h:358