Test Utilities for Memory and Caches - 2021.1 English

Xilinx Standalone Library Documentation OS and Libraries Document Collection (UG643)

Document ID
UG643
Release Date
2021-06-16
Version
2021.1 English

The xil_testcache.h, xil_testio.h and the xil_testmem.h files contain utility functions to test cache and memory.

Details of supported tests and subtests are listed below.

The xil_testcache.h file contains utility functions to test cache.

The xil_testio.h file contains utility functions to test endian related memory IO functions.

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.

  • Cache test: xil_testcache.h contains utility functions to test cache.
  • I/O test: The Xil_testio.h file contains endian related memory IO functions. 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.
  • Memory test: The xil_testmem.h file contains utility functions to test memory. 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.

Following list describes the supported memory tests:

  • XIL_TESTMEM_ALLMEMTESTS: This test runs all of the subtests.
  • XIL_TESTMEM_INCREMENT: This test starts at 'XIL_TESTMEM_INIT_VALUE' and uses the incrementing value as the test value for memory.
  • XIL_TESTMEM_WALKONES: Also known as the Walking ones test. This test uses a walking '1' as the test value for memory.
    location 1 = 0x00000001
    location 2 = 0x00000002
    ...
  • XIL_TESTMEM_WALKZEROS: Also known as the 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: Also known as the 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: Also known as the 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".
CAUTION:
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 boundary 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.
Table 1. Quick Function Reference
Type Name Arguments
s32 Xil_TestMem32
  • u32 * Addr
  • u32 Words
  • u32 Pattern
  • u8 Subtest
s32 Xil_TestMem16
  • u16 * Addr
  • u32 Words
  • u16 Pattern
  • u8 Subtest
s32 Xil_TestMem8
  • u8 * Addr
  • u32 Words
  • u8 Pattern
  • u8 Subtest
u32 RotateLeft
  • u32 Input
  • u8 Width
u32 RotateRight
  • u32 Input
  • u8 Width
s32 Xil_TestDCacheRange
  • void
s32 Xil_TestDCacheAll
  • void
s32 Xil_TestICacheRange
  • void
s32 Xil_TestICacheAll
  • void
s32 Xil_TestIO8
  • u8 * Addr
  • s32 Length
  • u8 Value
s32 Xil_TestIO16
  • u16 * Addr
  • s32 Length
  • u16 Value
  • s32 Kind
  • s32 Swap
s32 Xil_TestIO32
  • u32 * Addr
  • s32 Length
  • u32 Value
  • s32 Kind
  • s32 Swap