The present invention relates to microprocessor systems, and more particularly to a memory system for a microprocessor system to reduce memory contention between a CPU and a DMA controller.
In many situations, particularly for digital signal processing, DMA controller 120 must store a data set in single port memory 130 for CPU 110 to process. Ideally, DMA controller 120 would store a second data set for CPU 110 after writing the first data set. FIGS. 1(b) to 1(g) illustrate the processing of three data sets DS1, DS2, and DS3 using conventional microprocessor system 100. As illustrated in
As illustrated in
Because both DMA controller 120 and CPU 110 must access single port memory 130 through memory bus 140, DMA controller 120 must wait until after CPU 110 has processed a data set to write the next data set into single port memory 130. Thus DMA controller 120 is often stalled while waiting for CPU 110 to finish using single port memory 130. Similarly, while DMA controller is writing a data sent into single port memory 130, CPU 110 cannot access single port memory 130. Thus, CPU 110 is often stalled while waiting for DMA controller 120 to finish writing a data set into single port memory 130. Consequently, the processing power CPU 110 and data throughput of DMA controller 120 is often wasted.
Hence there is a need for a method or system that provides efficient use of a CPU and a DMA controller without requiring high power utilization or large silicon area.
Accordingly, a microprocessor system in accordance with the present invention, uses multiple single port memory banks to allow efficient use of the CPU and the DMA controller as well as other bus masters. For example, in one embodiment of the present invention, as the CPU is processing a first data set in the first memory bank, the DMA controller can be writing a second data set into the second memory bank. Once the CPU is finished processing the first data set and the DMA controller has finished writing the second data set, the CPU can process the second data set in the second memory bank while the DMA controller writes a third data set into the first memory bank. By using the memory banks in parallel, the present invention provides higher utilization of the CPU and the DMA controller.
The present invention will be more fully understood in view of the following description and drawings.
As explained above, conventional microprocessor systems have low utilization of the CPU due to memory bottlenecks caused by sharing a single port memory with a DMA controller. While using a dual port memory provides higher utilization, the cost in silicon area and power for the dual port memory prevents wide spread use of dual port memories. The present invention provides a novel microprocessor system that provides the benefits of a dual port memory system without the detriments.
When CPU 310 wants to use a memory bank (e.g. either memory bank 333 or memory bank 336), CPU 310 would make a request to use the memory bank. If the memory bank is free (i.e. not being used) then CPU 310 is granted use of the memory bank. However, if the memory bank is not free (i.e. the memory bank is being used by DMA controller 320), CPU 310 is not granted use of the memory bank and must wait until the memory bank is free. Similarly, when DMA controller 320 wants to use a memory bank DMA controller 320 would make a request to use the memory bank. If the memory bank is free (i.e. not being used) then DMA controller 320 is granted use of the memory bank. However, if the memory bank is not free (i.e. the memory bank is being used by CPU 310), DMA controller 320 is not granted use of the memory bank and must wait until the memory bank is free. In most embodiments of the present invention, if CPU 310 and DMA controller 320 makes simultaneous requests to use the same memory bank, DMA controller 320 is granted use of the memory bank. However, some embodiments of the present invention may grant use of the memory bank to CPU 310 when simultaneous requests are received. Still other embodiments may randomly grant use of the memory bank in when simultaneous requests are received.
Various request and grant protocols can be used with the present invention. For example, the embodiment of
When CPU 310 is granted use of a memory bank muxing circuit 340 is configured to route the output signals (control signals, address signals, and data signals) from CPU 310 to the input terminals of the memory bank and the output signals (control signals, address signals and data signals) from the memory bank to the input terminals of CPU 310. Muxing circuit 340 is configured similarly when DMA controller 320 is granted use of a memory bank. Specifically, muxing circuit 340 is configured to route the output signals (control signals, address signals, and data signals) from DMA Controller 320 to the input terminals of the memory bank and the output signals (control signals, address signals, and data signals) from the memory bank to the input terminals of DMA controller 320. Muxing circuits are well known in the art and various muxing circuits can be used with the present invention. One skilled in the art can easily create a muxing circuit for use with the present invention.
DMA multiplexer 448 receives first bank output signals FB_O from first memory bank 433 and second bank output signals SB_O from second memory bank 436. DMA multiplexer 448 provides output signals, which are referred to as DMA input signals DMA_I, to DMA controller 420. DMA multiplexer 448 is controlled by a DMA multiplexer control signal DMA_MC from DMA controller 420. In some embodiments of the present invention, DMA multiplexer control signal DMA_MC is a high bit address line that distinguishes between first memory bank 433 and second memory bank 436. In another embodiment of the present invention, CPU multiplexer control signal DMA_MC is a bank selection bit in a register that is not
First bank multiplexer 444 receives CPU output signals CPU_O (which include data, control and address signals) from CPU 110 and DMA output signals DMA_O (which include data, address, and control signals) from DMA controller 420. First bank multiplexer 444 provides output signals, which are referred to as first bank input signals FB_I, to first memory bank 433. First bank multiplexer 444 is controlled by a first bank multiplexer control signal FB_MC from arbitration unit 434.
Second bank multiplexer 446 receives CPU output signals CPU_O from CPU 110 and DMA output signals DMA_O from DMA controller 420. Second bank multiplexer 446 provides output signals, which are referred to as second bank input signals SB_I, to second memory bank 436. Second bank multiplexer 446 is controlled by a second bank multiplexer control signal SB_MC from arbitration unit 437.
To use first memory bank 433, CPU 410 would drive a CPU first bank request signal CPU_FBR to a request state (e.g., logic high). If first memory bank 433 is available, arbitration unit 434 would drive a CPU first bank grant signal CPU_FBG signal to a grant state (e.g. logic high). If first memory bank 433 is not available, arbitration unit 434 would drive CPU first bank grant signal to a denied state (e.g. logic low). In the embodiment of
Similarly DMA controller 420 requests and is granted or not granted access to first memory bank 433 using a DMA first bank request signal and a DMA first bank a grant signal. Access to second memory bank 436 is controlled by arbitration unit 437 in a similar fashion. Specifically, arbitration unit 437 interacts with CPU 410 using a CPU second bank request signal CPU_SBR and a CPU second bank grant signal CPU_SBG as described above with respect to arbitration unit 434. Similarly, Arbitration unit 437 interacts with DMA controller 420 using a DMA second bank request signal DMA_SBR and a DMA second bank grant signal CPU_SBG.
Thus by using two memory banks, embodiments of the present invention allow microprocessor systems to achieve results similar to systems using dual ported memories without the associated costs of dual ported memories. As explained above, dual ported memories typically take up 50% more silicon area than an equivalent single port memory. Furthermore, dual port memories consume almost twice the power of single port memories and require additional hardware to prevent multiple masters from accessing the same memory location at the same time.
In addition to providing performance similar to a dual port memory, the present invention offers many other advantages over conventional microprocessor systems. One advantage of the present invention is that two smaller memory banks consume less power than one large single port memory. Specifically, with smaller memory banks, the loading on the bit-lines and word-lines is smaller and therefore requires less power to pre-charge and discharge. Another advantage provided by the present invention is that each memory bank can have different sizes, speed, and memory cell types. For example, in one embodiment of the present invention the first memory bank is made using fast SRAM memory cells, while the second bank is much larger and is made using slower DRAM memory cells. Slower memories may need to assert wait states to the CPU and DMA controllers so that the overall system speed need not be brought down to the speed of the slower memory bank.
In the various embodiments of this invention, novel structures and methods have been described to provide high utilization of a CPU and DMA controller. By using a multi-bank memory, the CPU of a microprocessor systems in accordance with the present invention can process a data set in a first memory bank while a DMA controller (or other memory access device) reads or writes data in a second memory bank. The various embodiments of the structures and methods of this invention that are described above are illustrative only of the principles of this invention and are not intended to limit the scope of the invention to the particular embodiments described. For example, in view of this disclosure, those skilled in the art can define other memory access devices, CPUs, DMA controllers, arbitration units, arbitration schemes, memory banks, multi-bank memories, muxing circuits, data sets, and so forth, and use these alternative features to create a method or system according to the principles of this invention. Thus, the invention is limited only by the following claims.