Memory refresh

Last updated

Memory refresh is a process of periodically reading information from an area of computer memory and immediately rewriting the read information to the same area without modification, for the purpose of preserving the information. [1] Memory refresh is a background maintenance process required during the operation of semiconductor dynamic random-access memory (DRAM), the most widely used type of computer memory, and in fact is the defining characteristic of this class of memory. [2]

Contents

In a DRAM chip, each bit of memory data is stored as the presence or absence of an electric charge on a small capacitor on the chip. [2] [3] As time passes, the charges in the memory cells leak away, so without being refreshed the stored data would eventually be lost. To prevent this, external circuitry periodically reads each cell and rewrites it, restoring the charge on the capacitor to its original level. Each memory refresh cycle refreshes a succeeding area of memory cells, thus repeatedly refreshing all the cells on the chip in a consecutive cycle. This process is typically conducted automatically in the background by the memory circuitry and is transparent to the user. [2] While a refresh cycle is occurring the memory is not available for normal read and write operations, but in modern memory this overhead is not large enough to significantly slow down memory operation.

Static random-access memory (SRAM) is electronic memory that does not require refreshing. [2] An SRAM memory cell requires four to six transistors, compared to a single transistor and a capacitor for DRAM; therefore, SRAM circuits require more area on a chip. As a result, data density is much lower in SRAM chips than in DRAM, and gives SRAM a higher price per bit. Therefore, DRAM is used for the main memory in computers, video game consoles, graphics cards and applications requiring large capacities and low cost. [4] The need for memory refresh makes DRAM more complicated, but the density and cost advantages of DRAM justify this complexity.

Operation

While the memory is operating, each memory cell must be refreshed repetitively and within the maximum interval between refreshes specified by the manufacturer, usually in the millisecond region. Refreshing does not employ the normal memory operations (read and write cycles) used to access data, but specialized cycles called refresh cycles which are generated by separate counter circuits and interspersed between normal memory accesses. [5] [6]

The storage cells on a memory chip are laid out in a rectangular array of rows and columns. The read process in DRAM is destructive and removes the charge on the memory cells in an entire row, so there is a column of specialized latches on the chip called sense amplifiers, one for each column of memory cells, to temporarily hold the data. During a normal read operation, the sense amplifiers after reading and latching the data, rewrite the data in the accessed row. [2] [7] This arrangement allows the normal read electronics on the chip to refresh an entire row of memory in parallel, significantly speeding up the refresh process. Although a normal read or write cycle refreshes a row of memory, normal memory accesses cannot be relied on to hit all the rows within the necessary time, necessitating a separate refresh process. Rather than use the normal read cycle in the refresh process, to save time, an abbreviated refresh cycle is used. The refresh cycle is similar to the read cycle, but executes faster for two reasons:

To ensure that each cell gets refreshed within the refresh time interval, the refresh circuitry must perform a refresh cycle on each of the rows on the chip within the interval.

Types of refresh circuits

Although in some early systems the microprocessor controlled refresh, with a timer triggering a periodic interrupt that ran a subroutine that performed the refresh, this meant the microprocessor could not be paused, single-stepped, or put into energy-saving hibernation without stopping the refresh process and losing the data in memory. [6] So in modern systems refresh is handled by circuits in the memory controller, [2] which may be embedded in the chip itself. Specialized DRAM chips, such as pseudostatic RAM (PSRAM), have all the refresh circuitry on the chip, and function like static RAM as far as the rest of the computer is concerned. [8]

Usually the refresh circuitry consists of a refresh counter which contains the address of the row to be refreshed which is applied to the chip's row address lines, and a timer that increments the counter to step through the rows. [5] This counter may be part of the memory controller circuitry or on the memory chip itself. Two scheduling strategies have been used: [6]

Burst refresh results in long periods when the memory is unavailable, so distributed refresh has been used in most modern systems, [5] particularly in real-time systems. In distributed refresh, the interval between refresh cycles is

