Test Cases for the OAL Cache Test (Windows CE 5.0)

Send Feedback

Each test case for the OAL Cache Test allocates an array of memory by using the VirtualAlloc function. The array might or might not be contiguous in memory. The test case writes and then reads values from the array, verifying that each value matches the value written to the location.

Each test case derives values to store in the array from a hash of the array index and the current iteration of the test. The test uses the iteration value so that stale data does not mask an error in the cache. With hashed values, the test does not need to set values in memory to zero before each test pass.

If a test case that calls the CeGetCacheInfo function passes, but the cache size seems incorrect, investigate further. The CeGetCacheInfo function might return incorrect information because this function queries constants in the OAL. If the CeGetCacheInfo function returns incorrect information, test cases might fail.

The following table shows test cases for the OAL Cache Test.

Test case Description
200: Cache Tests Usage / Help Displays information about the OAL Cache Test.
201: Print Cache Info Displays the information returned by the CeGetCacheInfo function.
Write Boundaries Read Everything (array = cache size)

210: No caching

240: Write-through cache mode

270: Write-back cache mode

This test case searches for errors in consistency between data stored in the L1 data cache and data stored in main memory. By default, this test case runs for 10 minutes.

This test case writes data near the boundaries of the cache into an array that is the size of the L1 data cache as reported by the CeGetCacheInfo function. If the CeGetCacheInfo function reports that the size of the cache is zero, this test case uses a 4-MB array.

After the test case reaches steady state, each memory access is a cache hit. The test case verifies the accuracy of write operations by reading back the data. The test case also verifies that values surrounding the changed values are not changed.

This test case writes values to array indexes that surround multiples of eight. For each multiple of eight, the test case writes a value into the array at the following array indexes:

  • One greater than the multiple of eight
  • One less than the multiple of eight
  • Equal to the multiple of eight

The test case then reads and verifies the values.

Write Boundaries Read Everything (array = twice cache size)

211: No caching

241: Write-through cache mode

271: Write-back cache mode

This test case searches for errors in consistency between data stored in the L1 data cache and data stored in main memory. By default, this test case runs for 10 minutes.

This test case writes data near the boundaries of the cache into an array that is twice the size of the L1 data cache as reported by the CeGetCacheInfo function. If the CeGetCacheInfo function reports that the size of the cache is zero, this test case uses a 4-MB array.

After the test case reaches steady state, each memory access is a cache miss. The test case verifies the accuracy of write operations by reading back the data. The test case also verifies that values surrounding the changed values are not changed.

This test case writes values to array indexes that surround multiples of eight. For each multiple of eight, the test case writes a value into the array at the following array indexes:

  • One greater than the multiple of eight
  • One less than the multiple of eight
  • Equal to the multiple of eight

The test case then reads and verifies the values.

Write Boundaries Read Everything (array = user defined)

212: No caching

242: Write-through cache mode

272: Write-back cache mode

This test case searches for errors in consistency between data stored in the L1 data cache and data stored in main memory. By default, this test case runs for 10 minutes.

This test case writes data near the boundaries of the cache into an array of a size that you specify by using the ct_al <length> command-line parameter. For more information, see Command-Line Parameters for the OAL Cache Test. If you do not specify the ct_al <length> command-line parameter, this test case uses a 4-MB array.

After the test case reaches steady state, each memory access is a cache miss. The test case verifies the accuracy of write operations by reading back the data. The test case also verifies that values surrounding the changed values are not changed.

This test case writes values to array indexes that surround multiples of eight. For each multiple of eight, the test case writes a value into the array at the following array indexes:

  • One greater than the multiple of eight
  • One less than the multiple of eight
  • Equal to the multiple of eight

The test then reads and verifies the values.

Write Everything Read Everything (array = cache size)

213: No caching

243: Write-through cache mode

273: Write-back cache mode

This test case searches for errors in consistency between data stored in the L1 data cache and data stored in main memory. By default, this test case runs for 10 minutes.

This test case sequentially writes data into an array that is the size of the L1 data cache as reported by the CeGetCacheInfo function. If the CeGetCacheInfo function reports that the size of the cache is zero, this test case uses a 4-MB array.

After the test case reaches steady state, the write operations force a cache hit each time a memory value is accessed. The test case verifies the accuracy of write operations by reading back the data. The read operations also force cache misses.

The test case assigns each array index a unique identifier. The test case references this unique identifier when it compares data read to data written.

Write Everything Read Everything (array = twice cache size)

214: No caching

244: Write-through cache mode

274: Write-back cache mode

This test case searches for errors in consistency between data stored in the L1 data cache and data stored in main memory. By default, this test case runs for 10 minutes.

This test case sequentially writes data into an array that is twice the size of the L1 data cache as reported by the CeGetCacheInfo function. If the CeGetCacheInfo function reports that the size of the cache is zero, this test case uses a 4-MB array.

After the test case reaches steady state, the write operations force a cache miss each time a memory value is accessed. The test case verifies the accuracy of write operations by reading back the data. The read operations also force cache misses.

The test case assigns each unit of data a unique identifier. The test case references this unique identifier when it compares data read to data written.

Write Everything Read Everything (array = user defined)

215: No caching

245: Write-through cache mode

275: Write-back cache mode

This test case searches for errors in consistency between data stored in the L1 data cache and data stored in main memory. By default, this test case runs for 10 minutes.

