The present invention relates generally to memory systems, and more specifically to systems that manage combinations of nonvolatile memory and volatile memory.
Write operations to nonvolatile memories can take longer than write operations to volatile memory. For example, a write operation in FLASH nonvolatile memory can take significantly more time than a write operation in a dynamic random access memory (DRAM) or a static random access memory (SRAM). This presents a challenge to system designers wishing to incorporate nonvolatile memory devices, in part because system software may expect memory writes to always occur very fast.
The subject matter regarded as the invention is particularly pointed out and distinctly claimed in the concluding portion of the specification. The invention, however, both as to organization and method of operation, together with objects, features, and advantages thereof, may best be understood by reference to the following detailed description when read with the accompanying drawings in which:
It will be appreciated that for simplicity and clarity of illustration, elements illustrated in the figures have not necessarily been drawn to scale. For example, the dimensions of some of the elements may be exaggerated relative to other elements for clarity. Further, where considered appropriate, reference numerals have been repeated among the figures to indicate corresponding or analogous elements.
In the following detailed description, numerous specific details are set forth in order to provide a thorough understanding of the invention. However, it will be understood by those skilled in the art that the present invention may be practiced without these specific details. In other instances, well-known methods, procedures, components and circuits have not been described in detail so as not to obscure the present invention.
Memory system 110 includes physical memory 112 and memory management unit (MMU) 116. Physical memory 112 includes both nonvolatile memory 119 and volatile memory 121. The nonvolatile memory 119 is memory that does not require power to maintain the data stored in the memory. In some embodiments, nonvolatile memory 119 is FLASH memory that is written and erased one page at a time. A page of memory is a plurality of cells, with each cell in the page being addressed at a single time. A cell is the base unit that stores data either as a single bit, i.e., a “0” or a “1” or as a multilevel cell that can store more than one bit. In some embodiments, nonvolatile memory 119 is a NOR FLASH memory, and in other embodiments, nonvolatile memory 119 is a NAND FLASH memory. The volatile memory 121 may be random access memory such DRAM, SRAM, DDR-RAM, or other memory types.
In some embodiments, nonvolatile memory 119 includes phase change memory (PCM). Phase change memories are memories that store information based on modifiable material properties, such as whether a material is in a crystalline or amorphous state (phase). For example, in some embodiments, phase change memories include alloys of elements of group V1 of the periodic table, such as Te or Se, that are referred to as chalcogenides or chalcogenic materials. Chalcogenides may be used advantageously in phase change memory cells to provide data retention and remain stable even after the power is removed from the nonvolatile memory. Taking the phase change material as Ge2Sb2Te5 for example, two phases or more are exhibited having distinct electrical characteristics useful for memory storage. Phase change memory may be referred to as a Phase Change Memory (PCM), Phase-Change Random Access Memory (PRAM or PCRAM), Ovonic Unified Memory (OUM) or Chalcogenide Random Access Memory (C-RAM).
Memory system 110 also includes page table 114. Page table 114 is a virtual memory construct that maps virtual memory pages to physical memory page locations within nonvolatile memory 119 and volatile memory 121. In operation, MMU 116 performs translations between virtual memory addresses and physical memory addresses using page table 114. Virtual memory provides an application being run on the CPU with contiguous working memory when in fact the corresponding physical memory 112 may not be contiguous. The use of virtual memory makes for more efficient programming and improves the use of physical memory 112. Although page table 114 is shown separate from physical memory 112, in some embodiments, the page table is maintained as a data structure in the physical memory.
Memory management unit (MMU) 116 is coupled to communicate with CPU 111, physical memory 112, and page table 114. The memory management unit 116 may include both hardware and software to manage virtual memory, translate between virtual memory addresses and physical memory addresses, provide memory protection, control cache, arbitrate bus usage, etc.
Central processing unit 111 executes application software as well as an operating system 140. Operating system 140 is shown including fault handler 118, nonvolatile memory manager 123, and volatile memory manager 125. Operating system 140 also includes many other components that are not shown in
Fault handler 118 is a computer program product that includes instructions executable by CPU 111. In general, fault handler 118 causes CPU 111 to perform certain actions when a “fault” occurs. For example, fault handler 118 may be executed when MMU 116 determines that a command from CPU 111 conflicts with memory properties. In some embodiments, the MMU 116 determines that the processor is issuing a write operation to a write-protected memory location and issues a fault to CPU 111. The fault causes fault hander 118 to begin execution and to carry out a memory management process that is more fully explained below. In some embodiments, fault handler 118 corrects for the fault in a manner that is invisible to any application software running on the CPU 111.
A nonvolatile memory manager 123 and a volatile memory manager 125 are in communication with fault handler 118. The nonvolatile memory manager 123 controls movement of pages of data into and out of the nonvolatile memory 119. The volatile memory manager 125 controls movement of pages of data into and out of the volatile memory 121. Memory managers 123 and 125 are computer program products that are executed by CPU 111. In some embodiments, fault handler 118, nonvolatile memory manager 123, and volatile memory manager 125 are combined in a single computer program product in the form of instructions stored on a computer-readable medium. For example, the computer program product(s) may be stored in a memory within CPU 111, or may be stored elsewhere in memory system 110.
As shown in
The volatile memory manager and the nonvolatile memory manager cooperate to move memory contents from page location 233 of volatile memory to the empty page location 236 of nonvolatile memory. The volatile memory manager determines whether or not there is a free page location in the volatile memory. If no free page location is found in the volatile memory, them a page of data is moved out of the volatile memory to nonvolatile memory. In this example, page (5) is moved from location 233 in volatile memory to location 236 in nonvolatile memory. As a result, page location 236 now corresponds to virtual page 225, and page location 233 in volatile memory is now empty to make room for a page that is to accept a write. Page table 114 is updated to reflect that virtual page 225 now corresponds to page 236 and updates the read-only status of page 225 to write-protected as it now corresponds to a physical memory page in nonvolatile memory. In the embodiment shown in
In some embodiments, the volatile memory is managed such that all memory pages in the volatile memory are always full. This increases the likelihood that a write can be accomplished without first moving memory pages, because of the increased likelihood that the location to be written is already in the volatile memory. In embodiments in which volatile memory pages are always kept full, a page is transferred out of volatile memory each time a page is to be transferred in. When pages are moved out of volatile memory, the page to move may be selected using any criteria. For example, in some embodiments, a least recently used (LRU) algorithm is used to select which page of data is to be moved out of volatile memory.
When future write commands are received, they are handled in a similar manner. If the virtual memory locations 221, 222, or 223 are to be written to, no fault is generated as these pages are mapped to volatile memory page locations 233, 232, and 231, respectively, and are not marked as read only in page table 114. However, if a write command is received to write to virtual memory locations 224 or 225, then a fault is generated as these pages are mapped to nonvolatile memory page locations 235 and 236, respectively, which are marked as read-only in page table 114, and are write-protected.
Method 500 is shown beginning at block 510 in which a write command is issued to a first virtual memory location that corresponds to a page location in a nonvolatile memory. This may correspond to CPU 111 issuing a write command to a virtual memory location specified in page table 114, where the virtual memory location corresponds to a physical page of memory in nonvolatile memory 119 (
At 520, a fault is received. The fault may be sent by a memory management unit such as MMU 116 (
The fault handling mechanism described in
In some embodiments, fault handling as described in method 500 may be performed by a computer program product such as fault handler 118 (
Method 600 is shown beginning at block 610 in which a page table is maintained. The page table includes page table entries that map virtual memory addresses to physical memory addresses. Further, the page table has the ability to mark individual virtual pages as read-only. In some embodiments, all virtual pages that correspond to physical pages in nonvolatile memory are marked as read-only. When a page is marked as read-only in the page table, the page location is write-protected. Although the maintenance of the page table is shown in a single block (610) in
At 620 a write command is issued/received to write data to a location. The location is specified by a virtual address. At 630, a determination is made as to whether the location is in a write protected page. In some embodiments, this corresponds to a memory management unit such as MMU 116 (
At 640, a determination is made whether non write-protected memory has room to have a page of data transferred in. In some embodiments, the non write-protected memory is volatile memory such as volatile memory 121 (
Radio frequency circuit 750 communicates with antenna 760 and I/O controller 740. In some embodiments, RF circuit 750 includes a physical interface (PHY) corresponding to a communications protocol. For example, RF circuit 750 may include modulators, demodulators, mixers, frequency synthesizers, low noise amplifiers, power amplifiers, and the like. In some embodiments, RF circuit 750 may include a heterodyne receiver, and in other embodiments, RF circuit 750 may include a direct conversion receiver. In some embodiments, RF circuit 750 may include multiple receivers. For example, in embodiments with multiple antennas 760, each antenna may be coupled to a corresponding receiver. In operation, RF circuit 750 receives communications signals from antenna 760, and provides analog or digital signals to I/O controller 740. Further, I/O controller 740 may provide signals to RF circuit 750, which operates on the signals and then transmits them to antenna 760.
Processor 710 may be any type of processing device. For example, processor 710 may be a CPU such as CPU 111 (
Memory controller 720 provides a communications path between processor 710 and other devices shown in
Memory controller 720 provides data through bus 722 to memory 730 and receives data from memory 730 in response to read requests. Commands and/or addresses may be provided to memory 730 through conductors other than bus 722 or through bus 722. Memory controller 730 may receive data to be stored in memory 730 from processor 710 or from another source. Memory controller 720 may provide the data it receives from memory 730 to processor 710 or to another destination. Bus 722 may be a bi-directional bus or unidirectional bus. Bus 722 may include many parallel conductors. The signals may be differential or single ended.
Memory controller 720 is also coupled to I/O controller 740, and provides a communications path between processor 710 and I/O controller 740. I/O controller 740 includes circuitry for communicating with I/O circuits such as serial ports, parallel ports, universal serial bus (USB) ports, and the like. As shown in
Memory 730 may be any type of memory technology. For example, memory 730 may be random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM), nonvolatile memory such as FLASH memory, phase change memory (PCM), or any other type of memory. Memory 730 may represent a single memory device or a number of memory devices on one or more memory modules. For example, in some embodiments, memory 730 includes volatile and nonvolatile memory.
Memory 730 also represents a computer-readable medium that has instructions stored that when accessed cause memory controller 720 to perform various method embodiments of the present invention. For example, instructions for either or both of method 500 (
Example systems represented by
The systems and methods described herein provide techniques that allow the use of non-volatile memory with little to no affect on performance at the system level. System performance is not degraded as a software call to a driver is not required for every write to memory even though the system includes some non-volatile memory. Use of virtual memory, page tables, fault handlers, and memory managers to manage non-volatile memory allows the software to read and write to memory without needing to be aware of the memory type.
Although the present invention has been described in conjunction with certain embodiments, it is to be understood that modifications and variations may be resorted to without departing from the scope of the invention as those skilled in the art readily understand. Such modifications and variations are considered to be within the scope of the invention and the appended claims.