For example, DDR SDRAM has a refresh time of 64 ms and 8,192 rows, so the refresh cycle interval is 7.8 μs. [5] [9]

Generations of DRAM chips developed after 2012 contain an integral refresh counter, and the memory control circuitry can either use this counter or provide a row address from an external counter. These chips have three standard ways to provide refresh, selected by different patterns of signals on the column select (CAS) and row select (RAS) lines: [6]

Since the 2012 generation of DRAM chips, the RAS only mode has been eliminated, and the internal counter is used to generate refresh. The chip has an additional sleep mode, for use when the computer is in sleep mode, in which an on-chip oscillator generates internal refresh cycles so that the external clock can be shut down.

Refresh overhead

The fraction of time the memory spends on refresh, the refresh overhead, can be calculated from the system timing: [10]

For example, an SDRAM chip has 213=8,192 rows, a refresh interval of 64 ms, the memory bus runs at 133 MHz, and the refresh cycle takes 4 clock cycles. [10] The time for a refresh cycle is [10]

So less than 0.4% of the memory chip's time will be taken by refresh cycles. In SDRAM chips, the memory in each chip is divided into banks which are refreshed in parallel, saving further time. So the number of refresh cycles needed is the number of rows in a single bank, given in the specifications, which in the 2012 generation of chips has been frozen at 8,192.[ needs update ]

Refresh interval

The maximum time interval between refresh operations is standardized by JEDEC for each DRAM technology and is specified in the manufacturer's chip specifications. It is usually in the range of milliseconds for DRAM and microseconds for eDRAM. For DDR2 SDRAM chips it is 64 ms. [11] :20 Maximum refresh interval depends on the ratio of charge stored in the memory cell capacitors to leakage currents. Because the leakage currents in semiconductors increase with temperature, refresh intervals must be decreased at high temperatures. DDR2 SDRAM chips have a temperature-compensated refresh structure; refresh interval must be halved when chip case temperature exceeds 85 °C (185 °F). [11] :49 Although the geometry of the capacitors has been shrinking with each new generation of memory chips, reducing the charge stored, refresh intervals for DRAM have been increasing; from 8 ms for 1M chips, 32 ms for 16M chips, to 64 ms for 256M chips. Longer refresh interval means a smaller fraction of the device's time is occupied with refresh, leaving more time for memory accesses. This improvement is achieved mainly by reduced leakage.

The actual persistence of readable charge values and thus data in most DRAM memory cells is much longer than the refresh interval, up to 1–10 seconds. [12] However, transistor leakage currents vary widely between different memory cells on the same chip due to process variation. In order to make sure that all the memory cells are refreshed before a single bit is lost, manufacturers must set their refresh times conservatively short. [13]

This frequent DRAM refresh consumes a third of the total power drawn by low-power electronics devices in standby mode. Researchers have proposed several approaches for extending battery run-time between charges by reducing the refresh rate, including temperature-compensated refresh (TCR) and retention-aware placement in DRAM (RAPID). Experiments show that in a typical off-the-shelf DRAM chip, only a few weak cells really require the worst-case 64 ms refresh interval, [14] and even then only at the high end of its specified temperature range. At room temperature (e.g. 24 °C (75 °F)), those same weak cells need to be refreshed once every 500 ms for correct operation. If the system can avoid using the weakest 1% of pages, a typical DRAM only needs to be refreshed once a second, even at 70 °C (158 °F), for correct operation of the remaining 99% of the pages. Some experiments combine these two complementary techniques, giving correct operation at room temperature at refresh intervals of 10 seconds. [14]

For error-tolerant applications (e.g. graphics applications), refreshing non-critical data stored in DRAM or eDRAM at a rate lower than their retention period saves energy with minor quality loss, which is an example of approximate computing. [15] [16]

SRAM and DRAM memory technologies

SRAM

