Software Drivers

xutil.h File Reference


Detailed Description

This file contains utility functions such as memory test functions.

Memory test description

A subset of the memory tests can be selected or all of the tests can be run in order. If there is an error detected by a subtest, the test stops and the failure code is returned. Further tests are not run even if all of the tests are selected.

Subtest descriptions:

 XUT_ALLMEMTESTS:
       Runs all of the following tests

 XUT_INCREMENT:
       Incrementing Value Test.
       This test starts at 'XUT_MEMTEST_INIT_VALUE' and uses the incrementing
       value as the test value for memory.

 XUT_WALKONES:
       Walking Ones Test.
       This test uses a walking '1' as the test value for memory.
       location 1 = 0x00000001
       location 2 = 0x00000002
       ...

 XUT_WALKZEROS:
       Walking Zero's Test.
       This test uses the inverse value of the walking ones test
       as the test value for memory.
       location 1 = 0xFFFFFFFE
       location 2 = 0xFFFFFFFD
       ...

 XUT_INVERSEADDR:
       Inverse Address Test.
       This test uses the inverse of the address of the location under test
       as the test value for memory.

 XUT_FIXEDPATTERN:
       Fixed Pattern Test.
       This test uses the provided patters as the test value for memory.
       If zero is provided as the pattern the test uses '0xDEADBEEF".
 

WARNING

The tests are DESTRUCTIVE. Run before any initialized memory spaces have been set up.

The address, Addr, provided to the memory tests is not checked for validity except for the NULL case. It is possible to provide a code-space pointer for this test to start with and ultimately destroy executable code causing random failures.

Note:
Used for spaces where the address range of the region is smaller than the data width. If the memory range is greater than 2 ** width, the patterns used in XUT_WALKONES and XUT_WALKZEROS will repeat on a boundry of a power of two making it more difficult to detect addressing errors. The XUT_INCREMENT and XUT_INVERSEADDR tests suffer the same problem. Ideally, if large blocks of memory are to be tested, break them up into smaller regions of memory to allow the test patterns used not to repeat over the region tested.

 MODIFICATION HISTORY:

 Ver    Who    Date    Changes
 ----- ---- -------- -----------------------------------------------
 1.00a ecm  11/01/01 First release
 1.00a xd   11/03/04 Improved support for doxygen.
 


Memory subtests

#define XUT_ALLMEMTESTS

Functions

int XUtil_MemoryTest32 (u32 *Addr, u32 Words, u32 Pattern, u8 Subtest)
int XUtil_MemoryTest16 (u16 *Addr, u32 Words, u16 Pattern, u8 Subtest)
int XUtil_MemoryTest8 (u8 *Addr, u32 Words, u8 Pattern, u8 Subtest)


Define Documentation

#define XUT_ALLMEMTESTS

See the detailed description of the subtests in the file description.


Function Documentation

int XUtil_MemoryTest16 ( u16 *  Addr,
u32  Words,
u16  Pattern,
u8  Subtest 
)

Performs a destructive 16-bit wide memory test.

Parameters:
Addr is a pointer to the region of memory to be tested.
Words is the length of the block.
Pattern is the constant used for the constant pattern test, if 0, 0xDEADBEEF is used.
Subtest is the test selected. See xutil.h for possible values.
Returns:

Note:
Used for spaces where the address range of the region is smaller than the data width. If the memory range is greater than 2 ** width, the patterns used in XUT_WALKONES and XUT_WALKZEROS will repeat on a boundry of a power of two making it more difficult to detect addressing errors. The XUT_INCREMENT and XUT_INVERSEADDR tests suffer the same problem. Ideally, if large blocks of memory are to be tested, break them up into smaller regions of memory to allow the test patterns used not to repeat over the region tested.

int XUtil_MemoryTest32 ( u32 *  Addr,
u32  Words,
u32  Pattern,
u8  Subtest 
)

Performs a destructive 32-bit wide memory test.

Parameters:
Addr is a pointer to the region of memory to be tested.
Words is the length of the block.
Pattern is the constant used for the constant pattern test, if 0, 0xDEADBEEF is used.
Subtest is the test selected. See xutil.h for possible values.
Returns:

Note:
Used for spaces where the address range of the region is smaller than the data width. If the memory range is greater than 2 ** width, the patterns used in XUT_WALKONES and XUT_WALKZEROS will repeat on a boundry of a power of two making it more difficult to detect addressing errors. The XUT_INCREMENT and XUT_INVERSEADDR tests suffer the same problem. Ideally, if large blocks of memory are to be tested, break them up into smaller regions of memory to allow the test patterns used not to repeat over the region tested.

int XUtil_MemoryTest8 ( u8 *  Addr,
u32  Words,
u8  Pattern,
u8  Subtest 
)

Performs a destructive 8-bit wide memory test.

Parameters:
Addr is a pointer to the region of memory to be tested.
Words is the length of the block.
Pattern is the constant used for the constant pattern test, if 0, 0xDEADBEEF is used.
Subtest is the test selected. See xutil.h for possible values.
Returns:

Note:
Used for spaces where the address range of the region is smaller than the data width. If the memory range is greater than 2 ** width, the patterns used in XUT_WALKONES and XUT_WALKZEROS will repeat on a boundry of a power of two making it more difficult to detect addressing errors. The XUT_INCREMENT and XUT_INVERSEADDR tests suffer the same problem. Ideally, if large blocks of memory are to be tested, break them up into smaller regions of memory to allow the test patterns used not to repeat over the region tested.