This application claims the benefits of the Taiwan Patent Application Serial Number 100108955, filed on Mar. 16, 2011, the subject matter of which is incorporated herein by reference.
1. Field of the Invention
The present invention relates to the technical field of memory accesses and, more particularly, to a memory access system and method for optimizing synchronous dynamic random access memory (SDRAM) bandwidth.
2. Description of Related Art
With the rapid development of computer systems, microcomputer systems, consumer electronics, and semiconductor technologies, source data synchronous communication interfaces are improved greatly. For example, the access speed of DDR, DDR-II, and DDR-III synchronous dynamic random access memory (SDRAM) is raised quickly, and the higher memory bandwidth is provided. The SDRAM access speed is increased from several MHz to Giga Hz in several years. The number of latency cycles in a non-active band memory access is gradually increased. For example, the number of latency cycles in a non-active band memory access is between three and five for an SDR SDRAM and between 12 and 15 for a DDR2 or a DDR3 SDRAM.
A computer system or a video processing system includes a plurality of system bus masters. Each of the system bus masters has a special function such as video decoding, video encoding, video playback, audio decoding, audio playback, DMA, CPU and the like. Since each of the system bus masters can perform a special function, the system bus masters can concurrently access the memory access areas at a different address in a different command format, so that the dynamic memory access commands generated by the system bus masters can be used to access one or more different dynamic memory banks. Since the system bus masters concurrently access a memory at a different address, it is hard to find an active page of a current memory access command as same as that of a previous one.
To overcome this,
Another memory controller technology in the prior art uses a large memory access command queue to store many memory access commands and a complicated reordering algorithm to select a memory access command with the minimum latency or penalty cycles as a next access command to a SDRAM to thereby increase the SDRAM bandwidth utilization.
Another memory controller technology in the prior art uses multiple memory access command queues to select higher priority memory access commands to thereby reduce the number of latency cycles.
However, the two technologies cited above will relatively increase a large of read data latency for some memory read commands, resulting in unsatisfactory performance. At the same time, theses mechanisms and methods for accessing SDRAM in a complicated computing system cannot guarantee the SDRAM bandwidth utilization. The system will have a large memory and SDRAM bandwidth utilization depending on commands in command queue and application case. Thus, the cited technologies cannot ensure a high SDRAM bandwidth and the system performance.
Certain computing systems cannot use conventional technologies to improve the memory access performance. For example, a multi-media memory controller system has a complicated memory reference decoding algorithm (two dimension decoding for video image and a linear (sequence) memory access command) and almost all masters normally are accesses to different ranges of SDRAM addresses.
For an operation in such a system, the probability of finding an active page command (for next command) in current memory access commands in a command queue is low.
In the known patents, U.S. Pat. No. 6,629,220 granted to Dyer for a “Method and apparatus for dynamic arbitration between a first queue and a second queue based on a high priority transaction type” has disclosed a dynamic arbitration based on a high priority transaction type, which uses two queues to store different priority transaction types and adjusts the priorities according to a bandwidth limit.
U.S. Pat. No. 7,395,448 granted to Smith for a “Directly obtaining by application programs information usable in determining clock accuracy” has disclosed an information usable in determining the quality of time generated by a clock of a processing environment, which merges a plurality of short memory access commands into a long memory access command.
U.S. Pat. No. 6,564,304 granted to Van Hook, et al. for a “Memory processing system and method for accessing memory including reordering memory requests to reduce mode switching” has disclosed a memory processing system and method for accessing memory in a graphics processing system, which reorders memory access commands to thereby reduce the amount of mode switching (write command to read command or read command to write command).
U.S. Pat. No. 7,069,399 granted to Lin, et al. for a “Method and related apparatus for reordering access requests used to access main memory of a data processing system” has disclosed a method and related apparatus for reordering access requests used to access main memory of a data processing system, which reorders memory access commands based on latency cycles.
Finally, U.S. Pat. No. 7,281,110 granted to Cismas for a “Random access memory controller with out of order execution” has disclosed a memory controller for a multi-bank random access memory (RAM), which reorders commands of precharge PRE, active ACT, read READ, write WRITE for a SDRAM.
However, a system with such a reordering may relatively reduce the actually available SDRAM bandwidth due to the requirement for the maximum delay. Therefore, for a complete and complicated computing system, the cited command reordering cannot obtain the greatest SDRAM bandwidth and ensure the maximum system bandwidth.
Therefore, it is desirable to provide an improved memory access system and method for optimizing synchronous dynamic random access memory (SDRAM) bandwidth, so as to mitigate and/or obviate the aforementioned problems.
The object of the present invention is to provide a memory access system for optimizing SDRAM bandwidth, which can increase the performance of a synchronous dynamic random access memory (SDRAM) access and avoid an interleaving access from losing the SDRAM bandwidth due to the over-small amount of data accesses.
In accordance with a feature of the invention, a memory access system for optimizing a synchronous dynamic random access memory (SDRAM) bandwidth is provided. The system includes a memory command processor and an SDRAM interface and protocol controller. The memory command processor is connected to a memory bus arbiter and data switch circuit in order to receive memory access commands outputted by the memory bus arbiter and data switch circuit and convert the memory access commands into reordered SDRAM commands. The SDRAM interface and protocol controller is connected to the memory command processor in order to receive and execute the reordered SDRAM commands based on a protocol and timing of the SDRAM. The memory command processor decodes the memory access commands into general or alternative SDRAM commands. The memory access commands decoded into alternative SDRAM commands are generated by a specific bus master.
In accordance with another feature of the invention, a memory access method for optimizing a synchronous dynamic random access memory (SDRAM) bandwidth is provided. The method is applied to a system on a chip (SoC) for executing SDRAM commands in a manner of optimized bandwidth. The method includes: (A) using a memory bus arbiter and data switch circuit to select and grant a next memory access command; (B) using the memory bus arbiter and data switch circuit to send the next memory access command to a memory access system (memory controller) for optimizing the SDRAM bandwidth; (C) using the memory access system to decode the next memory access command into SDRAM commands; (D) determining whether the memory access command is generated by a specific bus master; (E) storing the SDRAM commands in an alternative SDRAM command queue when it is determined in step (D) that the memory access command is generated by the specific bus master, and executing step (G); (F) storing the SDRAM commands in a general SDRAM command queue when it is determined in step (D) that the memory access command is not generated by the specific bus master, and executing step (G); and (G) extracting the SDRAM commands with a minimum penalty from the general SDRAM command queue or the alternative SDRAM command queue, and storing the SDRAM commands with the minimum penalty in a minimum penalty SDRAM command queue.
Other objects, advantages, and novel features of the invention will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings.
The SoC 400 includes a processor 410, a video display processor 420, an MPEG decoder 430, a graphic processing unit (GPU) 440, a first on screen display (OSD1) 450, a second on screen display (OSD2) 460, a memory bus arbiter and data switch circuit 470, a synchronous dynamic random access memory (SDRAM) 490, and the memory access system 500.
The processor 410, the video display processor 420, the MPEG decoder 430, the GPU 440, the first OSD 450, the second OSD 460 are each independent masters on a specific bus. The specific bus can be an AMBA, OCP, PCI bus system or other SoC on-chip bus/memory-bus system. Each of the masters generates memory access commands to the memory bus arbiter and data switch circuit 470. The memory bus arbiter and data switch circuit 470 arbitrates the memory access command and selects one of the memory access command to the next memory access command for the memory bus system. The next memory access command will be second to memory access system (500).
The memory access system 500 includes a memory command processor 510 and an SDRAM interface and protocol controller 550.
The memory command processor 510 is connected to the memory bus arbiter and data switch circuit 470 in order to receive a memory access command and data sent by the memory bus arbiter and data switch circuit 470 and convert the memory access command into a serial of SDRAM commands.
The SDRAM interface and protocol controller 550 is connected to the memory command processor 510 in order to receive and execute the reordered SDRAM command based on the SDRAM protocol and timing specification.
The memory command processor 510 decodes the memory access command into general SDRAM commands or alternative SDRAM commands.
The memory access command decoded into several alternative SDRAM commands are generated by one or more specific bus masters.
For convenience of description, in this embodiment, the specific bus masters are the first OSD 450 and the second OSD 460. In other embodiments, the other masters can be selected as the specific bus masters.
As shown in
The memory bus command interface unit 511 is connected to the memory bus arbiter and data switch circuit 470 in order to receive a memory access command sent by the memory bus arbiter and data switch circuit 470 and perform data receiving and sending of the memory access command.
The memory command decoder 512 is connected to the memory bus command interface unit 511 in order to decode the memory access command and generate multiple SDRAM commands. Each of the SDRAM commands can be a general SDRAM command or an alternative SDRAM command.
The general SDRAM command queue 513 is connected to the memory command decoder 512 in order to temporarily store the general SDRAM commands.
The alternative SDRAM command queue 514 is connected to the memory command decoder 512 in order to temporarily store the alternative SDRAM commands.
The command reorder controller 515 is connected to the general SDRAM command queue 513 and the alternative SDRAM command queue 514 in order to select the general SDRAM command or the alternative SDRAM command as a next reordered SDRAM command according to the bandwidth utility of an optimized SDRAM interface.
The multiplexer 518 is connected to the general SDRAM command queue 513, the alternative SDRAM command queue 514, and the command reorder controller 515 in order to output a command selected from the general SDRAM command queue 513 or the alternative SDRAM command queue 514 to the minimum penalty SDRAM command queue 516 as the next reordered SDRAM command.
The minimum penalty SDRAM command queue 516 is connected to the command reorder controller 515, the general SDRAM command queue 513, and the alternative SDRAM command queue 514 through the multiplexer 518 in order to temporarily store the next reordered SDRAM command.
The alternative SDRAM command and data request controller 517 is connected to the command reorder controller 515 and the specific bus masters 450, 460, and has a request new memory access command signal 521 to inform the specific bus masters 450, 460.
When the alternative SDRAM commands stored in the alternative SDRAM command queue 514 are used up or not enough in number, the alternative SDRAM command and data request controller 517 can use the request new memory access command signal 521 to inform the specific bus masters 450, 460, so as to generate and output a memory access command.
The alternative SDRAM command and data request controller 517 also has an urgent data request signal and data FIFO near full signal 523 outputted to the command reorder controller 515 for raising the priority of the alternative SDRAM command or keeping normal priority of the alternative SDRAM command.
In addition, when the specific bus masters 450, 460 urgently require data, the urgent data request signal and data FIFO near full signal 523 is used to inform the alternative SDRAM command and data request controller 517 and the command reorder controller 515, so that the command reorder controller 515 adjusts the priority of the alternative SDRAM command based on the urgent data request signal and data FIFO near signal 523. Accordingly, the specific bus masters 450, 460 can avoid the data starved condition.
The memory access commands generated by the specific bus masters 450, 460 are decoded by the memory command decoder 512 into an address range of specific memory banks of the SDRAM 490. For example, the memory access commands are decoded into the address range of the first and second memory banks or third and fourth memory banks of the SDRAM 490.
The programmable control register 519 is connected to the command reorder controller 515 in order to allow the command reorder controller 515 to adjust the priority of the general SDRAM command. The command reorder controller 515 combines and reorders all SDRAM commands generated by decoding the same memory access command, and outputs the reordered SDRAM commands to the minimum penalty SDRAM command queue.
Since the prior art does not have the alternative SDRAM command queue 514, a typical SDRAM controller with the command reordering function find or select a no-penalty or minimum-penalty SDRAM access command from the general SDRAM command queue for the next SDRAM access command. Typically, the reordered SDRAM commands are used to improve the utilization of SDRAM bandwidth. Each of the masters presents a different behavior and accesses different memory address range of whole system memory. For example, a video decoder and video processing master uses a 2-dimentional (block) mode to access a memory (X-directional start address, Y-directional start address, length in X direction, length in Y direction), a direction access memory (DMA) device uses a continuous address mode to access a memory, and a RISC/DSP processor mostly contains short data and a memory command type of accessing discontinuous addresses. Therefore, it is not guaranteed that a no-penalty SDRAM access command can be found in a typical SDRAM command queue for the SDRM controller with the SDRAM command reordering function.
The SDRM controller with the SDRAM command reordering function reorders the SDRAM commands of the general SDRAM command queue to thereby generate the minimum-penalty SDRAM commands, as shown in the right side of
The addresses of the SDRAM bank-0 at E-command and F-command are arranged together because the number of SDRAM access commands temporarily stored in the general SDRAM command queue is too small or can't find other commands at the moment. The typical solution is to enlarge the storage capacity of the general command queue so as to temporarily store a large number of memory access commands, which causes the system to generate a large number of latency cycles of memory access command, resulting in that the time of issuing a memory access command to obtaining the data is relatively increased. Therefore, the storage capacity of the general command queue in this case is limited, and a certain amount of SDRAM bandwidth is lost and to reduce the system performance, even the optimal reordering is applied to the SDRAM commands.
In this case, the bus masters are the first OSD 450 (OSD1) and the second OSD 460 (OSD2). The memory access commands corresponding to the first OSD 450 are in the memory bank 0 (Bank-0) and 1 (Bank-1). Namely, the memory access commands corresponding to the first OSD 450 are decoded so as to access addresses of memory banks Bank-0 and Bank-1. Similarly, memory banks 2 (Bank-2) and 3 (Bank-3) of the SDRAM correspond to the memory access commands of the second OSD 460. Thus, the alternative SDRAM command queue 514 contains the SDRAM commands of all SDRAM banks, and the command reorder controller 515 can use the SDRAM commands stored in the general SDRAM command queue 513 or the alternative SDRAM command queue 514 to generate a no-penalty SDRAM command sequence.
The right side of
As shown in
As shown in
In this embodiment, the memory access commands stored in the general SDRAM command queue 513 have a higher priority than those stored in the alternative SDRAM command queue 514 in normal. The command reorder controller 515 uses a timer (not shown) to change the priority to thereby guarantee the service time and bandwidths of certain desired bus masters.
When the specific bus masters 450, 460 generate the urgent data request signal, the command reorder controller 515 assigns a higher priority to the memory access commands stored in the alternative SDRAM command queue 514 to thereby meet with the data requirement of memory access commands of the bus masters 450, 460.
When the space of data read buffer of the specific bus masters is near full, an FIFO data near full signal is used to inform the command reorder controller 515, and in this case the command reorder controller 515 can only select the memory access commands stored in the general SDRAM command queue 513.
First, in step (A), the memory bus arbiter and data switch circuit 470 selects or grants a next memory access command.
In step (B), the memory bus arbiter and data switch circuit 470 sends the memory access command selected in step (A) to the memory access system 500.
In step (C), the memory access system 500 decodes the memory access command to SDRAM commands.
In step (D), it is determined whether the memory access command is generated by a specific bus master or not. If yes, the SDRAM commands are stored in the alternative SDRAM command queue 514 in step (E); otherwise, the SDRAM commands are stored to the general SDRAM command queue 513 in step (F). The alternative SDRAM command correspondingly generated by the specific bus master is decoded to access certain specific or desired banks of the SDRAM (SDRAM banks).
In step (G), a no-penalty or minimum penalty SDRAM command is selected from the general SDRAM queue 513 or the alternative SDRAM queue 514, and stored to the minimum penalty SDRAM command queue 516.
As cited, the invention provides a memory access system and method for optimizing an SDRAM bandwidth, which is a new memory access configuration and process. The invention uses the alternative SDRAM command queue 514 to temporarily store the memory access command generated by a specific bus master. The memory access command generated by the bus master is decoded into SDRAM commands for accessing specific SDRAM banks. Accordingly, the command reorder controller 515 is based on a maximum utility of SDRAM interface to select a general SDRAM command from the general SDRAM command queue 513 or an alternative SDRAM command from the alternative SDRAM command queue 514 as the reordered SDRAM command. Since the memory access command generated by the bus master is decoded into SDRAM commands to access specific SDRAM banks, the command reorder controller 515 can implement a no-penalty interleaving access of the SDRAM commands to thereby optimize the performance of an SDRAM access. Also, it is able to effectively eliminate the problem of bandwidth loss caused by the amount of data accesses of some SDRAM commands being too short in an SDRAM interleaving access.
Although the present invention has been explained in relation to its preferred embodiment, it is to be understood that many other possible modifications and variations can be made without departing from the spirit and scope of the invention as hereinafter claimed.
Number | Date | Country | Kind |
---|---|---|---|
100108955 | Mar 2011 | TW | national |