TW202046112A - Memory controller, memory controlling method, and computer system - Google Patents

Memory controller, memory controlling method, and computer system Download PDF

Info

Publication number
TW202046112A
TW202046112A TW108119564A TW108119564A TW202046112A TW 202046112 A TW202046112 A TW 202046112A TW 108119564 A TW108119564 A TW 108119564A TW 108119564 A TW108119564 A TW 108119564A TW 202046112 A TW202046112 A TW 202046112A
Authority
TW
Taiwan
Prior art keywords
memory controller
host
commands
memory
processor
Prior art date
Application number
TW108119564A
Other languages
Chinese (zh)
Other versions
TWI714116B (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 TW108119564A priority Critical patent/TWI714116B/en
Publication of TW202046112A publication Critical patent/TW202046112A/en
Application granted granted Critical
Publication of TWI714116B publication Critical patent/TWI714116B/en

Links

Images

Abstract

A memory controller includes an interface circuit and a processor. The interface circuit is configured to perform data communicate with a host device. When the processor finishes N commands transmitted from the host device, the memory controller informs the host device to release memory addresses corresponding to the N commands, wherein N is a positive integer. The processer compares a data transmitting speed of the interface circuit with a predetermined value. If the data transmitting speed is lower than the predetermined value, the processor adjusts the value of N according to the comparison result. The memory controller adjusts the value of N to match the masters having different configurations such that the transmission speed of the interface circuit is optimized.

Description

記憶體控制器、記憶體控制方法、以及電腦系統 Memory controller, memory control method, and computer system

本揭示文件有關一種記憶體控制器,尤指一種可提升資料傳輸效率的記憶體控制器、其控制方法、以及電腦系統。 This disclosure relates to a memory controller, in particular to a memory controller that can improve data transmission efficiency, its control method, and a computer system.

市售的電子裝置可使用各種不同的介面電路(例如:ATA、PCI-e、USB)與儲存裝置(例如,固態硬碟)存取資料。部份介面電路(例如:序列先進技術附接(Serial Advanced Technology Attachment,SATA)介面可支援原生命令排序(Native Command Queuing,NCQ)技術以提升介面的傳輸效率。NCQ技術允許多筆命令存入佇列以接續或同時執行,有別於舊的排序技術需要等待前一筆命令執行完畢後才能接收下一筆命令的運作方式。 Commercially available electronic devices can access data using various interface circuits (for example: ATA, PCI-e, USB) and storage devices (for example, solid state drives). Some interface circuits (such as Serial Advanced Technology Attachment (SATA)) interface can support Native Command Queuing (NCQ) technology to improve interface transmission efficiency. NCQ technology allows multiple commands to be stored in the queue Columns are executed in succession or at the same time, which is different from the old sorting technology, which requires waiting for the execution of the previous command before receiving the next command.

市面上的電子設備廠商推出了眾多型號的產品,例如個人電腦、伺服器、筆記型電腦等等,這些產品在資料讀寫運作中扮演著主控端的腳色。然而,市面上存在許多不同組態(Configuration)的主控端,(例如:不同的作業系統或是不同硬體架構)。若裝置端僅能以相同的運作模式回應組態不相同的主控端,不但可能無法提升整體的傳輸速度,還可能會降低雙方的工作效率。 Electronic equipment manufacturers on the market have introduced many models of products, such as personal computers, servers, notebooks, etc. These products play the role of the master in data reading and writing operations. However, there are many consoles with different configurations (for example, different operating systems or different hardware architectures) on the market. If the device can only respond to a host with a different configuration in the same operating mode, not only may not be able to increase the overall transmission speed, but it may also reduce the work efficiency of both parties.

本揭示文件提供一種記憶體控制器,其包含介面電路與處理器。介面電路用於和主控端進行資料通信。當處理器執行完來自主控端的N筆命令時,記憶體控制器通知主控端釋放對應於N筆命令的記憶體位址,且N為正整數。處理器將介面電路的資料傳輸速率與預設值進行比較以產生一比較結果,並依據該比較結果來調整N的數值。 The present disclosure provides a memory controller, which includes an interface circuit and a processor. The interface circuit is used for data communication with the host. When the processor finishes executing N commands from the host, the memory controller informs the host to release the memory address corresponding to the N commands, and N is a positive integer. The processor compares the data transmission rate of the interface circuit with a preset value to generate a comparison result, and adjusts the value of N according to the comparison result.

本揭示文件另提供一種控制方法,係應用於包含介面電路以及處理器的記憶體控制器。前述控制方法包含以下流程:利用介面電路接收來自主控端的N筆命令;當處理器執行完N筆命令時,利用處理器通知主控端釋放對應於前述N筆命令的記憶體位址,且N為正整數;利用處理器將介面電路的資料傳輸速率與預設值進行比較以產生一比較結果,並依據該比較結果來調整N的數值。 The present disclosure also provides a control method, which is applied to a memory controller including an interface circuit and a processor. The foregoing control method includes the following processes: the interface circuit is used to receive N commands from the host; when the processor finishes executing the N commands, the processor is used to notify the host to release the memory address corresponding to the foregoing N commands, and N It is a positive integer; the processor compares the data transmission rate of the interface circuit with a preset value to generate a comparison result, and adjusts the value of N according to the comparison result.

本揭示文件另提供一種電腦系統,其包含主控端、記憶體控制器、以及記憶體模組。記憶體控制器包含介面電路與處理器。介面電路用於和主控端進行資料通信。當處理器執行完來自主控端的N筆命令時,記憶體控制器通知主控端釋放對應於前述N筆命令的記憶體位址,且N為正整數。記憶體模組耦接於記憶體控制器。處理器將介面電路的資料傳輸速率與預設值進行比較以產生一比較結果,並依據該比較結果來調整N的數值。 The present disclosure also provides a computer system, which includes a host, a memory controller, and a memory module. The memory controller includes an interface circuit and a processor. The interface circuit is used for data communication with the host. When the processor finishes executing N commands from the host, the memory controller informs the host to release the memory address corresponding to the aforementioned N commands, and N is a positive integer. The memory module is coupled to the memory controller. The processor compares the data transmission rate of the interface circuit with a preset value to generate a comparison result, and adjusts the value of N according to the comparison result.

上述的記憶體控制器、其控制方法、以及電腦系統可以提升資料傳輸效率。 The aforementioned memory controller, its control method, and computer system can improve data transmission efficiency.

100‧‧‧電腦系統 100‧‧‧Computer system

110‧‧‧主控端 110‧‧‧Host

112‧‧‧第一處理器 112‧‧‧First processor

114‧‧‧第一直接記憶體存取(DMA)電路 114‧‧‧The first direct memory access (DMA) circuit

116‧‧‧第一記憶體 116‧‧‧First memory

118a‧‧‧第一介面電路 118a‧‧‧The first interface circuit

118b‧‧‧第一介面電路 118b‧‧‧The first interface circuit

120‧‧‧記憶體控制器 120‧‧‧Memory Controller

122‧‧‧第二處理器 122‧‧‧Second processor

124‧‧‧第二直接記憶體存取(DMA)電路 124‧‧‧Second direct memory access (DMA) circuit

126‧‧‧第二記憶體 126‧‧‧Second memory

128‧‧‧第二介面電路 128‧‧‧Second interface circuit

Fc‧‧‧控制電路 Fc‧‧‧Control circuit

130‧‧‧儲存裝置 130‧‧‧Storage device

140‧‧‧記憶體模組 140‧‧‧Memory Module

2102~2110‧‧‧流程 2102~2110‧‧‧Process

2202~2210‧‧‧流程 2202~2210‧‧‧Process

230、240、250‧‧‧流程 230, 240, 250‧‧‧process

CMD1、CMD2、CMD[1]~CMD[2N]、CMD[N+M]‧‧‧命令 CMD1, CMD2, CMD[1]~CMD[2N], CMD[N+M]‧‧‧Command

TSa~TSd‧‧‧傳輸階段 TSa~TSd‧‧‧Transmission stage

TS[1]~TS[4N]、TS[2N+2M]‧‧‧傳輸階段 TS[1]~TS[4N], TS[2N+2M]‧‧‧Transmission phase

310‧‧‧檔頭 310‧‧‧ Gear Head

320‧‧‧欄位 320‧‧‧Field

5102~5108‧‧‧流程 5102~5108‧‧‧Process

5202~5208‧‧‧流程 5202~5208‧‧‧Process

530~570‧‧‧流程 530~570‧‧‧Process

第1圖為根據本揭示文件一實施例的電腦系統簡化後的功能方塊圖。 FIG. 1 is a simplified functional block diagram of a computer system according to an embodiment of the disclosure.

第2圖為依據本揭示文件一實施例的記憶體控制方法的流程圖。 FIG. 2 is a flowchart of a memory control method according to an embodiment of the disclosure.

第3圖為依據本揭示文件一實施例的傳送設置裝置位元FIS簡化後的示意圖。 FIG. 3 is a simplified schematic diagram of the bit FIS of the transmission setting device according to an embodiment of the present disclosure.

第4A圖和第4B圖為電腦系統執行第2圖的記憶體控制方法時調整設置裝置位元FIS傳送模式的簡化後運作示意圖。 Figures 4A and 4B are simplified operational schematic diagrams of the FIS transmission mode of adjusting the setting device bit when the computer system executes the memory control method of Figure 2.

第5圖為依據本揭示文件另一實施例的記憶體控制方法的流程圖。 FIG. 5 is a flowchart of a memory control method according to another embodiment of the present disclosure.

第6A圖和第6B圖為電腦系統執行第5圖的記憶體控制方法時調整多筆讀取命令完成順序的簡化後運作示意圖。 FIGS. 6A and 6B are simplified operational schematic diagrams of adjusting the order of completion of multiple read commands when the computer system executes the memory control method of FIG. 5.

以下將配合相關圖式來說明本揭示文件的實施例。在圖式中,相同的標號表示相同或類似的元件或方法流程。 The embodiments of the present disclosure will be described below in conjunction with related drawings. In the drawings, the same reference numerals indicate the same or similar elements or method flows.

第1圖為根據本揭示文件一實施例的電腦系統100簡化後的功能方塊圖。電腦系統100包含主控端110、記憶體控制器120、儲存裝置130、以及記憶體模組140。主控端110和儲存裝置130可以是某一裝置中的局部電路。例如,主控端110和儲存裝置130可以分別是個人電腦中的主機板和硬碟。記憶體控制器120和記憶體模組140可以是另一裝置中的局部電路。例如,記憶體控制器120和記憶體模組140可以分別是固態硬碟中的固態硬碟控制器和NAND快閃記憶體。為使圖面簡潔而易於說明,電腦系統100中的其他元件與連接關係並未繪示於第1圖中。 FIG. 1 is a simplified functional block diagram of the computer system 100 according to an embodiment of the present disclosure. The computer system 100 includes a host 110, a memory controller 120, a storage device 130, and a memory module 140. The host 110 and the storage device 130 may be partial circuits in a certain device. For example, the host 110 and the storage device 130 may be a motherboard and a hard disk in a personal computer, respectively. The memory controller 120 and the memory module 140 may be partial circuits in another device. For example, the memory controller 120 and the memory module 140 may be a solid state drive controller and a NAND flash memory in a solid state drive, respectively. In order to make the drawing concise and easy to explain, other components and connection relationships in the computer system 100 are not shown in the first figure.

主控端110包含第一處理器112、第一直接記憶體存取(Direct Memory Access,DMA)電路114、第一記憶體116、第一介面電路118a、以及第一介面電路118b。第一介面電路118a用於和記憶體控制器120進行資料通信。第一處理器112用於控制儲存裝置130和第一記憶體116之間的雙向資料傳輸。而第一DMA電路114用於執行第一記憶體116和記憶體控制器120之間的雙向資料傳輸。 The host 110 includes a first processor 112, a first direct memory access (DMA) circuit 114, a first memory 116, a first interface circuit 118a, and a first interface circuit 118b. The first interface circuit 118a is used for data communication with the memory controller 120. The first processor 112 is used to control two-way data transmission between the storage device 130 and the first memory 116. The first DMA circuit 114 is used to perform bidirectional data transmission between the first memory 116 and the memory controller 120.

記憶體控制器120包含第二處理器122、第二直接記憶體存取(DMA)電路124、第二記憶體126、第二介面電路128、以及控制電路Fc。第二介面電路128用於和第一介面電路118a進行資料通信。第二處理器122用於依據主控端110的命令控制第二DMA電路124和控制電路Fc。第二DMA電路124用於執行第二記憶體126和主控端110之間的雙向資料傳輸。控制電路Fc用於執行第二記憶體126和記憶體模組140之間的雙向資料傳輸。 The memory controller 120 includes a second processor 122, a second direct memory access (DMA) circuit 124, a second memory 126, a second interface circuit 128, and a control circuit Fc. The second interface circuit 128 is used for data communication with the first interface circuit 118a. The second processor 122 is used for controlling the second DMA circuit 124 and the control circuit Fc according to the command of the main control terminal 110. The second DMA circuit 124 is used to perform bidirectional data transmission between the second memory 126 and the host 110. The control circuit Fc is used to perform bidirectional data transmission between the second memory 126 and the memory module 140.

實作上,第一介面電路118a以及第二介面電路128可以是SATA介面,但本揭示文件不以此為限。在某一實施例中,第一介面電路118b可以是SATA介面、或快速周邊組件互聯(PCI Express)介面。 In practice, the first interface circuit 118a and the second interface circuit 128 may be SATA interfaces, but the present disclosure is not limited thereto. In an embodiment, the first interface circuit 118b may be a SATA interface or a PCI Express interface.

主控端110與記憶體控制器120之間的傳輸資訊包裝為訊框資訊架構(Frame Information Structure,簡稱FIS)。例如,主控端110傳輸給記憶體控制器120的命令為主機至裝置(Host to Device)FIS,而記憶體控制器120回傳至主控端110的確認接收的訊息為裝置至主機(Device to Host)FIS。當記憶體控制器120執行完N(一或多個)個命令時,記憶體控制器120會傳送設置裝置位元(Set Device Bits)FIS至主控端110,以通知主控端110釋放分配給該N個命令的記憶 體位址。 The transmission information between the host 110 and the memory controller 120 is packaged as a frame information structure (FIS). For example, the command transmitted by the host 110 to the memory controller 120 is the host to device (Host to Device) FIS, and the message confirmed by the memory controller 120 sent back to the host 110 is the device to host (Device to Device). to Host) FIS. When the memory controller 120 has executed N (one or more) commands, the memory controller 120 will send the Set Device Bits FIS to the host 110 to notify the host 110 to release the allocation Give the memory of the N commands Body address.

在主控端110的第一記憶體116的容量較少或第一處理器112的處理速度較慢的情況下,若記憶體控制器120發送設置裝置位元FIS的次數過低(例如,於執行過多筆命令後才傳送一個設置裝置位元FIS),則主控端110會因記憶體空間不足(因第一記憶體116尚未被釋放)而持續(多次)發送暫停基元(Hold Primitive)給記憶體控制器120。另一方面,在主控端110記憶體空間較多或處理器的處理速度較快的情況下,則記憶體控制器120發送設置裝置位元FIS的次數愈少,愈能提升主控端110與記憶體控制器120間的傳輸效率。 In the case where the capacity of the first memory 116 of the host 110 is small or the processing speed of the first processor 112 is slow, if the number of times the memory controller 120 sends the setting device bit FIS is too low (for example, in After executing too many commands before sending a setting device bit FIS), the host 110 will continue to (multiple times) send the hold primitive (Hold Primitive) due to insufficient memory space (because the first memory 116 has not been released). ) To the memory controller 120. On the other hand, when the host 110 has more memory space or the processing speed of the processor is faster, the fewer times the memory controller 120 sends the setting device bit FIS, the more the host 110 can be improved. Transmission efficiency with the memory controller 120.

