I. Field of the Disclosure
The technology of the disclosure relates generally to memory access controllers, memory page management policies, and related systems and methods in a processor-based system.
II. Background
It is common for processor-based systems, including central processing unit (CPU) based systems, to use dynamic memory for system memory. Dynamic memory is typically organized into a number of memory banks with each memory bank containing multiple memory pages. Accessing dynamic memory involves two discrete tasks, both of which require processing time. First, the memory page (i.e., row) corresponding to the desired memory location in the memory bank to be accessed is opened. This is also known as a “row select,” referring to a two-dimensional row and column memory arrangement. Second, the desired memory location within the memory page is accessed. This is also known as a “column select.” The memory page containing the accessed memory location must be closed before another memory page can be opened in the same memory bank. Increased memory access times can impact CPU performance in terms of both reduced bandwidth and increased latency (i.e., processing time) in transactions involving memory accesses.
To reduce memory access times and latency, memory controllers can be configured with a global memory page management policy to leave open a memory page after a memory access. The leave open memory page management policy only closes the memory page if required to service a pending memory access request targeting a new memory page or to perform memory maintenance commands, such as auto-refresh or self-refresh, as examples. Configuring a memory controller to leave open a memory page after an access may be ideal for certain memory applications, particularly those involving non-random, sequential memory location accesses, such as by multi-media applications or processors, as an example. In these scenarios, sequential memory accesses are often to the same memory page. Processing time is saved by not closing the memory page for a memory bank prior to a next memory access to the same memory page in the memory bank. However, a tradeoff exists by providing a memory page management policy to leave open memory pages. A processing time penalty is incurred if sequential memory accesses to a memory bank are to different memory pages. If, for example, a CPU with a cache hierarchy accesses a different memory page than a currently open memory page in a memory bank, the currently open memory page must be closed before the new memory page can be opened. The additional processing time incurred in closing the currently open memory page before a new memory page can be accessed can increase latency. Another tradeoff of employing a memory page management policy of leaving open a memory page is the additional power expended keeping the memory page open after an access.
Embodiments disclosed in detailed description include memory controller page management devices, systems, methods, and computer-readable mediums. In one embodiment, a memory controller is provided and configured to access memory in response to a memory access request. The memory controller is configured to apply a configurable page management policy to either leave open or close a memory page after an access to a memory location in the memory page based on at least an identifier or identification information associated with a requestor. In this manner, a memory page management policy can be applied by the memory controller to memory to optimize memory access times and reduce latency based on the identification of the requestor. For example, the requestor may be associated with sequential or a series of memory access requests to the same memory page such that a leave open page management policy would be optimal for reduced memory access times. As another example, the requestor may be associated with memory access requests to random memory pages such that a close page management policy would be optimal for reduced memory access times.
In another embodiment, a method of accessing memory is provided. The method includes receiving a memory access request comprising a memory address at a memory controller. An identifier associated with a requestor of the memory access request at the memory controller is also received. The method includes determining a page management policy for a memory page containing the memory address based on the identifier associated with the requestor, accessing a memory location at the memory address, and applying the page management policy to the memory page.
In another embodiment, a memory system comprised of a plurality of memory controllers is provided, each configured to access memory in response to a memory access request. An arbiter is coupled to the plurality of memory controllers and configured to provide memory access requests from requestors to the plurality of memory controllers. The plurality of memory controllers are configurable to apply a page management policy to at least one memory page in the memory based on an identifier associated with a requestor.
In one system embodiment, the memory controller is provided in a memory system accessible by multiple master units. The multiple master units may be hardware devices, such as central processing units (CPUs), digital signal processors (DSPs), direct memory access (DMA) controllers, etc., as examples. The multiple master units may be associated with other sub-master units and/or software processes, any of which may be responsible for a memory access request. The multiple master units provide a master identifier identifying the master unit, sub-master units, and/or other software processes or threads to an arbiter as part of a memory access request. The arbiter arbitrates the memory access requests based on the master identifier and/or memory mapping associating the memory address associated with the memory access request. The master identifier is communicated from the arbiter to a memory controller as part of a memory access request. The memory controller can use the master identifier to determine the identification of the requestor to determine the page management policy to apply to the memory page associated with the memory access request. The memory controller can be configured to identify whether a given requestor often provides sequential or a series of memory access requests to the same memory page to determine whether to apply a leave open or close page management policy to the memory page after an access.
In another embodiment, a computer readable medium having stored thereon computer executable instructions to cause a memory controller to apply a page management policy to at least one memory page in memory based on at least an identifier associated with a requestor is provided.
In each of the embodiments, the page management policies provided in the memory controller may be programmable. Further, the characteristics used to determine the page management policy may be based on both an identifier or identification information associated with a requestor and other characteristics or information. For example, the page management policy may be based on attribute information associated with a requestor. The attribute information may include an identification of a particular software process or thread, or any other information desired to be used to set the page management policy. In another embodiment, the page management policy may also be based on the memory address in the memory access request to the memory controller.
With reference now to the drawing figures, several exemplary embodiments of the present disclosure are described. The word “exemplary” is used herein to mean “serving as an example, instance, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.
Embodiments disclosed in detailed description include memory controller page management devices, systems, and methods. In one embodiment, a memory controller is configured to access memory in response to a memory access request. The memory controller is configured to apply a configurable page management policy to either leave open or close a memory page after an access to a memory location in the memory page based on at least an identifier or identification information associated with a requestor. In this manner, a memory page management policy can be applied by the memory controller to optimize memory access times and reduce latency based on an identifier or identification information associated with a requestor. For example, the requestor may be associated with sequential or a series of memory access requests to the same memory page such that a leave open page management policy would be optimal for reduced memory access times. As another example, the requestor may be associated with memory access requests to random memory pages such that a close page management policy would be optimal for reduced memory access times.
In this regard,
In this embodiment, two memory units 16 are provided in the memory system 10. Each memory unit 16 has a dedicated memory controller 14 and associated memory 12. The memory controller 14 is responsible for the flow of data to and from memory 12. In the illustrated example, the memory controller 14 is responsible for controlling the flow of data to and from two dynamic memory chips 12A, 12B in its memory unit 16, although any number of memory chips can be provided. In this example, each memory chip 12A, 12B is a 16-bit double data rate (DDR) dynamic random access memory (DRAM) chip, labeled DDRO and DDRn. In this regard, the memory controller 14 that controls accesses to the two memory chips 12A, 12B may be a DDR memory controller. DDR memory controllers may be more complicated than Single Data Rate (SDR) memory controllers, but they allow for twice the data to be transferred without increasing the clock rate or bus width to the memory cell.
The memory chips 12A, 12B may be any type of dynamic memory. Examples include SDRAM, DDR, DDR2, DDR3, MDDR (Mobile DDR), LPDDR and LPDDR2. The memory chips 12A, 12B may be other types of memory other than dynamic memory. The memory controller 14 may be any type of memory controller compatible with its memory chips. Further, the memory controller 14 as illustrated may be provided on a motherboard or other printed circuit board (PCB) as a separate device, or integrated on at least one central processing unit (CPU) or semiconductor die, which may reduce latency.
The memory controllers 14 in each memory unit 16 control the flow of data to and from the memory chips 12A, 12B via a memory bus 17. In this example, the memory bus 17 includes two chip selects (CS0, CS1) 18, 20; one for each memory chip 12A, 12B. The chip selects 18, 20 are selectively enabled by the memory controller 14 to enable the memory chip 12A, 12B containing the desired memory location to be accessed. The memory controller 14 enables one of the memory chips 12A, 12B at a time so that one memory chip 12A, 12B asserts data on a data (DATA) bus 22 at one time to avoid data collisions. The memory bus 17 also includes an address/control (ADDR/CTRL) bus 24 that allows the memory controller 14 to control the memory address accessed in the memory chips 12A, 12B for either writing or reading data to or from memory 12. The memory bus 17 also includes a clock signal (CLK) 26 to synchronize timing between the memory controller 14 and the memory chips 12A, 12B for memory accesses.
In this embodiment, an arbiter 28 is provided and coupled to the memory controllers 14 via a memory unit bus 30 to arbitrate multiple devices to access the memory units 16. The arbiter 28 may be any type of device or circuit, and may be provided in an IC chip as illustrated in
In this embodiment, the arbiter 28 determines which memory unit 16 should receive a memory access request from a requesting master unit 36 over a master unit bus 38 based on arbitration criteria. The master identifier 40 includes the identification of the master unit 36 that communicated the memory access request to the arbiter 28. If the memory address is unique to memory 12 in one of the memory units 16, the arbiter 28 can forward the memory access request to the appropriate memory controller 14. The memory controller 14 will communicate the request to the appropriate memory chip 12A, 12B. If the memory access request is a read request, the data stored in the memory 12 at the memory address is communicated back from the memory controller 14 to the arbiter 28. The arbiter 28 uses the master identifier 40 received in the memory access request to provide a memory access response to the requesting master unit 36. The arbiter 28 may also return the master identifier 40 to the requesting master unit 36. The master unit 36 can review the master identifier 40 to determine if the memory access response should be further communicated to a component connected to the master unit 36.
The master units 36 may be any type of hardware device or software component, examples of which include DMA controllers, display controllers, CPUs, and DSPs. The master units 36 may execute software processes that have differentiated master identifiers 40 based on a particular software thread or internal master. This may enable differentiated services with a core of the master units 36 as well as across core functions of the master units 36. The master identifier 40 may include information identifying not only the requesting master unit 36, but also sub-master units 42 that are coupled to the requesting master unit 36. For example, sub-master units 42 (SM0,0-SM0,N) are illustrated in
In the exemplary memory system 10 of
With reference back to
With continuing reference to
Each memory bank 50 is organized into a grid-like pattern, with “rows” and “columns.” The data stored in the memory 12 comes in blocks, defined by the coordinates of the row and column of the specific information. Each row is known as a memory page 52. In order to access a memory location in memory 12, the memory controller 14 asserts a chip select (CS0 or CS1) 18, 20, and issues a memory page open command that activates a certain memory page 52 as indicated by the address on the ADDR/CTRL bus 24. This command typically takes a few clock cycles. After the desired memory page 52 is opened, a column address 54, along with either a “read” or “write” command, is issued by the memory controller 14 to access the data in the desired memory location. When an access is requested to another memory page 52 in the memory bank 50, the memory controller 14 has to deactivate or close the currently activated memory page 52, which typically takes a few clock cycles. Hence, memory access to the data in memory 12 normally involves opening the memory page 52 containing the desired memory location for writing or reading data, and then closing the memory page 52 after the memory access is completed. In this manner, a different memory page 52 can subsequently be accessed by the memory controller 14.
If sequential or a series of memory accesses are made to the same memory page 52 in a given memory bank 50, clock cycles could be saved if the memory page 52 was kept open. In this manner, sequential or a series of memory accesses to the same memory page 52 would not require reopening the memory page 52. The amount of total clock cycle savings depends on the number of sequential or series of memory accesses to the same memory page 52. However, if memory accesses are often made to different memory pages 52, keeping or leaving open a memory page 52 after an access can result in clock cycle penalties. This is because before the memory page 52 of subsequent memory access can be opened, the memory controller 14 would first have to close the currently opened memory page 52. The amount of clock cycle penalty can depend on the number of sequential or series of memory accesses to different memory pages 52. The amount of clock cycle penalty can also depend on the specific timing parameters of the memory 12 that govern how long the memory controller 14 must wait in response to a memory access request.
According to embodiments described herein, the memory controllers 14 in memory units 16 of the memory system 10 in
For example, if the requestor's characteristics are determined to more likely access the same memory page 52, a page management policy of leaving open the memory page 52 accessed may be applied by the memory controller 14. In this manner, clock cycles and processing time are saved by not having to reopen a memory page 52 for a memory access request to the same memory page 52 previously left open. For example, a memory access request by a DMA or display controller may often provide sequential or a series of memory access requests to the same memory page 52. If, on the other hand, the requestor's characteristics are determined to more likely access different memory pages 52, a page management policy of closing a memory page 52 after access may be applied. In this manner, clock cycle penalties are not incurred by having to close a previously left open memory page 52 before a next, different memory page 52 is accessed. For example, CPUs and DSPs may often provide a series of memory access requests to different memory pages 52. As previously discussed, the requestor can be the master unit 36 or the sub-master unit 42, and/or a particular software process or thread therein in this embodiment over a particular fabric 41.
One technique that may be employed in the memory controller 14 to determine a page management policy for memory 12 based on the master identifier 40 is applying a mask to the master identifier 40. The master identifier 40 is received by the memory controller 14 from the arbiter 28 as part of a memory access request.
With continuing reference to
The page policy index table 60 in the memory controller 14 can also be programmed such that a match is not produced for every master identifier 40 received by the arbiter 28. In this situation, the last page management policy in place for the memory page 52 containing the memory location to be accessed will be applied by the memory controller 14. Further, a default page management policy may be provided in the memory controller 14 and may be programmable so that a default page management policy is applied by the memory controller 14 if the master identifier 40 does not produce a match within the page policy index table 60. The default page management policy may be either to close or leave open a memory page 52 after an access.
If the duration bit 74 is set to a time (e.g., 1), the leave open page management policy is only to be applied for a set duration of time. The remaining bits in the page management policy 68, time bits 76 (C5-C0), provide a number of clock cycles to keep the leave open page management policy in place before reverting back to a default page management policy. In this manner, the duration of the leave page open management policy can also be programmed. By providing six time bits 76, a maximum duration of sixty-four (64) clock cycles is possible. However, the memory controller 14 could be configured to apply a multiplier factor to the count value in the time bits 76 (e.g., each count equals two clock cycles) to allow for larger clock cycle counts over a limited number of time bits 76. Alternatively, a page management policy 68 could be provided that includes additional time bits 76 to allow higher time counts without a multiplying factor being applied.
The memory controller 14 determines which memory bank 50 and memory page 52 within the memory 12 corresponds to the received memory address in the memory access request (block 82). This is so the memory controller 14 can enable the correct chip select (CS) 18, 20 for the memory chip 12A, 12B containing the desired memory location of the memory access request. The memory controller 14 also uses this information to activate the correct memory page 52 and column address 54 in the memory chip 12A, 12B corresponding to the memory location to be accessed. The memory controller 14 then determines if the memory page 52 to be accessed is already opened (block 84) by consulting internal registers 110 in the memory controller 14, illustrated by example in
Before finishing the memory access, the memory controller 14 next determines the page management policy for the memory page 52 accessed (decision 88). The memory controller 14 determines if the page management policy dictates that the memory page 52 should be left open or closed based on the page management policy criteria. If the page management policy is to leave open the memory pages, the page management policy may be an indefinite policy or may be a policy that is only applied for a duration of time wherein it will eventually expire as previously discussed. In this example, the page management policy criteria is based on the identification information in the master identifier 40. Examples on how the master identifier 40 received by the memory controller 14 is consulted to determine a page management policy were discussed previously with regard to
If the memory page 52 to be accessed is already closed (decision 84), this means the memory page 52 corresponding to the memory location to be accessed must first be opened before the memory location can be accessed. In this regard, as illustrated in
It is possible and contemplated herein that other configurations can be used in the memory controllers 14 to determine the page management policy for an accessed memory page 52 based on the master identifier 40.
A benefit of the page policy index table 120 in
Other page management policy criteria can be used by the memory controller 14 to apply a page management policy. As another example, the memory address in the memory access request received by the memory controller 14 may be used to determine and apply a page management policy.
A further possibility could be to configure the memory controllers 14 to combine multiple page management policy criteria to determine and apply a page management policy to a memory page 52. For example, the page management policy criteria could be based on both identification information in the master identifier 40 as well as the memory address provided in the memory access request. Examples of providing page management policy configurations based on the master identifier 40 and the memory address of the memory access request described above are possible examples. As an example, the memory controller 14 could provide both configurations as the page management policy criteria (e.g., block 88 in
The input devices 144 can include any type of input device, including but not limited to input keys, switches, voice processors, etc. The output devices 146 can include any type of output device, including but not limited to audio, video, other visual indicators, etc. The network interface device(s) 148 can be any devices configured to allow exchange of data to and from a network 152. The network 152 can be any type of network, including but not limited to a wired or wireless network, private or public network, a local area network (LAN), a wide local area network (WLAN), and the Internet. The network interface device(s) 148 can be configured to support any type of communication protocol desired. The system memory 142 can include one or more memory units 16 like provided in the memory system 10 of
The CPU 132 may also be configured to access the display controller(s) 150 over the system bus 140 to control information sent to one or more displays 154. The display controller(s) 150 sends information to the display(s) 154 to be displayed via one or more video processors 156, which process the information to be displayed into a format suitable for the display(s) 154. The display(s) 154 can include any type of display, including but not limited to a cathode ray tube (CRT), a liquid crystal display (LCD), a plasma display, etc.
The CPU 132 and the display controller 150 may act as master units to make memory access requests to the arbiter 28 over the system bus 140. Different threads within the CPU 132 and the display controller 150 may make requests to the arbiter 28. The CPU 132 and the display controller 150 may provide the master identifier 40 to the arbiter 28 as previously described to determine a page management policy.
A memory controller and memory system according to embodiments disclosed herein may be provided in or integrated into any processor-based device for controlling access to memory. Examples, without limitation, include a set top box, an entertainment unit, a navigation device, a communications device, a fixed location data unit, a mobile location data unit, a mobile phone, a cellular phone, a computer, a portable computer, a desktop computer, a personal digital assistant (PDA), a monitor, a computer monitor, a television, a tuner, a radio, a satellite radio, a music player, a digital music player, a portable music player, a digital video player, a video player, a digital video disc (DVD) player, and a portable digital video player.
Those of skill in the art would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithms described in connection with the embodiments disclosed herein may be implemented as electronic hardware, instructions stored in memory or in another computer-readable medium and executed by a processor or other processing device, or combinations of both. The memory controllers, arbiter, master units, and sub-master units described herein may be employed in any circuit, hardware component, IC, or IC chip, as examples. The memory may be any type and size of memory and may be configured to store any type of information desired. To clearly illustrate this interchangeability, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. How such functionality is implemented depends upon the particular application, design choices, and/or design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The various illustrative logical blocks, modules, and circuits described in connection with the embodiments disclosed herein may be implemented or performed with a processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. A processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP core, or any other such configuration.
The embodiments disclosed herein may be embodied in hardware and in instructions that are stored in hardware, and may reside, for example, in Random Access Memory (RAM), flash memory, Read Only Memory (ROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), registers, hard disk, a removable disk, a CD-ROM, or any other form of computer readable medium known in the art. An exemplary storage medium is coupled to the processor such that the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an ASIC. The ASIC may reside in a remote station. In the alternative, the processor and the storage medium may reside as discrete components in a remote station, base station, or server.
It is also noted that the operational steps described in any of the exemplary embodiments herein are described to provide examples and discussion. The operations described may be performed in numerous different sequences other than the illustrated sequences. Furthermore, operations described in a single operational step may actually be performed in a number of different steps. Additionally, one or more operational steps discussed in the exemplary embodiments may be combined. It is to be understood that the operational steps illustrated in the flow chart diagrams may be subject to numerous different modifications as will be readily apparent to one of skill in the art. Those of skill in the art would also understand that information and signals may be represented using any of a variety of different technologies and techniques. For example, data, instructions, commands, information, signals, bits, symbols, and chips that may be referenced throughout the above description may be represented by voltages, currents, electromagnetic waves, magnetic fields or particles, optical fields or particles, or any combination thereof.
The previous description of the disclosure is provided to enable any person skilled in the art to make or use the disclosure. Various modifications to the disclosure will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other variations without departing from the spirit or scope of the disclosure. Thus, the disclosure is not intended to be limited to the examples and designs described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.