Energy Micro IEC60355 Library Project 1.037 GCC-Version
IEC60355 Library documentation and API

Program Counter Test

The program counter test checks the functionality of the CPUs PC. More...

Collaboration diagram for Program Counter Test:

Functions

testResult_t IEC60335_ClassB_PCTest_POST (const Exec_t *fTable, const IEC60335_B_PCTest_ReturnValues *rTable)
 public function referenced by POST test
testResult_t IEC60335_ClassB_PCTest_BIST (void)
 BIST test of PC.
IEC60335_B_PCTest_ReturnValues IEC60335_B_PCTest_A (Data_t *data)
 private function referenced by POST and BIST tests
IEC60335_B_PCTest_ReturnValues IEC60335_B_PCTest_B (Data_t *data)
 private function referenced by POST and BIST tests
IEC60335_B_PCTest_ReturnValues IEC60335_B_PCTest_C (Data_t *data)
 private function referenced by POST and BIST tests
IEC60335_B_PCTest_ReturnValues IEC60335_B_PCTest_D (Data_t *data)
 private function referenced by POST and BIST tests
IEC60335_B_PCTest_ReturnValues IEC60335_B_PCTest_E (Data_t *data)
 private function referenced by POST and BIST tests
IEC60335_B_PCTest_ReturnValues IEC60335_B_PCTest_F (Data_t *data)
 private function referenced by POST and BIST tests

Variables

const Exec_t PCTest_funcTable [6]
 function table to the PC test subroutines, this table is Flash located to prevent RAM usage in POST tests
const
IEC60335_B_PCTest_ReturnValues 
PCTest_resultTable [6]
 function table to the PC test subroutines return values, this table is Flash located to prevent RAM usage in POST tests
const Exec_t PCTest_funcTable [6]
 function table to the PC test subroutines, this table is Flash located to prevent RAM usage in POST tests
const
IEC60335_B_PCTest_ReturnValues 
PCTest_resultTable [6]
 function table to the PC test subroutines return values, this table is Flash located to prevent RAM usage in POST tests

Detailed Description

The program counter test checks the functionality of the CPUs PC.

POST and BIST tests are available. The PC test is realized in assembler
language to ensure direct access to the CPUs register. This tests are compiler coded specific according to their mnemonics.
Selecting the correct assembler source is necessary for compilation.

PC-Test.jpg

Function Documentation

IEC60335_B_PCTest_ReturnValues IEC60335_B_PCTest_A ( Data_t data)

private function referenced by POST and BIST tests

Parameters:
dataRAM location to do something with (not relevant)
Returns:
IEC60335_B_PCTest_ReturnValues table based enum value
Note:
The function is placed in a specified code segment to force the linker to locate it separately. The return value is specified by the return value table with enumerations. (DO_NOT_INCLUDE_WITH_DOXYGEN)

Definition at line 51 of file iec60335_class_b_programcounter_test.c.

References _Data::number, and VAL_A.

{
  data->number++;
  return VAL_A;
}
IEC60335_B_PCTest_ReturnValues IEC60335_B_PCTest_B ( Data_t data)

private function referenced by POST and BIST tests

Parameters:
dataRAM location to do something with (not relevant)
Returns:
IEC60335_B_PCTest_ReturnValues table based enum value
Note:
The function is placed in a specified code segment to force the linker to locate it separately. The return value is specified by the return value table with enumerations. (DO_NOT_INCLUDE_WITH_DOXYGEN)

Definition at line 72 of file iec60335_class_b_programcounter_test.c.

References _Data::number, and VAL_B.

{
  data->number++;
  return VAL_B;
}
IEC60335_B_PCTest_ReturnValues IEC60335_B_PCTest_C ( Data_t data)

private function referenced by POST and BIST tests

Parameters:
dataRAM location to do something with (not relevant)
Returns:
IEC60335_B_PCTest_ReturnValues table based enum value
Note:
The function is placed in a specified code segment to force the linker to locate it separately. The return value is specified by the return value table with enumerations. (DO_NOT_INCLUDE_WITH_DOXYGEN)

Definition at line 93 of file iec60335_class_b_programcounter_test.c.

References _Data::number, and VAL_C.

{
  data->number++;
  return VAL_C;
}
IEC60335_B_PCTest_ReturnValues IEC60335_B_PCTest_D ( Data_t data)

private function referenced by POST and BIST tests

Parameters:
dataRAM location to do something with (not relevant)
Returns:
IEC60335_B_PCTest_ReturnValues table based enum value
Note:
The function is placed in a specified code segment to force the linker to locate it separately. The return value is specified by the return value table with enumerations. (DO_NOT_INCLUDE_WITH_DOXYGEN)

Definition at line 114 of file iec60335_class_b_programcounter_test.c.

References _Data::number, and VAL_D.