In static random-access memory (SRAM), another type of semiconductor memory, the data is not stored as charge on a capacitor, but in a bistable circuit, so SRAM does not need to be refreshed. The two basic types of memory have advantages and disadvantages. Static memory can be considered permanent while powered on, i.e., once written the memory stays until specifically changed and thus, its use tends to be simple in terms of system design. However, the internal construction of each SRAM cell requires six transistors, compared to the single transistor required for a DRAM cell, so the density of SRAM is much lower and price-per-bit much higher than DRAM.

CPU-based refresh

Some early microprocessors (e.g. the Zilog Z80) provided special internal registers that could provide the Row Address Strobe (RAS) to refresh dynamic memory cells, the register being incremented on each refresh cycle. This could also be accomplished by other integrated circuits already being used in the system, if these already generated cycling accesses across RAM (e.g. the Motorola 6845). In CPUs such as the Z80, the availability of a RAS refresh was a big selling point due to its simplifying hardware design. Here, RAS refresh is signaled by a unique combination of address and control wires during operationally redundant clock cycles (T-States), i.e. during instruction decode and execution when the buses may not be required. Instead of the bus being inactive during such T-states, the refresh register would be presented on the address bus along with a combination of control signals to activate the refresh circuitry.

In early versions of the Z80, the ubiquity of 16 kB RAM chips having 128 rows and something of a lack of foresight resulted in the R register only incrementing over a 7 bit-wide range (0–127, 128 rows); the 8th bit could be set by the user, but would be left unchanged by the internal cycling. With the advent of 64 kbit+ DRAM chips (with 256 rows), extra circuitry or logic had to be built around the refresh signal to synthesize the missing 8th bit and prevent blocks of memory contents from being lost after a few milliseconds. In some contexts, it was possible to utilize interrupts and software to flip the 8th bit at the appropriate time and thus cover the entire range of the R register (256 rows). Another method, perhaps more universal but also more complex in terms of hardware, was to use an 8-bit counter chip, whose output would provide the refresh RAS address instead of the R register. The refresh signal from the CPU was used as the clock for this counter, resulting in the memory row being incremented with each refresh cycle. Later versions and licensed work-alikes of the Z80 core remedied the non-inclusion of the 8th bit in automatic cycling, and modern CPUs have greatly expanded on such basic provisioning to provide rich all-in-one solutions for DRAM refresh.

Pseudostatic DRAM

Pseudostatic RAM (PSRAM or PSDRAM) is dynamic RAM with built-in refresh and address-control circuitry to make it behave similarly to SRAM. It combines the high density of DRAM with the ease of use of true SRAM. PSRAM (made by Numonyx) is used in the Apple iPhone and other embedded systems. [17]

Some DRAM components have a self-refresh standby mode. It is provided primarily to allow a system to suspend operation of its DRAM controller to save power without losing data stored in DRAM, whereas PSRAM allows operation without a separate DRAM controller. An embedded variant of PSRAM is sold by MoSys under the name 1T-SRAM. It is technically DRAM, but behaves much like SRAM, and is used in the GameCube and Wii consoles.

Other memory technologies using refresh

Several early computer memory technologies also required periodical processes similar in purpose to the memory refreshing. The Williams tube has the closest similarity, since, as with DRAM, it is essentially a capacitive memory in which the values stored for each bit would gradually decay unless refreshed.

In magnetic-core memory, each memory cell can retain data indefinitely even with the power turned off, but reading the data from any memory cell erases its contents. As a consequence, the memory controller typically added a refresh cycle after each read cycle in order to create the illusion of a non-destructive read operation. Some early computers implemented atomic read–modify–write cycles (combined read and write with modify) for increment and decrement.

Delay-line memory requires constant refreshing because the data is actually stored as a signal in a transmission line. In this case, the refresh rate is comparable to the memory access time.

See also

Related Research Articles

<span class="mw-page-title-main">Computer memory</span> Computer component that stores information for immediate use

Computer memory stores information, such as data and programs, for immediate use in the computer. The term memory is often synonymous with the terms RAM,main memory, or primary storage. Archaic synonyms for main memory include core and store.

