IXP1200 Programming: The Microengine Coding Guide for the Intel IXP1200 Network Processor Family

Using Atomic Bit Operations

Inter-microengine information sharing consists of reading and writing memory. Atomic bit operations are the only inter-microengine synchronization mechanism that also performs read-modify-write actions on memory. Notice the overlap here: our information sharing mechanism is reading and writing memory, while this synchronization mechanism is also reading and writing memory. So, in theory, atomic bit operations should represent an ideal way to combine both our information sharing and synchronization mechanisms.

Let s start from the beginning and explore how to use atomic bit operations as both an inter-microengine information sharing and synchronization mechanism.

Atomic bit operations are available for scratchpad and SRAM memory, but not SDRAM memory. The atomic bit operations offered are atomic bit-test-and-set, bit-test-and-clear, bit-set, and bit-clear. The bit-set and bit-clear operations perform an atomic read-modify-write cycle on a given long-word in either SRAM or scratchpad memory. The bit-test-and-set and bit-test-and-clear bit operations perform the atomic bit-set and bitclear operations, respectively, as well as returning the original value of the modified long-word.

The basic steps performed by all of these atomic bit operations are:

  1. The given memory location is read.

  2. According to a provided mask, bits of the long-word read in the first step are then set or cleared.

  3. The modified long-word is then written back to memory at the same address.

  4. The original, unmodified, long-word is returned for bit-test-and-set and bit-test-and-clear operations.

These steps are performed atomically within the unit servicing the atomic bit command.

To understand these operations, let s examine the signature for the scratchpad...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Memory Modules
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.