1.41 CLASSB_CPU_PCTest

Function

CLASSB_TEST_STATUS CLASSB_CPU_PCTest(bool running_context);

Summary

This self-test checks the Program Counter register (PC) of the CPU, to detect stuck-at faults.

Description

This self-test calls multiple functions in predefined order and verifies that each function is executed and returns the expected value. If the return values of all test functions are correct, the Program Counter is assumed to be working fine.

Precondition

None.

Parameters

running_context - False for startup test. True for run-time test.

Returns

CLASSB_TEST_STATUS - Status of the test.

Example

CLASSB_TEST_STATUS classb_test_status = CLASSB_TEST_NOT_EXECUTED;
// Perform run-time test of the PC
classb_test_status = CLASSB_CPU_PCTest(true);

Remarks

This self-test can be used during startup as well as run-time. If a failure is detected, this self-test remains in an infinite loop to avoid unsafe code execution.