<span class="mw-page-title-main">DDR SDRAM</span> Type of computer memory

Double Data Rate Synchronous Dynamic Random-Access Memory is a double data rate (DDR) synchronous dynamic random-access memory (SDRAM) class of memory integrated circuits used in computers. DDR SDRAM, also retroactively called DDR1 SDRAM, has been superseded by DDR2 SDRAM, DDR3 SDRAM, DDR4 SDRAM and DDR5 SDRAM. None of its successors are forward or backward compatible with DDR1 SDRAM, meaning DDR2, DDR3, DDR4 and DDR5 memory modules will not work on DDR1-equipped motherboards, and vice versa.

<span class="mw-page-title-main">Static random-access memory</span> Type of computer memory

Static random-access memory is a type of random-access memory (RAM) that uses latching circuitry (flip-flop) to store each bit. SRAM is volatile memory; data is lost when power is removed.

<span class="mw-page-title-main">Dynamic random-access memory</span> Type of computer memory

Dynamic random-access memory is a type of random-access semiconductor memory that stores each bit of data in a memory cell, usually consisting of a tiny capacitor and a transistor, both typically based on metal–oxide–semiconductor (MOS) technology. While most DRAM memory cell designs use a capacitor and transistor, some only use two transistors. In the designs where a capacitor is used, the capacitor can either be charged or discharged; these two states are taken to represent the two values of a bit, conventionally called 0 and 1. The electric charge on the capacitors gradually leaks away; without intervention the data on the capacitor would soon be lost. To prevent this, DRAM requires an external memory refresh circuit which periodically rewrites the data in the capacitors, restoring them to their original charge. This refresh process is the defining characteristic of dynamic random-access memory, in contrast to static random-access memory (SRAM) which does not require data to be refreshed. Unlike flash memory, DRAM is volatile memory, since it loses its data quickly when power is removed. However, DRAM does exhibit limited data remanence.

<span class="mw-page-title-main">Synchronous dynamic random-access memory</span> Type of computer memory

Synchronous dynamic random-access memory is any DRAM where the operation of its external pin interface is coordinated by an externally supplied clock signal.

<span class="mw-page-title-main">DIMM</span> Computer memory module

A DIMM is a popular type of memory module used in computers. It is a printed circuit board with one or both sides holding DRAM chips and pins. The vast majority of DIMMs are manufactured in compliance with JEDEC memory standards, although there are proprietary DIMMs. DIMMs come in a variety of speeds and capacities, and are generally one of two lengths: PC, which are 133.35 mm (5.25 in), and laptop (SO-DIMM), which are about half the length at 67.60 mm (2.66 in).

Volatile memory, in contrast to non-volatile memory, is computer memory that requires power to maintain the stored information; it retains its contents while powered on but when the power is interrupted, the stored data is quickly lost.

Semiconductor memory is a digital electronic semiconductor device used for digital data storage, such as computer memory. It typically refers to devices in which data is stored within metal–oxide–semiconductor (MOS) memory cells on a silicon integrated circuit memory chip. There are numerous different types using different semiconductor technologies. The two main types of random-access memory (RAM) are static RAM (SRAM), which uses several transistors per memory cell, and dynamic RAM (DRAM), which uses a transistor and a MOS capacitor per cell. Non-volatile memory uses floating-gate memory cells, which consist of a single floating-gate transistor per cell.

Column address strobe latency, also called CAS latency or CL, is the delay in clock cycles between the READ command and the moment data is available. In asynchronous DRAM, the interval is specified in nanoseconds. In synchronous DRAM, the interval is specified in clock cycles. Because the latency is dependent upon a number of clock ticks instead of absolute time, the actual time for an SDRAM module to respond to a CAS event might vary between uses of the same module if the clock rate differs.

XDR DRAM is a high-performance dynamic random-access memory interface. It is based on and succeeds RDRAM. Competing technologies include DDR2 and GDDR4.

