TWI824847B - Method and apparatus for controlling shared memory, shareable memory and electrical device using the same - Google Patents

Method and apparatus for controlling shared memory, shareable memory and electrical device using the same Download PDF

Info

Publication number
TWI824847B
TWI824847B TW111144963A TW111144963A TWI824847B TW I824847 B TWI824847 B TW I824847B TW 111144963 A TW111144963 A TW 111144963A TW 111144963 A TW111144963 A TW 111144963A TW I824847 B TWI824847 B TW I824847B
Authority
TW
Taiwan
Prior art keywords
address
multiplexers
memory
read data
write data
Prior art date
Application number
TW111144963A
Other languages
Chinese (zh)
Other versions
TW202422360A (en
Inventor
王政傑
Original Assignee
新唐科技股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 新唐科技股份有限公司 filed Critical 新唐科技股份有限公司
Priority to TW111144963A priority Critical patent/TWI824847B/en
Priority to CN202310004610.8A priority patent/CN118069344A/en
Application granted granted Critical
Publication of TWI824847B publication Critical patent/TWI824847B/en
Publication of TW202422360A publication Critical patent/TW202422360A/en

Links

Landscapes

  • Dram (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The present invention relates to a method and an apparatus for controlling shared memory a shareable memory and an electrical device using the same. The method includes: providing a plurality of memory blocks; pre-allocating the memory blocks to a plurality of systems; when a specific system of the systems output an access request, the method further includes: enabling the allocated memory block(s) of the specific system; and electrically connecting an access signal to the enabled allocated memory block(s).

Description

記憶體分享裝置、方法、可分享記憶體以及其使用之電子設 備 Memory sharing device, method, shareable memory and electronic device using the same Prepare

本發明涉及一種記憶體控制的技術,且特別是一種記憶體分享裝置、方法、可分享記憶體以及其使用之電子設備。 The present invention relates to a memory control technology, and in particular to a memory sharing device, method, shareable memory and electronic equipment using the same.

隨機存取記憶體(Random Access Memory,RAM)是與處理器交換資料的內部記憶體。一般情況它可以隨時被讀寫,而且速度很快,通常作為操作系統或其他正在運行中的程式的臨時資料儲存媒介。一般隨機存取記憶體在設計時,每個隨機存取記憶體界面所能存取的位址大小、資料長短等,皆為固定的設計。故當多個系統想要共用記憶體時,必須要每個系統採用相同位址寬度的存取方式。除此之外,一般記憶體僅有單一埠(Single Port),存取皆依靠此單一埠進行,故還需要一個相當複雜的記憶體分享機制,避免存取的記憶體互相重疊,導致資料錯誤。 Random Access Memory (RAM) is an internal memory that exchanges data with the processor. Generally, it can be read and written at any time, and it is very fast. It is usually used as a temporary data storage medium for the operating system or other running programs. When designing random access memory, the address size, data length, etc. that can be accessed by each random access memory interface are all fixed. Therefore, when multiple systems want to share memory, each system must use the same address width access method. In addition, general memory only has a single port (Single Port), and all access depends on this single port. Therefore, a rather complex memory sharing mechanism is required to prevent the accessed memories from overlapping each other and causing data errors. .

另外,在先前技術中,還有一種雙埠隨機存取記憶體(Dual-Ported RAM,DPRAM)。圖1繪示為先前技術之雙埠隨機存取記憶體10的電路方塊圖。請參考圖1,此種雙埠隨機存取記憶體是一種允許同時(或幾乎同時)由二 個系統101、102存取的隨機存取記憶體。雙埠隨機存取記憶體有兩組位址匯流排及兩組資料匯流排(因此稱為「雙埠」),因此允許由二個設備存取,而一般的隨機存取記憶體的位址匯流排及資料匯流排都只有一組。一般若使用雙埠隨機存取記憶體,若在同一個位置同時(或幾乎同時)由不同設備寫入不同資料,會有競爭危害(Race Hazard)的問題,會導致資料錯誤。 In addition, in the prior art, there is also a dual-ported random access memory (Dual-Ported RAM, DPRAM). FIG. 1 is a circuit block diagram of a dual-port random access memory 10 in the prior art. Please refer to Figure 1. This kind of dual-port random access memory is a kind of memory that allows simultaneous (or almost simultaneous) operation by two Random access memory accessed by systems 101 and 102. Dual-port random access memory has two sets of address buses and two sets of data buses (hence the name "dual port"), thus allowing access by two devices, while the address of a general random access memory There is only one set of bus and data bus. Generally, if dual-port random access memory is used, if different data are written by different devices at the same location at the same time (or almost at the same time), there will be a race hazard (Race Hazard) problem, which will lead to data errors.

本發明提供一種記憶體分享裝置、方法、可分享記憶體以及其使用之電子設備,用以提供一個彈性且低成本的方法,讓多個系統可以存取同一個記憶體設備,且每個系統可以有不同的位址寬度,可以達到簡單控制、容許多種記憶體寬度以及可避免資料錯誤。 The present invention provides a memory sharing device, method, shareable memory and electronic equipment using the same to provide a flexible and low-cost method to allow multiple systems to access the same memory device, and each system Different address widths are possible, enabling simple control, allowing for a variety of memory widths, and avoiding data errors.

本發明的實施例提供了一種可分享記憶體,用以將記憶體分享給一多個系統,此可分享記憶體包括多個記憶體區塊(Rank)以及本發明實施例的記憶體分享裝置,此記憶體分享裝置包括一選擇電路以及一界面選擇控制電路。選擇電路包括多個接收埠以及一輸出埠,其中,每一位址接收埠耦接對應的系統,其中,位址輸出埠耦接每一記憶體區塊。界面選擇控制電路耦接選擇電路,根據上述系統中,至少一特定系統輸出之存取要求,將選擇電路的接收埠中,對應特定系統之接收埠電性連接至選擇電路的輸出埠,並致能記憶體區塊中,分配給特定系統之記憶體區塊,以存取上述可分享記憶體。 Embodiments of the present invention provide a shareable memory for sharing memory to multiple systems. The shareable memory includes multiple memory blocks (Ranks) and a memory sharing device according to embodiments of the present invention. , the memory sharing device includes a selection circuit and an interface selection control circuit. The selection circuit includes a plurality of receiving ports and an output port, wherein each address receiving port is coupled to a corresponding system, and wherein the address output port is coupled to each memory block. The interface selection control circuit is coupled to the selection circuit, and according to the access request of at least one specific system output in the above system, electrically connects the receiving port of the selection circuit corresponding to the specific system to the output port of the selection circuit, and causes Within the memory block, the memory block allocated to a specific system can be used to access the above-mentioned shareable memory.

依照本發明較佳實施例所述的記憶體分享裝置以及可分享記憶體,致能記憶體區塊中,分配給特定系統之記憶體區塊的方法更包括界面選擇控 制電路輸出一晶片選擇(Chip Selection)訊號以致能分配給特定系統之記憶體區塊。 According to the memory sharing device and the shareable memory according to the preferred embodiment of the present invention, the method of allocating the memory block to a specific system in the enabling memory block further includes an interface selection control. The control circuit outputs a chip selection (Chip Selection) signal so that the memory block can be allocated to a specific system.

依照本發明較佳實施例所述的記憶體分享裝置以及可分享記憶體,上述選擇電路更包括多個位址多工器以及多個讀取資料多工器。每一位址多工器包括多個位址接收埠以及一位址輸出埠,每一位址多工器的位址接收埠分別接收上述系統所輸出的位址訊號,每一位址多工器的位址輸出埠分別耦接每一記憶體區塊的位址接收埠。每一讀取資料多工器包括多個讀取資料接收埠以及一讀取資料輸入埠,每一讀取資料多工器的讀取資料接收埠分別耦接上述系統,每一讀取資料多工器的讀取資料輸入埠分別耦接每一記憶體區塊的讀取資料輸出埠。當界面選擇控制電路根據特定系統輸出之讀取要求,界面選擇控制電路控制多個位址多工器中,對應特定系統之記憶體區塊的位址接收埠電性連接至對應特定系統之記憶體區塊的位址多工器的位址輸出埠,界面選擇控制電路控制多個讀取資料多工器中,對應特定系統之記憶體區塊的讀取資料接收埠電性連接至對應特定系統之記憶體區塊的多個讀取資料多工器的讀取資料輸入埠。 According to the memory sharing device and the shareable memory according to the preferred embodiment of the present invention, the selection circuit further includes a plurality of address multiplexers and a plurality of read data multiplexers. Each address multiplexer includes multiple address receiving ports and an address output port. The address receiving port of each address multiplexer receives the address signal output by the above system respectively. Each address multiplexer The address output port of the device is respectively coupled to the address receiving port of each memory block. Each read data multiplexer includes a plurality of read data receiving ports and a read data input port. The read data receiving ports of each read data multiplexer are respectively coupled to the above systems. Each read data multiplexer The read data input port of the processor is respectively coupled to the read data output port of each memory block. When the interface selection control circuit outputs a read request based on a specific system, the interface selection control circuit controls the address receiving port of the memory block corresponding to the specific system in the multiple address multiplexers to be electrically connected to the memory corresponding to the specific system. The address output port of the address multiplexer of the block. The interface selection control circuit controls multiple read data multiplexers. The read data receiving port of the memory block corresponding to the specific system is electrically connected to the corresponding specific Read data input ports for multiple read data multiplexers of the system's memory block.

依照本發明較佳實施例所述的記憶體分享裝置以及可分享記憶體,上述選擇電路更包括多個晶片選擇(chip selection)多工器,每一晶片選擇多工器包括多個晶片選擇訊號接收埠以及一晶片選擇訊號輸出埠,每一該些晶片選擇多工器的該些晶片選擇訊號接收埠分別接收該些系統對應的晶片選擇訊號,每一該些晶片選擇多工器的晶片選擇訊號輸出埠分別耦接每一記憶體區塊的晶片選擇訊號接收端。當界面選擇控制電路根據特定系統輸出之讀取要求,界面選擇控制電路控制每一該些晶片選擇多工器中,對應特定系統的位址接收埠 電性連接至每一晶片選擇多工器的位址輸出埠,以致能對應特定系統之記憶體區塊。 According to the memory sharing device and the shareable memory according to the preferred embodiment of the present invention, the selection circuit further includes a plurality of chip selection multiplexers, and each chip selection multiplexer includes a plurality of chip selection signals. A receiving port and a chip selection signal output port. The chip selection signal receiving ports of each of the chip selection multiplexers respectively receive the chip selection signals corresponding to the systems. The chip selection signals of each of the chip selection multiplexers are The signal output port is respectively coupled to the chip selection signal receiving end of each memory block. When the interface selection control circuit responds to the reading request of the specific system output, the interface selection control circuit controls the address receiving port corresponding to the specific system in each of the chip selection multiplexers. Electrically connected to the address output port of each chip select multiplexer so as to correspond to the memory block of a specific system.

依照本發明較佳實施例所述的記憶體分享裝置以及可分享記憶體,上述選擇電路更包括多個寫入資料多工器。每一寫入資料多工器包括多個寫入資料接收埠以及一寫入資料輸出埠,每一寫入資料多工器的寫入資料接收埠分別耦接上述系統,每一寫入資料多工器的寫入資料輸出埠分別耦接每一記憶體區塊的寫入資料輸入埠。當界面選擇控制電路根據特定系統輸出之寫入要求,界面選擇控制電路控制多個位址多工器中,對應特定系統之記憶體區塊的位址接收埠電性連接至對應特定系統之記憶體區塊的位址多工器的位址輸出埠,界面選擇控制電路控制多個寫入資料多工器中,對應特定系統之記憶體區塊的寫入資料接收埠電性連接至對應特定系統之記憶體區塊的多個寫入資料多工器的寫入資料輸出埠。在另一較佳實施例中,當界面選擇控制電路根據特定系統輸出之寫入要求,界面選擇控制電路控制每一晶片選擇多工器中,對應特定系統的位址接收埠電性連接至每一晶片選擇多工器的位址輸出埠,以致能對應特定系統之記憶體區塊。 According to the memory sharing device and the shareable memory according to the preferred embodiment of the present invention, the selection circuit further includes a plurality of write data multiplexers. Each write data multiplexer includes a plurality of write data receiving ports and a write data output port. The write data receiving ports of each write data multiplexer are respectively coupled to the above system. Each write data multiplexer The write data output port of the processor is respectively coupled to the write data input port of each memory block. When the interface selection control circuit outputs a write request based on a specific system, the interface selection control circuit controls the address receiving port of the memory block corresponding to the specific system in the multiple address multiplexers to be electrically connected to the memory corresponding to the specific system. The address output port of the address multiplexer of the block block, the interface selection control circuit controls multiple write data multiplexers, and the write data receiving port of the memory block corresponding to the specific system is electrically connected to the corresponding specific Write data output port for multiple write data multiplexers of the system's memory block. In another preferred embodiment, when the interface selection control circuit outputs a writing request according to a specific system, the interface selection control circuit controls each chip selection multiplexer to electrically connect the address receiving port corresponding to the specific system to each A chip selects the address output port of the multiplexer so that it corresponds to the memory block of a specific system.

依照本發明較佳實施例所述的記憶體分享裝置以及可分享記憶體,上述選擇電路更包括多個位址多工器以及多個讀取資料多工器。每一位址多工器包括N個位址接收埠以及一位址輸出埠,每一該些位址多工器的位址輸出埠分別耦接每一該些記憶體區塊的位址接收埠,其中,第I個系統耦接對應第I個系統的該些記憶體區塊所耦接的該些位址多工器中,第I個位址接收埠,以分別接收第I個系統所輸出的位址訊號。每一讀取資料多工器包括多個讀取資料接收埠以及一讀取資料輸入埠,每一讀取資料多工器的讀取資料輸入埠分別耦接 每一記憶體區塊的讀取資料輸出埠,其中,對應第I個系統的記憶體區塊所耦接的讀取資料多工器的第I個讀取資料接收埠分別耦接第I個系統。當界面選擇控制電路根據特定系統輸出之讀取要求,界面選擇控制電路控制多個位址多工器中,對應特定系統之記憶體區塊的位址接收埠電性連接至對應該特定系統之記憶體區塊的位址多工器的位址輸出埠,界面選擇控制電路控制多個讀取資料多工器中,對應特定系統之記憶體區塊的讀取資料接收埠電性連接至對應特定系統之記憶體區塊的多個讀取資料多工器的讀取資料輸入埠。 According to the memory sharing device and the shareable memory according to the preferred embodiment of the present invention, the selection circuit further includes a plurality of address multiplexers and a plurality of read data multiplexers. Each address multiplexer includes N address receiving ports and an address output port. The address output ports of each of the address multiplexers are respectively coupled to the address receiving ports of each of the memory blocks. Port, wherein the I-th system is coupled to the I-th address receiving port among the address multiplexers coupled to the memory blocks of the I-th system to receive the I-th system respectively. The output address signal. Each read data multiplexer includes a plurality of read data receiving ports and a read data input port. The read data input ports of each read data multiplexer are respectively coupled to The read data output port of each memory block, wherein the 1st read data receiving port of the read data multiplexer coupled to the memory block of the 1st system is respectively coupled to the 1st read data output port system. When the interface selection control circuit responds to the read request output by a specific system, the interface selection control circuit controls the address receiving port of the memory block corresponding to the specific system in the multiple address multiplexers to be electrically connected to the memory block corresponding to the specific system. The address output port of the address multiplexer of the memory block, the interface selection control circuit controls multiple read data multiplexers, and the read data receiving port of the memory block corresponding to the specific system is electrically connected to the corresponding Read data input port for multiple read data multiplexers of a specific system's memory block.

依照本發明較佳實施例所述的記憶體分享裝置以及可分享記憶體,上述選擇電路更包括多個寫入資料多工器。每一寫入資料多工器包括多個寫入資料接收埠以及一寫入資料輸出埠,每一寫入資料多工器的寫入資料輸出埠分別耦接每一記憶體區塊的寫入資料輸入埠,其中,對應第I個系統的記憶體區塊所耦接的寫入資料多工器的第I個寫入資料接收埠分別耦接第I個系統。當界面選擇控制電路根據特定系統輸出之寫入要求,界面選擇控制電路控制多個位址多工器中,對應特定系統之記憶體區塊的位址接收埠電性連接至對應該特定系統之記憶體區塊的位址多工器的位址輸出埠,界面選擇控制電路控制多個寫入資料多工器中,對應特定系統之記憶體區塊的寫入資料接收埠電性連接至對應特定系統之記憶體區塊的多個寫入資料多工器的寫入資料輸出埠。 According to the memory sharing device and the shareable memory according to the preferred embodiment of the present invention, the selection circuit further includes a plurality of write data multiplexers. Each write data multiplexer includes a plurality of write data receiving ports and a write data output port. The write data output ports of each write data multiplexer are respectively coupled to the write data of each memory block. A data input port, wherein the first write data receiving port of the write data multiplexer coupled to the memory block of the first system is coupled to the first system respectively. When the interface selection control circuit outputs a write request according to a specific system, the interface selection control circuit controls the address receiving port of the memory block corresponding to the specific system in the multiple address multiplexers to be electrically connected to the address corresponding to the specific system. The address output port of the address multiplexer of the memory block, the interface selection control circuit controls multiple write data multiplexers, and the write data receiving port of the memory block corresponding to the specific system is electrically connected to the corresponding The write output port for multiple write multiplexers of a specific system's memory block.

依照本發明較佳實施例所述的記憶體分享裝置以及可分享記憶體,上述界面選擇控制電路更包括一查找表,用以儲存每一系統與上述記憶體區塊的對應關係,藉以根據特定系統的存取要求,致能對應的記憶體區塊。 According to the memory sharing device and the shareable memory according to the preferred embodiment of the present invention, the above-mentioned interface selection control circuit further includes a lookup table for storing the corresponding relationship between each system and the above-mentioned memory block, so as to select the corresponding memory block according to the specific System access requirements enable the corresponding memory block.

另外,本發明的較佳實施例提出一種電子設備,包括上述之可分享記憶體以及至少一周邊裝置,透過匯流排所述多個系統其中之一電性連接。 In addition, a preferred embodiment of the present invention provides an electronic device, including the above-mentioned shareable memory and at least one peripheral device, electrically connected to one of the plurality of systems through a bus.

再者,本發明的較佳實施例提出一種記憶體分享方法,此記憶體分享方法包括下列步驟:提供多個記憶體區塊;將每一記憶體區塊依照需求,預先分配給多個系統;當每一系統中,至少一特定系統輸出一存取要求,此記憶體分享方法包括:致能記憶體區塊中,分配給特定系統之記憶體區塊;以及將特定系統輸出之存取訊號電性連接至被致能的記憶體區塊。 Furthermore, a preferred embodiment of the present invention proposes a memory sharing method. The memory sharing method includes the following steps: providing multiple memory blocks; and pre-allocating each memory block to multiple systems according to needs. ; When in each system, at least one specific system outputs an access request, the memory sharing method includes: enabling the memory block allocated to the specific system in the memory block; and outputting the access request from the specific system The signal is electrically connected to the enabled memory block.

依照本發明較佳實施例所述的記憶體分享方法,上述記憶體分享方法更包括提供一查找表,用以儲存每一系統與該些記憶體區塊的對應關係,藉以根據特定系統的存取要求,致能對應的記憶體區塊。 According to the memory sharing method according to the preferred embodiment of the present invention, the memory sharing method further includes providing a lookup table to store the corresponding relationship between each system and the memory blocks, so as to store the memory blocks according to the specific system. Get the request and enable the corresponding memory block.

依照本發明較佳實施例所述的記憶體分享方法,上述記憶體分享方法更包括:在每一個記憶體區塊與該些系統之間,耦接多個位址多工器;在每一個記憶體區塊與上述系統之間,耦接多個讀取資料多工器;當特定系統輸出之讀取要求,上述記憶體分享方法包括:控制上述多個位址多工器,使該特定系統電性連接至對應該特定系統之記憶體區塊,以提供位址給對應該特定系統之記憶體區塊;以及控制上述多個讀取資料多工器,使該特定系統電性連接至對應該特定系統之記憶體區塊,以讀取資料。 According to the memory sharing method according to the preferred embodiment of the present invention, the memory sharing method further includes: coupling a plurality of address multiplexers between each memory block and the systems; A plurality of read data multiplexers are coupled between the memory block and the above-mentioned system; when a specific system outputs a read request, the above-mentioned memory sharing method includes: controlling the above-mentioned multiple address multiplexers so that the specific system The system is electrically connected to the memory block corresponding to the specific system to provide an address to the memory block corresponding to the specific system; and the plurality of read data multiplexers are controlled so that the specific system is electrically connected to The memory block corresponding to that specific system to read the data.

依照本發明較佳實施例所述的記憶體分享方法,其中,在每一個記憶體區塊與該些系統之間,耦接多個位址多工器,更包括:在每一該些位址多工器提供多個位址輸入埠,其中,第I個系統耦接第I個系統與對應之記憶體區塊之間之位址多工器的第I個位址輸入埠,並空接其餘位址輸入埠;其中,在每一個記憶體區塊與該些系統之間,耦接多個讀取資料多工器,更包括:在每一該些讀取資料多工器提供多個讀取資料輸出埠,其中,第I個系統耦接第I個系 統與對應之記憶體區塊之間之讀取資料多工器的第I個讀取資料輸出埠,並空接其餘讀取資料輸出埠。 According to the memory sharing method according to the preferred embodiment of the present invention, a plurality of address multiplexers are coupled between each memory block and the systems, and further includes: in each of the bits The address multiplexer provides a plurality of address input ports, wherein the 1st system is coupled to the 1st address input port of the address multiplexer between the 1st system and the corresponding memory block, and is empty Connect other address input ports; among them, multiple read data multiplexers are coupled between each memory block and the systems, and further include: providing multiple read data multiplexers in each of the read data multiplexers. read data output port, wherein the I-th system is coupled to the I-th system The first read data output port of the read data multiplexer between the system and the corresponding memory block is connected to the remaining read data output ports.

依照本發明較佳實施例所述的記憶體分享方法,上述記憶體分享方法更包括:在每一個記憶體區塊與該些系統之間,耦接多個位址多工器;在每一個記憶體區塊與該些系統之間,耦接多個寫入資料多工器;當特定系統輸出之寫入要求,上述記憶體分享方法包括:控制上述多個位址多工器,使該特定系統電性連接至對應該特定系統之記憶體區塊,以提供位址給對應該特定系統之記憶體區塊;以及控制上述多個寫入資料多工器,使該特定系統電性連接至對應該特定系統之記憶體區塊,以寫入資料至對應該特定系統之記憶體區塊。 According to the memory sharing method according to the preferred embodiment of the present invention, the memory sharing method further includes: coupling a plurality of address multiplexers between each memory block and the systems; Multiple write data multiplexers are coupled between the memory block and the systems; when a specific system outputs a write request, the memory sharing method includes: controlling the multiple address multiplexers so that the The specific system is electrically connected to the memory block corresponding to the specific system to provide an address to the memory block corresponding to the specific system; and the plurality of write data multiplexers are controlled to electrically connect the specific system to the memory block corresponding to the specific system to write data to the memory block corresponding to the specific system.

依照本發明較佳實施例所述的記憶體分享方法,其中,在每一個記憶體區塊與該些系統之間,耦接多個位址多工器,更包括:在每一該些位址多工器提供多個位址輸入埠,其中,第I個系統耦接第I個系統與對應之記憶體區塊之間之位址多工器的第I個位址輸入埠,並空接其餘位址輸入埠;其中,在每一個記憶體區塊與該些系統之間,耦接多個寫入資料多工器,更包括:在每一該些寫入資料多工器提供多個寫入資料輸入埠,其中,第I個系統耦接第I個系統與對應之記憶體區塊之間之寫入資料多工器的第I個寫入資料輸入埠,並空接其餘寫入資料料輸入埠。 According to the memory sharing method according to the preferred embodiment of the present invention, a plurality of address multiplexers are coupled between each memory block and the systems, and further includes: in each of the bits The address multiplexer provides a plurality of address input ports, wherein the 1st system is coupled to the 1st address input port of the address multiplexer between the 1st system and the corresponding memory block, and is empty Connect other address input ports; among them, multiple write data multiplexers are coupled between each memory block and the systems, and further include: providing multiple write data multiplexers in each of the write data multiplexers. A write data input port, wherein the 1st system is coupled to the 1st write data input port of the write data multiplexer between the 1st system and the corresponding memory block, and is connected to the remaining write data input ports. Enter the data input port.

綜上所述,本發明實施例的精神在於利用選擇電路耦接每一個系統,且利用界面選擇控制電路控制選擇電路與致能對應的內部的記憶體區塊,藉由選擇電路,將欲存取記憶體的系統的存取指令,傳遞給被致能的記憶體區塊,藉此,讓每個系統存取同一個可分享記憶體模組中的不同區塊。由於致能的記憶體區塊數目可依照不同系統做調整,故可以相容不同記憶體位址寬度。另外,由 於根據系統存取不同,致能不同的記憶體區塊,故不會發生資料錯誤或資料覆蓋的問題。再者,由於是採用選擇電路做記憶體分享,故記憶體模組內部走線可以完全不改變,僅須改變選擇電路與系統之間的走線。電路複雜度可以降低,也降低使用成本。 To sum up, the spirit of the embodiments of the present invention is to use the selection circuit to couple each system, and to use the interface selection control circuit to control the selection circuit and enable the corresponding internal memory block. Through the selection circuit, the desired memory is The access command of the system fetching the memory is passed to the enabled memory block, thereby allowing each system to access different blocks in the same shareable memory module. Since the number of enabled memory blocks can be adjusted according to different systems, it can be compatible with different memory address widths. In addition, by Different memory blocks are enabled according to different system accesses, so data errors or data overwriting problems will not occur. Furthermore, since the selection circuit is used for memory sharing, the internal wiring of the memory module does not need to be changed at all. Only the wiring between the selection circuit and the system needs to be changed. The circuit complexity can be reduced and the cost of use is also reduced.

為了進一步理解本發明的技術、手段和效果,可以參考以下詳細描述和附圖,從而可以徹底和具體地理解本發明的目的、特徵和概念。然而,以下詳細描述和附圖僅用於參考和說明本發明的實現方式,其並非用於限制本發明。 In order to further understand the technology, means and effects of the present invention, reference may be made to the following detailed description and accompanying drawings, so that the purpose, features and concepts of the present invention can be thoroughly and specifically understood. However, the following detailed description and drawings are only used to refer to and illustrate the implementation of the present invention, and are not intended to limit the present invention.

10:雙埠隨機存取記憶體 10:Dual port random access memory

101、102:系統 101, 102: System

20:第一系統 20:First system

21:第二系統 21:Second system

22:第三系統 22:Third system

23:可分享記憶體 23: Shareable memory

24:周邊裝置 24:Peripheral devices

R0、R1、R2、R3、R4、R5、R6、R7、R8、R9、R10、R11、R12、R13、R14、R15:記憶體區塊 R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15: memory block

301:選擇電路 301: Select circuit

302:界面選擇控制電路 302: Interface selection control circuit

30:記憶體模組 30:Memory module

401查找表 401 lookup table

ADD0、ADD1、ADD2、ADD3、ADD4、ADD5、ADD6、ADD7:位址多工器 ADD0, ADD1, ADD2, ADD3, ADD4, ADD5, ADD6, ADD7: address multiplexer

WDAT0、WDAT1、WDAT2、WDAT3、WDAT4、WDAT5、WDAT6、WDAT7:寫入資料多工器 WDAT0, WDAT1, WDAT2, WDAT3, WDAT4, WDAT5, WDAT6, WDAT7: write data multiplexer

RDAT0、RDAT1、RDAT2、RDAT3、RDAT4、RDAT5、RDAT6、RDAT7:讀取資料多工器 RDAT0, RDAT1, RDAT2, RDAT3, RDAT4, RDAT5, RDAT6, RDAT7: read data multiplexer

C0、C1、C2、C3:晶片選擇(Chip Selection)多工器 C0, C1, C2, C3: Chip Selection multiplexer

601、602、603、604、605、606、607、608:多工電路 601, 602, 603, 604, 605, 606, 607, 608: multiplex circuit

S901~S910:本發明一較佳實施例的一種記憶體分享方法的流程步驟 S901~S910: Process steps of a memory sharing method according to a preferred embodiment of the present invention

提供的附圖用以使本發明所屬技術領域具有通常知識者可以進一步理解本發明,並且被併入與構成本發明之說明書的一部分。附圖示出了本發明的示範實施例,並且用以與本發明之說明書一起用於解釋本發明的原理。 The accompanying drawings are provided to enable those skilled in the art to further understand the present invention, and are incorporated into and constitute a part of the specification of the present invention. The drawings illustrate exemplary embodiments of the invention and, together with the description of the invention, serve to explain the principles of the invention.

圖1繪示為先前技術之雙埠隨機存取記憶體的電路方塊圖。 FIG. 1 is a circuit block diagram of a dual-port random access memory in the prior art.

圖2繪示為本發明實施例的一種電子設備之記憶體存取示意圖。 FIG. 2 is a schematic diagram of memory access of an electronic device according to an embodiment of the present invention.

圖3繪示為本發明一較佳實施例的一種可分享記憶體的電路方塊圖。 FIG. 3 is a circuit block diagram of a shareable memory according to a preferred embodiment of the present invention.

圖4繪示為本發明一較佳實施例的一種可分享記憶體的電路方塊圖。 FIG. 4 is a circuit block diagram of a shareable memory according to a preferred embodiment of the present invention.

圖5繪示為本發明一較佳實施例的一種可分享記憶體的電路方塊圖。 FIG. 5 is a circuit block diagram of a shareable memory according to a preferred embodiment of the present invention.

圖6繪示為本發明一較佳實施例的一種可分享記憶體的電路方塊圖。 FIG. 6 is a circuit block diagram of a shareable memory according to a preferred embodiment of the present invention.

圖7A繪示為本發明一較佳實施例的一種可分享記憶體的第一系統20與記憶體區塊R0~R3的走線示意圖。 FIG. 7A is a schematic wiring diagram of a first system 20 that can share memory and memory blocks R0 to R3 according to a preferred embodiment of the present invention.

圖7B繪示為本發明一較佳實施例的一種可分享記憶體的第二系統21、第三系統22與記憶體區塊R4~R7的走線示意圖。 FIG. 7B is a schematic diagram of the wiring of the second system 21 and the third system 22 that can share memory and the memory blocks R4 to R7 according to a preferred embodiment of the present invention.

圖8繪示為本發明一較佳實施例的一種可分享記憶體的電路方塊圖。 FIG. 8 is a circuit block diagram of a shareable memory according to a preferred embodiment of the present invention.

圖9繪示為本發明一較佳實施例的一種記憶體分享方法的流程圖。 FIG. 9 is a flow chart of a memory sharing method according to a preferred embodiment of the present invention.

現在將詳細參考本發明的示範實施例,其示範實施例會在附圖中被繪示出。在可能的情況下,在附圖和說明書中使用相同的元件符號來指代相同或相似的部件。另外,示範實施例的做法僅是本發明之設計概念的實現方式之一,下述的該等示範皆非用於限定本發明。 Reference will now be made in detail to exemplary embodiments of the present invention, exemplary embodiments of which are illustrated in the accompanying drawings. Wherever possible, the same reference numbers are used in the drawings and description to refer to the same or similar parts. In addition, the exemplary embodiment is only one of the implementation ways of the design concept of the present invention, and the following examples are not intended to limit the present invention.

圖2繪示為本發明一較佳實施例的一種電子設備之記憶體存取示意圖。請參考第2圖,此電子設備包括三個系統20、21、22、一可分享記憶體23以及一周邊裝置24。周邊裝置24耦接第一系統20。在此實施例中,上述可分享記憶體23被分配給上述三個系統20、21、22使用。且每一個系統20、21、22皆使用不同寬度的記憶體存取界面。在此實施例中,可分享記憶體23包含16個記憶體區塊R0~R15,每一個記憶體區塊R0~R15皆為32位元。第一系統20 的記憶體存取位址寬度是32位元,分配給第一系統20的記憶體區塊是記憶體區塊R0~R3,故每次第一系統20存取記憶體時,僅被致能一個記憶體區塊R0~R3。系統21的記憶體存取位址寬度是128位元,分配給第二系統21的記憶體區塊是記憶體區塊R4~R7、R12~R15,故每次第二系統21存取記憶體時,一次致能四個記憶體區塊R4~R7或R12~R15。系統22的記憶體存取位址寬度是64位元,分配給第三系統22的記憶體區塊是記憶體區塊R8~R11,故每次第三系統22存取記憶體時,一次致能兩個記憶體區塊R8~R11。 FIG. 2 is a schematic diagram of memory access of an electronic device according to a preferred embodiment of the present invention. Please refer to Figure 2. This electronic device includes three systems 20, 21, 22, a shareable memory 23 and a peripheral device 24. Peripheral device 24 is coupled to first system 20 . In this embodiment, the above-mentioned shareable memory 23 is allocated for use by the above-mentioned three systems 20, 21, and 22. And each system 20, 21, 22 uses memory access interfaces of different widths. In this embodiment, the shareable memory 23 includes 16 memory blocks R0~R15, and each memory block R0~R15 is 32 bits. First system 20 The memory access address width is 32 bits, and the memory blocks allocated to the first system 20 are memory blocks R0~R3. Therefore, each time the first system 20 accesses the memory, it is only enabled. A memory block R0~R3. The memory access address width of the system 21 is 128 bits. The memory blocks allocated to the second system 21 are memory blocks R4~R7 and R12~R15. Therefore, every time the second system 21 accesses the memory When , four memory blocks R4~R7 or R12~R15 are enabled at one time. The memory access address width of the system 22 is 64 bits, and the memory blocks allocated to the third system 22 are memory blocks R8~R11. Therefore, each time the third system 22 accesses the memory, an error occurs. It can support two memory blocks R8~R11.

圖3繪示為本發明一較佳實施例的一種可分享記憶體的電路方塊圖。請參考圖3,此可分享記憶體包括記憶體模組30以及本發明較佳實施例的記憶體分享裝置31。記憶體模組30包括8個記憶體區塊R0、R1、R2、R3、R4、R5、R6、R7。記憶體分享裝置31包括選擇電路301以及界面選擇控制電路302。選擇電路301在此實施例中包括3個接收埠以及一個輸出埠。選擇電路301的位址接收埠分別耦接上述三個系統20、21、22。選擇電路301的位址輸出埠耦接每一個記憶體區塊R0、R1、R2、R3、R4、R5、R6、R7。界面選擇控制電路302耦接並用以控制選擇電路301。 FIG. 3 is a circuit block diagram of a shareable memory according to a preferred embodiment of the present invention. Please refer to Figure 3. This shareable memory includes a memory module 30 and a memory sharing device 31 according to the preferred embodiment of the present invention. The memory module 30 includes eight memory blocks R0, R1, R2, R3, R4, R5, R6, and R7. The memory sharing device 31 includes a selection circuit 301 and an interface selection control circuit 302. The selection circuit 301 includes three receiving ports and one output port in this embodiment. The address receiving port of the selection circuit 301 is coupled to the above three systems 20, 21, and 22 respectively. The address output port of the selection circuit 301 is coupled to each memory block R0, R1, R2, R3, R4, R5, R6, R7. The interface selection control circuit 302 is coupled to and used to control the selection circuit 301 .

舉例來說,假設記憶體區塊R0、R1、R2、R3是分配給第一系統20;記憶體區塊R4、R5是分配給第二系統21;記憶體區塊R6、R7是分配給第三系統22。當第一系統20要進行存取時,界面選擇控制電路302會將第一系統20的存取訊號經由選擇電路301的接收埠電性連接到輸出埠中對應上述記憶體區塊R0、R1、R2、R3的部份,並且致能上述記憶體區塊R0、R1、R2、R3,第一系統20便可以存取上述記憶體區塊R0、R1、R2、R3。當第二系統21要進行存取時,界面選擇控制電路302會將第二系統21的存取訊號經由選擇電路301 的接收埠電性連接到輸出埠中對應上述記憶體區塊R4、R5的部份,並且致能上述記憶體區塊R4、R5,第二系統21便可以存取上述記憶體區塊R4、R5。同樣的,當第三系統22要進行存取時,界面選擇控制電路302會將第三系統22的存取訊號經由選擇電路301的接收埠電性連接到輸出埠中對應上述記憶體區塊R6、R7的部份,並且致能上述記憶體區塊R6、R7,第三系統22便可以存取上述記憶體區塊R6、R7。上述致能記憶體區塊R0~R7的方式可以例如是界面選擇控制電路302輸出晶片致能訊號(Chip Selection Signal)來根據不同系統的存取致能不同的記憶體區塊。 For example, assume that the memory blocks R0, R1, R2, and R3 are allocated to the first system 20; the memory blocks R4 and R5 are allocated to the second system 21; and the memory blocks R6 and R7 are allocated to the second system 21. Three systems22. When the first system 20 wants to access, the interface selection control circuit 302 will electrically connect the access signal of the first system 20 to the output port corresponding to the above-mentioned memory blocks R0, R1, through the receiving port of the selection circuit 301. R2 and R3, and enabling the memory blocks R0, R1, R2, and R3, the first system 20 can access the memory blocks R0, R1, R2, and R3. When the second system 21 wants to access, the interface selection control circuit 302 passes the access signal of the second system 21 through the selection circuit 301 The receiving port is electrically connected to the part of the output port corresponding to the memory blocks R4 and R5, and the memory blocks R4 and R5 are enabled, the second system 21 can access the memory blocks R4 and R5. R5. Similarly, when the third system 22 wants to access, the interface selection control circuit 302 will electrically connect the access signal of the third system 22 to the output port corresponding to the above-mentioned memory block R6 through the receiving port of the selection circuit 301 , R7 part, and enabling the above-mentioned memory blocks R6 and R7, the third system 22 can access the above-mentioned memory blocks R6 and R7. The above-mentioned method of enabling the memory blocks R0 to R7 may be, for example, that the interface selection control circuit 302 outputs a chip enable signal (Chip Selection Signal) to enable different memory blocks according to the access of different systems.

由上述實施例可以看出,界面選擇控制電路302根據不同系統來切換記憶體區塊(memory rank),搭配選擇電路301,可讓整個記憶體模組30用相同界面共用例如位址(ADDR)、讀取資料(RDATA)、寫入資料(WDATA)等訊號,以便減少在記憶體區塊內訊號線使用量,減少記憶體模組30中,過多訊號繞、走線所產生之各種各樣的干擾問題,且容易導致所存取的資料錯誤。 As can be seen from the above embodiments, the interface selection control circuit 302 switches memory blocks (memory ranks) according to different systems. Together with the selection circuit 301, the entire memory module 30 can use the same interface to share, for example, an address (ADDR). , read data (RDATA), write data (WDATA) and other signals, in order to reduce the usage of signal lines in the memory block and reduce various problems caused by excessive signal winding and routing in the memory module 30 interference problem, and can easily lead to errors in the data being accessed.

圖4繪示為本發明一較佳實施例的一種可分享記憶體的電路方塊圖。請參考圖4,在此實施例中,界面選擇控制電路302包括一查找表401,用以儲存每一系統與記憶體區塊的對應關係,界面選擇控制電路302藉由上述查找表401,根據不同系統的存取要求,致能對應的記憶體區塊。再者,選擇電路301在此實施例中,被分成4個位址多工器ADD0~ADD3、4個寫入資料多工器WDAT0~WDAT3、4個讀取資料多工器RDAT0~RDAT3以及4個晶片選擇(Chip Selection)多工器C0~C3。為了讓本領域具有通常知識者能理解本發明,在此實施例僅以4個記憶體區塊R0~R4做說明。所屬技術領域具有通常知識者應當知道,記憶體區塊R0~R4的數目是隨產品或不同設計而改變,本發明不以此為限。 FIG. 4 is a circuit block diagram of a shareable memory according to a preferred embodiment of the present invention. Please refer to Figure 4. In this embodiment, the interface selection control circuit 302 includes a lookup table 401 to store the corresponding relationship between each system and the memory block. The interface selection control circuit 302 uses the above lookup table 401 to determine The access requirements of different systems enable corresponding memory blocks. Furthermore, in this embodiment, the selection circuit 301 is divided into 4 address multiplexers ADD0~ADD3, 4 write data multiplexers WDAT0~WDAT3, 4 read data multiplexers RDAT0~RDAT3 and 4 Chip Selection multiplexers C0~C3. In order to allow those with ordinary knowledge in the art to understand the present invention, only four memory blocks R0 to R4 are used for illustration in this embodiment. Those with ordinary knowledge in the art should know that the number of memory blocks R0 ~ R4 changes with products or different designs, and the present invention is not limited thereto.

在此實施例中,每個位址多工器ADD0~ADD3的三個位址輸入埠分別接收三個系統20~22輸出的位址,這三個位址寬度可以不一樣,故位址多工器ADD0~ADD3的三個位址輸入埠的排線寬度亦可以不同。位址多工器ADD0~ADD3的每一個輸出埠分別耦接4個記憶體區塊R0~R4。每個讀取資料多工器RDAT0~RDAT3的三個讀取資料輸出埠分別用以輸出資料到三個系統20~22。讀取資料多工器RDAT0~RDAT3的讀取資料輸入埠分別耦接4個記憶體區塊R0~R4。寫入資料多工器WDAT0~WDAT3的三個寫入資料輸入埠分別用以接收三個系統20~22所欲寫入記憶體的資料。寫入資料多工器WDAT0~WDAT3的寫入資料輸出埠分別耦接4個記憶體區塊R0~R4。 In this embodiment, the three address input ports of each address multiplexer ADD0 ~ ADD3 respectively receive the addresses output by the three systems 20 ~ 22. The three address widths may be different, so there are many addresses. The wiring widths of the three address input ports of the processor ADD0~ADD3 can also be different. Each output port of the address multiplexers ADD0~ADD3 is coupled to four memory blocks R0~R4 respectively. The three read data output ports of each read data multiplexer RDAT0~RDAT3 are used to output data to the three systems 20~22 respectively. The read data input ports of the read data multiplexers RDAT0 ~ RDAT3 are respectively coupled to the four memory blocks R0 ~ R4. The three write data input ports of the write data multiplexers WDAT0 ~ WDAT3 are respectively used to receive data to be written into the memory by the three systems 20 ~ 22. The write data output ports of the write data multiplexers WDAT0 ~ WDAT3 are respectively coupled to the four memory blocks R0 ~ R4.

為了方便說明本發明的精神,在此實施例中,假設記憶體區塊R0與R1被分配給第一系統20,記憶體區塊R2被分配給第二系統21,記憶體區塊R3被分配給第三系統22。當界面選擇控制電路302收到第一系統20輸出之讀取要求時,界面選擇控制電路302根據查找表401,以選擇信號SEL0、SEL1控制位址多工器ADD0以及ADD1,將第一系統20對應的位址接收埠電性連接至位址多工器ADD0以及ADD1的位址輸出埠,且界面選擇控制電路302以選擇信號SEL0、SEL1控制晶片選擇多工器C0以及C1輸出對應的晶片選擇訊號,致能記憶體區塊R0與R1。在此同時,界面選擇控制電路302以選擇信號SEL0、SEL1控制讀取資料多工器RDAT0以及RDAT1的讀取輸入埠電性連接對應第一系統20的讀取資料輸出埠。故第一系統20所輸入的位址便可以傳送到記憶體區塊R0與R1,且第一系統20便可以從讀取資料多工器RDAT0以及RDAT1的讀取資料輸出埠取得對應的讀取資料。 In order to conveniently illustrate the spirit of the present invention, in this embodiment, it is assumed that the memory blocks R0 and R1 are allocated to the first system 20, the memory block R2 is allocated to the second system 21, and the memory block R3 is allocated to the first system 20. Give 22 to the third system. When the interface selection control circuit 302 receives the read request output by the first system 20, the interface selection control circuit 302 uses the selection signals SEL0 and SEL1 to control the address multiplexers ADD0 and ADD1 according to the lookup table 401, and the first system 20 The corresponding address receiving port is electrically connected to the address output port of the address multiplexer ADD0 and ADD1, and the interface selection control circuit 302 uses the selection signal SEL0 and SEL1 to control the chip selection multiplexer C0 and C1 to output the corresponding chip selection. Signal enables memory blocks R0 and R1. At the same time, the interface selection control circuit 302 uses the selection signals SEL0 and SEL1 to control the read input ports of the read data multiplexers RDAT0 and RDAT1 to be electrically connected to the read data output port of the corresponding first system 20 . Therefore, the addresses input by the first system 20 can be transmitted to the memory blocks R0 and R1, and the first system 20 can obtain the corresponding read data from the read data output ports of the read data multiplexers RDAT0 and RDAT1. material.

上述實施例中,雖然是以只控制位址多工器ADD0、ADD1以及讀取資料多工器RDAT0、RDAT1的方式進行,然此種方式係屬於較佳實施例,所屬技術領域具有通常知識者應當知道,每個位址多工器ADD0~ADD3以及讀取資料多工器RDAT0~RDAT3皆被電性連接到第一系統20亦可以實施,只要記憶體區塊R0與R1被致能,就不會有存取錯誤產生。但是,這樣的電性連接方式會需要記憶體區塊R0與R1在輸出讀取資料時,具有較大的驅動能力。然本發明不以上述較佳實施例為限。 In the above embodiment, although only the address multiplexers ADD0 and ADD1 and the read data multiplexers RDAT0 and RDAT1 are controlled, this method is a preferred embodiment. Those with ordinary knowledge in the technical field can It should be noted that each address multiplexer ADD0~ADD3 and the read data multiplexer RDAT0~RDAT3 are electrically connected to the first system 20 and can be implemented as long as the memory blocks R0 and R1 are enabled. No access errors will occur. However, such an electrical connection method requires the memory blocks R0 and R1 to have greater driving capabilities when outputting and reading data. However, the present invention is not limited to the above-mentioned preferred embodiments.

當界面選擇控制電路302收到第二系統21輸出之讀取要求時,界面選擇控制電路302根據查找表401,以選擇信號SEL2控制位址多工器ADD2,將第二系統21對應的位址接收埠電性連接至位址多工器ADD2的位址輸出埠,且界面選擇控制電路302以選擇信號SEL2控制晶片選擇多工器C2輸出對應的晶片選擇訊號,致能記憶體區塊R2。在此同時,界面選擇控制電路302以選擇信號SEL2控制讀取資料多工器RDAT2的讀取輸入埠電性連接對應第二系統21的讀取資料輸出埠。故第二系統21所輸入的位址便可以傳送到記憶體區塊R2,且第二系統21便可以從讀取資料多工器RDAT2的讀取資料輸出埠取得對應的讀取資料。 When the interface selection control circuit 302 receives the read request output by the second system 21, the interface selection control circuit 302 controls the address multiplexer ADD2 with the selection signal SEL2 according to the lookup table 401, and converts the address corresponding to the second system 21 The receiving port is electrically connected to the address output port of the address multiplexer ADD2, and the interface selection control circuit 302 uses the selection signal SEL2 to control the chip selection multiplexer C2 to output the corresponding chip selection signal to enable the memory block R2. At the same time, the interface selection control circuit 302 uses the selection signal SEL2 to control the read input port of the read data multiplexer RDAT2 to be electrically connected to the read data output port of the corresponding second system 21 . Therefore, the address input by the second system 21 can be transmitted to the memory block R2, and the second system 21 can obtain the corresponding read data from the read data output port of the read data multiplexer RDAT2.

同樣的,當界面選擇控制電路302收到第三系統22輸出之讀取要求時,界面選擇控制電路302根據查找表401,以選擇信號SEL3控制位址多工器ADD3,將第三系統22對應的位址接收埠電性連接至位址多工器ADD3的位址輸出埠,且界面選擇控制電路302以選擇信號SEL3控制晶片選擇多工器C3輸出對應的晶片選擇訊號,致能記憶體區塊R3。在此同時,界面選擇控制電路302以選擇信號SEL3控制讀取資料多工器RDAT3的讀取輸入埠電性連接對 應第三系統22的讀取資料輸出埠。故第三系統22所輸入的位址便可以傳送到記憶體區塊R3,且第三系統22便可以從讀取資料多工器RDAT3的讀取資料輸出埠取得對應的讀取資料。 Similarly, when the interface selection control circuit 302 receives the read request output by the third system 22, the interface selection control circuit 302 uses the selection signal SEL3 to control the address multiplexer ADD3 according to the lookup table 401, so that the third system 22 corresponds to The address receiving port is electrically connected to the address output port of the address multiplexer ADD3, and the interface selection control circuit 302 uses the selection signal SEL3 to control the chip selection multiplexer C3 to output the corresponding chip selection signal to enable the memory area. Block R3. At the same time, the interface selection control circuit 302 uses the selection signal SEL3 to control the electrical connection pair of the read input port of the read data multiplexer RDAT3. Corresponds to the read data output port of the third system 22. Therefore, the address input by the third system 22 can be transmitted to the memory block R3, and the third system 22 can obtain the corresponding read data from the read data output port of the read data multiplexer RDAT3.

另外,當界面選擇控制電路302收到第一系統20輸出之寫入要求時,界面選擇控制電路302根據查找表401,以選擇信號SEL0、SEL1控制位址多工器ADD0以及ADD1,將第一系統20對應的位址接收埠電性連接至位址多工器ADD0以及ADD1的位址輸出埠,且界面選擇控制電路302以選擇信號SEL0、SEL1控制晶片選擇多工器C0以及C1輸出對應的晶片選擇訊號,致能記憶體區塊R0與R1。在此同時,界面選擇控制電路302以選擇信號SEL0、SEL1控制寫入資料多工器WDAT0以及WDAT1的寫入輸出埠電性連接對應第一系統20的寫入資料輸入埠。故第一系統20所輸入的位址便可以傳送到記憶體區塊R0與R1,且第一系統20便可以從寫入資料多工器WDAT0以及WDAT1的寫入資料輸入埠將寫入資料寫入至記憶體區塊R0與R1。 In addition, when the interface selection control circuit 302 receives the write request output from the first system 20, the interface selection control circuit 302 uses the selection signals SEL0 and SEL1 to control the address multiplexers ADD0 and ADD1 according to the lookup table 401, to change the first The corresponding address receiving port of the system 20 is electrically connected to the address output ports of the address multiplexers ADD0 and ADD1, and the interface selection control circuit 302 uses the selection signals SEL0 and SEL1 to control the chip selection multiplexers C0 and C1 to output the corresponding The chip select signal enables memory blocks R0 and R1. At the same time, the interface selection control circuit 302 uses the selection signals SEL0 and SEL1 to control the write output ports of the write data multiplexers WDAT0 and WDAT1 to be electrically connected to the write data input port corresponding to the first system 20 . Therefore, the addresses input by the first system 20 can be transferred to the memory blocks R0 and R1, and the first system 20 can write the write data from the write data input ports of the write data multiplexers WDAT0 and WDAT1. into memory blocks R0 and R1.

當界面選擇控制電路302收到第二系統21輸出之寫入要求時,界面選擇控制電路302根據查找表401,以選擇信號SEL2控制位址多工器ADD2,將第二系統21對應的位址接收埠電性連接至位址多工器ADD2的位址輸出埠,且界面選擇控制電路302以選擇信號SEL2控制晶片選擇多工器C2輸出對應的晶片選擇訊號,致能記憶體區塊R2。在此同時,界面選擇控制電路302以選擇信號SEL2控制寫入資料多工器WDAT2的寫入輸出埠電性連接對應第二系統21的寫入資料輸入埠。故第二系統21所輸入的位址便可以傳送到記憶體區塊R2,且第二系統21便可以從寫入資料多工器WDAT2的寫入資料輸入埠將寫入資料寫入至記憶體區塊R2。 When the interface selection control circuit 302 receives the write request output by the second system 21, the interface selection control circuit 302 controls the address multiplexer ADD2 with the selection signal SEL2 according to the lookup table 401, and converts the address corresponding to the second system 21 The receiving port is electrically connected to the address output port of the address multiplexer ADD2, and the interface selection control circuit 302 uses the selection signal SEL2 to control the chip selection multiplexer C2 to output the corresponding chip selection signal to enable the memory block R2. At the same time, the interface selection control circuit 302 uses the selection signal SEL2 to control the write output port of the write data multiplexer WDAT2 to be electrically connected to the write data input port corresponding to the second system 21 . Therefore, the address input by the second system 21 can be transmitted to the memory block R2, and the second system 21 can write the write data into the memory from the write data input port of the write data multiplexer WDAT2. Block R2.

同樣的道理,當界面選擇控制電路302收到第三系統22輸出之寫入要求時,界面選擇控制電路302根據查找表401,以選擇信號SEL3控制位址多工器ADD3,將第三系統22對應的位址接收埠電性連接至位址多工器ADD3的位址輸出埠,且界面選擇控制電路302以選擇信號SEL3控制晶片選擇多工器C3輸出對應的晶片選擇訊號,致能記憶體區塊R3。在此同時,界面選擇控制電路302以選擇信號SEL3控制寫入資料多工器WDAT3的寫入輸出埠電性連接對應第三系統22的寫入資料輸入埠。故第三系統22所輸入的位址便可以傳送到記憶體區塊R3,且第三系統22便可以從寫入資料多工器WDAT3的寫入資料輸入埠將寫入資料寫入至記憶體區塊R2。 In the same way, when the interface selection control circuit 302 receives the write request output by the third system 22, the interface selection control circuit 302 uses the selection signal SEL3 to control the address multiplexer ADD3 according to the lookup table 401, and the third system 22 The corresponding address receiving port is electrically connected to the address output port of the address multiplexer ADD3, and the interface selection control circuit 302 uses the selection signal SEL3 to control the chip selection multiplexer C3 to output the corresponding chip selection signal to enable the memory. Block R3. At the same time, the interface selection control circuit 302 uses the selection signal SEL3 to control the write output port of the write data multiplexer WDAT3 to be electrically connected to the write data input port corresponding to the third system 22 . Therefore, the address input by the third system 22 can be transmitted to the memory block R3, and the third system 22 can write the write data into the memory from the write data input port of the write data multiplexer WDAT3. Block R2.

上述實施例中,雖然都是只控制對應的位址多工器ADD0~ADD3以及對應的讀取資料多工器RDAT0~RDAT3或對應的寫入資料多工器WDAT0~WDAT3的方式進行,然此種方式係屬於較佳實施例,其好處在上述實施例中已經詳述理由,在此不予贅述。然本發明並不以上述較佳實施例為限。 In the above embodiments, although only the corresponding address multiplexers ADD0~ADD3 and the corresponding read data multiplexers RDAT0~RDAT3 or the corresponding write data multiplexers WDAT0~WDAT3 are controlled, however, This method is a preferred embodiment, and the reasons for its advantages have been detailed in the above embodiments and will not be repeated here. However, the present invention is not limited to the above-mentioned preferred embodiments.

圖5繪示為本發明一較佳實施例的一種可分享記憶體的電路方塊圖。請參考圖4與圖5,在此實施例中,與圖4的差異在於,界面選擇控制電路302只需要使用選擇信號SEL0,便可以讓第一系統20存取記憶體R0以及R1。故可以更加的減少走線的使用,降低印刷電路板或電路布局複雜度。由於圖5的實施例與圖4的實施例類似,故在此不予贅述。 FIG. 5 is a circuit block diagram of a shareable memory according to a preferred embodiment of the present invention. Please refer to FIGS. 4 and 5 . In this embodiment, the difference from FIG. 4 is that the interface selection control circuit 302 only needs to use the selection signal SEL0 to allow the first system 20 to access the memories R0 and R1 . Therefore, the use of wiring can be further reduced, and the complexity of the printed circuit board or circuit layout can be reduced. Since the embodiment of FIG. 5 is similar to the embodiment of FIG. 4 , no further description is given here.

圖6繪示為本發明一較佳實施例的一種可分享記憶體的電路方塊圖。請參考圖6,在此實施例中,此可分享記憶體的記憶體區塊R0~R3是分配給第一系統20,記憶體區塊R4~R5是分配給第二系統21,記憶體區塊R6~R7是分配給第三系統22。再者,為了簡化說明,在此實施例中,繪示了8個多工 電路601~608,這些多工電路601~608分別表示了上述位址多工器、上述讀取資料多工器、上述寫入資料多工器以及上述晶片選擇多工器。在此實施例中,第一系統20僅耦接到多工電路601~604,並未耦接到多工電路605~608。 FIG. 6 is a circuit block diagram of a shareable memory according to a preferred embodiment of the present invention. Please refer to Figure 6. In this embodiment, the memory blocks R0~R3 of the shareable memory are allocated to the first system 20, the memory blocks R4~R5 are allocated to the second system 21, and the memory area Blocks R6~R7 are assigned to the third system 22. Furthermore, in order to simplify the description, in this embodiment, 8 multiplexers are shown Circuits 601 to 608. These multiplexing circuits 601 to 608 respectively represent the above-mentioned address multiplexer, the above-mentioned read data multiplexer, the above-mentioned write data multiplexer and the above-mentioned chip selection multiplexer. In this embodiment, the first system 20 is only coupled to the multiplexing circuits 601 to 604 and is not coupled to the multiplexing circuits 605 to 608 .

所屬技術領域具有通常知識者參考上述圖4~圖6的實施例後,應當可以理解到,第一系統20到記憶體區塊R0~R4的耦接狀態應當如圖7A所示,圖7A繪示為本發明一較佳實施例的一種可分享記憶體的第一系統20與記憶體區塊R0~R3的走線示意圖。同樣的道理,所屬技術領域具有通常知識者參考上述圖4~圖6的實施例後,應當可以理解到,第二系統21到記憶體區塊R4~R5的耦接狀態以及第三系統22到記憶體區塊R6~R7的耦接狀態以及應當如圖7B所示,圖7B繪示為本發明一較佳實施例的一種可分享記憶體的第二系統21、第三系統22與記憶體區塊R4~R7的走線示意圖。 Those with ordinary knowledge in the art should be able to understand after referring to the above embodiments of FIGS. 4 to 6 that the coupling state of the first system 20 to the memory blocks R0 to R4 should be as shown in FIG. 7A . FIG. 7A depicts This is a schematic wiring diagram of a first system 20 that can share memory and memory blocks R0 to R3 according to a preferred embodiment of the present invention. By the same token, those with ordinary knowledge in the technical field should be able to understand, after referring to the above-mentioned embodiments of FIGS. 4 to 6 , the coupling status of the second system 21 to the memory blocks R4 to R5 and the coupling status of the third system 22 to the memory blocks R4 to R5. The coupling status of the memory blocks R6~R7 should be as shown in Figure 7B. Figure 7B illustrates a second system 21, a third system 22 and a memory that can share memory according to a preferred embodiment of the present invention. Schematic diagram of the wiring of blocks R4~R7.

上述實施例中,第一系統20耦接位址多工器ADD0~ADD3的第一位址接收埠。第一系統20耦接讀取資料多工器RDAT0~RDAT3的第一讀取資料接收埠。第一系統20耦接寫入資料多工器WDAT0~WDAT3的第一寫入資料接收埠。第二系統21耦接位址多工器ADD4~ADD5的第二位址接收埠。第二系統21耦接讀取資料多工器RDAT4~RDAT5的第二讀取資料接收埠。第二系統21耦接寫入資料多工器WDAT4~WDAT5的第二寫入資料接收埠。第三系統22耦接位址多工器ADD6~ADD7的第三位址接收埠。第三系統23耦接讀取資料多工器RDAT6~RDAT7的第三讀取資料接收埠。第三系統23耦接寫入資料多工器WDAT6~WDAT7的第三寫入資料接收埠。 In the above embodiment, the first system 20 is coupled to the first address receiving ports of the address multiplexers ADD0~ADD3. The first system 20 is coupled to the first read data receiving ports of the read data multiplexers RDAT0~RDAT3. The first system 20 is coupled to the first write data receiving ports of the write data multiplexers WDAT0˜WDAT3. The second system 21 is coupled to the second address receiving ports of the address multiplexers ADD4~ADD5. The second system 21 is coupled to the second read data receiving ports of the read data multiplexers RDAT4~RDAT5. The second system 21 is coupled to the second write data receiving ports of the write data multiplexers WDAT4˜WDAT5. The third system 22 is coupled to the third address receiving ports of the address multiplexers ADD6~ADD7. The third system 23 is coupled to the third read data receiving port of the read data multiplexers RDAT6~RDAT7. The third system 23 is coupled to the third write data receiving ports of the write data multiplexers WDAT6~WDAT7.

在上述實施例中,上述位址多工器ADD0~ADD3的第二、第三位址接收埠皆未耦接任何裝置(空接)。上述位址多工器ADD4~ADD5的第一、 第三位址接收埠皆未耦接任何裝置(空接)。上述位址多工器ADD6~ADD7的第一、第二位址接收埠皆未耦接任何裝置(空接)。上述讀取資料多工器RDAT0~RDAT3的第二、第三讀取資料接收埠皆未耦接任何裝置(空接)。上述讀取資料多工器RDAT4~RDAT5的第一、第三讀取資料接收埠皆未耦接任何裝置(空接)。上述讀取資料多工器RDAT6~RDAT7的第一、第二讀取資料接收埠皆未耦接任何裝置(空接)。上述寫入資料多工器WDAT0~RDAT3的第二、第三寫入資料接收埠皆未耦接任何裝置(空接)。上述寫入資料多工器WDAT4~WDAT5的第一、第三寫入資料接收埠皆未耦接任何裝置(空接)。上述寫入資料多工器WDAT6~WDAT7的第一、第二寫入資料接收埠皆未耦接任何裝置(空接)。 In the above embodiment, the second and third address receiving ports of the above address multiplexers ADD0 ~ ADD3 are not coupled to any device (empty connection). The first and second bits of the above address multiplexers ADD4~ADD5 None of the third address receiving ports are connected to any devices (empty connections). The first and second address receiving ports of the above-mentioned address multiplexers ADD6~ADD7 are not coupled to any device (empty connection). The second and third read data receiving ports of the above-mentioned read data multiplexers RDAT0 ~ RDAT3 are not coupled to any device (empty connection). The first and third read data receiving ports of the above-mentioned read data multiplexers RDAT4~RDAT5 are not coupled to any device (empty connection). The first and second read data receiving ports of the above-mentioned read data multiplexers RDAT6~RDAT7 are not coupled to any device (empty connection). The second and third write data receiving ports of the above-mentioned write data multiplexers WDAT0 ~ RDAT3 are not coupled to any device (empty connection). The first and third write data receiving ports of the above-mentioned write data multiplexers WDAT4~WDAT5 are not coupled to any device (empty connection). The first and second write data receiving ports of the above-mentioned write data multiplexers WDAT6~WDAT7 are not coupled to any device (empty connection).

由上述圖6、圖7A與圖7B的實施例可以看出,當任何一個系統20、21、22要進行記憶體存取時,由於對應的系統只耦接到被分配的記憶體區塊的位址多工器ADD0~ADD7、讀取資料多工器RDAT0~RDAT7、寫入資料多工器WDAT0~RDAT7,故界面選擇控制電路302可以用選擇信號SEL0~SEL7控制全部的位址多工器ADD0~ADD7、讀取資料多工器RDAT0~RDAT7、寫入資料多工器WDAT0~RDAT7。舉例來說,當系統20送出讀取要求時,界面選擇控制電路302可以用選擇訊號SEL0~SEL7將位址多工器ADD0~ADD7全部都切換到第一位址接收埠,且用選擇訊號SEL0~SEL7將讀取資料多工器RDAT0~RDAT7全部都切換到第一讀取資料接收埠。由於位址多工器ADD4~ADD7的第一位址接收埠以及讀取資料多工器RDAT0~RDAT7的第一讀取資料接收埠係空接,故第一系統20只會將位址送至記憶體區塊R0~R3,且記憶體區塊R0~R3只會將對應的讀出資料透過讀取資料多工器RDAT0~RDAT3送 給第一系統20。如此,可以簡化記憶體分享裝置的控制邏輯複雜度。並且還可以減少系統與可分享記憶體之間的走線,同時也可以減少更多的訊號串音干擾(Crosstalk)。 It can be seen from the embodiments of FIG. 6, FIG. 7A and FIG. 7B that when any system 20, 21, 22 wants to perform memory access, since the corresponding system is only coupled to the assigned memory block, Address multiplexers ADD0~ADD7, read data multiplexers RDAT0~RDAT7, and write data multiplexers WDAT0~RDAT7, so the interface selection control circuit 302 can use the selection signals SEL0~SEL7 to control all address multiplexers. ADD0~ADD7, read data multiplexers RDAT0~RDAT7, write data multiplexers WDAT0~RDAT7. For example, when the system 20 sends a read request, the interface selection control circuit 302 can use the selection signals SEL0 ~ SEL7 to switch all the address multiplexers ADD0 ~ ADD7 to the first address receiving port, and use the selection signal SEL0 ~SEL7 switches all read data multiplexers RDAT0~RDAT7 to the first read data receiving port. Since the first address receiving ports of the address multiplexers ADD4~ADD7 and the first read data receiving ports of the read data multiplexers RDAT0~RDAT7 are open, the first system 20 will only send the address to Memory blocks R0~R3, and memory blocks R0~R3 will only send the corresponding read data through the read data multiplexers RDAT0~RDAT3 Give 20 to the first system. In this way, the control logic complexity of the memory sharing device can be simplified. It can also reduce the wiring between the system and the shareable memory, and can also reduce more signal crosstalk interference (Crosstalk).

圖8繪示為本發明一較佳實施例的一種可分享記憶體的電路方塊圖。請參考圖6以及圖8,在此實施例中,與圖6的差異在於,界面選擇控制電路302只需要使用選擇信號SEL0,便可以讓第一系統20存取記憶體R0~R3,同樣的,界面選擇控制電路302只需要使用選擇信號SEL1,便可以讓第二系統21存取記憶體R4~R5。故可以比圖6的實施例更加的減少走線的使用,降低印刷電路板或電路布局複雜度。由於圖8的實施例與圖6的實施例類似,且控制方式已經在第6、第7A以及第7B圖與對應實施例中詳述,故在此不予贅述。 FIG. 8 is a circuit block diagram of a shareable memory according to a preferred embodiment of the present invention. Please refer to Figure 6 and Figure 8. In this embodiment, the difference from Figure 6 is that the interface selection control circuit 302 only needs to use the selection signal SEL0 to allow the first system 20 to access the memories R0~R3. Similarly , the interface selection control circuit 302 only needs to use the selection signal SEL1 to allow the second system 21 to access the memories R4~R5. Therefore, the use of wiring can be reduced and the complexity of the printed circuit board or circuit layout can be reduced compared with the embodiment of FIG. 6 . Since the embodiment of FIG. 8 is similar to the embodiment of FIG. 6 , and the control method has been described in detail in FIGS. 6 , 7A and 7B and the corresponding embodiments, they will not be described again here.

根據上述實施例,本發明可以被歸納成一個記憶體分享方法,圖9繪示為本發明一較佳實施例的一種記憶體分享方法的流程圖。請參考第9圖,此記憶體分享方法包括: According to the above embodiments, the present invention can be summarized as a memory sharing method. FIG. 9 is a flow chart of a memory sharing method according to a preferred embodiment of the present invention. Please refer to Figure 9. This memory sharing method includes:

步驟S901:開始。 Step S901: Start.

步驟S902:提供多個記憶體區塊。如上述實施例的記憶體區塊R0~R4或R0~R8。 Step S902: Provide multiple memory blocks. Such as the memory blocks R0~R4 or R0~R8 in the above embodiment.

步驟S903:將每一記憶體區塊依照需求,預先分配給多個系統。舉例來說,以圖4的實施例來說,記憶體區塊R0~R1分配給第一系統20,記憶體區塊R2分配給第二系統21,記憶體區塊R3分配給第三系統22。又,以圖6的實施例來說,記憶體區塊R0~R3分配給第一系統20,記憶體區塊R4~R5分配給第二系統21,記憶體區塊R6~R7分配給第三系統22。而以下說明,皆以圖6的實施例作為舉例。 Step S903: Pre-allocate each memory block to multiple systems according to requirements. For example, taking the embodiment of FIG. 4 , the memory blocks R0 ~ R1 are allocated to the first system 20 , the memory block R2 is allocated to the second system 21 , and the memory block R3 is allocated to the third system 22 . In addition, taking the embodiment of FIG. 6 as an example, the memory blocks R0~R3 are allocated to the first system 20, the memory blocks R4~R5 are allocated to the second system 21, and the memory blocks R6~R7 are allocated to the third system 20. System 22. The following description takes the embodiment of FIG. 6 as an example.

步驟S904:判斷存取要求的系統。在此方法實施例中,同樣以三個系統當舉例。當存取要求是由第一系統20,進行步驟S905,當存取要求是由第二系統21,進行步驟S907,當存取要求是由第三系統22,進行步驟S909。 Step S904: Determine the system for access requirements. In this method embodiment, three systems are also taken as examples. When the access request is from the first system 20, step S905 is performed. When the access request is from the second system 21, step S907 is performed. When the access request is from the third system 22, step S909 is performed.

步驟S905:致能記憶體區塊R0~R3。以圖6的實施例來說,當收到第一系統20的存取要求,則致能記憶體區塊R0~R3,致能記憶體區塊的方式可以是用晶片選擇訊號(Chip Selection Signal)。 Step S905: Enable memory blocks R0~R3. Taking the embodiment of FIG. 6 as an example, when an access request from the first system 20 is received, the memory blocks R0 ~ R3 are enabled. The method of enabling the memory blocks may be to use a chip selection signal (Chip Selection Signal). ).

步驟S906:將第一系統20輸出之存取訊號電性連接至被致能的記憶體區塊記憶體區塊R0~R3。例如上述的選擇電路301、上述的位址多工器ADD0~ADD3、上述的讀取資料多工器RDAT0~RDAT3、上述的寫入資料多工器WDAT0~WDAT3的運作。 Step S906: Electrically connect the access signal output by the first system 20 to the enabled memory blocks R0~R3. For example, the operation of the above-mentioned selection circuit 301, the above-mentioned address multiplexers ADD0~ADD3, the above-mentioned read data multiplexers RDAT0~RDAT3, and the above-mentioned write data multiplexers WDAT0~WDAT3.

步驟S907:致能記憶體區塊R4~R5。以圖6的實施例來說,當收到第二系統21的存取要求,則致能記憶體區塊R4~R5,致能記憶體區塊的方式可以是用晶片選擇訊號(Chip Selection Signal)。 Step S907: Enable memory blocks R4~R5. Taking the embodiment of FIG. 6 as an example, when an access request from the second system 21 is received, the memory blocks R4 to R5 are enabled. The method of enabling the memory blocks may be to use a chip selection signal (Chip Selection Signal). ).

