by tibbydudeza · 4y ago · 0 comments
There are some more optimizations that DRAM controllers can perform. As part of reading a certain address, you first need to open a bank. This is not a free operation, it can take a while (relatively speaking). After the first read in a bank, you can read other addresses inside the same bank for free, without having to open the bank again. This means it makes sense for a DRAM controller to process reads out of order: Instead of processing a command sequence like A1 B1 A2 (A/B are banks here) in order, it saves time to process them out of order, i.e. A1 A2 B1.
Disclaimer: It has been a while since I last looked into DRAM controllers, so I hope I didn't miss anything. But the general ideas should be correct.
https://youtu.be/Q8ph2OVqZeM?t=504
I find it really gives you some context. Memory is refreshed many, many times a frame, roughly once per scan line on a CRT.
Edit: Though it's unclear to me if it's the CPU actually doing the refreshing or if the CPU is just waiting until the refresh is complete.
As far as I can tell, all the actually widespread successful computers after that have used DRAM too.
It wouldn’t call it “widespread successful”, but he Macintosh Portable also had SRAM (https://en.wikipedia.org/wiki/Macintosh_Portable)
Or in some real ancient case (ZX81), generate a video signal for the display (TV) - except in "fast" mode, where the screen would just show noise.
the CPU had to do memory refresh during busy times too!
The Z80 would do it automatically
Z80 CPUs had DRAM refresh logic built in. The first two clock cycles it would read the primary opcode byte, and the next two clock cycles it would do a refresh of the next row and then increment the row counter ("R"). That worked well because the minimum instruction took four clock cycles to complete. The timing was a bit surprising though -- it would seem to take four cycles to fetch the first byte of an instruction but only three clock cycles for each subsequent memory transaction. Unfortunately, the R counter was only 7b wide, which was fine for 16Kbit DRAMs, but became a problem for 64Kbit DRAMs which needed to refresh 256 rows, not just 128. Some Z80 based designs would decode the refresh cycles and either mux in their own 8b count value, or they ignored the Z80 and just stall the Z80 every so often to perform a refresh cycle.