Best Practices for the OAL General Cache Test (Windows Embedded CE 6.0)
1/6/2010
The following table shows best practices to consider when using the OAL Cache Tests to assess the cache and memory subsystem of a Windows Embedded CE-based device.
Best practice | Description |
---|---|
Run the Print Cache Info test case and verify that the return value of CeGetCacheInfo is valid and expected |
Compare the return value of the CeGetCacheInfo function to the hardware specifications. |
Run the OAL Cache Tests on more than one target device |
Testing multiple target devices can help you to identify random flaws in memory chips and other hardware problems. Even if you can reproduce a problem on multiple target devices, the source of the problem might be hardware. Each test case walks memory in a deterministic way. If a test case is faulty, it most likely fails at the same array index during each subsequent run, unless a stray pointer incorrectly changes memory values. The existence of a stray pointer is unlikely because the OAL Cache Tests do not use pointers extensively. If a problem occurs at different array indexes during subsequent runs, most likely the test is working correctly and there is something wrong with the target device. |
Observe the physical address values displayed in the debug output to determine in which memory blocks faults occur |
If the same memory block consistently causes a fault, most likely the cache incorrectly stores data for the block or there is something physically wrong with the memory at that location. |
Use a hash function that is less complex if you cannot discern a pattern in the output of the test |
A complex hash function can hide patterns in the output of the test. For more information, see the CacheTest.cpp file in the %_WINCEROOT%\private\test\BaseOs\pqoal\cetk\caches directory. For more information about CETK source code, see Source Code for CETK Tests. The OAL Cache Test does not use less complex hash functions by default because a less complex hash function is less likely to find an error. |
If a test case fails because it cannot allocate memory, reduce the array length or free memory on the target device |
Each test case allocates a contiguous chunk of memory and fails if a contiguous chunk of memory is not allocated. |
On an SHx CPU or MIPS CPU, you can achieve full testing coverage by running a subset of test cases for the OAL Cache Tests |
On an SHx CPU, the behavior of a test case with no caching is identical to the behavior of the same test case in write-through cache mode and write-back cache mode. On a MIPS CPU, the behavior of a test case in write-through cache mode is identical to the behavior of the same test case in write-back cache mode. |