CN103218308B - Buffer memory management method, memory controller and memory storage device - Google Patents
Buffer memory management method, memory controller and memory storage device Download PDFInfo
- Publication number
- CN103218308B CN103218308B CN201210018820.4A CN201210018820A CN103218308B CN 103218308 B CN103218308 B CN 103218308B CN 201210018820 A CN201210018820 A CN 201210018820A CN 103218308 B CN103218308 B CN 103218308B
- Authority
- CN
- China
- Prior art keywords
- memory
- buffer
- data
- rewritable non
- buffer memory
- Prior art date
- Legal status (The legal status 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 status listed.)
- Active
Links
- 239000000872 buffer Substances 0.000 title claims abstract description 222
- 230000005055 memory storage Effects 0.000 title claims abstract description 49
- 238000007726 management method Methods 0.000 title claims description 93
- 238000013507 mapping Methods 0.000 claims description 18
- 238000012546 transfer Methods 0.000 claims description 12
- 238000000034 method Methods 0.000 abstract description 15
- 238000010586 diagram Methods 0.000 description 10
- 238000012937 correction Methods 0.000 description 8
- 230000005540 biological transmission Effects 0.000 description 6
- 238000012545 processing Methods 0.000 description 3
- 230000003068 static effect Effects 0.000 description 3
- 230000001360 synchronised effect Effects 0.000 description 3
- 230000002093 peripheral effect Effects 0.000 description 2
- 239000007787 solid Substances 0.000 description 2
- 238000004891 communication Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 239000002356 single layer Substances 0.000 description 1
- 239000000758 substrate Substances 0.000 description 1
Landscapes
- Read Only Memory (AREA)
Abstract
Description
技术领域 technical field
本发明涉及一种管理缓冲存储器的技术,尤其涉及一种能暂时增加缓冲存储器的存储器空间的缓冲存储器管理方法及使用此方法的存储器控制器与存储器储存装置。The present invention relates to a technique for managing a buffer memory, in particular to a buffer memory management method capable of temporarily increasing the memory space of the buffer memory, and a memory controller and a memory storage device using the method.
背景技术 Background technique
数码相机、手机与MP3在这几年来的成长十分迅速,使得消费者对储存媒体的需求也急速增加。由于可复写式非易失性存储器(rewritablenon-volatilememory)具有数据非易失性、省电、体积小、无机械结构、读写速度快等特性,最适于可携式电子产品,例如笔记型电脑。固态硬盘就是一种以快速存储器作为储存媒体的存储器储存装置。因此,近年快速存储器产业成为电子产业中相当热门的一环。Digital cameras, mobile phones, and MP3 players have grown rapidly in recent years, making consumers' demand for storage media also increase rapidly. Because rewritable non-volatile memory (rewritable non-volatile memory) has the characteristics of data non-volatility, power saving, small size, no mechanical structure, and fast read and write speed, it is most suitable for portable electronic products, such as notebooks. computer. A solid state drive is a memory storage device that uses fast memory as a storage medium. Therefore, the fast memory industry has become a very popular part of the electronics industry in recent years.
在使用可复写式非易失性存储器作为储存媒体的存储器储存装置中,通常也会配置缓冲存储器,用以暂存程序码或是数据。由于成本的考量,这样的缓冲存储器并不会有很大的存储器空间。当缓冲存储器的存储器空间不够时,存储器储存装置便无法正常的运作。然而,在存储器储存装置执行一些程序时,需要一些额外的存储器空间。例如,要排序大小为n的数据时,通常至少需要大小为log(n)的存储器空间。因此,若缓冲存储器中的存储器空间不足,便无法执行上述的排序程序。因此,如何能够快速且暂时地空出缓冲存储器的储存空间,是此领域技术人员所关心的议题。In a memory storage device that uses a rewritable non-volatile memory as a storage medium, a buffer memory is usually configured to temporarily store program codes or data. Due to cost considerations, such a buffer memory does not have a large memory space. When the memory space of the buffer memory is insufficient, the memory storage device cannot operate normally. However, when the memory storage device executes some programs, some additional memory space is required. For example, when sorting data of size n, usually at least a memory space of size log(n) is required. Therefore, if the memory space in the buffer memory is insufficient, the above-mentioned sorting procedure cannot be executed. Therefore, how to quickly and temporarily free up the storage space of the buffer memory is an issue that those skilled in the art are concerned about.
发明内容 Contents of the invention
本发明提出一种缓冲存储器管理方法、存储器控制器与存储器储存装置,其能够暂时且快速的空出缓冲存储器的储存空间。The present invention provides a buffer memory management method, a memory controller and a memory storage device, which can temporarily and quickly free up the storage space of the buffer memory.
本发明一范例实施例提出一种用于操作存储器储存装置的缓冲存储器的缓冲存储器管理方法,其中此存储器储存装置包括可复写式非易失性存储器模组且此可复写式非易失性存储器模组包括缓冲区与储存区。此缓冲存储器管理方法包括用一预程序化指令组将暂存数据从缓冲存储器中传送至缓冲区。根据此预程序化指令组,可复写式非易失性存储器模组不会将暂存数据程序化至上述的储存区中。此方法还包括在缓冲存储器中释放用以储存上述暂存数据的储存空间。此方法还包括,之后,将暂存数据从可复写式非易失性存储器模组的缓冲区重新载入至缓冲存储器的储存空间。An exemplary embodiment of the present invention provides a buffer memory management method for operating a buffer memory of a memory storage device, wherein the memory storage device includes a rewritable non-volatile memory module and the rewritable non-volatile memory Modules include buffers and storage areas. The buffer memory management method includes using a pre-programmed instruction set to transfer temporary data from the buffer memory to the buffer. According to the pre-programmed instruction group, the rewritable non-volatile memory module will not program the temporary storage data into the above-mentioned storage area. The method also includes releasing the storage space used for storing the temporary data in the buffer memory. The method further includes, afterward, reloading the temporarily stored data from the buffer of the rewritable non-volatile memory module to the storage space of the buffer memory.
在本发明的一范例实施例中,上述释放缓冲存储器的储存空间的步骤还包括:判断是否要执行特定任务或判断缓冲存储器的空间是否不足;以及,当要执行此特定任务或缓冲存储器的空间不足时,释放缓冲存储器的储存空间。In an exemplary embodiment of the present invention, the above-mentioned step of releasing the storage space of the buffer memory further includes: judging whether a specific task is to be executed or whether the space of the buffer memory is insufficient; and, when the specific task or the space of the buffer memory is to be executed When insufficient, release the storage space of the buffer memory.
在本发明的一范例实施例中,上述缓冲存储器管理方法还包括:在将暂存数据从可复写式非易失性存储器模组的缓冲区重新载入至缓冲存储器的储存空间之前,利用此储存空间来排序记录在全域混乱表中的信息。In an exemplary embodiment of the present invention, the above buffer memory management method further includes: before reloading the temporarily stored data from the buffer area of the rewritable non-volatile memory module to the storage space of the buffer memory, using this Storage space to sort the information recorded in the global chaos table.
在本发明的一范例实施例中,上述将暂存数据从可复写式非易失性存储器模组的缓冲区中重新载入至缓冲存储器的储存空间的步骤包括:使用缓冲区读取指令将暂存数据从可复写式非易失性存储器模组的缓冲区读取至缓冲存储器的储存空间。In an exemplary embodiment of the present invention, the step of reloading the temporarily stored data from the buffer of the rewritable non-volatile memory module to the storage space of the buffer memory includes: using a buffer read command to Temporary data is read from the buffer of the rewritable non-volatile memory module to the storage space of the buffer memory.
在本发明的一范例实施例中,上述缓冲存储器管理方法还包括:在暂存数据储存在缓冲区的期间,停止存取可复写式非易失性存储器模组的储存区中的数据。In an exemplary embodiment of the present invention, the buffer memory management method further includes: during the temporary storage of data in the buffer, stop accessing the data in the storage area of the rewritable non-volatile memory module.
在本发明的一范例实施例中,上述缓冲存储器管理方法还包括:将缓冲存储器划分为多个区域,而上述的储存空间为这些区域的其中之In an exemplary embodiment of the present invention, the above buffer memory management method further includes: dividing the buffer memory into a plurality of areas, and the above storage space is one of these areas
在本发明的一范例实施例中,上述缓冲存储器管理方法还包括:设定上述的多个区域包括映射表暂存区、变量暂存区、固件码暂存区、全域混乱表暂存区、存取数据暂存区与剩余区域。In an exemplary embodiment of the present invention, the buffer memory management method further includes: setting the above-mentioned multiple areas to include a mapping table temporary storage area, a variable temporary storage area, a firmware code temporary storage area, a global confusion table temporary storage area, Access data temporary storage area and remaining area.
以另外一个角度来说,本发明一范例实施例提出一种存储器控制器,用以控制可复写式非易失性存储器模组,其中可复写式非易失性存储器模组包括一缓冲区与储存区。此存储器控制器包括主机接口、存储器接口、缓冲存储器与存储器管理电路。主机接口是用以电性连接至主机系统。存储器接口是用以电性连接至可复写式非易失性存储器模组。存储器管理电路是电性连接至主机接口、存储器接口与缓冲存储器。在此,存储器管理电路会使用一预程序化指令组来将一暂存数据从缓冲存储器中传送至缓冲区。根据此预程序化指令,可复写式非易失性存储器模组并不会将暂存数据程序化(program)至储存区中。此外,存储器管理电路还用以在缓冲存储器中释放用以储存上述暂存数据的储存空间。之后,存储器管理电路还用以将暂存数据从可复写式非易失性存储器模组的缓冲区重新载入至缓冲存储器的储存空间。From another perspective, an exemplary embodiment of the present invention provides a memory controller for controlling a rewritable non-volatile memory module, wherein the rewritable non-volatile memory module includes a buffer and storage area. The memory controller includes host interface, memory interface, buffer memory and memory management circuit. The host interface is used to electrically connect to the host system. The memory interface is used to electrically connect to the rewritable non-volatile memory module. The memory management circuit is electrically connected to the host interface, the memory interface and the buffer memory. Here, the memory management circuit uses a pre-programmed instruction set to transfer a temporary data from the buffer memory to the buffer. According to the preprogramming instruction, the rewritable nonvolatile memory module does not program the temporary storage data into the storage area. In addition, the memory management circuit is also used for releasing the storage space used for storing the temporary data in the buffer memory. Afterwards, the memory management circuit is also used to reload the temporarily stored data from the buffer of the rewritable non-volatile memory module to the storage space of the buffer memory.
在本发明的一范例实施例中,上述存储器管理电路还用以判断是否要执行一特定任务或判断缓冲存储器的空间是否不足。当要执行此特定任务或缓冲存储器的空间不足时,存储器管理电路会释放缓冲存储器的储存空间。In an exemplary embodiment of the present invention, the above-mentioned memory management circuit is also used for judging whether to execute a specific task or judging whether the space of the buffer memory is insufficient. When the specific task is to be executed or the space of the buffer memory is insufficient, the memory management circuit releases the storage space of the buffer memory.
在本发明的一范例实施例中,在将暂存数据从可复写式非易失性存储器模组的缓冲区重新载入至缓冲存储器的储存空间之前,存储器管理电路还利用储存空间来排序记录在全域混乱表中的信息。In an exemplary embodiment of the present invention, the memory management circuit also uses the storage space to sort the records before reloading the temporary data from the buffer memory of the rewritable non-volatile memory module into the storage space of the buffer memory Information in the global confusion table.
在本发明的一范例实施例中,上述存储器管理电路使用缓冲区读取指令将暂存数据从可复写式非易失性存储器模组的缓冲区读取至缓冲存储器的储存空间。In an exemplary embodiment of the present invention, the above-mentioned memory management circuit uses a buffer read command to read the temporarily stored data from the buffer of the rewritable non-volatile memory module to the storage space of the buffer memory.
在本发明的一范例实施例中,上述暂存数据储存在缓冲区的期间,存储器管理电路停止存取可复写式非易失性存储器模组的储存区中的数据。In an exemplary embodiment of the present invention, the memory management circuit stops accessing the data in the storage area of the rewritable non-volatile memory module while the temporary storage data is stored in the buffer.
在本发明的一范例实施例中,上述存储器管理电路还用以将缓冲存储器划分为多个区域,并设定储存空间为这些区域的其中之一。In an exemplary embodiment of the present invention, the memory management circuit is further used to divide the buffer memory into multiple areas, and set the storage space as one of these areas.
在本发明的一范例实施例中,上述多个区域包括映射表暂存区、变量暂存区、固件码暂存区、全域混乱表暂存区、存取数据暂存区与剩余区域。In an exemplary embodiment of the present invention, the above-mentioned multiple areas include a mapping table temporary storage area, a variable temporary storage area, a firmware code temporary storage area, a global confusion table temporary storage area, an access data temporary storage area, and a remaining area.
以另外一个角度来说,本发明一范例实施例提出一种存储器储存装置,其包括连接器、可复写式非易失性存储器模组与存储器控制器。连接器是用以电性连接至主机系统。可复写式非易失性存储器模组包括缓冲区与储存区。存储器控制器是电性连接至连接器与可复写式非易失性存储器模组,并且具有缓冲存储器。在此,存储器控制器使用一预程序化指令组将暂存数据从缓冲存储器中传送至缓冲区。并且,根据此预程序化指令组,可复写式非易失性存储器模组不会将暂存数据程序化至储存区。存储器控制器用以将暂存在缓冲存储器中的该暂存数据传送至可复写式非易失性存储器模组的该缓冲区中,暂存数据不会被程序化至储存区。存储器控制器会在缓冲存储器中释放用以储存暂存数据的储存空间。之后,存储器控制器还用以将暂存数据从可复写式非易失性存储器模组的缓冲区重新载入至缓冲存储器的储存空间。From another perspective, an exemplary embodiment of the present invention provides a memory storage device, which includes a connector, a rewritable non-volatile memory module, and a memory controller. The connector is used to electrically connect to the host system. The rewritable non-volatile memory module includes a buffer and a storage area. The memory controller is electrically connected to the connector and the rewritable non-volatile memory module, and has a buffer memory. Here, the memory controller uses a pre-programmed instruction set to transfer the temporary data from the buffer memory to the buffer. Moreover, according to the pre-programmed instruction group, the rewritable non-volatile memory module will not program the temporary storage data into the storage area. The memory controller is used to transfer the temporary data temporarily stored in the buffer memory to the buffer of the rewritable non-volatile memory module, and the temporary data will not be programmed into the storage area. The memory controller releases the storage space for storing temporary data in the buffer memory. Afterwards, the memory controller is also used to reload the temporarily stored data from the buffer of the rewritable non-volatile memory module to the storage space of the buffer memory.
在本发明的一范例实施例中,上述存储器控制器还用以判断是否要执行一特定任务或判断缓冲存储器的空间是否不足。当要执行特定任务或缓冲存储器的空间不足时,存储器控制器会释放缓冲存储器的储存空间。In an exemplary embodiment of the present invention, the above-mentioned memory controller is also used for judging whether to execute a specific task or judging whether the space of the buffer memory is insufficient. When a specific task is to be executed or the space of the buffer memory is insufficient, the memory controller releases the storage space of the buffer memory.
在本发明的一范例实施例中,在将暂存数据从可复写式非易失性存储器模组的缓冲区重新载入至缓冲存储器的储存空间之前,存储器控制器利用储存空间来排序记录在全域混乱表中的信息。In an exemplary embodiment of the present invention, before reloading the temporary data from the buffer of the rewritable non-volatile memory module into the storage space of the buffer memory, the memory controller utilizes the storage space to sort records in Information in the global confusion table.
在本发明的一范例实施例中,上述存储器控制器使用缓冲区读取指令将暂存数据从可复写式非易失性存储器模组的缓冲区读取至缓冲存储器的储存空间。In an exemplary embodiment of the present invention, the above-mentioned memory controller uses a buffer read command to read the temporarily stored data from the buffer of the rewritable non-volatile memory module to the storage space of the buffer memory.
在本发明的一范例实施例中,上述暂存数据储存在缓冲区的期间,存储器控制器会停止存取可复写式非易失性存储器模组的储存区中的数据。In an exemplary embodiment of the present invention, during the period when the temporary storage data is stored in the buffer, the memory controller stops accessing the data in the storage area of the rewritable non-volatile memory module.
在本发明的一范例实施例中,上述存储器控制器还用以将缓冲存储器划分为多个区域,上述的储存空间为这些区域的其中之一。In an exemplary embodiment of the present invention, the memory controller is further configured to divide the buffer memory into a plurality of areas, and the storage space is one of these areas.
在本发明的一范例实施例中,上述多个区域包括映射表暂存区、变量暂存区、固件码暂存区、全域混乱表暂存区、存取数据暂存区与剩余区域。In an exemplary embodiment of the present invention, the above-mentioned multiple areas include a mapping table temporary storage area, a variable temporary storage area, a firmware code temporary storage area, a global confusion table temporary storage area, an access data temporary storage area, and a remaining area.
在本发明的一范例实施例中,上述可复写式非易失性存储器模组还包括至少一个存储器晶片并且每一个存储器晶片包括多个存储器晶粒。并且,上述的缓冲区与储存区是被配置在相同的存储器晶片中。In an exemplary embodiment of the present invention, the above-mentioned rewritable non-volatile memory module further includes at least one memory chip and each memory chip includes a plurality of memory dies. Moreover, the above-mentioned buffer area and storage area are configured in the same memory chip.
在本发明的一范例实施例中,上述的缓冲区与储存区是被配置在相同的存储器晶粒中。In an exemplary embodiment of the present invention, the above-mentioned buffer area and storage area are configured in the same memory die.
基于上述,本发明范例实施例提出的缓冲区管理方法、存储器控制器与存储器储存装置,可以暂时地空出缓冲存储器的储存空间。并且,由于将数据暂存在可复写式非易失性存储器模组的缓冲区所需的时间短于将数据暂存至可复写式非易失性存储器模组的储存区所需的时间,因此,缓冲存储器的可用储存空间可以快速且暂时的增加。Based on the above, the buffer management method, the memory controller and the memory storage device proposed by the exemplary embodiments of the present invention can temporarily free up the storage space of the buffer memory. And, because the time required for temporarily storing data in the buffer area of the rewritable non-volatile memory module is shorter than the time required for temporarily storing data in the storage area of the rewritable non-volatile memory module, therefore , the available storage space of the buffer memory can be rapidly and temporarily increased.
为让本发明的上述特征和优点能更明显易懂,下文特举实施例,并配合所附附图作详细说明如下。In order to make the above-mentioned features and advantages of the present invention more comprehensible, the following specific embodiments are described in detail together with the accompanying drawings.
附图说明 Description of drawings
图1A是根据一范例实施例所示的主机系统与存储器储存装置。FIG. 1A shows a host system and a memory storage device according to an exemplary embodiment.
图1B是根据一范例实施例所示的电脑、输入/输出装置与存储器储存装置的示意图。FIG. 1B is a schematic diagram of a computer, an input/output device and a memory storage device according to an exemplary embodiment.
图1C是根据一范例实施例所示的主机系统与存储器储存装置的示意图。FIG. 1C is a schematic diagram of a host system and a memory storage device according to an exemplary embodiment.
图2A是显示图1A所示的存储器储存装置的概要方框图。FIG. 2A is a schematic block diagram showing the memory storage device shown in FIG. 1A.
图2B是根据一范例实施例所示的可复写式非易失性存储器模组的方框图。FIG. 2B is a block diagram of a rewritable non-volatile memory module according to an exemplary embodiment.
图3是根据一范例实施例所示的存储器控制器的概要方框图。FIG. 3 is a schematic block diagram of a memory controller according to an exemplary embodiment.
图4是根据一范例实施例说明空出缓冲存储器的部分存储器空间的示意图。FIG. 4 is a schematic diagram illustrating vacating part of the memory space of the buffer memory according to an exemplary embodiment.
图5是根据一范例实施例所示的缓冲区管理方法的流程图。Fig. 5 is a flowchart of a buffer management method according to an exemplary embodiment.
主要元件符号说明:Description of main component symbols:
1000:主机系统1000: host system
1100:电脑1100: computer
1102:微处理器1102: Microprocessor
1104:随机存取存储器1104: random access memory
1106:输入/输出装置1106: Input/Output Device
1108:系统总线1108: System bus
1110:数据传输接口1110: data transmission interface
1202:鼠标1202: mouse
1204:键盘1204: keyboard
1206:显示器1206: display
1208:打印机1208: Printer
1212:随身盘1212: Pen drive
1214:存储卡1214: memory card
1216:固态硬盘1216: SSD
1310:数码相机1310: Digital camera
1312:SD卡1312: SD card
1314:MMC卡1314: MMC card
1316:记忆棒1316: memory stick
1318:CF卡1318: CF card
1320:嵌入式储存装置1320: Embedded Storage
100:存储器储存装置100: memory storage device
102:连接器102: Connector
104:存储器控制器104: memory controller
106:可复写式非易失性存储器模组106: Rewritable non-volatile memory module
120:缓冲区120: buffer
140:储存区140: storage area
160:存储器晶粒160: memory die
122:I/O控制接口122: I/O control interface
124:控制电路124: Control circuit
202:存储器管理电路202: memory management circuit
204:主机接口204: host interface
206:存储器接口206: memory interface
208:缓冲存储器208: buffer memory
402:映射表暂存区402: Mapping table temporary storage area
404:变量暂存区404: variable temporary storage area
406:固件码暂存区406: Firmware code temporary storage area
408:全域混乱表暂存区408: Global chaos table temporary storage area
410:存取数据暂存区410: Access data temporary storage area
420:暂存数据420: temporarily store data
440:储存空间440: storage space
S502、S504、S506、S508:缓冲存储器管理方法的步骤S502, S504, S506, S508: steps of the buffer memory management method
具体实施方式 detailed description
一般而言,存储器储存装置(也称,存储器储存系统)包括可复写式非易失性存储器模组与控制器(也称,控制电路)。通常存储器储存装置是与主机系统一起使用,以使主机系统可将数据写入至存储器储存装置或从存储器储存装置中读取数据。Generally speaking, a memory storage device (also called a memory storage system) includes a rewritable non-volatile memory module and a controller (also called a control circuit). Typically memory storage devices are used with a host system so that the host system can write data to or read data from the memory storage device.
图1A是根据一范例实施例所示的主机系统与存储器储存装置。FIG. 1A shows a host system and a memory storage device according to an exemplary embodiment.
请参照图1A,主机系统1000一般包括电脑1100与输入/输出(input/output,I/O)装置1106。电脑1100包括微处理器1102、随机存取存储器(randomaccessmemory,RAM)1104、系统总线1108与数据传输接口1110。输入/输出装置1106包括如图1B的鼠标1202、键盘1204、显示器1206与打印机1208。必须了解的是,图1B所示的装置非限制输入/输出装置1106,输入/输出装置1106可还包括其他装置。Referring to FIG. 1A , the host system 1000 generally includes a computer 1100 and an input/output (I/O) device 1106 . The computer 1100 includes a microprocessor 1102 , a random access memory (random access memory, RAM) 1104 , a system bus 1108 and a data transmission interface 1110 . The input/output device 1106 includes a mouse 1202, a keyboard 1204, a monitor 1206 and a printer 1208 as shown in FIG. 1B. It must be understood that the device shown in FIG. 1B is not limited to the I/O device 1106, and the I/O device 1106 may also include other devices.
在本发明实施例中,存储器储存装置100是通过数据传输接口1110与主机系统1000的其他元件电性连接。藉由微处理器1102、随机存取存储器1104与输入/输出装置1106的运作可将数据写入至存储器储存装置100或从存储器储存装置100中读取数据。例如,存储器储存装置100可以是如图1B所示的随身盘1212、存储卡1214或固态硬盘(SolidStateDrive,SSD)1216等的可复写式非易失性存储器储存装置。In the embodiment of the present invention, the memory storage device 100 is electrically connected with other components of the host system 1000 through the data transmission interface 1110 . Data can be written into the memory storage device 100 or read from the memory storage device 100 by the operation of the microprocessor 1102 , the random access memory 1104 and the input/output device 1106 . For example, the memory storage device 100 may be a rewritable non-volatile memory storage device such as a pen drive 1212 , a memory card 1214 or a solid state drive (SSD) 1216 as shown in FIG. 1B .
一般而言,主机系统1000为可实质地与存储器储存装置100配合以储存数据的任意系统。虽然在本范例实施例中,主机系统1000是以电脑系统来作说明,然而,在本发明另一范例实施例中主机系统1000可以是数码相机、摄影机、通信装置、音频播放器或视频播放器等系统。例如,在主机系统为数码相机(摄影机)1310时,可复写式非易失性存储器储存装置则为其所使用的SD卡1312、MMC卡1314、记忆棒(memorystick)1316、CF卡1318或嵌入式储存装置1320(如图1C所示)。嵌入式储存装置1320包括嵌入式多媒体卡(EmbeddedMMC,eMMC)。值得一提的是,嵌入式多媒体卡是直接电性连接于主机系统的基板上。In general, the host system 1000 is any system that can substantially cooperate with the memory storage device 100 to store data. Although in this exemplary embodiment, the host system 1000 is described as a computer system, however, in another exemplary embodiment of the present invention, the host system 1000 may be a digital camera, video camera, communication device, audio player or video player and other systems. For example, when the host system is a digital camera (video camera) 1310, the rewritable non-volatile memory storage device is the SD card 1312, MMC card 1314, memory stick (memorystick) 1316, CF card 1318 or embedded type storage device 1320 (as shown in FIG. 1C ). The embedded storage device 1320 includes an embedded multimedia card (EmbeddedMMC, eMMC). It is worth mentioning that the embedded multimedia card is directly electrically connected to the substrate of the host system.
图2是显示图1A所示的存储器储存装置的概要方框图。FIG. 2 is a schematic block diagram showing the memory storage device shown in FIG. 1A.
请参照图2,存储器储存装置100包括连接器102、存储器控制器104与可复写式非易失性存储器模组106。Referring to FIG. 2 , the memory storage device 100 includes a connector 102 , a memory controller 104 and a rewritable non-volatile memory module 106 .
在本范例实施例中,连接器102是相容于序列先进附件(SerialAdvancedTechnologyAttachment,SATA)标准。然而,必须了解的是,本发明不限于此,连接器102也可以是符合平行高级技术附件(ParellelAdvancedTechnologyAttachment,PATA)标准、电气和电子工程师协会(InstituteofElectricalandElectronicEngineers,IEEE)1394标准、高速周边零件连接接口(PeripheralComponentInterconnectExpress,PCIExpress)标准、通用串行总线(UniversalSerialBus,USB)标准、安全数字(SecureDigital,SD)接口标准、记忆棒(MemoryStick,MS)接口标准、多媒体储存卡(MultiMediaCard,MMC)接口标准、小型快速(CompactFlash,CF)接口标准、整合式驱动电子接口(IntegratedDeviceElectronics,IDE)标准或其他适合的标准。In this exemplary embodiment, the connector 102 is compatible with the Serial Advanced Technology Attachment (SATA) standard. However, it must be understood that the present invention is not limited thereto, and the connector 102 may also be a high-speed peripheral component connection interface ( Peripheral Component Interconnect Express, PCIExpress) standard, Universal Serial Bus (Universal Serial Bus, USB) standard, Secure Digital (SecureDigital, SD) interface standard, Memory Stick (MemoryStick, MS) interface standard, MultiMediaCard (MultiMediaCard, MMC) interface standard, small and fast (CompactFlash, CF) interface standard, Integrated Device Electronics (IDE) standard, or other suitable standards.
存储器控制器104用以执行以硬件型式或固件型式实作的多个逻辑门或控制指令,并且根据主机系统1000的指令在可复写式非易失性存储器模组106中进行数据的写入、读取与清除等运作。The memory controller 104 is used to execute a plurality of logic gates or control instructions implemented in hardware or firmware, and write data in the rewritable non-volatile memory module 106 according to the instructions of the host system 1000, Read and clear operations.
可复写式非易失性存储器模组106是电性连接至存储器控制器104,并且用以储存主机系统1000所写入的数据。并且,可复写式非易失性存储器模组106具有缓冲区120与储存区140。The rewritable non-volatile memory module 106 is electrically connected to the memory controller 104 and used for storing data written by the host system 1000 . Moreover, the rewritable non-volatile memory module 106 has a buffer 120 and a storage area 140 .
图2B是根据一范例实施例所示的可复写式非易失性存储器模组的方框图。FIG. 2B is a block diagram of a rewritable non-volatile memory module according to an exemplary embodiment.
请参照图2B,在一范例实施例中,可复写式非易失性存储器模组106还包括I/O控制接口122,控制电路124与至少一个存储器晶片(未示出),且每一个存储器晶片包括多个存储器晶粒(例如,存储器晶粒160),每一个存储器晶粒则包括多个实体区块。I/O控制接口122是用以从存储器控制器104接收指令与数据。控制电路124是用以控制可复写式非易失性存储器模组106的整体运作,例如将数据写入至缓冲区120与储存区140。在本范例实施例中,缓冲区120与储存区140封装在相同的存储器晶片中。在一范例实施例中,缓冲区120与储存区140属于同一个存储器晶粒(die)160。然而,在其他范例实施例中,缓冲区120与储存区140也可以属于不同的存储器晶粒,本发明并不限于此。Please refer to FIG. 2B, in an exemplary embodiment, the rewritable non-volatile memory module 106 also includes an I/O control interface 122, a control circuit 124 and at least one memory chip (not shown), and each memory The chip includes a plurality of memory dies (eg, memory die 160 ), and each memory die includes a plurality of physical blocks. The I/O control interface 122 is used for receiving instructions and data from the memory controller 104 . The control circuit 124 is used to control the overall operation of the rewritable non-volatile memory module 106 , such as writing data into the buffer 120 and the storage area 140 . In this exemplary embodiment, the buffer area 120 and the storage area 140 are packaged in the same memory chip. In an exemplary embodiment, the buffer area 120 and the storage area 140 belong to the same memory die 160 . However, in other exemplary embodiments, the buffer area 120 and the storage area 140 may also belong to different memory dies, and the present invention is not limited thereto.
缓冲区120是用以暂存来自于存储器控制器104或是暂存储存区140的数据。具体来说,在可复写式非易失性存储器模组106中写入数据的过程包括数据传输以及数据程序化两个部分。在数据传输的部分,快速存储器控制器104的存储器管理电路202会将欲写入的数据传输至缓冲区120。而在数据程序化的部分,欲写入的数据会从缓冲区120中程序化至储存区140。在一范例实施例中,缓冲区120可为易失性存储器,例如动态随机存取存储器(dynamicrandomaccessmemory,DRAM),但是缓冲区120也可以是静态随机存取存储器(staticrandomaccessmemory,SRAM)、磁电阻式随机存取存储器(MagnetoresistiveRandomAccessMemory,MRAM)、快取随机存取存储器(CacheRAM)、同步动态随机存取存储器(synchronousdynamicrandomaccessmemory,SDRAM)、视频随机存取存储器(VideoRAM,VRAM)、嵌入式动态随机存取存储器(embeddedDRAM,eDRAM)或其他的存储器。在另一范例实施例中,缓冲区120可为非易失性存储器,例如或非门快速存储器(NORFlash)或其他的存储器。The buffer 120 is used to temporarily store data from the memory controller 104 or the temporary storage area 140 . Specifically, the process of writing data in the rewritable non-volatile memory module 106 includes two parts: data transmission and data programming. In the part of data transmission, the memory management circuit 202 of the fast memory controller 104 transmits the data to be written to the buffer 120 . In the part of data programming, the data to be written is programmed from the buffer 120 to the storage area 140 . In an exemplary embodiment, the buffer 120 can be a volatile memory, such as a dynamic random access memory (DRAM), but the buffer 120 can also be a static random access memory (static random access memory, SRAM), magneto-resistive Random access memory (Magnetoresistive Random Access Memory, MRAM), fast access random access memory (CacheRAM), synchronous dynamic random access memory (synchronous dynamic random access memory, SDRAM), video random access memory (VideoRAM, VRAM), embedded dynamic random access memory (embeddedDRAM, eDRAM) or other memory. In another exemplary embodiment, the buffer 120 may be a non-volatile memory, such as a NOR flash memory (NORFlash) or other memory.
储存区140具有多个实体区块。例如,这些实体区块可属于同一个存储器晶粒(die)或者属于不同的存储器晶粒。每一实体区块分别具有多数个实体页面,并且每一实体页面具有至少一实体扇区,其中属于同一个实体区块的实体页面可被独立地写入且被同时地清除。例如,每一实体区块是由128个实体页面所组成,并且每一实体页面具有8个实体扇区(sector)。也就是说,在每一实体扇区为512比特组(byte)的例子中,每一实体页面的容量为4千比特组(Kilobyte,K)。然而,必须了解的是,本发明不限于此,每一实体区块是可由64个实体页面、256个实体页面或其他任意个实体页面所组成。The storage area 140 has a plurality of physical blocks. For example, these physical blocks may belong to the same memory die or belong to different memory dies. Each physical block has a plurality of physical pages, and each physical page has at least one physical sector, wherein the physical pages belonging to the same physical block can be written independently and erased simultaneously. For example, each physical block is composed of 128 physical pages, and each physical page has 8 physical sectors. That is to say, in the example where each physical sector is 512 bytes, the capacity of each physical page is 4 Kilobytes (K). However, it must be understood that the present invention is not limited thereto, and each physical block may be composed of 64 physical pages, 256 physical pages, or any other number of physical pages.
更详细来说,实体区块为清除的最小单位。也即,每一实体区块含有最小数目的一并被清除的记忆胞。实体页面为程序化的最小单元。即,实体页面为写入数据的最小单元。每一实体页面通常包括数据比特区与冗余比特区。数据比特区用以储存使用者的数据,而冗余比特区用以储存系统的数据(例如,错误检查与校正码)。In more detail, a physical block is the smallest unit of clearing. That is, each physical block contains a minimum number of memory cells to be cleared together. Entity page is the smallest unit of program. That is, a physical page is the smallest unit for writing data. Each physical page generally includes a data bit area and a redundant bit area. The data bit area is used to store user data, and the redundant bit area is used to store system data (eg, ECC codes).
在本范例实施例中,可复写式非易失性存储器模组106为多层记忆胞(MultiLevelCell,MLC)NAND快速存储器模组,即一个记忆胞中可储存至少2个比特数据。然而,本发明不限于此,可复写式非易失性存储器模组106也可是单层记忆胞(SingleLevelCell,SLC)NAND快速存储器模组、其他快速存储器模组或其他具有相同特性的存储器模组。In this exemplary embodiment, the rewritable non-volatile memory module 106 is a multi-level memory cell (MultiLevelCell, MLC) NAND fast memory module, that is, a memory cell can store at least 2 bits of data. However, the present invention is not limited thereto, and the rewritable non-volatile memory module 106 may also be a single-layer memory cell (SingleLevelCell, SLC) NAND fast memory module, other fast memory modules or other memory modules with the same characteristics .
图3是根据一范例实施例所示的存储器控制器的概要方框图。FIG. 3 is a schematic block diagram of a memory controller according to an exemplary embodiment.
请参照图3,存储器控制器104包括存储器管理电路202、主机接口204、存储器接口206与缓冲存储器208。Referring to FIG. 3 , the memory controller 104 includes a memory management circuit 202 , a host interface 204 , a memory interface 206 and a buffer memory 208 .
存储器管理电路202用以控制存储器控制器104的整体运作。具体来说,存储器管理电路202具有多个控制指令,并且在存储器储存装置100运作时,此些控制指令会被执行以进行数据的写入、读取与清除等运作。The memory management circuit 202 is used to control the overall operation of the memory controller 104 . Specifically, the memory management circuit 202 has a plurality of control instructions, and when the memory storage device 100 is operating, these control instructions are executed to perform operations such as writing, reading, and clearing data.
在本范例实施例中,存储器管理电路202的控制指令是以固件型式来实作。例如,存储器管理电路202具有微处理器单元(未示出),并且此些控制指令是被烧录至此只读存储器中。当存储器储存装置100运作时,此些控制指令会由微处理器单元来执行以进行数据的写入、读取与清除等运作。In this exemplary embodiment, the control commands of the memory management circuit 202 are implemented in the form of firmware. For example, the memory management circuit 202 has a microprocessor unit (not shown), and these control instructions are programmed into this ROM. When the memory storage device 100 is in operation, these control instructions will be executed by the microprocessor unit to perform operations such as writing, reading, and clearing data.
在本发明另一范例实施例中,存储器管理电路202的控制指令也可以程序码型式储存于可复写式非易失性存储器模组106的特定区域(例如,存储器模组中专用于存放系统数据的系统区)中。特别是,此只读存储器具有驱动码,并且当存储器控制器104被致能时,微处理器单元会先执行此驱动码段来将储存于可复写式非易失性存储器模组106中的控制指令载入至存储器管理电路202的随机存取存储器中。之后,微处理器单元会运转此些控制指令以进行数据的写入、读取与清除等运作。In another exemplary embodiment of the present invention, the control instructions of the memory management circuit 202 can also be stored in a specific area of the rewritable non-volatile memory module 106 in the form of program code (for example, the memory module is dedicated to storing system data system area). In particular, the ROM has driver code, and when the memory controller 104 is enabled, the microprocessor unit will first execute the driver code segment to store the data stored in the rewritable non-volatile memory module 106 The control instructions are loaded into the random access memory of the memory management circuit 202 . Afterwards, the microprocessor unit executes these control instructions to perform operations such as writing, reading and clearing data.
此外,在本发明另一范例实施例中,存储器管理电路202的控制指令也可以一硬件型式来实作。例如,存储器管理电路202包括微控制器、存储器管理单元、存储器写入单元、存储器读取单元、存储器清除单元与数据处理单元。存储器管理单元、存储器写入单元、存储器读取单元、存储器清除单元与数据处理单元是电性连接至微控制器。其中,存储器管理单元用以管理可复写式非易失性存储器模组106的实体区块;存储器写入单元用以对可复写式非易失性存储器模组106下达写入指令以将数据写入至可复写式非易失性存储器模组106中;存储器读取单元用以对可复写式非易失性存储器模组106下达读取指令以从可复写式非易失性存储器模组106中读取数据;存储器清除单元用以对可复写式非易失性存储器模组106下达清除指令以将数据从可复写式非易失性存储器模组106中清除;而数据处理单元用以处理欲写入至可复写式非易失性存储器模组106的数据以及从可复写式非易失性存储器模组106中读取的数据。In addition, in another exemplary embodiment of the present invention, the control instructions of the memory management circuit 202 can also be implemented in a hardware form. For example, the memory management circuit 202 includes a microcontroller, a memory management unit, a memory writing unit, a memory reading unit, a memory clearing unit and a data processing unit. The memory management unit, the memory writing unit, the memory reading unit, the memory clearing unit and the data processing unit are electrically connected to the microcontroller. Wherein, the memory management unit is used to manage the physical block of the rewritable non-volatile memory module 106; the memory writing unit is used to issue a write command to the rewritable non-volatile memory module 106 to write data into the rewritable non-volatile memory module 106; the memory read unit is used to issue a read instruction to the rewritable non-volatile memory module 106 to read from the rewritable non-volatile memory module 106 read data in; the memory clearing unit is used to issue clearing instructions to the rewritable non-volatile memory module 106 to clear data from the rewritable non-volatile memory module 106; and the data processing unit is used to process Data to be written into the rewritable non-volatile memory module 106 and data read from the rewritable non-volatile memory module 106 .
主机接口204是电性连接至存储器管理电路202并且用以接收与识别主机系统1000所传送的指令与数据。也就是说,主机系统1000所传送的指令与数据会通过主机接口204来传送至存储器管理电路202。在本范例实施例中,主机接口204是相容于SATA标准。然而,必须了解的是本发明不限于此,主机接口204也可以是相容于PATA标准、IEEE1394标准、PCIExpress标准、USB标准、SD标准、MS标准、MMC标准、CF标准、IDE标准或其他适合的数据传输标准。The host interface 204 is electrically connected to the memory management circuit 202 and used for receiving and identifying commands and data transmitted by the host system 1000 . That is to say, the commands and data transmitted by the host system 1000 are transmitted to the memory management circuit 202 through the host interface 204 . In this exemplary embodiment, the host interface 204 is compatible with the SATA standard. However, it must be understood that the present invention is not limited thereto, and the host interface 204 may also be compatible with PATA standard, IEEE1394 standard, PCIExpress standard, USB standard, SD standard, MS standard, MMC standard, CF standard, IDE standard or other suitable data transmission standards.
存储器接口206是电性连接至存储器管理电路202并且用以存取可复写式非易失性存储器模组106。也就是说,欲写入至可复写式非易失性存储器模组106的数据会经由存储器接口206转换为可复写式非易失性存储器模组106所能接受的格式。The memory interface 206 is electrically connected to the memory management circuit 202 and used for accessing the rewritable non-volatile memory module 106 . That is to say, the data to be written into the rewritable non-volatile memory module 106 will be converted into a format acceptable to the rewritable non-volatile memory module 106 via the memory interface 206 .
缓冲存储器208是用以暂存存储器管理电路202的程序码或者数据。例如,缓冲存储器208为静态随机存取存储器。然而,必须了解的是,缓冲存储器208也可以是动态随机存取存储器、磁电阻式随机存取存储、快取随机存取存储器、同步动态随机存取存储器、视频随机存取存储器、或非门快速存储器、嵌入式动态随机存取存储器或其他的存储器。The buffer memory 208 is used to temporarily store program codes or data of the memory management circuit 202 . For example, the buffer memory 208 is a static random access memory. However, it must be understood that the buffer memory 208 may also be a DRAM, a magneto-resistive RAM, a cache RAM, a synchronous DRAM, a video RAM, or a NOR gate. Flash memory, embedded DRAM or other memory.
此外,在一范例实施例中,存储器控制器104可还包括电源管理电路与错误检查与校正电路(未示出)。电源管理电路是电性连接至存储器管理电路202并且用以控制存储器储存装置100的电源。错误检查与校正电路是电性连接至存储器管理电路202并且用以执行一错误校正程序以确保数据的正确性。具体来说,当主机接口204从主机系统1000中接收到主机写入指令时,错误检查与校正电路会为对应此主机写入指令的写入数据(也称为更新数据)产生对应的错误检查与校正码(ErrorCheckingandCorrectingCode,ECCCode),并且存储器管理电路202会将此更新数据与对应的错误校正码写入至可复写式非易失性存储器模组106中。之后,当存储器管理电路202从可复写式非易失性存储器模组106中读取数据时会同时读取此数据对应的错误校正码,并且错误检查与校正电路会依据此错误校正码对所读取的数据执行错误校正程序。In addition, in an exemplary embodiment, the memory controller 104 may further include a power management circuit and an error checking and correction circuit (not shown). The power management circuit is electrically connected to the memory management circuit 202 and used to control the power of the memory storage device 100 . The error checking and correcting circuit is electrically connected to the memory management circuit 202 and used for executing an error correcting procedure to ensure the correctness of data. Specifically, when the host interface 204 receives a host write command from the host system 1000, the error checking and correction circuit will generate corresponding error checking for the write data (also called update data) corresponding to the host write command. and a correction code (Error Checking and Correcting Code, ECCC Code), and the memory management circuit 202 will write the update data and the corresponding error correction code into the rewritable non-volatile memory module 106 . Afterwards, when the memory management circuit 202 reads data from the rewritable non-volatile memory module 106, it will read the error correction code corresponding to the data at the same time, and the error checking and correction circuit will check all the data according to the error correction code. The read data is subjected to error correction procedures.
在本范例实施例中,当缓冲存储器208的储存空间不足时,存储器管理电路202便无法正常地执行。例如,当存储器管理电路202要排序一全域混乱表(globalrandomtable)时,便需要额外的储存空间来储存此全域混乱表的内容。详细来说,全域混乱表是记录着一逻辑存取单位与一实体存取单位的映射关系。在一范例实施例中,此逻辑存取单位是一个逻辑页面(logicalpage),而实体存取单位是一个实体页面(physicalpage)。当存储器控制器104对可复写式非易失性存储器模组106中的一个实体页面一直重复的写入数据时,若使用以区块为基准的映射关系(逻辑区块映射至实体区块),会使得被写入的实体区块必须一直被整并(merge),使得写入效率降低。因此,在这样的情况,存储器控制器104会使用以页面为基准的映射关系(逻辑页面映射至实体页面),并维护一个全域混乱表来维护以页面为基准的映射关系。然而,由于以页面为基准的映射关系会比以区块为基准的映射关系较为多,因此使得全域混乱表的内容也较为复杂。为了维护且能有效的存取全域混乱表,存储器控制器104会不定时的排序全域混乱表的信息。而在一般排序过程中,必须使用额外的存储器空间。例如,若使用快速排序演算法(quicksort)来排序大小为n的数据,则必须额外的使用大小为log(n)的存储器空间来执行此快速排序演算法法。因此,当缓冲存储器208中的空间不够以执行排序全域混乱表的演算法时,存储器管理电路202就必须暂时地空出缓冲存储器208的部分存储器空间,藉此完成此排序。In this exemplary embodiment, when the storage space of the buffer memory 208 is insufficient, the memory management circuit 202 cannot perform normally. For example, when the memory management circuit 202 needs to sort a global random table (global random table), additional storage space is required to store the contents of the global random table. Specifically, the global confusion table records the mapping relationship between a logical access unit and a physical access unit. In an exemplary embodiment, the logical access unit is a logical page, and the physical access unit is a physical page. When the memory controller 104 repeatedly writes data to a physical page in the rewritable non-volatile memory module 106, if a block-based mapping relationship is used (logic blocks are mapped to physical blocks) , the physical blocks to be written must be merged all the time, reducing the writing efficiency. Therefore, in such a case, the memory controller 104 uses a page-based mapping relationship (logical page to physical page mapping), and maintains a global confusion table to maintain the page-based mapping relationship. However, since there are more mapping relationships based on pages than based on blocks, the content of the global confusion table is also more complicated. In order to maintain and effectively access the global confusion table, the memory controller 104 sorts the information in the global confusion table from time to time. In normal sorting, however, additional memory space must be used. For example, if a quicksort algorithm (quicksort) is used to sort data of size n, an additional memory space of size log(n) must be used to execute the quicksort algorithm. Therefore, when the space in the buffer memory 208 is not enough to execute the algorithm of sorting the global confusion table, the memory management circuit 202 must temporarily clear part of the memory space of the buffer memory 208 to complete the sorting.
图4是根据一范例实施例说明空出缓冲存储器的部分存储器空间的示意图。FIG. 4 is a schematic diagram illustrating vacating part of the memory space of the buffer memory according to an exemplary embodiment.
请参考图4,一般来说,存储器控制器104的存储器管理电路202会将缓冲存储器208的储存空间划分为多个区域,以储存数据。举例来说,存储器管理电路202会将缓冲存储器208划分为映射表(mappingtable)暂存区402、变量暂存区404、固件码暂存区406、全域混乱表暂存区408与存取数据暂存区410与其他剩余区域,并且暂存数据420是储存在此剩余区域(即,储存空间440)。在本范例实施例中,映射表暂存区402用以暂存映射表的至少一部分,其中此映射表用以是储存逻辑地址与实体地址之间的映射关系。变量暂存区404是用以储存存储器管理电路202于运作过程中所使用的至少一变量。固件码暂存区406是用以储存存储器管理电路202所执行的至少一程序码。全域混乱表暂存区408是用以暂存全域混乱表的至少一部分。而存取数据暂存区410是用以暂存欲写入至或读取自可复写式非易失性存储器模组106的数据。Please refer to FIG. 4 , generally speaking, the memory management circuit 202 of the memory controller 104 divides the storage space of the buffer memory 208 into multiple areas for storing data. For example, the memory management circuit 202 divides the buffer memory 208 into a mapping table temporary storage area 402, a variable temporary storage area 404, a firmware code temporary storage area 406, a global confusion table temporary storage area 408, and an access data temporary storage area. The storage area 410 and other remaining areas, and the temporary data 420 is stored in this remaining area (ie, the storage space 440 ). In this exemplary embodiment, the mapping table temporary storage area 402 is used for temporarily storing at least a part of the mapping table, wherein the mapping table is used for storing a mapping relationship between logical addresses and physical addresses. The variable temporary storage area 404 is used to store at least one variable used by the memory management circuit 202 during operation. The firmware code temporary storage area 406 is used for storing at least one program code executed by the memory management circuit 202 . The global confusion table temporary storage area 408 is used to temporarily store at least a part of the global confusion table. The access data temporary storage area 410 is used for temporarily storing data to be written into or read from the rewritable non-volatile memory module 106 .
如上所述,由于缓冲存储器208的储存空间会事先被规划,以储存存储器储存装置100运作时所需暂存的程序或数据。因此,当需要执行上述排序全域混乱表的额外运算时,存储器管理电路202必须释放缓冲存储器208的储存空间。例如,在本范例实施例中,存储器管理电路202会先利用一指令组将暂存在缓冲存储器208中的暂存数据420传送至可复写式非易失性存储器模组106的缓冲区120中,并且,此指令组并不会要求将暂存数据420程序化(program)至储存区140中。As mentioned above, since the storage space of the buffer memory 208 will be planned in advance to store the programs or data that need to be temporarily stored when the memory storage device 100 operates. Therefore, the memory management circuit 202 must release the storage space of the buffer memory 208 when it is necessary to perform the above-mentioned additional operation of sorting the global confusion table. For example, in this exemplary embodiment, the memory management circuit 202 first transmits the temporary data 420 temporarily stored in the buffer memory 208 to the buffer 120 of the rewritable non-volatile memory module 106 by using an instruction set, Moreover, the command set does not require the temporary storage data 420 to be programmed into the storage area 140 .
具体来说,在本范例实施例中,存储器管理电路202可使用一个预程序化指令组来将暂存数据420从缓冲存储器208中传送至缓冲区120。例如,此预程序化指令组是由“写入指令”栏位、“地址”栏位、“数据”栏位所组成,其中“写入指令”栏位是用以指示可复写式非易失性存储器模组106此指令为一写入指令;“地址”栏位是记录欲写入数据的存储器地址;并且“数据”栏位是记录欲写入的数据的内容。值得注意的是,在一般的数据存取中,一个写入指令除了包括上述“写入指令”栏位、“地址”栏位以及“数据”栏位以外,还会包括一个对应“写入指令”栏位的”执行指令”栏位,其用以指示可复写式非易失性存储器模组106开始将欲写入的数据程序化至储存区140中。而在本范例实施例中,存储器管理电路202所使用的预程序化指令组并不包括对应“写入指令”栏位的”执行指令”栏位。因此可复写式非易失性存储器模组106在接收到此预程序化指令组以后,并不会将暂存数据420程序化至储存区140。另一方面,由于可复写式非易失性存储器模组106并不会将暂存数据420程序化至储存区140,因此省去了执行程序化的时间。换句话说,存储器控制器104可以快速将暂存数据420传送至可复写式非易失性存储器模组106,藉此让储存空间440变成闲置且可用的。Specifically, in this exemplary embodiment, the memory management circuit 202 can use a set of pre-programmed instructions to transfer the temporary storage data 420 from the buffer memory 208 to the buffer 120 . For example, the pre-programmed command group is composed of a "write command" field, an "address" field, and a "data" field. The "write command" field is used to indicate the rewritable non-volatile The command of the permanent memory module 106 is a write command; the "address" field is the memory address to record the data to be written; and the "data" field is to record the content of the data to be written. It is worth noting that in general data access, a write command will include a corresponding "write command" field in addition to the "write command" field, "address" field and "data" The "execution command" field of the " field is used to instruct the rewritable non-volatile memory module 106 to start programming the data to be written into the storage area 140 . However, in this exemplary embodiment, the pre-programmed command set used by the memory management circuit 202 does not include the "execute command" field corresponding to the "write command" field. Therefore, the rewritable non-volatile memory module 106 will not program the temporary storage data 420 to the storage area 140 after receiving the pre-programmed instruction set. On the other hand, since the rewritable non-volatile memory module 106 does not program the temporary storage data 420 to the storage area 140 , the time for performing programming is saved. In other words, the memory controller 104 can quickly transfer the temporary storage data 420 to the rewritable non-volatile memory module 106, thereby making the storage space 440 free and available.
存储器管理电路202在将暂存数据420传送至缓冲区120以后,存储器管理电路202会释放缓冲存储器208的储存空间440,也即存储器管理电路202可将一新数据写入至储存空间440,其中,储存空间440中的暂存数据420可被新数据覆写。此时,存储器管理电路202便可以利用储存空间440来排序记录在全域混乱表中的信息。在存储器管理电路完成全域混乱表的排序以后,存储器管理电路202会将暂存数据420从可复写式非易失性存储器模组160的缓冲区120中重新载入至缓冲存储器208的储存空间440。具体来说,存储器管理电路202是使用一缓冲区读取指令来将暂存数据420从可复写式非易失性存储器模组160的缓冲区120读取至缓冲存储器208的储存空间440。例如,此缓冲区读取指令是由“读取指令”栏位、“行地址”(columnaddress)栏位、对应”读取指令”栏位的“执行指令”栏位所组成。在此,“读取指令”栏位是用以指示可复写式非易失性存储器模组160此指令为一读取指令欲读取一数据;“行地址”栏位则用以记录欲读取数据的行地址;并且对应”读取指令”栏位的“执行指令”栏位则用以指示可复写式非易失性存储器模组160开始读取数据。特别是,根据此缓冲区读取指令,可复写式非易失性存储器模组160仅会将缓冲区120的数据提供给存储器管理电路202,而不会再从储存区140读取数据。基此,当接收到此缓冲区读取指令以后,可复写式非易失性存储器模组160便会从缓冲区120中对应上述读取数据的存储器地址中,将暂存数据420传送给存储器控制器104,并且存储器管理电路202会将数据载入至缓冲存储器208的储存空间440。如此一来,便完成了暂时增加缓冲存储器208的可用存储器空间的程序。After the memory management circuit 202 transmits the temporary storage data 420 to the buffer memory 120, the memory management circuit 202 will release the storage space 440 of the buffer memory 208, that is, the memory management circuit 202 can write a new data into the storage space 440, wherein , the temporary data 420 in the storage space 440 can be overwritten by new data. At this point, the memory management circuit 202 can use the storage space 440 to sort the information recorded in the global confusion table. After the memory management circuit finishes sorting the global confusion table, the memory management circuit 202 will reload the temporary data 420 from the buffer 120 of the rewritable non-volatile memory module 160 to the storage space 440 of the buffer memory 208 . Specifically, the memory management circuit 202 uses a buffer read command to read the temporary storage data 420 from the buffer 120 of the rewritable non-volatile memory module 160 to the storage space 440 of the buffer memory 208 . For example, the buffer read command is composed of a "read command" field, a "column address" field, and an "execution command" field corresponding to the "read command" field. Here, the "read command" column is used to indicate the rewritable non-volatile memory module 160 that the command is a read command to read a data; the "row address" column is used to record the data to be read. The row address for fetching data; and the "execution command" field corresponding to the "read command" field is used to instruct the rewritable non-volatile memory module 160 to start reading data. In particular, according to the buffer read command, the rewritable non-volatile memory module 160 will only provide the data in the buffer 120 to the memory management circuit 202 and will not read data from the storage area 140 again. Based on this, after receiving the buffer read command, the rewritable non-volatile memory module 160 will transfer the temporary storage data 420 to the memory from the memory address corresponding to the read data in the buffer 120 The controller 104 and the memory management circuit 202 load data into the storage space 440 of the buffer memory 208 . In this way, the procedure of temporarily increasing the available memory space of the buffer memory 208 is completed.
在另一范例实施例中,在暂存数据420储存在缓冲区120的期间,存储器管理电路202还停止存取可复写式非易失性存储器模组106的储存区140中的数据。具体来说,由于在存取储存区140时,所有的数据都会被暂存在缓冲区120中。因此,在暂存数据420储存在缓冲区120的期间存储器管理电路202停止存取储存区140中的数据,由此避免储存在缓冲区120的暂存数据420被覆写而遗失。In another exemplary embodiment, while the temporary data 420 is stored in the buffer 120 , the memory management circuit 202 also stops accessing the data in the storage area 140 of the rewritable non-volatile memory module 106 . Specifically, when accessing the storage area 140 , all data will be temporarily stored in the buffer 120 . Therefore, the memory management circuit 202 stops accessing the data in the storage area 140 while the temporary data 420 is stored in the buffer 120 , thereby preventing the temporary data 420 stored in the buffer 120 from being overwritten and lost.
值得注意的是,本范例实施例中存储器控制器104在将暂存数据420传送至缓冲区120后,使用储存空间440来排序全域混乱表。然而,在其他范例实施例中,存储器控制器104也可以使用储存空间440来执行其他的程序,本发明并不限制储存空间440的用途。举例来说,存储器控制器104还会判断是否要执行一特定任务或判断缓冲存储器208的空间是否不足。例如,此特定任务为全域混乱表的排序任务,但本发明并不限制此特定任务的内容。如果要执行此特定任务,则存储器控制器104会释放储存空间440来执行此特定任务。或者,当存储器控制器104判断缓冲存储器208的空间不足时,便可以释放储存空间440。另一方面,存储器控制器104也可以将缓冲存储器208中的任何数据当做暂存数据420并传送至缓冲区120,藉此暂时地增加缓冲存储器208的可使用储存空间。本发明也不限制暂存数据420的内容。或者是,存储器控制器104可以将缓冲存储器208中的任何一个区域(例如,变量暂存区404)的存储器空间释放。本发明也不限制所释放的存储器空间的位置。It should be noted that in this exemplary embodiment, the memory controller 104 uses the storage space 440 to sort the global confusion table after transferring the temporary storage data 420 to the buffer 120 . However, in other exemplary embodiments, the memory controller 104 can also use the storage space 440 to execute other programs, and the application of the storage space 440 is not limited in the present invention. For example, the memory controller 104 may also determine whether to execute a specific task or whether the space of the buffer memory 208 is insufficient. For example, this specific task is the sorting task of the global confusion table, but the present invention does not limit the content of this specific task. If the specific task is to be performed, the memory controller 104 releases the storage space 440 to perform the specific task. Alternatively, when the memory controller 104 determines that the space of the buffer memory 208 is insufficient, the storage space 440 may be released. On the other hand, the memory controller 104 can also take any data in the buffer memory 208 as temporary data 420 and send it to the buffer 120 , thereby temporarily increasing the available storage space of the buffer memory 208 . The present invention also does not limit the contents of the temporary storage data 420 . Alternatively, the memory controller 104 may release the memory space of any area in the buffer memory 208 (for example, the temporary variable storage area 404 ). The invention also does not limit the location of the freed memory space.
图5是根据一范例实施例所示的缓冲区管理方法的流程图。Fig. 5 is a flowchart of a buffer management method according to an exemplary embodiment.
在步骤S502中,存储器控制器104的存储器管理电路202将暂存在缓冲存储器208中的暂存数据传送至可复写式非易失性存储器模组106的缓冲区120中,其中暂存数据不会被程序化至可复写式非易失性存储器模组106的储存区140。在步骤S504中,存储器管理电路202会释放缓冲存储器208中用以储存上述暂存数据的储存空间。之后,在步骤S506中,存储器管理电路202会利用此储存空间执行暂时性的运作。例如,执行上述排序全域混乱表的排序。最后,在步骤S508中,存储器管理电路202会将暂存数据从可复写式非易失性存储器模组106的缓冲区120重新载入至缓冲存储器208的储存空间。图5中各步骤已详细说明如上,在此便不再赘述。In step S502, the memory management circuit 202 of the memory controller 104 transmits the temporary data temporarily stored in the buffer memory 208 to the buffer 120 of the rewritable non-volatile memory module 106, wherein the temporary data will not It is programmed to the storage area 140 of the rewritable non-volatile memory module 106 . In step S504 , the memory management circuit 202 releases the storage space in the buffer memory 208 for storing the temporary data. Afterwards, in step S506, the memory management circuit 202 uses the storage space to perform temporary operations. For example, perform the sorting of the sort universe confusion table above. Finally, in step S508 , the memory management circuit 202 reloads the temporarily stored data from the buffer 120 of the rewritable non-volatile memory module 106 to the storage space of the buffer memory 208 . Each step in FIG. 5 has been described in detail above, and will not be repeated here.
综上所述,本发明范例实施例所提出的缓冲存储器管理方法、存储器控制器与存储器储存装置,可以将缓冲存储器中的暂存数据利用一预程序化指令组传送至缓冲区,并且此暂存数据并不会被程序化至可复写式非易失性存储器模组的储存区。如此一来,缓冲存储器中原本用以储存暂存数据的储存空间便可以被释放,用以执行存储器控制器的其他程序。特别是,相较于将数据搬移至可复写式非易失性存储器模组的储存区,将暂存数据暂存至可复写式非易失性存储器模组的缓冲区所需的时间较短,因此,缓冲存储器的可用储存空间可暂时且快速地被增加。To sum up, the buffer memory management method, memory controller and memory storage device proposed by the exemplary embodiments of the present invention can transfer the temporarily stored data in the buffer memory to the buffer by using a pre-programmed instruction set, and the temporary The stored data will not be programmed to the storage area of the rewritable non-volatile memory module. In this way, the storage space originally used to store temporary data in the buffer memory can be released to execute other programs of the memory controller. In particular, compared to moving data to the storage area of the rewritable non-volatile memory module, the time required to temporarily store the temporary data in the buffer of the rewritable non-volatile memory module is shorter , therefore, the available storage space of the buffer memory can be temporarily and rapidly increased.
虽然本发明已以实施例揭示如上,然其并非用以限定本发明,任何所属技术领域中的普通技术人员,当可作些许更动与润饰,而不脱离本发明的精神和范围。Although the present invention has been disclosed above with the embodiments, it is not intended to limit the present invention, and any person skilled in the art may make some changes and modifications without departing from the spirit and scope of the present invention.
Claims (23)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201210018820.4A CN103218308B (en) | 2012-01-20 | 2012-01-20 | Buffer memory management method, memory controller and memory storage device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201210018820.4A CN103218308B (en) | 2012-01-20 | 2012-01-20 | Buffer memory management method, memory controller and memory storage device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN103218308A CN103218308A (en) | 2013-07-24 |
| CN103218308B true CN103218308B (en) | 2016-06-29 |
Family
ID=48816124
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201210018820.4A Active CN103218308B (en) | 2012-01-20 | 2012-01-20 | Buffer memory management method, memory controller and memory storage device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN103218308B (en) |
Families Citing this family (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP6094303B2 (en) * | 2013-03-25 | 2017-03-15 | 富士通株式会社 | Arithmetic processing apparatus, information processing apparatus, and control method for information processing apparatus |
| TWI604306B (en) * | 2016-08-08 | 2017-11-01 | 慧榮科技股份有限公司 | Data management method for data storage device and memory controller |
| CN106681652B (en) * | 2016-08-26 | 2019-11-19 | 合肥兆芯电子有限公司 | Storage management method, memorizer control circuit unit and memory storage apparatus |
| CN114333930B (en) * | 2021-12-23 | 2024-03-08 | 合肥兆芯电子有限公司 | Multi-channel memory storage device, control circuit unit and data reading method thereof |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101763895A (en) * | 2008-10-08 | 2010-06-30 | 三星电子株式会社 | Data storage device and data storage system having the same |
| CN102243603A (en) * | 2010-05-13 | 2011-11-16 | 美光科技公司 | Memory buffer having accessible information after a program-fail |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2000251035A (en) * | 1999-02-26 | 2000-09-14 | Hitachi Ltd | Memory card |
| TWI397821B (en) * | 2009-01-19 | 2013-06-01 | Phison Electronics Corp | Method, system and controller thereof for transmitting data stream |
-
2012
- 2012-01-20 CN CN201210018820.4A patent/CN103218308B/en active Active
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101763895A (en) * | 2008-10-08 | 2010-06-30 | 三星电子株式会社 | Data storage device and data storage system having the same |
| CN102243603A (en) * | 2010-05-13 | 2011-11-16 | 美光科技公司 | Memory buffer having accessible information after a program-fail |
Also Published As
| Publication number | Publication date |
|---|---|
| CN103218308A (en) | 2013-07-24 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| TWI515735B (en) | Data erasing method, memory control circuit unit and memory storage device | |
| CN104423888B (en) | Data writing method, memory control circuit unit and memory storage device | |
| US9176865B2 (en) | Data writing method, memory controller, and memory storage device | |
| TWI479492B (en) | Memory storage device, memory controller thereof, and method for programming data thereof | |
| TWI523030B (en) | Method for managing buffer memory, memory controllor, and memory storage device | |
| US9177656B2 (en) | Data writing method, memory storage device and memory controlling circuit unit | |
| US20150161042A1 (en) | Memory management method, memory controlling circuit unit, and memory storage device | |
| US9383929B2 (en) | Data storing method and memory controller and memory storage device using the same | |
| TW201508748A (en) | Data writing method, memory controller and memory storage apparatus | |
| CN107818808A (en) | Data writing method, memory control circuit unit and memory storage device | |
| CN103136111B (en) | Data writing method, memory controller and memory storage device | |
| TWI622044B (en) | Memory managing method, memory control circuit unit and memory storage apparatus | |
| CN107544922A (en) | Data writing method, memory control circuit unit and memory storage device | |
| CN107357520B (en) | Sorting instruction processing method, memory control circuit unit and storage device thereof | |
| CN103914391B (en) | Data reading method, memory controller and memory storage device | |
| CN103218308B (en) | Buffer memory management method, memory controller and memory storage device | |
| CN103577344B (en) | Data writing method, memory controller and memory storage device | |
| CN102800357B (en) | Program code loading and accessing method, memory controller and memory storage device | |
| TWI553477B (en) | Memory management method, memory control circuit unit and memory storage device | |
| CN104657083B (en) | Data writing method, memory storage device, memory control circuit unit | |
| CN103513930A (en) | Memory management method, memory controller and memory storage device | |
| CN103186470B (en) | Memory storage device, its memory controller, and data writing method | |
| CN102543184B (en) | Memory storage device, its memory controller and data writing method | |
| CN104731710A (en) | Memory management method, memory control circuit unit and memory storage device | |
| CN104238956A (en) | Data writing method, memory controller and memory storage device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| C14 | Grant of patent or utility model | ||
| GR01 | Patent grant |