第2圖為依據本揭示文件一實施例的記憶體控制方法的流程圖。第3圖為依據本揭示文件一實施例的設置裝置位元FIS簡化後的示意圖。第2圖的控制方法能令記憶體控制器120依據主控端110的行為來適應性地調整設置裝置位元FIS的傳輸模式(pattern)。請參考第1~3圖,記憶體控制器120可執行來自主控端110的命令CMD1,命令CMD1的內容為自記憶體模組140讀取資料,且命令CMD1的執行過程包含傳輸階段TSa~TSb。 FIG. 2 is a flowchart of a memory control method according to an embodiment of the disclosure. FIG. 3 is a simplified schematic diagram of the setting device bit FIS according to an embodiment of the present disclosure. The control method in FIG. 2 enables the memory controller 120 to adaptively adjust the transmission pattern of the device bit FIS according to the behavior of the host 110. Please refer to Figures 1~3, the memory controller 120 can execute the command CMD1 from the host 110. The content of the command CMD1 is to read data from the memory module 140, and the execution of the command CMD1 includes the transmission stage TSa~ TSb.

在傳輸階段TSa,主控端110會使用主機至裝置FIS傳送命令CMD1至記憶體控制器120(流程2102)。接著,記憶體控制器120會使用裝置至主機FIS向主控端110回覆命令CMD1已被接收(流程2104)。 In the transmission phase TSa, the host 110 will use the host-to-device FIS to send the command CMD1 to the memory controller 120 (process 2102). Then, the memory controller 120 uses the device-to-host FIS to reply to the host 110 that the command CMD1 has been received (process 2104).