<span class="mw-page-title-main">1T-SRAM</span> Pseudo-static random-access memory technology introduced by MoSys Inc.

1T-SRAM is a pseudo-static random-access memory (PSRAM) technology introduced by MoSys, Inc. in September 1998, which offers a high-density alternative to traditional static random-access memory (SRAM) in embedded memory applications. Mosys uses a single-transistor storage cell like dynamic random-access memory (DRAM), but surrounds the bit cell with control circuitry that makes the memory functionally equivalent to SRAM. 1T-SRAM has a standard single-cycle SRAM interface and appears to the surrounding logic just as an SRAM would.

<span class="mw-page-title-main">Ferroelectric RAM</span> Novel type of computer memory

Ferroelectric RAM is a random-access memory similar in construction to DRAM but using a ferroelectric layer instead of a dielectric layer to achieve non-volatility. FeRAM is one of a growing number of alternative non-volatile random-access memory technologies that offer the same functionality as flash memory. An FeRAM chip contains a thin film of ferroelectric material, often lead zirconate titanate, commonly referred to as PZT. The atoms in the PZT layer change polarity in an electric field, thereby producing a power-efficient binary switch. However, the most important aspect of the PZT is that it is not affected by power disruption or magnetic interference, making FeRAM a reliable nonvolatile memory.

Double Data Rate 3 Synchronous Dynamic Random-Access Memory is a type of synchronous dynamic random-access memory (SDRAM) with a high bandwidth interface, and has been in use since 2007. It is the higher-speed successor to DDR and DDR2 and predecessor to DDR4 synchronous dynamic random-access memory (SDRAM) chips. DDR3 SDRAM is neither forward nor backward compatible with any earlier type of random-access memory (RAM) because of different signaling voltages, timings, and other factors.

Double Data Rate 4 Synchronous Dynamic Random-Access Memory is a type of synchronous dynamic random-access memory with a high bandwidth interface.

<span class="mw-page-title-main">Random-access memory</span> Form of computer data storage

Random-access memory is a form of electronic computer memory that can be read and changed in any order, typically used to store working data and machine code. A random-access memory device allows data items to be read or written in almost the same amount of time irrespective of the physical location of data inside the memory, in contrast with other direct-access data storage media, where the time required to read and write data items varies significantly depending on their physical locations on the recording medium, due to mechanical limitations such as media rotation speeds and arm movement.

<span class="mw-page-title-main">LPDDR</span> Computer hardware

Low-Power Double Data Rate (LPDDR), also known as LPDDR SDRAM, is a type of synchronous dynamic random-access memory (SDRAM) that consumes less power than other random access memory designs and is thus targeted for mobile computing devices such as laptop computers and smartphones. Older variants are also known as Mobile DDR, and abbreviated as mDDR.

A sense amplifier is a circuit that is used to amplify and detect small signals in electronic systems. It is commonly used in memory circuits, such as dynamic random access memory (DRAM), to read and amplify the weak signals stored in memory cells.

<span class="mw-page-title-main">DDR5 SDRAM</span> Type of computer memory

Double Data Rate 5 Synchronous Dynamic Random-Access Memory is a type of synchronous dynamic random-access memory. Compared to its predecessor DDR4 SDRAM, DDR5 was planned to reduce power consumption, while doubling bandwidth. The standard, originally targeted for 2018, was released on July 14, 2020.

<span class="mw-page-title-main">Memory cell (computing)</span> Part of computer memory

The memory cell is the fundamental building block of computer memory. The memory cell is an electronic circuit that stores one bit of binary information and it must be set to store a logic 1 and reset to store a logic 0. Its value is maintained/stored until it is changed by the set/reset process. The value in the memory cell can be accessed by reading it.

Rowhammer is a computer security exploit that takes advantage of an unintended and undesirable side effect in dynamic random-access memory (DRAM) in which memory cells interact electrically between themselves by leaking their charges, possibly changing the contents of nearby memory rows that were not addressed in the original memory access. This circumvention of the isolation between DRAM memory cells results from the high cell density in modern DRAM, and can be triggered by specially crafted memory access patterns that rapidly activate the same memory rows numerous times.

