Some understanding of memory hardware
The lower-level parts of computers
General: Computer power consumption · Computer noises Memory: Some understanding of memory hardware · CPU cache · Flash memory · Virtual memory · Memory mapped IO and files · RAM disk · Memory limits on 32-bit and 64-bit machines Related: Network wiring notes - Power over Ethernet · 19" rack sizes Unsorted: GPU, GPGPU, OpenCL, CUDA notes · Computer booting
|
"What Every Programmer Should Know About Memory" is a good overview of memory architectures, RAM types, reasons bandwidth and access speeds vary.
RAM types
DRAM - Dynamic RAM
- lower component count per cell than most (transistor+capacitor mainly), so high-density and cheaper
- yet capacitor leakage means this has to be refreshed regularly, meaning a DRAM controller, more complexity and higher latency than some
- (...which can be alleviated and is less of an issue when you have multiple chips)
- this or a variant is typical as main RAM, due to low cost per bit
SDRAM - Synchronous DRAM - is mostly a practical design consideration
- ...that of coordinating the DRAM via an external clock signal (previous DRAM was asynchronous, manipulating state as soon as lines changed)
- This allows the interface to that RAM to be a predictable state machine, which allows easier buffering, and easier interleaving of internal banks
- ...and thereby higher data rates (though not necessarily lower latency)
- SDR/DDR:
- DDR doubled busrate by widening the (minimum) units they read/write (double that of SDR), which they can do from single DRAM bank(verify)
- similarly, DDR2 is 4x larger units than SDR and DDR3 is 8x larger units than SDR
- DDR4 uses the same width as DDR3, instead doubling the busrate by interleaving from banks
- unrelated to latency, it's just that the bus frequency also increased over time.
Graphics RAM refers to varied specialized
- Earlier versions would e.g. allow reads and writes (almost) in parallel, making for lower-latency framebuffers
- "GDDR" is a somwhat specialized form of DDR SDRAM
SRAM - Static RAM
- Has a higher component count per cell (6 transistors) than e.g. DRAM
- Retains state as long as power is applied to the chip, no need for refresh, also making it a little lower-latency
- no external controller, so simpler to use
- e.g used in caches, due to speed, and acceptable cost for lower amounts
PSRAM - PseudoStatic RAM
- A tradeoff somewhere between SRAM and DRAM
- in that it's DRAM with built-in refresh, so functionally it's as standalone as SRAM and slower but you can have a bunch more of it for the same price - e.g. SRAM tends to
- (yes, DRAM can have built-in refresh, but that's often points a sleep mode that retains state without requiring an active DRAM controller)
Memory stick types
ECC RAM
- can detect many (and correct some) hardware errors in RAM
- The rate of of bit-flips is low, but will happen. If your computations or data are very important to you, you want ECC.
- See also:
Registered RAM (sometimes buffered RAM) basically places a buffer on the DRAM modules (register as in hardware register)
- offloads some electrical load from the main controller onto these buffers, making it easier to have designs more stably connect more individual memory sticks/chips.
- ...at a small latency hit
- typical in servers, because they can accept more sticks
- Must be supported by the memory controller, which means it is a motherboard design choice to go for registered RAM or not
- pricier (more electronics, fewer units sold)
- because of this correlation with server use, most registered RAM is specifically registered ECC RAM
- yet there is also unregistered ECC, and registered non-ECC, which can be good options on specific designs of simpler servers and beefy workstations.
- sometimes called RDIMM -- in the same context UDIMM is used to refer to unbuffered
- https://en.wikipedia.org/wiki/Registered_memory
FB-DIMM, Fully Buffered DIMM
- same intent as registered RAM - more stable sticks on one controller
- the buffer is now between stick and controller [1] rather than on the stick
- physically different pinout/notching
SO-DIMM (Small Outline DIMM)
- Physically more compact. Used in laptops, some networking hardware, some Mini-ITX
EPP and XMP (Enhanced Performance Profile, Extreme Memory Profiles)
- basically, one-click overclocking for RAM, by storing overclocked timing profiles
- so you can configure faster timings (and Vdimm and such) according to the modules, rather than your trial and error
- normally, memory timing is configured according to a table in the SPD, which are JEDEC-approved ratings and typically conservative.
- EPP and XMP basically means running them as fast as they could go (and typically higher voltage)
On pin count
- SO-DIMM tends to have a different pin count
- e.g. DDR3 has 240 pins, DDR3 SO-DIMM has 204
- e.g. DDR4 has 288 pins, DDR4 SO-DIMM has 260
- Registered RAM has the same pin count
- ECC RAM has the same pin count
In any case, the type of memory must be supported by the memory controller
- DDR2/3/4 - physically won't fit
- Note that while some controllers (e.g. those in CPUs) support two generations, a motherboard will typically have just one type of memory socket
- registered or not
- ECC or not
Historically, RAM controllers were a thing on the motherboard near the CPU, while there are now various cases where the controller is on the CPU.
More on DRAM versus SRAM
On ECC
Buffered/registered RAM
EPROM, EEPROM, and variants
PROM is Programmable ROM
- can be written exactly once
EPROM is Erasable Programmable ROM.
- often implies UV-EEPROM, erased with UV shone through a quartz window.
EEPROM's extra E means Electrically Eresable
- meaning it's now a command.
- early EEPROM read, wrote, and erased (verify) a single byte at a time. Modern EEPROM can work in alrger chunks.
- you only get a limited amount of erases (much like Flash. Flash is arguably just an evolution of EEPROM)
Flash memory (intro)