記憶體控制器120的控制電路Fc會將對應的資料自記憶體模組140搬移至第二記憶體126以準備傳輸(流程2106)。 The control circuit Fc of the memory controller 120 moves the corresponding data from the memory module 140 to the second memory 126 to prepare for transmission (process 2106).

在傳輸階段TSb,記憶體控制器120傳送直接記憶體存取設置(DMA Setup)FIS至主控端110,以通知主控端110準備開始接收 資料(流程2108)。接著,記憶體控制器120將欲傳輸的資料填入資料FIS之中,並將資料FIS傳送至主控端110(流程2110)。 In the transmission phase TSb, the memory controller 120 sends the direct memory access setup (DMA Setup) FIS to the host 110 to notify the host 110 to start receiving Data (process 2108). Then, the memory controller 120 fills the data to be transmitted into the data FIS, and transmits the data FIS to the host 110 (process 2110).

記憶體控制器120還可執行來自主控端110的命令CMD2,命令CMD2的內容為將資料寫入記憶體模組140,且命令CMD2的執行過程包含傳輸階段TSc~TSd。 The memory controller 120 can also execute the command CMD2 from the host 110. The content of the command CMD2 is to write data into the memory module 140, and the execution process of the command CMD2 includes transmission stages TSc~TSd.

於傳輸階段TSc,主控端110會使用主機至裝置FIS傳送命令CMD2至記憶體控制器120(流程2202)。第二處理器122會使用裝置至主機FIS向主控端110回覆命令CMD2已被接收(流程2204)。 In the transmission stage TSc, the host 110 will use the host-to-device FIS to send the command CMD2 to the memory controller 120 (process 2202). The second processor 122 uses the device-to-host FIS to reply to the host 110 that the command CMD2 has been received (process 2204).

在傳輸階段TSd,記憶體控制器120傳送直接記憶體存取設置FIS至主控端110,以通知主控端110準備開始傳輸資料(流程S2206)。接著,主控端110將欲傳輸的資料填入資料FIS之中,並將資料FIS傳送至記憶體控制器120(流程S2208)。 In the transmission stage TSd, the memory controller 120 transmits the direct memory access setting FIS to the master 110 to notify the master 110 to prepare to start data transmission (process S2206). Then, the host 110 fills the data to be transmitted into the data FIS, and transmits the data FIS to the memory controller 120 (process S2208).

接著,記憶體控制器120會將接收到的資料寫入記憶體模組140(流程2210)。 Then, the memory controller 120 writes the received data into the memory module 140 (process 2210).

在流程S230中,記憶體控制器120傳送設置裝置位元FIS至主控端110,以使主控端110釋放第一記憶體116中對應於命令CMD1和CMD2的記憶體位址。請參照第3圖,傳送設置裝置位元FIS包含檔頭310和欄位320,其中欄位320的大小為32位元。檔頭310可包含錯誤項目(Error Entry)、FIS類型項目(FIS Type Entry)、以及中斷項目(Interrupt Entry)等等。欄位320的每個位元對應於一筆主控端110發出的命令。若位元的數值被設定為1,則代表主控端110需要釋放對應的記憶體位址,而若位元的數值被設定為0,則代表主控端110無需釋放對應的記憶體位址。 In the process S230, the memory controller 120 transmits the setting device bit FIS to the host 110, so that the host 110 releases the memory addresses in the first memory 116 corresponding to the commands CMD1 and CMD2. Please refer to Figure 3, the transmission setting device bit FIS includes a file header 310 and a field 320, where the size of the field 320 is 32 bits. The file header 310 may include an error entry (Error Entry), an FIS type entry (FIS Type Entry), an interrupt entry (Interrupt Entry), and so on. Each bit in the field 320 corresponds to a command issued by the host 110. If the value of the bit is set to 1, it means that the host 110 needs to release the corresponding memory address, and if the value of the bit is set to 0, it means that the host 110 does not need to release the corresponding memory address.

在本實施例中,記憶體控制器120會將傳送設置裝置位 元FIS中分別對應於命令CMD1和CMD2的二個位元(例如,第一位元和第二位元)設置為1,並將其他位元(例如,第三位元至第三十二位元)設置為0。 In this embodiment, the memory controller 120 will send the device location The two bits (for example, the first bit and the second bit) in the element FIS corresponding to the commands CMD1 and CMD2 are set to 1, and the other bits (for example, the third bit to the thirty-second bit) Yuan) is set to 0.

在某一實施例中,FIS的種類與內容是由第1圖的第一處理器116和第二處理器122決定,而FIS的傳輸則是由第一DMA電路114和第二DMA電路124來執行。當第一DMA電路114和第二DMA電路124互相傳輸資料FIS時,第一處理器112和第二處理器122無需介入。如此一來,第一處理器112和第二處理器122的運算效率可以獲得提升。 In an embodiment, the type and content of FIS are determined by the first processor 116 and the second processor 122 in Figure 1, and the transmission of FIS is performed by the first DMA circuit 114 and the second DMA circuit 124. carried out. When the first DMA circuit 114 and the second DMA circuit 124 transfer data FIS to each other, the first processor 112 and the second processor 122 do not need to intervene. In this way, the computing efficiency of the first processor 112 and the second processor 122 can be improved.