This test case sequentially writes data into an array that is of a size that you specify by using the ct_al <length> command-line parameter. For more information, see Command-Line Parameters for the OAL Cache Test. If you do not specify the ct_al <length> command-line parameter, this test case uses a 4-MB array.

After the test case reaches steady state, the write operations force a cache miss each time a memory value is accessed. The test case verifies the accuracy of write operations by reading back the data. The read operations also force cache misses.

The test case assigns each array index a unique identifier. The test case references this unique identifier when it compares data read to data written.

Verify Near Powers of Two (array = cache size)

216: No caching

246: Write-through cache mode

276: Write-back cache mode

This test case searches for errors in consistency between data stored in the L1 data cache and data stored in main memory. With a cache, errors generally fall on powers of two. This test case might expose errors not exposed by a test case that performs sequential write operations. By default, this test case runs for 10 minutes.

This test case writes data into values that are close to a power of two in an array that is the size of the L1 data cache as reported by the CeGetCacheInfo function. This test case exercises the cache rather than the underlying memory subsystem because in steady state, each memory access should be a cache hit. If the CeGetCacheInfo function reports that the size of the cache is zero, this test case uses a 4-MB array.

The step size varies throughout the test case to expose errors that might occur only during a similar access sequence. The smallest step size is 16 bytes. For each power of two, the test case writes a value into the array at the following array indexes:

  • One greater than the power of two
  • One less than the power of two
  • Equal to the power of two

The test case then reads and verifies the values in the same order that they were written.

Verify Near Powers of Two (array = twice cache size)

217: No caching

247: Write-through cache mode

277: Write-back cache mode

This test case searches for errors in consistency between data stored in the L1 data cache and data stored in main memory. With a cache, errors generally fall on powers of two. This test case might expose errors not exposed by a test case that performs sequential write operations. By default, this test case runs for 10 minutes.

This test case writes data into values that are close to a power of two in an array that is twice the size of the L1 data cache as reported by the CeGetCacheInfo function. If the CeGetCacheInfo function reports that the size of the cache is zero, this test case uses a 4-MB array.

The step size varies throughout the test case to expose errors that might occur only during a similar access sequence. The smallest step size is 16 bytes. For each power of two, the test case writes a value into the array at the following array indexes:

  • One greater than the power of two
  • One less than the power of two
  • Equal to the power of two

The test case then reads and verifies the values in the same order that they were written.

Verify Near Powers of Two (array = user defined)

218: No caching

248: Write-through cache mode

278: Write-back cache mode

This test case searches for errors in consistency between data stored in the L1 data cache and data stored in main memory. With a cache, errors generally fall on powers of two. This test case might expose errors not exposed by a test case that performs sequential write operations. By default, this test case runs for 10 minutes.

This test case writes data into values that are close to a power of two in an array of a size that you specify by using the ct_al <length> command-line parameter. For more information, see Command-Line Parameters for the OAL Cache Test. If you do not specify the ct_al <length> command-line parameter, this test case uses a 4-MB array.

The step size varies throughout the test case to expose errors that might occur only during a similar access sequence. The smallest step size is 16 bytes. For each power of two, the test case writes a value into the array at the following array indexes:

  • One greater than the power of two
  • One less than the power of two
  • Equal to the power of two

The test case then reads and verifies the values in the same order that they were written.

Write Everything Read Everything Mixed Up (array = twice cache size)

219: No caching

249: Write-through cache mode

279: Write-back cache mode

This test case searches for errors in consistency between data stored in the L1 data cache and data stored in main memory. By default, this test case runs for 10 minutes.

This test case writes data in a semi-random way into an array that is twice the size of the L1 data cache as reported by the CeGetCacheInfo function. If the CeGetCacheInfo function reports that the size of the cache is zero, this test case uses a 4-MB array.

This test case produces both cache misses and cache hits, thereby exercising the cache in a more random way than a sequential set of read and write operations would. The test case writes each value in the tested array once and verifies the value during a subsequent read pass.

The sequence of write operations that this test case uses is semi-random. The sequence is not as random as a random number generator because the test case must access each value once and only once. The first 16 values in the sequence are 0, 3, 1, 2, 12, 15, 13, 14, 4, 7, 5, 6, 8, 11, 9, and 10.

Write Everything Read Everything Mixed Up (array = user defined)

220: No caching

250: Write-through cache mode

280: Write-back cache mode

This test case searches for errors in consistency between data stored in the L1 data cache and data stored in main memory. By default, this test case runs for 10 minutes.

This test case writes data in a semi-random way into an array of a size that you specify by using the ct_al <length> command-line parameter. The length that you specify for the ct_al <length> command-line parameter must be a power of two. For more information, see Command-Line Parameters for the OAL Cache Test. If you do not specify the ct_al <length> command-line parameter, this test case uses a 4-MB array.

This test case produces both cache misses and cache hits, thereby exercising the cache is a more random way than a sequential set of read and write operations would. The test case writes each value in the tested array once and verifies the value during a subsequent read pass.

The sequence of write operations that this test case uses is semi-random. The sequence is not as random as a random number generator because the test case must access each value once and only once. The first 16 values in the sequence are 0, 3, 1, 2, 12, 15, 13, 14, 4, 7, 5, 6, 8, 11, 9, and 10.

See Also

OAL Cache Test | Command-Line Parameters for the OAL Cache Test | Best Practices for the OAL Cache Test

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.