步驟S908:將第二系統21輸出之存取訊號電性連接至被致能的記憶體區塊記憶體區塊R4~R5。例如上述的選擇電路301、上述的位址多工器ADD4~ADD5、上述的讀取資料多工器RDAT4~RDAT5、上述的寫入資料多工器WDAT4~WDAT5的運作。 Step S908: Electrically connect the access signal output by the second system 21 to the enabled memory blocks R4~R5. For example, the operation of the above-mentioned selection circuit 301, the above-mentioned address multiplexers ADD4~ADD5, the above-mentioned read data multiplexers RDAT4~RDAT5, and the above-mentioned write data multiplexers WDAT4~WDAT5.

步驟S909:致能記憶體區塊R6或R7。以圖6的實施例來說,當收到第三系統22的存取要求,則根據其存取的位址,致能記憶體區塊R6或R7。由於第三系統22的記憶體存取寬度較小,故可以根據存取的位址,選擇致能記憶體區塊R6或R7。致能記憶體區塊的方式可以是用晶片選擇訊號(Chip Selection Signal)。 Step S909: Enable memory block R6 or R7. Taking the embodiment of FIG. 6 as an example, when an access request from the third system 22 is received, the memory block R6 or R7 is enabled according to the accessed address. Since the memory access width of the third system 22 is small, the memory block R6 or R7 can be selectively enabled according to the accessed address. The memory block can be enabled by using a Chip Selection Signal.