例如,當主控端110於流程2108中接收到直接記憶體存取設置FIS時,第一處理器112可將包含第一記憶體116的位址的物理區域描述表格(Physical Region Description Table)載入第一DMA電路114之中,以指定準備接收的資料大小與欲儲存的位址。接著,第一DMA電路114於流程2110中會自第二DMA電路124接收資料FIS。 For example, when the host 110 receives the direct memory access setting FIS in the process 2108, the first processor 112 may load the physical region description table (Physical Region Description Table) containing the address of the first memory 116 Enter the first DMA circuit 114 to specify the size of the data to be received and the address to be stored. Then, the first DMA circuit 114 receives the data FIS from the second DMA circuit 124 in the process 2110.

又例如,當主控端110於流程2206中接收到直接記憶體存取設置FIS時,第一處理器112會將欲寫入的資料於第一記憶體116中的位址載入至第一DMA電路114。接著,第一DMA電路114會於流程2208中利用資料FIS將欲寫入的資料傳送至第二DMA電路124。 For another example, when the host 110 receives the direct memory access setting FIS in the process 2206, the first processor 112 loads the address of the data to be written in the first memory 116 into the first DMA circuit 114. Then, the first DMA circuit 114 uses the data FIS to transfer the data to be written to the second DMA circuit 124 in the process 2208.

在一實施例中,當電腦系統100支援原生命令排序技術,第二處理器122尚將來自主控端110的多筆命令存入佇列並調整執行順序。換言之,第2圖的傳輸階段之執行順序僅為示例性繪示,並可依據實際狀況進行調整。例如,在主控端110一次傳輸多筆命令的情況下,傳輸階段TSb和TSc可以互相調換順序。 In one embodiment, when the computer system 100 supports the native command ordering technology, the second processor 122 still stores multiple commands from the autonomous control terminal 110 in a queue and adjusts the execution order. In other words, the execution sequence of the transmission phase in FIG. 2 is only an example, and can be adjusted according to actual conditions. For example, in the case where the master 110 transmits multiple commands at a time, the transmission phases TSb and TSc can exchange the order with each other.

由上述可知,在執行流程230之前,記憶體控制器120共完成了來自主控端110的兩筆命令CMD1和CMD2,且每筆命令至少 包含兩個傳輸階段。然而,第2圖中完成的命令數量僅為示範性的實施例。在每次執行第2圖的記憶體控制方法時,記憶體控制器120實際上可先完成總共N筆來自主控端110的命令(亦即,完成至少2N個傳輸階段),然後再進行流程230,且N為小於或等於32的正整數。在此情況下,於流程230中,記憶體控制器120會將欄位320中對應的N個位元設置為1,並將其他位元設置為0,以通知主控端110釋放第一記憶體116中分別對應於該N筆命令的記憶體位址。在後續繼續說明第2圖的記憶體控制方法的段落中,將假設記憶體控制器120在執行流程230之前,已完成了來自主控端110的N筆命令。 It can be seen from the above that before executing the process 230, the memory controller 120 has completed two commands CMD1 and CMD2 from the main control terminal 110, and each command is at least Contains two transmission stages. However, the number of completed commands in Figure 2 is only an exemplary embodiment. Each time the memory control method of Figure 2 is executed, the memory controller 120 can actually complete a total of N commands from the host 110 (that is, complete at least 2N transmission stages), and then proceed to the process 230, and N is a positive integer less than or equal to 32. In this case, in the process 230, the memory controller 120 sets the corresponding N bits in the field 320 to 1, and sets other bits to 0 to notify the host 110 to release the first memory The memory addresses in the body 116 respectively correspond to the N commands. In the subsequent paragraphs that continue to describe the memory control method of FIG. 2, it will be assumed that the memory controller 120 has completed N commands from the host 110 before executing the process 230.

在流程240中,記憶體控制器120會計算第二介面電路128的傳輸速率。具體而言,第二DMA電路124會於每筆資料的傳輸起始與結束時通知第二處理器122,例如在流程2110和流程2208的起始與結束時通知第二處理器122。因此,記憶體控制器120可計算執行該N筆命令時第二DMA電路124處於忙碌(busy)狀態的一時間總和。記憶體控制器120會進一步依據該時間總和與執行該N筆命令時傳輸的資料FIS大小總和,來計算第二介面電路128的傳輸速率。 In the process 240, the memory controller 120 calculates the transfer rate of the second interface circuit 128. Specifically, the second DMA circuit 124 notifies the second processor 122 at the start and end of each data transfer, for example, at the start and end of the process 2110 and the process 2208. Therefore, the memory controller 120 can calculate the total time that the second DMA circuit 124 is in a busy state when the N commands are executed. The memory controller 120 further calculates the transmission rate of the second interface circuit 128 based on the sum of the time and the sum of the FIS size of the data transmitted when the N commands are executed.

接著,在流程250中,記憶體控制器120會將第二介面電路128的傳輸速率與預設值進行比較。若比較結果為第二介面電路128的傳輸速率低於預設值,則記憶體控制器120會調整傳送設置裝置位元FIS之前(亦即,流程230之前)完成的命令數量。具體的調整方法將搭配第4A圖和第4B圖來進一步說明。當然,若比較結果為第二介面電路128的傳輸速率高於預設值,則記憶體控制器120亦可調高傳送設置裝置位元FIS之前完成的命令數量,直到完成傳輸速度的最佳化。 Then, in the process 250, the memory controller 120 compares the transmission rate of the second interface circuit 128 with a preset value. If the comparison result is that the transmission rate of the second interface circuit 128 is lower than the preset value, the memory controller 120 will adjust the number of commands completed before the setting device bit FIS (that is, before the process 230). The specific adjustment method will be further explained with Figure 4A and Figure 4B. Of course, if the comparison result is that the transmission rate of the second interface circuit 128 is higher than the preset value, the memory controller 120 can also increase the number of commands completed before transmitting the setting device bit FIS until the transmission speed is optimized. .

如第4A圖所示,記憶體控制器120預設為每完成N筆命 令(例如,命令CMD[1]~CMD[N]或是CMD[N+1]~CMD[2N])後傳送一次設置裝置位元FIS。亦即,記憶體控制器120會每完成至少2N個傳輸階段(例如,傳輸階段TS[1]~TS[2N]或是TS[2N+1]~TS[4N])後傳送一次設置裝置位元FIS。 As shown in FIG. 4A, the memory controller 120 is preset to complete every N commands Command (for example, command CMD[1]~CMD[N] or CMD[N+1]~CMD[2N]) and then send it once to set the device bit FIS. That is, the memory controller 120 will transmit the setting device position once after completing at least 2N transmission stages (for example, transmission stage TS[1]~TS[2N] or TS[2N+1]~TS[4N]) Yuan FIS.