References

  1. "refresh cycle" in Laplante, Phillip A. (1999). Comprehensive Dictionary of Electrical Engineering. Springer. p. 540. ISBN   3540648356.
  2. 1 2 3 4 5 6 Ganssle, Jack; Tammy Noergaard; Fred Eady; Lewin Edwards; David J. Katz (2007). Embedded Hardware. Newnes. p. 106. ISBN   978-0750685849.
  3. Jacob, Bruce; Spencer Ng; David Wang (2007). Memory Systems: Cache, DRAM, Disk. Morgan Kaufmann. pp. 431–432. ISBN   978-0123797513.
  4. Laasby, Gitte (March 10, 2014). "Consumers eligible for money under computer chip price-fixing settlement". Milwaukee Journal-Sentinel. Milwaukee, Wisconsin. Retrieved April 16, 2024.
  5. 1 2 3 4 5 6 Reinhardt, Steven K. (1999). "Memory, p. 9–3" (PDF). EECS 373 Design of Microprocessor-based Systems, Lecture Notes, Fall 1999. Electrical Engineering Dept., Univ. of Michigan. Archived (PDF) from the original on January 2, 2014. Retrieved April 16, 2024.
  6. 1 2 3 4 Heath, Steve (2003). Embedded Systems Design, 2nd Ed. Newnes. pp. 88–89. ISBN   0750655461.
  7. "Memory 1997" (PDF). Integrated Circuit Engineering. 1997. p. 7.4. on The Chip Collection, Smithsonian website
  8. Kumar (2009). Fundamentals of Digital Circuits, 2nd Ed. India: PHI Learning Pvt. Ltd. p. 819. ISBN   978-8120336797.
  9. "JEDEC Double Data Rate (DDR) SDRAM Specification" (PDF). JESD79C. JEDEC Solid State Technology Assoc. March 2003. Retrieved April 16, 2024., p.20, on School of Engineering and Computer Science, Baylor Univ. website
  10. 1 2 3 Godse, Deepali A.; Godse, Atul P. (2008). Computer Organization. India: Technical Publications. p. 4.23. ISBN   978-8184313567.
  11. 1 2 "JEDEC DDR2 SDRAM Specification" (PDF). ECS.Baylor.edu. JESD79-2b. JEDEC Solid State Technology Assoc. January 2005. Retrieved April 16, 2024.
  12. Jacob, 2007, p.356
  13. Bhati, Ishwar; Chang, Mu-Tien; Chishti, Zeshan; Lu, Shih-Lien; Jacob, Bruce (2016). "DRAM Refresh Mechanisms, Penalties, and Trade-Offs". IEEE Transactions on Computers. 65 (1): 108–121. doi:10.1109/TC.2015.2417540.
  14. 1 2 Ravi K. Venkatesan, Stephen Herr, Eric Rotenberg. "Retention-Aware Placement in DRAM (RAPID): Software Methods for Quasi-Non-Volatile DRAM". 2006.
  15. Raha, A.; Sutar, S.; Jayakumar, H.; Raghunathan, V. (July 2017). "Quality Configurable Approximate DRAM". IEEE Transactions on Computers. 66 (7): 1172–1187. doi: 10.1109/TC.2016.2640296 . ISSN   0018-9340.
  16. Kim, Yongjune; Choi, Won Ho; Guyot, Cyril; Cassuto, Yuval (December 2019). "On the Optimal Refresh Power Allocation for Energy-Efficient Memories". 2019 IEEE Global Communications Conference (GLOBECOM). Waikoloa, HI, USA: IEEE. pp. 1–6. arXiv: 1907.01112 . doi:10.1109/GLOBECOM38437.2019.9013465. ISBN   978-1-7281-0962-6. S2CID   195776538.
  17. EE Times teardown of iPhone 3G