步驟S910:將第三系統22輸出之存取訊號電性連接至被致能的記憶體區塊記憶體區塊R6或R7。例如上述的選擇電路301、上述的位址多工器ADD6~ADD7、上述的讀取資料多工器RDAT6~RDAT7、上述的寫入資料多工器WDAT6~WDAT7的運作。 Step S910: Electrically connect the access signal output by the third system 22 to the enabled memory block memory block R6 or R7. For example, the operations of the above-mentioned selection circuit 301, the above-mentioned address multiplexers ADD6~ADD7, the above-mentioned read data multiplexers RDAT6~RDAT7, and the above-mentioned write data multiplexers WDAT6~WDAT7.

上述實施例中,電性連接的方法可以參考圖4~圖8的實施例,在此不予贅述。 In the above embodiments, the method of electrical connection may refer to the embodiments in FIGS. 4 to 8 , and will not be described in detail here.

綜合以上所述,本發明實施例的精神在於利用選擇電路耦接每一個系統,且利用界面選擇控制電路控制選擇電路與致能對應的內部的記憶體區塊,藉由選擇電路,將欲存取記憶體的系統的存取指令,傳遞給被致能的記憶體區塊,藉此,讓每個系統存取同一個可分享記憶體模組中的不同區塊。由於致能的記憶體區塊數目可依照不同系統做調整,故可以相容不同記憶體位址寬度。另外,由於根據系統存取不同,致能不同的記憶體區塊,故不會發生資料錯誤或資料覆蓋的問題。再者,由於是採用選擇電路做記憶體分享,故記憶體模組內部走線可以完全不改變,僅須改變選擇電路與系統之間的走線。電路複雜度可以降低,也降低使用成本。 Based on the above, the spirit of the embodiments of the present invention is to use the selection circuit to couple each system, and to use the interface selection control circuit to control the selection circuit and enable the corresponding internal memory block. Through the selection circuit, the desired memory is The access command of the system fetching the memory is passed to the enabled memory block, thereby allowing each system to access different blocks in the same shareable memory module. Since the number of enabled memory blocks can be adjusted according to different systems, it can be compatible with different memory address widths. In addition, since different memory blocks are enabled according to different system accesses, data errors or data overwriting problems will not occur. Furthermore, since the selection circuit is used for memory sharing, the internal wiring of the memory module does not need to be changed at all. Only the wiring between the selection circuit and the system needs to be changed. The circuit complexity can be reduced and the cost of use is also reduced.