若第二介面電路128的傳輸速率在第2圖的流程250中被判斷為低於預設值,如第4B圖所示,記憶體控制器120會切換為每完成M筆命令(例如,命令CMD[N+1]~CMD[N+M])後傳送一次設置裝置位元FIS,其中M為不等於N之正整數且M小於或等於32。亦即,記憶體控制器120會切換為每完成至少2M個傳輸階段(例如,傳輸階段TS[2N+1]~TS[2N+2M])後傳送一次設置裝置位元FIS。此時,當再度執行第2圖的流程230時,記憶體控制器120會將設置裝置位元FIS中被設置為1的位元數量由N個調整為M個,以通知裝置端110釋放對應於該M筆命令(例如,命令CMD[N+1]~CMD[N+M])的記憶體位址。 If the transmission rate of the second interface circuit 128 is judged to be lower than the preset value in the process 250 of FIG. 2, as shown in FIG. 4B, the memory controller 120 will switch to complete M commands (for example, command After CMD[N+1]~CMD[N+M]), send the setting device bit FIS once, where M is a positive integer not equal to N and M is less than or equal to 32. That is, the memory controller 120 will switch to transmit the set device bit FIS once after completing at least 2M transmission stages (for example, the transmission stages TS[2N+1]~TS[2N+2M]). At this time, when the process 230 in Figure 2 is executed again, the memory controller 120 will adjust the number of bits set to 1 in the device bit FIS from N to M to notify the device 110 to release the corresponding The memory address of the M commands (for example, the command CMD[N+1]~CMD[N+M]).

電腦系統100可以多次執行第2圖的記憶體控制方法,以使記憶體控制器120適應性地依據主控端110的組態優化資料傳輸效率。前述的組態指的是主控端110的第一處理器112的處理器架構、南北橋晶片、第一記憶體116的記憶體大小、進階主機控制器介面(Advanced Host Controller Interface)架構、作業系統、驅動軟體、或有無啟動NCQ技術等等要素的組合。在主控端110的隨機存取記憶體較小或運算速度較慢的某一實施例中,電腦系統100可以減少N之數值(例如,將N由16調整至7)以增加主控端110釋放記憶體位址的次數,進而減少主控端110因來不及釋放記憶體而導致記憶體空間不足而要求暫停資料傳輸的次數。在主控端110的隨機存取記憶體較大或運算速度較快的另一實施例中,電腦系統100可以增加N之數值(例如,將N由16 調整至30),以可減少記憶體控制器120為了傳送設置裝置位元FIS而耗費的傳輸時間以及提升主控端110和記憶體控制器120之間的資料傳輸效率,並提升記憶體控制器120的運算效能。 The computer system 100 can execute the memory control method of FIG. 2 many times, so that the memory controller 120 can adaptively optimize the data transmission efficiency according to the configuration of the host 110. The foregoing configuration refers to the processor architecture of the first processor 112 of the host 110, the north-south bridge chip, the memory size of the first memory 116, the advanced host controller interface architecture, A combination of operating system, driver software, or whether NCQ technology is activated or not. In an embodiment where the random access memory of the host 110 is small or the operation speed is slow, the computer system 100 can reduce the value of N (for example, adjust N from 16 to 7) to increase the host 110 The number of times the memory address is released, thereby reducing the number of times that the host 110 requests to suspend data transmission due to insufficient memory space due to the time to release the memory. In another embodiment where the random access memory of the host 110 is larger or the calculation speed is faster, the computer system 100 can increase the value of N (for example, change N from 16 Adjust to 30) to reduce the transmission time consumed by the memory controller 120 to transmit and set the device bit FIS, improve the data transmission efficiency between the host 110 and the memory controller 120, and improve the memory controller 120 computing performance.

此外,在記憶體控制器120對N的數值進行優化後,且當N的數值大於或等於2時,記憶體控制器120會判定主控端係有支援原生命令排序技術。然而,在支援原生命令排序技術的眾多主控端中,有些主控端對於亂序回傳的資料具有較高的處理效率,而另外一些主控端則對於順序回傳的資料具有較高的處理效率。 In addition, after the memory controller 120 optimizes the value of N, and when the value of N is greater than or equal to 2, the memory controller 120 determines that the host supports native command sequencing technology. However, among the many masters that support native ordering technology, some masters have higher processing efficiency for the data returned in disorder, while others have higher processing efficiency for the data returned in sequence. Processing efficiency.

第5圖為依據本揭示文件另一實施例的記憶體控制方法的流程圖。第5圖的記憶體控制方法能令記憶體控制器120依據主控端110的行為而適應性地調整回傳資料的順序。在第5圖的實施例中,記憶體控制器120會執行命令CMD1和CMD2,且命令CMD1和CMD2的內容皆為自記憶體模組140中讀取資料。命令CMD1的執行過程包含傳輸階段TSa和TSc,而命令CMD2的執行過程則包含傳輸階段TSb和TSd。 FIG. 5 is a flowchart of a memory control method according to another embodiment of the present disclosure. The memory control method of FIG. 5 enables the memory controller 120 to adaptively adjust the order of returning data according to the behavior of the host 110. In the embodiment of FIG. 5, the memory controller 120 executes the commands CMD1 and CMD2, and the contents of the commands CMD1 and CMD2 are read from the memory module 140. The execution process of command CMD1 includes transmission phases TSa and TSc, while the execution process of command CMD2 includes transmission phases TSb and TSd.

於傳輸階段TSa中,主控端110會使用主機至裝置FIS傳送命令CMD1至記憶體控制器120(流程5102)。記憶體控制器120會使用裝置至主機FIS向主控端110回覆命令CMD1已被接收(流程5104)。接著,於傳輸階段TSb中,主控端110會使用主機至裝置FIS傳送命令CMD2至記憶體控制器120(流程5202)。記憶體控制器120會使用裝置至主機FIS向主控端110回覆命令CMD2已被接收(流程5204)。 In the transmission stage TSa, the host 110 uses the host-to-device FIS to send the command CMD1 to the memory controller 120 (process 5102). The memory controller 120 uses the device-to-host FIS to reply to the host 110 that the command CMD1 has been received (process 5104). Then, in the transmission stage TSb, the host 110 will use the host-to-device FIS to send the command CMD2 to the memory controller 120 (process 5202). The memory controller 120 uses the device-to-host FIS to reply to the host 110 that the command CMD2 has been received (process 5204).

在本實施例中,由於資料大小或儲存位址等等因素,記憶體控制器120較快自記憶體模組140中存取到對應於命令CMD2的資料,且較慢存取到對應於命令CMD1的資料。亦即,控制電路Fc會較 快將對應於命令CMD2的資料自記憶體模組140搬移至第二記憶體126以等待傳輸(流程530)。 In this embodiment, due to factors such as data size or storage address, the memory controller 120 accesses the data corresponding to the command CMD2 from the memory module 140 faster, and accesses the data corresponding to the command CMD2 more slowly. CMD1 information. That is, the control circuit Fc will be The data corresponding to the command CMD2 is quickly moved from the memory module 140 to the second memory 126 to wait for transmission (process 530).

如前所述,記憶體控制器120能決定來自主控端110的多個命令的執行順序,而不一定會按照接收到該些命令的順序來執行。因此,記憶體控制器120接著會執行傳輸階段TSc,以將對應於命令CMD2的資料傳送至主控端110。在傳輸階段TSc中,流程5206和流程5208分別相似於第2圖的流程2108和流程2110,差異在於:流程5208中被傳輸的是對應於命令CMD2的資料FIS。為簡潔起見,流程5206和流程5208的其餘內容在此不重複贅述。 As mentioned above, the memory controller 120 can determine the order of execution of the multiple commands from the host 110, but not necessarily the order in which the commands are received. Therefore, the memory controller 120 then executes the transmission stage TSc to transmit the data corresponding to the command CMD2 to the host 110. In the transmission stage TSc, the process 5206 and the process 5208 are respectively similar to the process 2108 and the process 2110 in FIG. 2, the difference is that the data FIS corresponding to the command CMD2 is transmitted in the process 5208. For the sake of brevity, the rest of the process 5206 and process 5208 will not be repeated here.

