Heavenly Sword lead programmer: Atomic Cache Unit is dreamy

Coming straight out of Dean Calver’s blog is word that the miracle Cell chip that powers the mighty PlayStation 3 is very much the Godsend for programmers such as himself. If the name doesn’t ring a bell, he’s the lead programmer on Heavenly Sword, over at Ninja Theory.

Anyway, the glee is about the Cell’s Atomic Cache Unit and how much easier it makes harnessing the power of the PS3. What is all this mumbo jumbo about ACU? Allow Dean to break it down for you, after the jump.

Well its one of my favorite things on the PS3 and gets little love cos its one of those tiny features that make life so much nicer.

Atomic ops refer to the most important principle in multi threading. It say that a single processor must read/modify/write without another thread interrupting (hence atomic). Without atomicy, multiple core system are much harder (if not near impossible)

Dean then goes on to elaborate a bit more.

The ACU (s) are a part of each SPU that allow atomic updates to occur very quickly. It appears fairly simple each SPU had 512 bytes of cache (yes contrary to what you might have heard SPU do have a tiny bit of cache). 512 bytes is divided into 4 128 byte lines. The MFC (DMA) unit can bring a cache line in from memory and mark it reserved… if another processor writes to the same bit of memory the reservation is lost and you know to repeat the read/modify/write cycle to guarantee atomicy.

All good, but whats really clever its how its implemented. If another SPU asks for that bit of memory its get its from another SPUs cache, if its in there. So you effectively have a fast SHARED 512 bytes. When an SPU writes, the other SPU only have to read from the writing SPU cache rather than DMAing it back to main memory and DMAing it into LS. Cuts down alot of memory traffic. I even abuse it and just use it as a conventional cache and communication channel between SPU. You can push alot of data around with a fast 128 byte path.

And the nicest thing about it… It just works… All the cache snooping, routing etc. all just happens magically inside the chip. You say ATOMIC_GET and ATOMIC_SET and treat yourself to a 512 byte shared cache.

So what does this mean to you, the gamer? Well if nothing else, it’s a feather in Sony’s hat regarding benefits the Cell chip offers the people that dare to take on the daunting task of making games for a console ahead of its time. We all remember how feisty some of you became over news that the PS2, at least initially, wasn’t exactly the easiest machine to program for.

We didn’t contact any Microsoft reps for a response, but I’d be willing to bet that they would simply smile, and point to this

[Via N4G