應當理解,本文描述的示例和實施例僅用於說明目的,並且鑑於其的各種修改或改變將被建議給本領域技術人員,並且將被包括在本申請的精神和範圍以及所附權利要求的範圍之內。 It is to be understood that the examples and embodiments described herein are for illustrative purposes only and that various modifications or alterations thereof will be suggested to those skilled in the art and will be included within the spirit and scope of the application and the appended claims. within the range.

20:第一系統 20:First system

21:第二系統 21:Second system

22:第三系統 22:Third system

23:可分享記憶體 23: Shareable memory

24:周邊裝置 24:Peripheral devices

R0、R1、R2、R3、R4、R5、R6、R7、R8、R9、R10、R11、R12、R13、R14、R15:記憶體區塊 R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15: memory block

Claims (12)

一種記憶體分享裝置,用以將多個記憶體區塊分別分享給多個系統,此記憶體分享裝置包括:一選擇電路,包括多個接收埠以及一輸出埠,其中,每一該些接收埠耦接對應的每一該些系統,其中,該輸出埠耦接每一該些記憶體區塊;以及一界面選擇控制電路,耦接該選擇電路,根據每一該些系統中,至少一特定系統輸出之存取要求,將該選擇電路的該些接收埠中,對應該特定系統之接收埠電性連接至該選擇電路的輸出埠,並致能該些記憶體區塊中,分配給該特定系統之記憶體區塊。 A memory sharing device is used to share multiple memory blocks to multiple systems respectively. The memory sharing device includes: a selection circuit including a plurality of receiving ports and an output port, wherein each of the receiving ports The port is coupled to each of the corresponding systems, wherein the output port is coupled to each of the memory blocks; and an interface selection control circuit is coupled to the selection circuit, according to at least one of the systems in each of the systems. The specific system output access requirement is to electrically connect the receiving ports of the selection circuit corresponding to the specific system to the output port of the selection circuit, and enable the memory blocks allocated to A block of memory for this particular system. 根據請求項1所述之記憶體分享裝置,致能該些記憶體區塊中,分配給該特定系統之記憶體區塊更包括:該界面選擇控制電路輸出一晶片選擇訊號以致能分配給該特定系統之記憶體區塊。 According to the memory sharing device described in claim 1, enabling the memory blocks allocated to the specific system among the memory blocks further includes: the interface selection control circuit outputs a chip selection signal to enable allocation to the System-specific memory block. 根據請求項1所述之記憶體分享裝置,其中,該選擇電路更包括:多個位址多工器,每一該些位址多工器包括多個位址接收埠以及一位址輸出埠,每一該些位址多工器的該些位址接收埠分別接收該些系統所輸出的位址訊號,每一該些位址多工器的位址輸出埠分別耦接每一該些記憶體區塊的位址接收埠;以及多個讀取資料多工器,每一該些讀取資料多工器包括多個讀取資料接收埠以及一讀取資料輸入埠,每一該些讀取資料多工器的該些讀取資料接收埠分別 耦接該些系統,每一該些讀取資料多工器的讀取資料輸入埠分別耦接每一該些記憶體區塊的讀取資料輸出埠;其中,當該界面選擇控制電路根據特定系統輸出之讀取要求,該界面選擇控制電路控制上述多個位址多工器中,對應該特定系統之記憶體區塊的位址接收埠電性連接至對應該特定系統之記憶體區塊的位址多工器的位址輸出埠,該界面選擇控制電路控制上述多個讀取資料多工器中,對應該特定系統之記憶體區塊的讀取資料接收埠電性連接至對應該特定系統之記憶體區塊的多個讀取資料多工器的讀取資料輸入埠。 The memory sharing device according to claim 1, wherein the selection circuit further includes: a plurality of address multiplexers, each of the address multiplexers includes a plurality of address receiving ports and an address output port. , the address receiving ports of each of the address multiplexers respectively receive the address signals output by the systems, and the address output ports of each of the address multiplexers are respectively coupled to each of the an address receiving port of the memory block; and a plurality of read data multiplexers, each of which includes a plurality of read data receiving ports and a read data input port, each of which The read data receiving ports of the read data multiplexer are respectively Coupling the systems, the read data input port of each of the read data multiplexers is respectively coupled to the read data output port of each of the memory blocks; wherein, when the interface selection control circuit is configured according to a specific According to the read request of the system output, the interface selection control circuit controls the address receiving port of the memory block corresponding to the specific system among the above multiple address multiplexers to be electrically connected to the memory block corresponding to the specific system. The address output port of the address multiplexer. The interface selection control circuit controls the read data receiving port of the multiple read data multiplexers corresponding to the memory block of the specific system to be electrically connected to the corresponding Read data input port for multiple read data multiplexers of a specific system's memory block. 根據請求項3所述之記憶體分享裝置,其中,該選擇電路更包括:多個晶片選擇(chip selection)多工器,每一該些晶片選擇多工器包括多個晶片選擇訊號接收埠以及一晶片選擇訊號輸出埠,每一該些晶片選擇多工器的該些晶片選擇訊號接收埠分別接收該些系統對應的晶片選擇訊號,每一該些晶片選擇多工器的晶片選擇訊號輸出埠分別耦接每一該些記憶體區塊的晶片選擇訊號接收端,其中,當該界面選擇控制電路根據特定系統輸出之讀取要求,該界面選擇控制電路控制每一該些晶片選擇多工器中,對應該特定系統的位址接收埠電性連接至每一該些晶片選擇多工器的位址輸出埠,以致能對應該特定系統之記憶體區塊。 The memory sharing device according to claim 3, wherein the selection circuit further includes: a plurality of chip selection multiplexers, each of the chip selection multiplexers includes a plurality of chip selection signal receiving ports and A chip selection signal output port, the chip selection signal receiving ports of each of the chip selection multiplexers respectively receive the chip selection signals corresponding to the systems, and the chip selection signal output port of each of the chip selection multiplexers The chip selection signal receiving end is respectively coupled to each of the memory blocks, wherein when the interface selection control circuit controls each of the chip selection multiplexers according to the reading request of the specific system output In the process, the address receiving port corresponding to the specific system is electrically connected to the address output port of each of the chip select multiplexers, so as to correspond to the memory block of the specific system. 根據請求項1所述之記憶體分享裝置,其中,該選擇電路更包括: 多個位址多工器,每一該些位址多工器包括多個位址接收埠以及一位址輸出埠,每一該些位址多工器的該些位址接收埠分別接收該些系統所輸出的位址訊號,每一該些位址多工器的位址輸出埠分別耦接每一該些記憶體區塊的位址接收埠;以及多個寫入資料多工器,每一該些寫入資料多工器包括多個寫入資料接收埠以及一寫入資料輸出埠,每一該些寫入資料多工器的該些寫入資料接收埠分別耦接該些系統,每一該些寫入資料多工器的寫入資料輸出埠分別耦接每一該些記憶體區塊的寫入資料輸入埠;其中,當該界面選擇控制電路根據特定系統輸出之寫入要求,該界面選擇控制電路控制上述多個位址多工器中,對應該特定系統之記憶體區塊的位址接收埠電性連接至對應該特定系統之記憶體區塊的位址多工器的位址輸出埠,該界面選擇控制電路控制上述多個寫入資料多工器中,對應該特定系統之記憶體區塊的寫入資料接收埠電性連接至對應該特定系統之記憶體區塊的多個寫入資料多工器的寫入資料輸出埠。 The memory sharing device according to claim 1, wherein the selection circuit further includes: Multiple address multiplexers, each of the address multiplexers includes multiple address receiving ports and an address output port, and the address receiving ports of each of the address multiplexers receive the The address signals output by these systems, the address output port of each of the address multiplexers is respectively coupled to the address receiving port of each of the memory blocks; and a plurality of write data multiplexers, Each of the write data multiplexers includes a plurality of write data receiving ports and a write data output port. The write data receiving ports of each of the write data multiplexers are respectively coupled to the systems. , the write data output port of each of the write data multiplexers is respectively coupled to the write data input port of each of the memory blocks; wherein, when the interface selection control circuit outputs a write data according to a specific system It is required that the interface selection control circuit controls the address receiving port of the memory block corresponding to the specific system among the above multiple address multiplexers to be electrically connected to the address multiplexer of the memory block corresponding to the specific system. The interface selection control circuit controls the write data receiving port of the memory block corresponding to the specific system in the multiple write data multiplexers to be electrically connected to the memory corresponding to the specific system. The write output port for the block's multiple write multiplexers. 根據請求項5所述之記憶體分享裝置,其中,該選擇電路更包括:多個晶片選擇(chip selection)多工器,每一該些晶片選擇多工器包括多個晶片選擇訊號接收埠以及一晶片選擇訊號輸出埠,每一該些晶片選擇多工器的該些晶片選擇訊號接收埠分別接收該些系統對應的晶片選擇訊號,每一該些晶片選擇多工器的晶片選擇訊號輸出埠分別耦接每一該些記憶體區塊的晶片選擇訊號接收端, 其中,當該界面選擇控制電路根據特定系統輸出之寫入要求,該界面選擇控制電路控制每一該些晶片選擇多工器中,對應該特定系統的位址接收埠電性連接至每一該些晶片選擇多工器的位址輸出埠,以致能對應該特定系統之記憶體區塊。 The memory sharing device according to claim 5, wherein the selection circuit further includes: a plurality of chip selection multiplexers, each of the chip selection multiplexers includes a plurality of chip selection signal receiving ports and A chip selection signal output port, the chip selection signal receiving ports of each of the chip selection multiplexers respectively receive the chip selection signals corresponding to the systems, and the chip selection signal output port of each of the chip selection multiplexers The chip selection signal receiving ends respectively coupled to each of the memory blocks, Wherein, when the interface selection control circuit outputs a write request according to a specific system, the interface selection control circuit controls each of the chip selection multiplexers to electrically connect the address receiving port corresponding to the specific system to each of the chip selection multiplexers. Some chips select the multiplexer's address output port so that it corresponds to the memory block of that particular system. 根據請求項1所述之記憶體分享裝置,其中,共有N個系統分享該些記憶體區塊,且該選擇電路更包括:多個位址多工器,每一該些位址多工器包括N個位址接收埠以及一位址輸出埠,每一該些位址多工器的位址輸出埠分別耦接每一該些記憶體區塊的位址接收埠,其中,第I個系統耦接對應第I個系統的該些記憶體區塊所耦接的該些位址多工器中,第I個位址接收埠,以分別接收第I個系統所輸出的位址訊號,其中,對應第I個系統的該些記憶體區塊所耦接的該些位址多工器的其餘位址接收埠空接;以及多個讀取資料多工器,每一該些讀取資料多工器包括多個讀取資料接收埠以及一讀取資料輸入埠,每一該些讀取資料多工器的讀取資料輸入埠分別耦接每一該些記憶體區塊的讀取資料輸出埠,其中,對應第I個系統的該些記憶體區塊所耦接的該些讀取資料多工器的第I個讀取資料接收埠分別耦接第I個系統,其中,對應第I個系統的該些記憶體區塊所耦接的該些讀取資料多工器的其餘讀取資料接收埠空接;其中,當該界面選擇控制電路根據特定系統輸出之讀取要求,該界面選擇控制電路控制上述多個位址多工器中,對應該特定系統之記憶體區塊的位址接收埠電性連接至對應該特定系統之記憶體區塊的位址多工器的位址輸出埠,該界面選擇控制電路控制上述多個讀取資料多工器中,對應該特定系統之記憶體區 塊的讀取資料接收埠電性連接至對應該特定系統之記憶體區塊的多個讀取資料多工器的讀取資料輸入埠,其中,N、I為自然數,I小於等於N。 The memory sharing device according to claim 1, wherein a total of N systems share the memory blocks, and the selection circuit further includes: a plurality of address multiplexers, each of the address multiplexers Including N address receiving ports and an address output port, the address output ports of each of the address multiplexers are respectively coupled to the address receiving ports of each of the memory blocks, wherein the I-th The system is coupled to the I-th address receiving port among the address multiplexers coupled to the memory blocks of the I-th system to respectively receive the address signals output by the I-th system. Among them, the remaining address receiving ports of the address multiplexers coupled to the memory blocks corresponding to the I-th system are air-connected; and a plurality of read data multiplexers, each of the read data multiplexers The data multiplexer includes a plurality of read data receiving ports and a read data input port. The read data input ports of each of the read data multiplexers are respectively coupled to the reading of each of the memory blocks. Data output ports, wherein the I-th read data receiving ports of the read data multiplexers coupled to the memory blocks of the I-th system are respectively coupled to the I-th system, wherein the corresponding The remaining read data receiving ports of the read data multiplexers coupled to the memory blocks of the first system are air-connected; wherein, when the interface selection control circuit outputs a read request based on a specific system, The interface selection control circuit controls the address receiving port corresponding to the memory block of the specific system among the plurality of address multiplexers to be electrically connected to the address multiplexer corresponding to the memory block of the specific system. Address output port, this interface selects the control circuit to control the memory area corresponding to the specific system among the multiple read data multiplexers. The read data receiving port of the block is electrically connected to the read data input ports of multiple read data multiplexers corresponding to the memory block of the specific system, where N and I are natural numbers, and I is less than or equal to N. 根據請求項1所述之記憶體分享裝置,其中,該選擇電路更包括:多個位址多工器,每一該些位址多工器包括多個位址接收埠以及一位址輸出埠,每一該些位址多工器的位址輸出埠分別耦接每一該些記憶體區塊的位址接收埠,其中,第I個系統耦接對應第I個系統的該些記憶體區塊所耦接的該些位址多工器中,第I個位址接收埠,以分別接收第I個系統所輸出的位址訊號,其中,對應第I個系統的該些記憶體區塊所耦接的該些位址多工器的其餘位址接收埠空接;以及多個寫入資料多工器,每一該些寫入資料多工器包括多個寫入資料接收埠以及一寫入資料輸出埠,每一該些寫入資料多工器的寫入資料輸出埠分別耦接每一該些記憶體區塊的寫入資料輸入埠,其中,對應第I個系統的該些記憶體區塊所耦接的該些寫入資料多工器的第I個寫入資料接收埠分別耦接第I個系統,其中,對應第I個系統的該些記憶體區塊所耦接的該些寫入資料多工器的其餘寫入資料接收埠空接;其中,當該界面選擇控制電路根據特定系統輸出之寫入要求,該界面選擇控制電路控制上述多個位址多工器中,對應該特定系統之記憶體區塊的位址接收埠電性連接至對應該特定系統之記憶體區塊的位址多工器的位址輸出埠,該界面選擇控制電路控制上述多個寫入資料多工器中,對應該特定系統之記憶體區 塊的寫入資料接收埠電性連接至對應該特定系統之記憶體區塊的多個寫入資料多工器的寫入資料輸出埠,其中,N、I為自然數,I小於等於N。 The memory sharing device according to claim 1, wherein the selection circuit further includes: a plurality of address multiplexers, each of the address multiplexers includes a plurality of address receiving ports and an address output port. , the address output port of each of the address multiplexers is respectively coupled to the address receiving port of each of the memory blocks, wherein the I-th system is coupled to the memories corresponding to the I-th system Among the address multiplexers coupled to the block, the I-th address receiving port is used to receive the address signal output by the I-th system respectively, wherein the memory areas corresponding to the I-th system The remaining address receive ports of the address multiplexers to which the block is coupled are air-connected; and a plurality of write data multiplexers, each of the write data multiplexers includes a plurality of write data receive ports and A write data output port, the write data output port of each of the write data multiplexers is respectively coupled to the write data input port of each of the memory blocks, wherein the write data input port corresponding to the I-th system The 1st write data receiving ports of the write data multiplexers coupled to the memory blocks are respectively coupled to the 1st system, wherein the memory blocks corresponding to the 1st system are coupled to The remaining write data receiving ports of the write data multiplexers connected are air-connected; among them, when the interface selection control circuit outputs a write request according to a specific system, the interface selection control circuit controls the above-mentioned multiple address multiplexers. In the processor, the address receiving port corresponding to the memory block of the specific system is electrically connected to the address output port of the address multiplexer corresponding to the memory block of the specific system. The interface selection control circuit controls the above multiplexer. write to the data multiplexer, corresponding to the memory area of that particular system The write data receiving port of the block is electrically connected to the write data output ports of multiple write data multiplexers corresponding to the memory block of the specific system, where N and I are natural numbers, and I is less than or equal to N. 根據請求項1所述之記憶體分享裝置,其中,該界面選擇控制電路更包括:一查找表,用以儲存每一系統與該些記憶體區塊的對應關係,藉以根據特定系統的存取要求,致能對應的記憶體區塊。 The memory sharing device according to claim 1, wherein the interface selection control circuit further includes: a lookup table for storing the corresponding relationship between each system and the memory blocks, so as to determine the access according to the specific system. Required to enable the corresponding memory block. 一種可分享記憶體,用以將記憶體分享給多個系統,此可分享記憶體包括:多個記憶體區塊(Rank);以及如請求項1~9其中一項所述之記憶體分享裝置。 A shareable memory used to share memory to multiple systems. The shareable memory includes: multiple memory blocks (Ranks); and memory sharing as described in one of requests 1 to 9 device. 一種電子設備,包括:多個系統;一可分享記憶體,包括:多個記憶體區塊(Rank);以及如請求項1~9其中一項所述之記憶體分享裝置;以及至少一周邊裝置,透過匯流排與所述多個系統其中之一電性連接。 An electronic device, including: multiple systems; a shareable memory including: multiple memory blocks (Rank); and the memory sharing device as described in one of claims 1 to 9; and at least one peripheral The device is electrically connected to one of the plurality of systems through a bus. 一種記憶體分享方法,包括:提供多個記憶體區塊;將每一該些記憶體區塊依照需求,預先分配給多個系統;當每一該些系統中,至少一特定系統輸出一存取要求,包括: 致能該些記憶體區塊中,分配給該特定系統之記憶體區塊;以及將該特定系統輸出之存取訊號電性連接至被致能的記憶體區塊。 A memory sharing method includes: providing multiple memory blocks; pre-allocating each of the memory blocks to multiple systems according to requirements; when in each of the systems, at least one specific system outputs a memory Requirements include: Enable the memory block allocated to the specific system among the memory blocks; and electrically connect the access signal output by the specific system to the enabled memory block.
TW111144963A 2022-11-24 2022-11-24 Method and apparatus for controlling shared memory, shareable memory and electrical device using the same TWI824847B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
TW111144963A TWI824847B (en) 2022-11-24 2022-11-24 Method and apparatus for controlling shared memory, shareable memory and electrical device using the same
CN202310004610.8A CN118069344A (en) 2022-11-24 2023-01-03 Memory sharing device and method, sharable memory and electronic device used by same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW111144963A TWI824847B (en) 2022-11-24 2022-11-24 Method and apparatus for controlling shared memory, shareable memory and electrical device using the same