接著,控制電路Fc會將對應於命令CMD1的資料自記憶體模組140搬移至第二記憶體126以等待傳輸(流程540)。記憶體控制器120接著會執行傳輸階段TSd,以將對應於命令CMD1的資料傳送至主控端110。在傳輸階段TSd中,流程5106和流程5108分別相似於第2圖的流程2108和流程2110,差異在於:流程5108中被傳輸的是對應於命令CMD1的資料FIS。為簡潔起見,流程5106和流程5108的其餘內容在此不重複贅述。 Then, the control circuit Fc moves the data corresponding to the command CMD1 from the memory module 140 to the second memory 126 to wait for transmission (process 540). The memory controller 120 then executes the transmission stage TSd to transmit the data corresponding to the command CMD1 to the host 110. In the transmission stage TSd, the process 5106 and the process 5108 are similar to the process 2108 and the process 2110 in FIG. 2 respectively. The difference is that the data FIS corresponding to the command CMD1 is transmitted in the process 5108. For the sake of brevity, the rest of the process 5106 and process 5108 will not be repeated here.

另外,第5圖的流程550相似於第2圖的流程230,為簡潔起見,在此亦不重複贅述。 In addition, the process 550 in FIG. 5 is similar to the process 230 in FIG.

由上述可知,記憶體控制器120可以不依據命令CMD1和CMD2的接收順序來傳送對應的資料。記憶體控制器120可以藉由優先傳輸先存取到的資料來提升工作效率。 It can be seen from the above that the memory controller 120 may not transmit corresponding data according to the order in which the commands CMD1 and CMD2 are received. The memory controller 120 can improve work efficiency by preferentially transmitting the first accessed data.

第5圖的兩個命令CMD1和CMD2僅是為了方便說明的示例性實施例。實作上,在每次執行第5圖的記憶體控制方法時,電腦系統100可先完成總共N筆命令,然後再進行流程550,且N為小於或等 於32的正整數。在後續繼續說明第5圖的記憶體控制方法的段落中,將假設記憶體控制器120在執行流程550之前,已完成了來自主控端110的N筆命令。 The two commands CMD1 and CMD2 in Fig. 5 are merely exemplary embodiments for convenience of description. In practice, each time the memory control method shown in Figure 5 is executed, the computer system 100 can complete a total of N commands before proceeding to the process 550, and N is less than or etc. A positive integer within 32. In the subsequent paragraphs that continue to describe the memory control method in FIG. 5, it will be assumed that the memory controller 120 has completed N commands from the main control terminal 110 before executing the process 550.

在流程560中,記憶體控制器120以相似於第2圖的流程240的方法計算第二介面電路128的傳輸速率。在流程570中,記憶體控制器120會將第二介面電路128的傳輸速率和預設值進行比較。若第二介面電路128的傳輸速率小於預設值,且前述的N筆命令中包含了i筆讀取命令,則記憶體控制器120會調整對應於該i筆讀取命令的i筆資料的傳送順序。 In the process 560, the memory controller 120 calculates the transmission rate of the second interface circuit 128 in a method similar to the process 240 in FIG. In the process 570, the memory controller 120 compares the transmission rate of the second interface circuit 128 with a preset value. If the transmission rate of the second interface circuit 128 is less than the preset value, and the aforementioned N commands include i read commands, the memory controller 120 will adjust the i data corresponding to the i read commands. Delivery order.

具體而言,記憶體控制器120會將該i筆資料的傳送順序,由對應於該i筆資料的存取順序(亦即,被搬移入第二記憶體126的順序),調整為對應於該i筆讀取命令的接收順序,其中i為小於或等於N的正整數。例如,記憶體控制器120會將第5圖的傳輸階段TSc和TSd的執行順序互相調換。詳細的調整方法將搭配第6A圖和第6B圖來進一步說明。 Specifically, the memory controller 120 adjusts the transfer sequence of the i data from the access sequence corresponding to the i data (that is, the sequence of being moved into the second memory 126) to correspond to The receiving sequence of the i read commands, where i is a positive integer less than or equal to N. For example, the memory controller 120 swaps the execution order of TSc and TSd in the transmission stages of FIG. 5 with each other. The detailed adjustment method will be further explained with Figure 6A and Figure 6B.

為方面說明,第6A圖和第6B圖僅繪示了讀取命令CMD[1]~CMD[N]以及對應的傳輸階段TS[1]~TS[2N],並省略了寫入命令。如第6A圖所示,記憶體控制器120預設優先傳送先存取到的資料。亦即,記憶體控制器120傳送資料FIS的順序是對應於對應的資料被搬移入第二記憶體126的順序(例如,3,1,2,...,N)。 To illustrate, Fig. 6A and Fig. 6B only show the read commands CMD[1]~CMD[N] and the corresponding transmission stages TS[1]~TS[2N], and the write commands are omitted. As shown in FIG. 6A, the memory controller 120 presets to give priority to the data that is accessed first. That is, the order in which the memory controller 120 transmits the data FIS corresponds to the order in which the corresponding data is moved into the second memory 126 (for example, 3, 1, 2, ..., N).

若第二介面電路128的傳輸速率於流程560中被判斷為小於預設值時,記憶體控制器120會將傳送資料FIS的順序切換為對應於對應的讀取命令的接收順序(亦即,1,2,3,...,N)。 If the transmission rate of the second interface circuit 128 is determined to be less than the preset value in the process 560, the memory controller 120 will switch the order of transmitting the data FIS to the order of receiving the corresponding read command (ie, 1,2,3,...,N).

在一實施例中,由於直接記憶體存取設置FIS與資料FIS 是於同一傳輸階段中傳輸,所以記憶體控制器120在切換資料FIS的傳送順序時,亦會對應切換直接記憶體存取設置FIS的傳送順序。亦即,記憶體控制器120會將直接記憶體存取設置FIS的傳送順序,由對應於對應的資料的存取順序,切換為對應於對應的讀取命令的接收順序。 In one embodiment, the FIS and data FIS are set due to direct memory access It is transmitted in the same transmission stage, so when the memory controller 120 switches the transmission sequence of the data FIS, it will also switch the transmission sequence of the direct memory access setting FIS accordingly. That is, the memory controller 120 switches the transmission sequence of the direct memory access setting FIS from the access sequence corresponding to the corresponding data to the receiving sequence corresponding to the corresponding read command.

在某些實施例中,非揮發記憶體控制器120預設為依據讀取命令的接收順序來傳送對應的資料FIS及/或直接記憶體存取設置FIS。當第二介面電路128的傳輸速率小於預設值時,非揮發記憶體控制器120會將資料FIS及/或直接記憶體存取設置FIS的傳輸順序切換為對應於對應的資料的存取順序。 In some embodiments, the non-volatile memory controller 120 is preset to transmit the corresponding data FIS and/or direct memory access setting FIS according to the receiving order of the read command. When the transmission rate of the second interface circuit 128 is less than the preset value, the non-volatile memory controller 120 switches the transmission sequence of the data FIS and/or the direct memory access setting FIS to correspond to the corresponding data access sequence .

在另外一些實施例中,當第二介面電路128的傳輸速率高於預設值時,非揮發記憶體控制器120也可以不切換資料FIS及/或直接記憶體存取設置FIS的傳輸順序。 In other embodiments, when the transmission rate of the second interface circuit 128 is higher than the preset value, the non-volatile memory controller 120 may not switch the data FIS and/or direct memory access to set the transmission sequence of the FIS.

請注意,第2圖和第5圖的記憶體控制方法可以互相結合。第2圖的流程250可以包含第5圖的流程570中的運作,而第5圖的流程570也可以包含第2圖的流程250中的運作。亦即,在某些實施例中,記憶體控制方法可以一併調整記憶體控制器120傳送設置裝置位元FIS的模式以及資料FIS的傳輸順序。 Please note that the memory control methods in Figure 2 and Figure 5 can be combined with each other. The process 250 in FIG. 2 may include the operations in the process 570 in FIG. 5, and the process 570 in FIG. 5 may also include the operations in the process 250 in FIG. That is, in some embodiments, the memory control method can also adjust the transmission mode of the setting device bit FIS and the transmission sequence of the data FIS by the memory controller 120.

在說明書及申請專利範圍中使用了某些詞彙來指稱特定的元件。然而,所屬技術領域中具有通常知識者應可理解,同樣的元件可能會用不同的名詞來稱呼。說明書及申請專利範圍並不以名稱的差異做為區分元件的方式,而是以元件在功能上的差異來做為區分的基準。在說明書及申請專利範圍所提及的「包含」為開放式的用語,故應解釋成「包含但不限定於」。另外,「耦接」在此包含任何直接及間接的連接手段。因此,若文中描述第一元件耦接於第二元件,則 代表第一元件可通過電性連接或無線傳輸、光學傳輸等信號連接方式而直接地連接於第二元件,或者通過其他元件或連接手段間接地電性或信號連接至該第二元件。 Certain words are used in the specification and the scope of the patent application to refer to specific elements. However, those with ordinary knowledge in the technical field should understand that the same element may be called by different terms. The specification and the scope of the patent application do not use the difference in names as a way of distinguishing elements, but the difference in function of the elements as the basis for distinguishing. The "including" mentioned in the specification and the scope of the patent application is an open term, so it should be interpreted as "including but not limited to". In addition, "coupling" here includes any direct and indirect connection means. Therefore, if the text describes that the first element is coupled to the second element, then It means that the first element can be directly connected to the second element through electrical connection, wireless transmission, optical transmission, or other signal connection methods, or indirectly electrically or signally connected to the second element through other elements or connection means.

在此所使用的「及/或」的描述方式,包含所列舉的其中之一或多個項目的任意組合。另外,除非說明書中特別指明,否則任何單數格的用語都同時包含複數格的涵義。 The description method of "and/or" used herein includes any combination of one or more of the listed items. In addition, unless otherwise specified in the specification, any term in the singular case also includes the meaning of the plural case.

以上僅為本揭示文件的較佳實施例,凡依本揭示文件請求項所做的均等變化與修飾,皆應屬本揭示文件的涵蓋範圍。 The above are only the preferred embodiments of the present disclosure, and all equal changes and modifications made in accordance with the requirements of the present disclosure should fall within the scope of the disclosure.

100‧‧‧電腦系統 100‧‧‧Computer system

110‧‧‧主控端 110‧‧‧Host

112‧‧‧第一處理器 112‧‧‧First processor

114‧‧‧第一直接記憶體存取(DMA)電路 114‧‧‧The first direct memory access (DMA) circuit

116‧‧‧第一記憶體 116‧‧‧First memory

118a‧‧‧第一介面電路 118a‧‧‧The first interface circuit

118b‧‧‧第一介面電路 118b‧‧‧The first interface circuit

120‧‧‧記憶體控制器 120‧‧‧Memory Controller

122‧‧‧第二處理器 122‧‧‧Second processor

124‧‧‧第二直接記憶體存取(DMA)電路 124‧‧‧Second direct memory access (DMA) circuit

126‧‧‧第二記憶體 126‧‧‧Second memory

128‧‧‧第二介面電路 128‧‧‧Second interface circuit

Fc‧‧‧控制電路 Fc‧‧‧Control circuit

130‧‧‧儲存裝置 130‧‧‧Storage device

140‧‧‧記憶體模組 140‧‧‧Memory Module

Claims (10)

一種記憶體控制器,其包含:一介面電路,用於和一主控端進行通信;以及一處理器,其中當該處理器執行完來自該主控端的N筆命令時,該記憶體控制器通知該主控端釋放對應於該N筆命令的記憶體位址,且N為正整數;其中該處理器將該介面電路的一資料傳輸速率與一預設值進行比較以產生一比較結果,其中該處理器依據該比較結果來調整N的數值。 A memory controller includes: an interface circuit for communicating with a master control terminal; and a processor, wherein when the processor finishes executing N commands from the master control terminal, the memory controller Notify the host to release the memory address corresponding to the N commands, and N is a positive integer; wherein the processor compares a data transmission rate of the interface circuit with a preset value to generate a comparison result, wherein The processor adjusts the value of N according to the comparison result. 如請求項1所述的記憶體控制器,其中,該記憶體控制器傳送一設置裝置位元訊框資訊架構(Frame Information Structure,FIS)至該主控端,以通知該主控端釋放對應於該N筆命令的記憶體位址,其中該設置裝置位元FIS包含一第一欄位,該第一欄位包含多個位元,且該多個位元分別代表來自該主控端的該N筆命令中的一筆命令。 The memory controller according to claim 1, wherein the memory controller sends a setting device frame information structure (FIS) to the host to notify the host to release the corresponding In the memory address of the N commands, the setting device bit FIS includes a first field, the first field includes a plurality of bits, and the plurality of bits respectively represent the N from the host One of the pen commands. 如請求項2所述的記憶體控制器,其中,該記憶體控制器依據該比較結果在一第一規則及一第二規則之間切換以決定如何傳送對應於該N筆命令中之多筆讀取命令的多個資料FIS,其中該第一規則包含:該多個資料FIS的傳送順序係對應於該記憶體控制器自一記憶體模組存取對應於該多筆讀取命令的多筆資料的順序; 其中該第二規則包含:該多個資料FIS的傳送順序對應於該記憶體控制器自該主控端接收該多筆讀取命令的順序。 The memory controller according to claim 2, wherein the memory controller switches between a first rule and a second rule according to the comparison result to determine how to transmit a plurality of commands corresponding to the N commands Read a plurality of data FIS of the command, wherein the first rule includes: the transmission sequence of the plurality of data FIS is corresponding to the memory controller accessing a plurality of data corresponding to the plurality of read commands from a memory module The order of the data; The second rule includes: the transmission sequence of the multiple data FIS corresponds to the sequence in which the memory controller receives the multiple read commands from the host. 如請求項3所述的記憶體控制器,其中,該記憶體控制器傳送對應於該多筆讀取命令的多個直接記憶體存取設置FIS至該主控端,且該第一規則另包含:該多個直接記憶體存取設置FIS的傳送順序對應於以下順序的其一:該記憶體控制器存取該多筆資料的順序,以及該記憶體控制器自該主控端接收該多筆讀取命令的順序;其中該第二規則另包含:該多個直接記憶體存取設置FIS的傳送順序對應於以下順序的另一:該記憶體控制器存取該多筆資料的順序,以及該記憶體控制器自該主控端接收該多筆讀取命令的順序。 The memory controller according to claim 3, wherein the memory controller transmits a plurality of direct memory access settings FIS corresponding to the plurality of read commands to the host, and the first rule further Including: the transmission sequence of the multiple direct memory access setting FIS corresponds to one of the following sequences: the sequence of the memory controller accessing the multiple data, and the memory controller receives the data from the host The sequence of multiple read commands; wherein the second rule further includes: the transmission sequence of the multiple direct memory access setting FIS corresponds to the other of the following sequence: the sequence of the memory controller accessing the multiple data , And the sequence in which the memory controller receives the multiple read commands from the host. 如請求項1所述的記憶體控制器,其中,該處理器計算對應於該N筆命令的多個資料FIS所使用的一時間長度,其中該處理器依據該時間長度與該多個資料FIS的大小來計算出該資料傳輸速率。 The memory controller according to claim 1, wherein the processor calculates a length of time used by the plurality of data FIS corresponding to the N commands, wherein the processor calculates the length of time and the plurality of data FIS To calculate the data transfer rate. 如請求項1所述的記憶體控制器,其中,該處理器依據該比較結果來調整N的數值,且當N的數值大於1時,該處理器判定為該主控端的組態係支援一原生命令排序(Native Command Queuing,NCQ)技術。 The memory controller of claim 1, wherein the processor adjusts the value of N according to the comparison result, and when the value of N is greater than 1, the processor determines that the configuration of the host supports a Native Command Queuing (NCQ) technology. 一種控制方法,係應用於一記憶體控制器,該記憶 體控制器包含一介面電路以及一處理器,該方法包含:利用該介面電路接收來自一主控端的N筆命令;當該處理器執行完該N筆命令時,利用該處理器通知該主控端釋放對應於該N筆命令的記憶體位址,且N為正整數;利用該處理器將該介面電路的一資料傳輸速率與一預設值進行比較以產生一比較結果;以及利用該處理器依據該比較結果來調整N的數值。 A control method applied to a memory controller, the memory The body controller includes an interface circuit and a processor, and the method includes: using the interface circuit to receive N commands from a host; when the processor finishes executing the N commands, using the processor to notify the host The terminal releases the memory address corresponding to the N commands, and N is a positive integer; uses the processor to compare a data transmission rate of the interface circuit with a preset value to generate a comparison result; and uses the processor Adjust the value of N according to the comparison result. 如請求項7所述的方法,其中,通知該主控端釋放對應於該N筆命令的記憶體位址的流程包含:利用該處理器傳送一設置裝置位元FIS至該主控端,其中該設置裝置位元FIS包含一第一欄位,該第一欄位包含多個位元,且該多個位元分別用於代表來自該主控端的該N筆命令中的一筆命令。 The method according to claim 7, wherein the process of notifying the host to release the memory address corresponding to the N commands includes: using the processor to transmit a setting device bit FIS to the host, wherein the The setting device bit FIS includes a first field, the first field includes a plurality of bits, and the plurality of bits are respectively used to represent one of the N commands from the host. 如請求項8所述的方法,其另包含:依據該比較結果在一第一規則及一第二規則之間切換以決定如何傳送對應於該N筆命令中之多筆讀取命令的多個資料FIS,其中該第一規則包含:該多個資料FIS的傳送順序係對應於該記憶體控制器自一記憶體模組存取對應於該多筆讀取命令的多筆資料的順序;其中該第二規則包含:該多個資料FIS的傳送順序對應於該記憶體控制器自該主控端接收該多筆讀取命令的順序。 The method according to claim 8, further comprising: switching between a first rule and a second rule according to the comparison result to determine how to transmit a plurality of read commands corresponding to a plurality of the N commands Data FIS, wherein the first rule includes: the transmission sequence of the multiple data FIS corresponds to the sequence in which the memory controller accesses multiple data corresponding to the multiple read commands from a memory module; wherein The second rule includes: the transmission sequence of the multiple data FIS corresponds to the sequence in which the memory controller receives the multiple read commands from the host. 一種電腦系統,其包含: 一主控端;一記憶體控制器,包含:一介面電路,用於和該主控端進行通信;一處理器,其中當該處理器執行完來自該主控端的N筆命令時,該記憶體控制器通知該主控端釋放對應於該N筆命令的記憶體位址,且N為正整數;以及一記憶體模組,耦接於該記憶體控制器;其中,該處理器將該介面電路的一資料傳輸速率與一預設值進行比較以產生一比較結果,該處理器依據該比較結果調整N的數值。 A computer system including: A main control terminal; a memory controller including: an interface circuit for communicating with the main control terminal; a processor, wherein when the processor finishes executing N commands from the main control terminal, the memory The body controller notifies the host to release the memory address corresponding to the N commands, and N is a positive integer; and a memory module coupled to the memory controller; wherein, the processor uses the interface A data transmission rate of the circuit is compared with a preset value to generate a comparison result, and the processor adjusts the value of N according to the comparison result.
TW108119564A 2019-06-05 2019-06-05 Memory controller, memory controlling method, and computer system TWI714116B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW108119564A TWI714116B (en) 2019-06-05 2019-06-05 Memory controller, memory controlling method, and computer system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW108119564A TWI714116B (en) 2019-06-05 2019-06-05 Memory controller, memory controlling method, and computer system

Publications (2)

Publication Number Publication Date
TW202046112A true TW202046112A (en) 2020-12-16
TWI714116B TWI714116B (en) 2020-12-21

Family

ID=74668296

Family Applications (1)

Application Number Title Priority Date Filing Date
TW108119564A TWI714116B (en) 2019-06-05 2019-06-05 Memory controller, memory controlling method, and computer system

Country Status (1)

Country Link
TW (1) TWI714116B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI813311B (en) * 2022-05-25 2023-08-21 瑞昱半導體股份有限公司 Nand flash memory controller

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6662280B1 (en) * 1999-11-10 2003-12-09 Advanced Micro Devices, Inc. Store buffer which forwards data based on index and optional way match
US10154317B2 (en) * 2016-07-05 2018-12-11 BoxCast, LLC System, method, and protocol for transmission of video and audio data
KR20190032809A (en) * 2017-09-20 2019-03-28 에스케이하이닉스 주식회사 Memory system and operating method thereof

Also Published As

Publication number Publication date
TWI714116B (en) 2020-12-21

Similar Documents

Publication Publication Date Title
JP6817273B2 (en) Devices and methods for providing cache transfer by a non-volatile high capacity memory system
US10453540B2 (en) Method and apparatus to prioritize read response time in a power-limited storage device
US9304691B2 (en) Memory system and bank interleaving method
US20200089537A1 (en) Apparatus and method for bandwidth allocation and quality of service management in a storage device shared by multiple tenants
US11036412B2 (en) Dynamically changing between latency-focused read operation and bandwidth-focused read operation
US20200409601A1 (en) Hold of Write Commands in Zoned Namespaces
KR20160049200A (en) Method for operating data storage device, mobile computing device having the same, and method of the mobile computing device
US8060669B2 (en) Memory controller with automatic command processing unit and memory system including the same
TW201131368A (en) Command queue for peripheral component
KR20160025292A (en) Data storage device, data processing system including the same and operating method thereof
US20220350655A1 (en) Controller and memory system having the same
JP2021125248A (en) Controller, controller action method, and storage device including controller
CN114385235A (en) Command eviction using host memory buffering
KR20170110810A (en) Data processing system and operating method thereof
US20190354483A1 (en) Controller and memory system including the same
JP2021043975A (en) Interface circuit, memory device, and operation method for the same
CN110221780B (en) Memory controller, memory control method, and computer system
TWI714116B (en) Memory controller, memory controlling method, and computer system
KR102634776B1 (en) Data storage device and operating method thereof
US20210373809A1 (en) Write Data-Transfer Scheduling in ZNS Drive
US8683161B2 (en) Method and apparatus for increasing file copy performance on solid state mass storage devices
TWI747660B (en) Method and apparatus and computer program product for reading data from multiple flash dies
KR102482527B1 (en) Method for operating of storage device using serial interface and method for operating data processing system including same
KR20150102329A (en) Data storage device
US8667188B2 (en) Communication between a computer and a data storage device