Not applicable.
1. Field of the Invention
The present invention relates to a memory controller and a method for writing a data packet to or reading a data packet from a memory. More particularly, the present invention relates to a memory controller and a method for writing a data packet to or reading a data packet from a memory under different bandwidths of an external memory bus.
2. Descriptions of the Related Art
Most systems require memories for storing data. A memory controller in such a system writes data packets to or reads data packets from a memory in response to a processor's instruction. In order to transmit data packets, there are data transmission channels, such as buses, between the processor, memory, and memory controller. In addition to the memory controller, the system requires several memory agents for temporary data storage before data packets are sent out. The memory agents are developed to monitor system resources. Once the system resources are available, the memory agents pass the data packets to the destination.
Because different systems have different bandwidth requirements, a memory controller should be able to support these bandwidth requirements. For example, a memory controller should be able to support different bus bandwidths.
The DDR-II memory 101 can transfer two words in one cycle at the rising and falling edges of clocks. If the bandwidth of the memory buses 107 is set to N bits, the bandwidth of the memory bus 109 needs to be twice that of the memory buses 107, i.e., 2N bits, in order to maintain correct data transmission. Similarly, if the bandwidth of the memory bus 107 is 0.5N bit, the bandwidth of the memory bus 109 has to be N bits. This causes each of the memory agents 105 to inconveniently deal with two bandwidths, 2N bits and N bits. Thus, the complexity of the memory agents 105 is increased. As a result, the cost becomes incredibly high when the conventional memory system 1 requires many memory agents 105.
In another conventional memory system, the bandwidth of the memory buses 109 is always 2N bits. When the memory bus 107 operates at a bandwidth of 0.5N bit, the memory controller 103 has to harmonize the incompatibility due to the bandwidth differences between the memory bus 107 and the memory buses 109. The complexity of the harmonization depends on the protocol of the memory buses 109. For example, the complexity of the harmonization would be much higher if the memory buses 109 support a burst length than if the memory buses 109 only support a single word. As a result, the costs of this conventional memory system remain high. In addition, the power consumption is also considerable since the usage rate of the memory buses 109 is only 50% when the memory bus 107 operates with a bandwidth of 0.5N bit.
Accordingly, a solution that deals with an external memory bus, connected to a memory, with different bandwidths is urgently required in this field.
An objective of this invention is to provide a memory controller for writing a data packet to or reading a data packet from a memory. The memory controller comprises a register, a data packet adjuster, and a burst length determination unit. The register sets a data bus width. The data packet adjuster adjusts the data packet according to the data bus width. The burst length determination unit determines a burst length according to the data bus width. The memory controller writes or reads the adjusted data packet in response to the burst length.
Another objective of this invention is to provide a memory controller for writing a data packet to or reading a data packet from a memory. The memory controller comprises a register, a data packet adjuster, and a frequency determination unit. The register sets a data bus width. The data packet adjuster adjusts the data packet according to the data bus width. The frequency determination unit determines an operating frequency of the memory controller according to the data bus width. The memory controller writes or reads the adjusted data packet in response to the operating frequency.
Another objective of this invention is to provide a method for writing a data packet to or reading a data packet from a memory. The method comprises the following steps: setting a data bus width; adjusting the data packet according to the data bus width; and determining a burst length according to the data bus width. The adjusted data packet is written or read in response to the burst length.
Another objective of this invention is to provide a method for writing a data packet to or reading a data packet from a memory. The method comprises the following steps: setting a data bus width; adjusting the data packet according to the data bus width; and determining an operating frequency according to the data bus width. The adjusted data packet is written or read in response to the operating frequency.
Another objective of this invention is to provide a digital television system. The digital television system comprises a memory and a memory controller. The memory controller writes a data packet to or reads a data packet from the memory, and comprises a register, a data packet adjuster, and a burst length determination unit. The register sets a data bus width. The data packet adjuster adjusts the data packet according to the data bus width. The burst length determination unit determines a burst length according to the data bus width. The memory controller writes or reads the adjusted data packet in response to the burst length.
Another objective of this invention is to provide a digital television system. The digital television system comprises a memory and a memory controller. The memory controller writes a data packet to or reads a data packet from the memory, and comprises a register, a data packet adjuster, and a frequency determination unit. The register sets a data bus width. The data packet adjuster adjusts the data packet according to the data bus width. The frequency determination unit determines an operating frequency of the memory controller according to the data bus width. The memory controller writes or reads the adjusted data packet in response to the operating frequency.
Another objective of this invention is to provide a memory controller for writing a data packet to or reading a data packet from a memory. The memory controller comprises: means for setting a data bus width; means for adjusting the data packet according to the data bus width; and means for determining a burst length according to the data bus width. The memory controller writes or reads the adjusted data packet in response to the burst length.
Another objective of this invention is to provide a memory controller for writing a data packet to or reading a data packet from a memory. The memory controller comprises: means for setting a data bus width; means for adjusting the data packet according to the data bus width; and means for determining an operating frequency of the memory controller according to the data bus width. The memory controller writes or reads the adjusted data packet in response to the operating frequency.
Another objective of this invention is to provide a memory controller for writing a data packet to or reading a data packet from a memory. The memory controller comprises a first register, a second register, a burst length determination and a data packet adjuster. The first register stores a data bus width. The second register store an operating frequency of the memory controller. The burst length determination unit determines a burst length according to the operating frequency. The data packet adjuster adjusts the data packet according to the data bus width and the burst length. The memory controller writes or reads the adjusted data packet in response to the burst length.
Yet a further objective of this invention is to provide a method for writing a data packet to or reading a data packet from a memory. The method comprises the following steps: setting a data bus width; determining an operating frequency of a memory controller; determining a burst length according to the operating frequency; and adjusting the data packet according to the data bus width and the burst length. Therefore, the adjusted data packet is written or read in response to the burst length.
The present invention provides a solution that deals with memory buses with different bandwidths. The production cost of the solution is lower than that of the prior art.
The detailed technology and preferred embodiments implemented for the subject invention are described in the following paragraphs accompanying the appended drawings for people skilled in this field to well appreciate the features of the claimed invention.
In this specification, the term “in response to” is defined as “replying to” or “reacting to.” For example, “in response to a signal” means “replying to a signal” or “reacting to a signal” without necessity of direct signal reception.
The memory controller 203 comprises a register 213, a data packet adjuster 215, a burst length determination unit 217, and a frequency determination unit 219. The register 213 sets a data bus width in response to the control signal 202 and transmits information of the data bus width to the data packet adjuster 215, the burst length determination unit 217, and the frequency determination unit 219. The data packet adjuster 215 comprises a data packet collector 221 and a data packet splitter 223 for adjusting the data packet according to the data bus width. The burst length determination unit 217 determines a burst length (BL) according to the data bus width. The frequency determination unit 219 determines an operating frequency of the memory controller 203 according to the data bus width, wherein the operating frequency comes from an internal clock (INTCLK) of the digital television system 2. The memory controller 203 writes or reads the adjusted data packet in response to the burst length and the operating frequency. The memory agents 205 monitor the resources of the digital television system 2. Once the digital television system 2 is available, the memory agents 205 will pass the adjusted data packet to the processor 201 or the memory controller 203. The memory agents 205 communicate with the memory controller 203 via internal memory buses 209. The memory 207, a DDR-II DRAM or SDRAM, stores the data packet or the adjusted data packet. The memory 207 communicates with the memory controller 203 with an external memory bus 211.
More specifically, the bandwidth of the external memory bus 211 is N bits, while the bandwidth of the internal memory buses 209 is M×N bits, wherein M and N are both positive integers. When the processor 201 requests to read a data packet from the memory 207, the data packet collector 221 collects M N-bit unprocessed data packets from the memory 207 to form the adjusted data packet because the bandwidth of the external memory bus 211 is smaller than that of the internal memory buses 209. Therefore, the width of the adjusted data packet is M×N bits, which is equal to the bandwidth of the internal memory buses 209. For example, if the bandwidth of the external memory bus 211 is 4 bits and the bandwidth of the internal memory buses 209 is 8 bits, then N=4 and M=2. However, if the bandwidth of the external memory bus 211 is 2 bits, then N=2 and M=4. The operating frequency of the memory controller 203 and the memory agents 205 is proportional to the value of N. That is, if N=4, the operating frequency is, for example, 400 MHz, and if N=2, the operating frequency is 200 MHz.
The data packet collector 221 may comprise a plurality of sub-collectors (not shown) and a multiplexer (not shown). Each sub-collector collects data packets from one particular bandwidth of the external memory bus 211. For example, if the external memory bus 211 has two possible bandwidths of 4 bits and 2 bits, the data packet collector 221 comprises two sub-collectors: one for collecting data packets when the bandwidth is 4 bits, and the other for collecting data packets when the bandwidth is 2 bits. The multiplexer receives the outputs of the sub-collectors and selects one of the outputs to send to the memory agents 205 in response to the control of the processor 201.
When the processor 201 requests to write an M×N-bit data packet into the memory 207, the data packet splitter 223 splits the data packet because the bandwidth of the external memory bus 211 is smaller than that of the internal memory buses 209. The data packet splitter 223 splits the M×N-bit unprocessed data packet to form M adjusted data packets, each with a width of N bits.
The data packet splitter 223 may comprise a plurality of sub-splitters (not shown) and a multiplexer (not shown). Each sub-splitter splits data packets from one particular bandwidth of the external memory bus 211. The multiplexer receives the outputs of the sub-splitters and selects one of the outputs to send to the memory 207 in response to the control of the processor 201.
A second embodiment of the present invention is a method adapted for a memory controller, as noted in the first embodiment.
In addition to the steps shown in
The bandwidth of the internal memory buses between the memory controller and the memory agents can be unified in accordance with the present invention. In other words, the memory agents do not need to deal with the memory buses with different bandwidths. Thus, the cost is reduced.
The memory controller 603 comprises a first register 613, a second register 633, a data packet adjuster 615, a burst length determination unit 617 and a frequency determination unit 619. The first register 613 sets a data bus width and transmits information of the data bus width to the data packet adjuster 615, the burst length determination unit 617 and the frequency determination unit 619. The burst length determination unit 617 determines a burst length according to an operating frequency 604 of the memory controller 603 which can be stored in the second register 633. It should be noted that in other embodiments, the second register 633 may not be the necessary matter in a digital television system, and instead, the operating frequency 604 can be instantly determined by the frequency determination unit 619 according to the data bus width without being stored in the second register. Besides, the operating frequency 604 can be determined by the frequency determination unit 619 according to the data bus width and then be stored in second register 633.
The data packet adjuster 615 comprises a data packet collector 621 and a data packet splitter 623 for adjusting the data packet according to the data bus width and the burst length. The memory controller 603 writes or reads the adjusted data packet in response to the burst length. Please note that the elements not detailed described herein operate similarly to those in
More specifically, in one case, the frequency determination unit 619 provides a plurality of candidate operating frequencies to be selected even under an environment setting, the environment setting comprising a type of the memory and width and frequency settings of a bus between the memory 207 and the memory controller 603, where the bus is configured to connect the memory 207 and the memory controller 603. The burst length determination unit 617 also obtains a value of a width of the bus and a value of a frequency of the bus to determine the burst length. The frequency determination unit 619 dynamically switches among the candidate operating frequencies of the memory controller 603 according to a power consumption requirement. For example, to save power, the frequency determination unit 619 switches the memory controller 603 from a normal operating frequency to a lower operating frequency, and the burst length determination unit 617 consequently switches the burst length from a normal burst length to a bigger burst length, and vice versa.
A fourth embodiment of the present invention is a method adapted for a memory controller, as noted in the third embodiment.
In addition to the steps shown in
As mentioned above, the present invention provides a solution that deals with memory buses with different bandwidths and thus reduces the production cost. The advantages of the present invention further include adding more flexibility to the design of the memory controller to satisfy different requirements. For example, the memory controller may adopt a higher operating frequency and a smaller burst length to support a higher speed, and switch to a lower operating frequency and a bigger burst length to save power.
The above disclosure is related to the detailed technical contents and inventive features thereof. People skilled in this field may proceed with a variety of modifications and replacements based on the disclosures and suggestions of the invention as described without departing from the characteristics thereof. Nevertheless, although such modifications and replacements are not fully disclosed in the above descriptions, they have substantially been covered in the following claims as appended.
This application is a continuation-in-part of patent application Ser. No. 11/538,543 filed on Oct. 4, 2006, which is incorporated by reference in its entirety.
Number | Date | Country | |
---|---|---|---|
Parent | 11538543 | Oct 2006 | US |
Child | 12503228 | US |