Publications (2)

Publication Number Publication Date
TWI824847B true TWI824847B (en) 2023-12-01
TW202422360A TW202422360A (en) 2024-06-01

Family

ID=90053095

Family Applications (1)

Application Number Title Priority Date Filing Date
TW111144963A TWI824847B (en) 2022-11-24 2022-11-24 Method and apparatus for controlling shared memory, shareable memory and electrical device using the same

Country Status (2)

Country Link
CN (1) CN118069344A (en)
TW (1) TWI824847B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW200305103A (en) * 2002-04-09 2003-10-16 Via Tech Inc Data maintenance method of DSM system
TW200707456A (en) * 2005-08-11 2007-02-16 Samsung Electronics Co Ltd Wrapper circuit and method for interfacing between non-muxed type memory controller and muxed type memory
CN101930416A (en) * 2009-06-21 2010-12-29 先耀无线股份有限公司 Hardware assisted inter-processor communication
TW201205284A (en) * 2010-07-27 2012-02-01 Mediatek Singapore Pte Ltd Method of accessing a memory and computing device
TW201342205A (en) * 2011-12-23 2013-10-16 Intel Corp Apparatus and method for selecting elements of a vector computation
CN110471870A (en) * 2019-08-14 2019-11-19 Oppo广东移动通信有限公司 Method, apparatus, electronic equipment and the storage medium of multisystem operation

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW200305103A (en) * 2002-04-09 2003-10-16 Via Tech Inc Data maintenance method of DSM system
TW200707456A (en) * 2005-08-11 2007-02-16 Samsung Electronics Co Ltd Wrapper circuit and method for interfacing between non-muxed type memory controller and muxed type memory
CN101930416A (en) * 2009-06-21 2010-12-29 先耀无线股份有限公司 Hardware assisted inter-processor communication
TW201205284A (en) * 2010-07-27 2012-02-01 Mediatek Singapore Pte Ltd Method of accessing a memory and computing device
TW201342205A (en) * 2011-12-23 2013-10-16 Intel Corp Apparatus and method for selecting elements of a vector computation
CN110471870A (en) * 2019-08-14 2019-11-19 Oppo广东移动通信有限公司 Method, apparatus, electronic equipment and the storage medium of multisystem operation

