![]() The L1D$ checks whether it contains the corresponding cache line. When the CPU core sees a memory load instruction, it passes the address to the L1 data cache (or “L1D$”, playing on the “cache” being pronounced the same way as “cash”). present in any of the cache levels) or not. In particular, I’m going to say “cache line” to mean a suitably aligned group of bytes in memory, no matter whether these bytes are currently cached (i.e. Each cache line knows what physical memory address range it corresponds to, and in this article I’m not going to differentiate between the physical cache line and the memory it represents – this is sloppy, but conventional usage, so better get used to it. You get the idea.Ĭaches are organized into “lines”, corresponding to aligned blocks of either 32 (older ARMs, 90s/early 2000s x86s/PowerPCs), 64 (newer ARMs and x86s) or 128 (newer Power ISA machines) bytes of memory. At this point, there’s generally more cache levels involved this means the L1 cache doesn’t talk to memory directly anymore, it talks to a L2 cache – which in turns talks to memory. And about 20 years ago, the L1 caches would indeed talk to memory directly. The CPU core’s load/store (and instruction fetch) units normally can’t even access memory directly – it’s physically impossible the necessary wires don’t exist! Instead, they talk to their L1 caches which are supposed to handle it. In modern CPUs (almost) all memory accesses go through the cache hierarchy there are some exceptions for memory-mapped IO and write-combined memory that bypass at least parts of this process, but both of these are corner cases (in the sense that the vast majority of user-mode code will never see either), so I’ll ignore them in this post. (If you are, feel free to skip this section.) I’m assuming you know the basic concept, but you might not be familiar with some of the details. ![]() This is a whirlwhind primer on CPU caches. I started writing a first post but quickly realized that there are a few basics I need to cover first. I’m planning to write a bit about data organization for multi-core scenarios. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |