xil_testmem.h File Reference
#include "xil_types.h"
Detailed Description
This file contains utility functions to test memory.
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:
XIL_TESTMEM_ALLMEMTESTS:
Runs all of the following tests
XIL_TESTMEM_INCREMENT:
Incrementing Value Test.
This test starts at 'XIL_TESTMEM_INIT_VALUE' and uses the
incrementing value as the test value for memory.
XIL_TESTMEM_WALKONES:
Walking Ones Test.
This test uses a walking '1' as the test value for memory.
location 1 = 0x00000001
location 2 = 0x00000002
...
XIL_TESTMEM_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
...
XIL_TESTMEM_INVERSEADDR:
Inverse Address Test.
This test uses the inverse of the address of the location under test
as the test value for memory.
XIL_TESTMEM_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 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 XIL_TESTMEM_WALKONES and XIL_TESTMEM_WALKZEROS will repeat on a boundry of a power of two making it more difficult to detect addressing errors. The XIL_TESTMEM_INCREMENT and XIL_TESTMEM_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 hbm 08/25/09 First release
Define Documentation
#define XIL_TESTMEM_ALLMEMTESTS 0 |
|
|
See the detailed description of the subtests in the file description. |
Function Documentation
int Xil_TestMem16 |
( |
u16 * |
Addr, |
|
|
u32 |
Words, |
|
|
u16 |
Pattern, |
|
|
u8 |
Subtest |
|
) |
|
|
|
Perform 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 xil_testmem.h for possible values. |
- Returns:
- -1 is returned for a failure
- 0 is returned for a pass
- 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 XIL_TESTMEM_WALKONES and XIL_TESTMEM_WALKZEROS will repeat on a boundry of a power of two making it more difficult to detect addressing errors. The XIL_TESTMEM_INCREMENT and XIL_TESTMEM_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 Xil_TestMem32 |
( |
u32 * |
Addr, |
|
|
u32 |
Words, |
|
|
u32 |
Pattern, |
|
|
u8 |
Subtest |
|
) |
|
|
|
Perform 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 xil_testmem.h for possible values. |
- Returns:
- 0 is returned for a pass
- -1 is returned for a failure
- 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 XIL_TESTMEM_WALKONES and XIL_TESTMEM_WALKZEROS will repeat on a boundry of a power of two making it more difficult to detect addressing errors. The XIL_TESTMEM_INCREMENT and XIL_TESTMEM_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 Xil_TestMem8 |
( |
u8 * |
Addr, |
|
|
u32 |
Words, |
|
|
u8 |
Pattern, |
|
|
u8 |
Subtest |
|
) |
|
|
|
Perform 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 xil_testmem.h for possible values. |
- Returns:
- -1 is returned for a failure
- 0 is returned for a pass
- 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 XIL_TESTMEM_WALKONES and XIL_TESTMEM_WALKZEROS will repeat on a boundry of a power of two making it more difficult to detect addressing errors. The XIL_TESTMEM_INCREMENT and XIL_TESTMEM_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. |
Generated on Thu Feb 13 14:48:12 2014 for 2014.1_doc by
1.4.5