{
  data->number++;
  return VAL_D;
}
IEC60335_B_PCTest_ReturnValues IEC60335_B_PCTest_E ( Data_t data)

private function referenced by POST and BIST tests

Parameters:
dataRAM location to do something with (not relevant)
Returns:
IEC60335_B_PCTest_ReturnValues table based enum value
Note:
The function is placed in a specified code segment to force the linker to locate it separately. The return value is specified by the return value table with enumerations. (DO_NOT_INCLUDE_WITH_DOXYGEN)

Definition at line 135 of file iec60335_class_b_programcounter_test.c.

References _Data::number, and VAL_E.

{
  data->number++;
  return VAL_E;
}
IEC60335_B_PCTest_ReturnValues IEC60335_B_PCTest_F ( Data_t data)

private function referenced by POST and BIST tests

Parameters:
dataRAM location to do something with (not relevant)
Returns:
IEC60335_B_PCTest_ReturnValues table based enum value
Note:
The function is placed in a specified code segment to force the linker to locate it separately. The return value is specified by the return value table with enumerations. (DO_NOT_INCLUDE_WITH_DOXYGEN)

Definition at line 156 of file iec60335_class_b_programcounter_test.c.

References _Data::number, and VAL_F.

{
  data->number++;
  return VAL_F;
}
testResult_t IEC60335_ClassB_PCTest_BIST ( void  )

BIST test of PC.

Attention:
for PC test, the C environment must be loaded!
Returns:
passed or failed. See testResult_t .
Note:
this test checks a one step branch to a sub-function the test performs different calls on each activation

(DO_NOT_INCLUDE_WITH_DOXYGEN)

Note:
The C-function is not used in the multi-compiler environment. It is for documentation purpose only

testResult_t IEC60335_ClassB_PCTest_POST(const Exec_t *fTable, const IEC60335_B_PCTest_ReturnValues *rTable) { UINT8 loop = 0; testResult_t Result = IEC60335_testFailed;

if ((fTable == 0) ||(rTable == 0)) { // check parameter return (Result); } while (loop < 6) { // march through tests

if (PCTest_resultTable[loop]==PCTest_funcTable[loop]) { loop ++; // good condition } else { loop = 10; // error condition } } if (loop == 6) { Result = IEC60335_testPassed; return (Result); } (DO_NOT_INCLUDE_WITH_DOXYGEN)

Definition at line 394 of file iec60335_class_b_programcounter_test.c.

References IEC60335_testFailed, IEC60335_testPassed, and VAL_G.

{
  static uint8_t lastFunction = 0;
  testResult_t   result       = IEC60335_testFailed;
  Exec_t         pfAction;
  Data_t         data = { VAL_G, 100 };

  if ((PCTest_resultTable[0] == 0) || (PCTest_funcTable[0] == 0))
  {
    return result;
  }
  if (lastFunction > 5)
  {
    lastFunction = 0;
  }
  
  pfAction = PCTest_funcTable[lastFunction];

  if (PCTest_resultTable[lastFunction] == (uint32_t)(*pfAction)(&data))
  {
    result                          = IEC60335_testPassed;
    lastFunction > 4 ? lastFunction = 0 : lastFunction++;
  }

  return result;
}
testResult_t IEC60335_ClassB_PCTest_POST ( const Exec_t fTable,
const IEC60335_B_PCTest_ReturnValues rTable 
)

public function referenced by POST test

Parameters:
fTableFlash location of subroutine table
rTableFlash location of expected return values
Returns:
passed or failed. See testResult_t .
Note:
The function is placed in a specified code segment to force the linker to locate it separately. The function saves input parameter, calls subroutines, compares the return values with the according table and returns a good or error state. The function is realized in "inline assembler" and a corresponding C-source is provided for better understanding.

POST test of PC.

Attention:
for PC test, the C environment must be loaded!
Returns:
passed or failed. See testResult_t .

Referenced by IEC60335_ClassB_POST().

Here is the caller graph for this function:


Variable Documentation

function table to the PC test subroutines, this table is Flash located to prevent RAM usage in POST tests

Definition at line 171 of file iec60335_class_b_programcounter_test.c.

Referenced by IEC60335_ClassB_POST().

Initial value:

function table to the PC test subroutines, this table is Flash located to prevent RAM usage in POST tests

Definition at line 171 of file iec60335_class_b_programcounter_test.c.

Referenced by IEC60335_ClassB_POST().

Initial value:

function table to the PC test subroutines return values, this table is Flash located to prevent RAM usage in POST tests

Definition at line 190 of file iec60335_class_b_programcounter_test.c.

Referenced by IEC60335_ClassB_POST().

function table to the PC test subroutines return values, this table is Flash located to prevent RAM usage in POST tests

Definition at line 190 of file iec60335_class_b_programcounter_test.c.

Referenced by IEC60335_ClassB_POST().