Also Published As

Publication number Publication date
CN118069344A (en) 2024-05-24

Similar Documents

Publication Publication Date Title
US7380045B2 (en) Protocol conversion and arbitration circuit, system having the same, and method for converting and arbitrating signals
US6233635B1 (en) Diagnostic/control system using a multi-level I2C bus
US4120048A (en) Memory with simultaneous sequential and random address modes
US10866916B2 (en) Folded memory modules
KR100647443B1 (en) Method and Apparatus for Supplementary Command Bus
CN100419901C (en) Memory device having different burst order addressing for read and write operations
KR20070059859A (en) On-chip communication architecture
WO2005101417A1 (en) Memory with single and dual mode access
US7405949B2 (en) Memory system having point-to-point (PTP) and point-to-two-point (PTTP) links between devices
GB2123189A (en) Communication between computers
TWI824847B (en) Method and apparatus for controlling shared memory, shareable memory and electrical device using the same
JPH10143466A (en) Bus communication system
JP3189816B2 (en) Semiconductor storage device
TW202422360A (en) Method and apparatus for controlling shared memory, shareable memory and electrical device using the same
KR100746364B1 (en) Method and apparatus for sharing memory
JPH11149406A (en) Semi-conductor storage device
KR100441996B1 (en) Direct Memory Access(DMA) Controller and control method
TWI746331B (en) Control method for flash memory, flash memory die and flash memory
JPH02132543A (en) Information processor
KR100663384B1 (en) Device and method for memory interface
JP3233470B2 (en) Computer system
JP3138597B2 (en) Dynamic polling method using memory for burst signal transmission management
KR100754361B1 (en) Multi-port memory device enabling share of dq power
JPH0160864B2 (en)
JPH01248395A (en) Multiplexer