1. Field of the Invention
The present invention relates to a memory controller which can reorder a command.
2. Description of the Related Art
Conventionally, a memory controller which reorders and issues a command in a command queue within the memory controller is discussed, for example, in Japanese Patent Laid-open Publication No. 2007-26365.
The memory controller core 100 includes a command control unit 110, a write data control unit 120, a memory command control unit 130, and an internal bus 140.
In the command control unit 110, a command queue 111 stores commands received from the plurality of bus interfaces A310, B320, and C330. A reordering circuit 112 reorders the commands in the command queue 111.
When the command queue 111 issues a write command to the memory 200, the write data control unit 120 reads out write data from a write data queue of the bus interface which is a master of the command, and temporarily stores the write data in a write data buffer 121 to write the write data into the memory 200.
The memory command control unit 130 performs receiving and sending data among the command control unit 110, the write data control unit 120, and the memory 200.
The internal bus 140 performs receiving and sending commands and data among the command control unit 110, the write data control unit 120, and the plurality of bus interfaces A310, B320, and C330.
In the bus interfaces A310, B320, and C330, command buffers 311, 321, and 331 temporarily store a write request or a read request from a bus outside the memory controller 000. Each of the write data queues 312, 322, and 332 stores data to be written, when each write data queue receives the write request from the bus outside the memory controller 000.
Each of the bus interfaces A310, B320, and C330 receives a write request or a read request via the corresponding bus connected thereto. It is assumed that the bus interface A310 received a write request, the bus interface B320 received a read request, and the bus interface C330 received a write request. In this circumstance, the command buffer 311 stores a write command, the command buffer 321 stores a read command, and the command buffer 331 stores a write command. In step S101, the write data queues 312 and 332 of the bus interfaces A310 and C330 which have received the write requests, receive write data to be written into the memory 200, respectively.
In step S102, the bus interfaces A310, B320, and C330 send commands stored in the respective command buffers 311, 321, and 331 to the command queue 111 of the command control unit 110 via the internal bus 140 of the memory controller core 100.
In step S103, the command control unit 110 sorts the commands in the command queue 111 by the reordering circuit 112. In step S104, the command control unit 110 sends a command cmd—02 at the head of the command queue 111 to the memory command control unit 130. Since the command cmd—02 is a read command, the memory controller core 100 sends read data that the memory command control unit 130 read out from the memory 200, to the bus interface B320 which is a source that issued the command cmd—02.
In step S105, the command control unit 110 sends a command cmd—01 at the head of the command queue 111 to the memory command control unit 130. In step S106, since the command cmd—01 is a write command, the memory command control unit 130 makes a request to the write data control unit 120 for write data. In step S107, when the write data control unit 120 receives the request for write data from the memory command control unit 130, the write data control unit 120 makes a request to the bus interface A310 which is a source that issued the write command for the write data.
Upon receiving the request for the write data from the write data control unit 120, the bus interface A310 sends the write data of the write command to the write data control unit 120 from a write data queue 312. In step S108, the write data control unit 120 temporarily stores the received write data in the write data buffer 121. In step S109, the memory controller core 100 sends the write data stored in the write data buffer 121 to the memory command control unit 130. According to the operations as described above, the write data is written into the memory 200.
However, in the above described conventional technique, the write data is read out from the write data queue of the bus interface only after an order of the commands is determined by reordering, when the memory controller writes the data into the memory. In this regard, there is a problem that latency becomes larger between the memory controller and the memory. Further, since each of the plurality of bus interfaces includes a write data queue, there is a problem that the circuit becomes larger in size.
The present invention is directed to a memory controller of which latency is small between the memory controller and a memory and of which circuit is small in size.
According to an aspect of the present invention, a memory controller includes a plurality of bus interfaces and a memory controller core configured to control a command and data issued from the plurality of bus interfaces and to write and read the command and data into and from a memory. The memory controller core includes a command control unit configured to receive a plurality of commands issued from the plurality of bus interfaces and to reorder and store the plurality of commands and a write data control unit configured to receive a plurality of pieces of write data issued from the plurality of bus interfaces in a sequence that the command control unit received write commands and to output the write data based on a reordered result of the command control unit.
Further features and aspects of the present invention will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings.
The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the invention and, together with the description, serve to explain the principles of the invention.
Various exemplary embodiments, features, and aspects of the invention will be described in detail below with reference to the drawings.
The write data control unit 120 reads out, when a command queue 111 issues a write command to the memory 200, write data from a write data buffer of the bus interface which is a master of the command and writes the write data into the memory 200. In the write data control unit 120, a write data output circuit 122 reads out the write data from a write data queue 123 according to the commands reordered by the reordering circuit 112 and sends the write data to the memory command control unit 130. The write data queue 123 receives the write data, when the plurality of bus interfaces issue write commands, and stores the write data.
In the bus interfaces A310, B320, and C330, the command buffers 311, 321, and 331 have the similar configurations to those described with reference to
Each of the bus interfaces A310, B320, and C330 receives a write request or a read request via the bus connected thereto. It is assumed that the bus interface A310 received a write request, the bus interface B320 received a read request, and the bus interface C330 received a write request. At the time, the command buffer 311 stores a write command, the command buffer 321 stores a read command, and the command buffer 331 stores a write command. In step S201, the write data buffers 313 and 333 of the bus interfaces A310 and C330 which have received the write requests receive write data to be written into the memory 200, respectively.
Each of the bus interfaces A310, B320, and C330 sends the command stored within the respective command buffers 311, 321, and 331 to the command queue 111 of the command control unit 110 via the internal bus 140 of the memory controller core 100.
In step S202, the bus interfaces A310 and C330 send the write commands as well as send the write data of the write data buffers 313 and 333 to the write data control unit 120. The write data control unit 120 stores pieces of the received write data data—01 and data—03 in the write data queue 123.
In step S203, the command control unit 110 sorts the commands in the command queue 111 by using the reordering circuit 112. In step S204, the command control unit 110 sends a command cmd—02 at the head of the command queue 111 to the memory command control unit 130. Since the command cmd—02 is a read command, the memory controller core 100 sends read data that the memory command control unit 130 read out from the memory 200 to the bus interface B320 which is the source that issued the command cmd—02.
In step S205, the command control unit 110 sends a command cmd—01 at the head of the command queue 111 to the memory command control unit 130. In step S206, since the command cmd—01 is a write command, the memory command control unit 130 requests the write data control unit 120 to send the write data. In step S207, upon receiving the request for the write data from the memory command control unit 130, in the write data control unit 120, the write data output circuit 122 reads out write data data—01 corresponding to the command cmd—01 from the write data queue 123 based on the reordered result, and sends the write data data—01 to the memory command control unit 130.
According to the operations as described above, the write data is written into the memory 200. In the present exemplary embodiment, since there is write data prepared in the write data queue 123 in the write data control unit 120 when the write data is requested from the memory command control unit 130 to the write data control unit 120, the latency can be minimized between the memory controller and the memory. Further, since a write data queue is not provided to each of the plurality of bus interfaces but the write data queue 123 is shared by the plurality of bus interfaces, downsizing of the circuit of the memory controller can be achieved.
While the present invention has been described with reference to exemplary embodiments, it is to be understood that the invention is not limited to the disclosed exemplary embodiments. The scope of the following claims is to be accorded the broadest interpretation so as to encompass all modifications, equivalent structures, and functions.
This application claims priority from Japanese Patent Application No. 2008-171732 filed on Jun. 30, 2008, which is hereby incorporated by reference herein in its entirety.
Number | Date | Country | Kind |
---|---|---|---|
2008-171732 | Jun 2008 | JP | national |