CN102023811B - Method and system for issuing programmatic instructions to flash memory - Google Patents
Method and system for issuing programmatic instructions to flash memory Download PDFInfo
- Publication number
- CN102023811B CN102023811B CN2009101721618A CN200910172161A CN102023811B CN 102023811 B CN102023811 B CN 102023811B CN 2009101721618 A CN2009101721618 A CN 2009101721618A CN 200910172161 A CN200910172161 A CN 200910172161A CN 102023811 B CN102023811 B CN 102023811B
- Authority
- CN
- China
- Prior art keywords
- instruction
- flash memory
- write
- data
- main frame
- 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
- 230000015654 memory Effects 0.000 title claims abstract description 333
- 238000000034 method Methods 0.000 title claims abstract description 28
- 239000000872 buffer Substances 0.000 claims description 97
- 230000005540 biological transmission Effects 0.000 claims description 23
- 238000012163 sequencing technique Methods 0.000 claims 6
- 238000010586 diagram Methods 0.000 description 14
- 230000005055 memory storage Effects 0.000 description 9
- 238000012546 transfer Methods 0.000 description 9
- 230000008569 process Effects 0.000 description 6
- 238000012790 confirmation Methods 0.000 description 4
- 238000013507 mapping Methods 0.000 description 4
- 230000004044 response Effects 0.000 description 4
- 102100034033 Alpha-adducin Human genes 0.000 description 3
- 101000799076 Homo sapiens Alpha-adducin Proteins 0.000 description 3
- 101000629598 Rattus norvegicus Sterol regulatory element-binding protein 1 Proteins 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 238000004904 shortening Methods 0.000 description 3
- 239000007787 solid Substances 0.000 description 3
- 102100034004 Gamma-adducin Human genes 0.000 description 2
- 101000799011 Homo sapiens Gamma-adducin Proteins 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 102100024348 Beta-adducin Human genes 0.000 description 1
- 101000689619 Homo sapiens Beta-adducin Proteins 0.000 description 1
- 230000009471 action Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 239000000758 substrate Substances 0.000 description 1
Images
Landscapes
- Read Only Memory (AREA)
Abstract
Description
技术领域 technical field
本发明涉及一种对闪存下达程序化指令的方法以及使用此方法的闪存控制器与闪存储存系统。 The invention relates to a method for issuing programming instructions to a flash memory, a flash memory controller and a flash memory storage system using the method. the
背景技术 Background technique
由于闪存(Flash Memory)具有数据非挥发性、省电、体积小与无机械结构等的特性,最适合使用于可携式电子产品上。例如,固态硬盘就是一种以NAND闪存作为储存媒体的储存装置,并且已广泛配置于笔记型计算机中作为主要的储存装置。 Because flash memory (Flash Memory) has the characteristics of data non-volatility, power saving, small size and no mechanical structure, it is most suitable for use in portable electronic products. For example, a solid state disk is a storage device using NAND flash memory as a storage medium, and has been widely deployed in notebook computers as a main storage device. the
图1是图示一般闪存储存装置的概要方块图。一般来说,当主机系统110透过连接器122与闪存储存装置电性连接并且欲储存数据至闪存储存装置120时,写入数据至闪存储存装置120的闪存模块126的程序可区分为数据传输(transfer)以及数据程序化(program)两个部分。具体来说,当主机系统110欲在闪存储存装置120中储存数据时,闪存控制器124会通过数据输入/输出总线128将数据传输至闪存模块126内的缓冲区132,之后闪存模块126会将缓冲区132内的数据程序化至闪存模块126的存储器(即,储存区)134,其中在闪存模块126将数据程序化至存储器134的期间,闪存模块126是处于一实际忙碌(busy)状态,且当闪存模块126处于实际忙碌状态下闪存控制器124无法对其下达任何指令或传输任何数据。也就是说,闪存控制器124必须于闪存模块126完成程序化后才能响应主机系统110并处理主机系统110的下一个指令。
FIG. 1 is a schematic block diagram illustrating a general flash storage device. In general, when the host system 110 is electrically connected to the flash storage device through the
具体来说,当闪存控制器124从主机系统110接收到主机写入指令与写 入数据而需将写入数据写入至闪存模块126时,闪存控制器124会通过数据输入/输出总线128下达程序化指令,而此程序化指令中的相关信息就会暂存于缓冲区132中。例如,此程序化指令是由“指令W1”、“实体地址”、“写入数据”与“指令W2”等字符串所组成,其中闪存控制器124通过“指令W1”指示闪存模块126准备执行程序化程序,通过“实体地址”指示闪存模块126欲程序化的地址,通过“写入数据”指示闪存模块126欲程序化的数据以及通过“指令W2”指示闪存模块126开始执行程序化。因此,当闪存模块126根据程序化指令中的“指令W2”开始将缓冲区132内的数据写入至存储器134时,闪存控制器124需接收到来自于闪存模块126的完成程序化的确认(acknowl edgement)信息后才会回复主机系统110,一般来说,当主机系统下达指令到主机系统接收到确认信息的时间称为响应时间(response time)。
Specifically, when the flash memory controller 124 receives the host write command and write data from the host system 110 and needs to write the write data to the
随着传输技术的发展,使得连接器的传输速度已大幅提升,例如,序列先进附件(Serial Advanced Technology Attachment,SATA)连接器已可达到每秒15亿位(Gigabit,Gb),甚至每秒30Gb。然而,上述程序化闪存的速度却远低连接器的速度下,整体储存的效能仍无法有效改善,因此如何缩短执行主机写入指令的时间是此领域技术人员所致力的目标。 With the development of transmission technology, the transmission speed of connectors has been greatly improved. For example, Serial Advanced Technology Attachment (SATA) connectors can reach 1.5 billion bits per second (Gigabit, Gb), or even 30Gb per second. . However, the speed of the above-mentioned programmable flash memory is far lower than the speed of the connector, and the performance of the overall storage cannot be effectively improved. Therefore, how to shorten the time for executing the host write command is the goal of those skilled in the art. the
发明内容 Contents of the invention
本发明提供一种下达程序化指令的方法,其能够有效地缩短执行主机写入指令的时间。 The invention provides a method for issuing programmed instructions, which can effectively shorten the time for executing the write instructions of the host. the
本发明提供一种闪存控制器,其能够有效地缩短执行主机写入指令的时间。 The present invention provides a flash memory controller, which can effectively shorten the time for executing a host write command. the
本发明提供一种闪存储存系统,能够有效地缩短执行主机写入指令的时间。 The invention provides a flash memory storage system, which can effectively shorten the time for executing a host write command. the
本发明范例实施例提出一种下达程序化指令的方法,用于将来自于一主机系统的数据写入至一闪存芯片中。本下达程序化指令的方法包括提供一闪 存控制器,以及由闪存控制器使用一原生指令排序(Native Command Queuing,NCQ)协议从主机系统中接收多个主机写入指令。本下达程序化指令的方法也包括由闪存控制器依据主机写入指令传送一下达指令顺序给主机系统。本下达程序化指令的方法还包括依据下达指令顺序从主机系统中依序地接收主机写入指令与对应主机写入指令的多个写入数据,并且分别地向闪存芯片下达一快取程序化指令以将写入数据写入至闪存芯片中。 Exemplary embodiments of the present invention provide a method for issuing programming instructions for writing data from a host system into a flash memory chip. The method for issuing programmed commands includes providing a flash controller, and the flash controller receives a plurality of host write commands from the host system using a native command queuing (Native Command Queuing, NCQ) protocol. The method for issuing programmed instructions also includes that the flash memory controller transmits an instruction sequence to the host system according to the host write instruction. The method for issuing programming commands also includes sequentially receiving the host write command and a plurality of write data corresponding to the host write command from the host system according to the command order, and issuing a cache programming command to the flash memory chip respectively. command to write the write data into the flash memory chip. the
本发明范例实施例提出一种闪存控制器,用于将来自于一主机系统的数据写入至一闪存芯片中。本闪存控制器包括一微处理器单元、一缓冲存储器、一闪存接口单元、一主机接口单元与一内存管理单元。闪存接口单元电性连接至微处理器单元,并且用以连接闪存芯片。缓冲存储器电性连接至微处理器单元。主机接口单元电性连接至微处理器单元,并且用以连接上述主机系统,其中主机接口单元支持NCQ协议。内存管理单元电性连接至微处理单元,并且用以通过主机接口单元使用NCQ协议从主机系统中接收多个主机写入指令。此外,内存管理单元通过主机接口单元依据主机写入指令传送一下达指令顺序给主机系统。再者,内存管理单元透过主机接口单元依据下达指令顺序从主机系统中依序地接收主机写入指令与对应主机写入指令的多个写入数据,并且分别地向闪存芯片下达快取程序化指令以将写入数据写入至闪存芯片中。 Exemplary embodiments of the present invention provide a flash memory controller for writing data from a host system into a flash memory chip. The flash memory controller includes a microprocessor unit, a buffer memory, a flash memory interface unit, a host interface unit and a memory management unit. The flash memory interface unit is electrically connected to the microprocessor unit and used for connecting the flash memory chip. The buffer memory is electrically connected to the microprocessor unit. The host interface unit is electrically connected to the microprocessor unit and used to connect to the above-mentioned host system, wherein the host interface unit supports the NCQ protocol. The memory management unit is electrically connected to the micro-processing unit, and is used for receiving a plurality of host write commands from the host system through the host interface unit using the NCQ protocol. In addition, the memory management unit transmits a command sequence to the host system through the host interface unit according to the host write command. Furthermore, the memory management unit sequentially receives the host write command and a plurality of write data corresponding to the host write command from the host system through the host interface unit according to the command order, and issues cache programs to the flash memory chip respectively. Write instructions to write the write data into the flash memory chip. the
本发明范例实施例提出一种闪存储存系统,用于储存来自于一主机系统的数据。本闪存储存系统包括用以电性连接上述主机系统的一连接器、一闪存芯片以及一闪存控制器,其中连接器支持NCQ协议。闪存控制器电性连接至连接器与闪存芯片,并且用以通过连接器使用NCQ协议从主机系统中接收多个主机写入指令。此外,闪存控制器依据主机写入指令传送一下达指令顺序给主机系统。再者,闪存控制器透过连接器依据上述下达指令顺序从主机系统中依序地接收主机写入指令与对应主机写入指令的多个写入数据,并且分别地向闪存芯片下达一快取程序化指令以将写入数据写入至闪存芯片中。 Exemplary embodiments of the present invention provide a flash storage system for storing data from a host system. The flash memory storage system includes a connector, a flash memory chip and a flash memory controller for electrically connecting the above-mentioned host system, wherein the connector supports the NCQ protocol. The flash memory controller is electrically connected to the connector and the flash memory chip, and used for receiving a plurality of host write commands from the host system through the connector using the NCQ protocol. In addition, the flash memory controller transmits a command sequence to the host system according to the host write command. Furthermore, the flash memory controller sequentially receives the host write command and a plurality of write data corresponding to the host write command from the host system through the connector according to the order of issuing the above commands, and issues a cache memory to the flash memory chip respectively. Program instructions to write write data into the flash memory chip. the
基于上述,本发明范例实施例的下达程序化指令的方法、闪存控制器与闪存储存系统能够有效地缩短执行主机写入指令的时间,由此提升数据存取的效能。 Based on the above, the method for issuing programming instructions, the flash memory controller and the flash memory storage system of the exemplary embodiments of the present invention can effectively shorten the execution time of the host write instruction, thereby improving the performance of data access. the
下面通过具体实施例并结合附图对本发明做进一步的详细描述。 The present invention will be described in further detail below through specific embodiments and in conjunction with the accompanying drawings. the
附图说明 Description of drawings
图1是图示一般闪存储存系统的概要方块图; Figure 1 is a schematic block diagram illustrating a general flash memory storage system;
图2A是根据本发明实施例图示使用闪存储存装置的主机系统; 2A is a diagram illustrating a host system using a flash memory storage device according to an embodiment of the present invention;
图2B是根据本发明范例实施例所图示的计算机、输入/输出装置与闪存储存装置的示意图; 2B is a schematic diagram of a computer, an input/output device, and a flash storage device according to an exemplary embodiment of the present invention;
图2C是根据本发明另一范例实施例所图示的主机系统与闪存储存装置的示意图; 2C is a schematic diagram of a host system and a flash storage device according to another exemplary embodiment of the present invention;
图2D是根据本发明范例实施例所图示的闪存储存装置的概要方块图; 2D is a schematic block diagram of a flash memory storage device illustrated according to an exemplary embodiment of the present invention;
图3是根据本发明范例实施例所图示的闪存晶粒的概要方块图; 3 is a schematic block diagram of a flash memory die illustrated according to an exemplary embodiment of the present invention;
图4A是根据本发明范例实施例所图示的闪存控制器透过数据输入/输出总线下达快取程序化指令的范例示意图; FIG. 4A is a schematic diagram of an example of a flash memory controller issuing cache programming instructions through a data input/output bus according to an exemplary embodiment of the present invention;
图4B是根据图4A所示的指令所图示闪存芯片的运作时序图; FIG. 4B is an operation timing diagram of the illustrated flash memory chip according to the instruction shown in FIG. 4A;
图5是根据本发明范例实施例所图示的下达程序化指令的流程图。 FIG. 5 is a flowchart illustrating issuing a programmatic instruction according to an exemplary embodiment of the present invention. the
附图标记说明: Explanation of reference signs:
110:主机系统; 120:闪存储存装置; 110: host system; 120: flash storage device;
122:连接器; 124:闪存控制器; 122: connector; 124: flash memory controller;
126:闪存模块; 128:数据输入/输出总线; 126: Flash memory module; 128: Data input/output bus;
132:缓冲区; 134:存储器; 132: Buffer; 134: Memory;
200:闪存储存装置; 202:连接器; 200: flash storage device; 202: connector;
204:闪存控制器; 206:微处理器单元; 204: flash controller; 206: microprocessor unit;
208:内存管理单元; 210:主机接口单元; 208: memory management unit; 210: host interface unit;
212:闪存接口单元; 214:缓冲存储器; 212: Flash memory interface unit; 214: Buffer memory;
220:闪存芯片; 290:主机系统; 220: flash memory chip; 290: host system;
295:总线; 300:第0闪存模块; 295: bus; 300: 0th flash memory module;
302:第0数据输入/输出总线; 310:第1闪存模块; 302: the 0th data input/output bus; 310: the 1st flash memory module;
312:第1数据输入/输出总线; 320:第2闪存模块; 312: the first data input/output bus; 320: the second flash memory module;
322:第2数据输入/输出总线; 330:第3闪存模块; 322: the second data input/output bus; 330: the third flash memory module;
332:第3数据输入/输出总线; 340:第4闪存模块; 332: the third data input/output bus; 340: the fourth flash memory module;
342:第4数据输入/输出总线; 350:第5闪存模块; 342: the 4th data input/output bus; 350: the 5th flash memory module;
352:第5数据输入/输出总线; 360:第6闪存模块; 352: the fifth data input/output bus; 360: the sixth flash memory module;
362:第6数据输入/输出总线; 370:第7闪存模块; 362: the sixth data input/output bus; 370: the seventh flash memory module;
372:第7数据输入/输出总线; 400:第0闪存晶粒; 372: the 7th data input/output bus; 400: the 0th flash memory die;
402:储存区; 404:第一缓冲区; 402: storage area; 404: first buffer zone;
406:第二缓冲区; 410:第1闪存晶粒; 406: the second buffer zone; 410: the first flash memory die;
420:第2闪存晶粒; 430:第3闪存晶粒; 420: the second flash memory die; 430: the third flash memory die;
440:第4闪存晶粒; 450:第5闪存晶粒; 440: the fourth flash memory die; 450: the fifth flash memory die;
460:第6闪存晶粒; 470:第7闪存晶粒; 460: the sixth flash memory die; 470: the seventh flash memory die;
480:第8闪存晶粒; 490:第9闪存晶粒; 480: the 8th flash memory die; 490: the 9th flash memory die;
500:第10闪存晶粒; 510:第11闪存晶粒; 500: the 10th flash memory die; 510: the 11th flash memory die;
520:第12闪存晶粒; 530:第13闪存晶粒; 520: the 12th flash memory die; 530: the 13th flash memory die;
540:第14闪存晶粒; 550:第15闪存晶粒; 540: the 14th flash memory grain; 550: the 15th flash memory grain;
1100:计算机; 1102:微处理器; 1100: computer; 1102: microprocessor;
1104:随机存取内存; 1106:输入/输出装置; 1104: random access memory; 1106: input/output device;
1108:系统总线; 1110:数据传输接口; 1108: system bus; 1110: data transmission interface;
1202:鼠标; 1204:键盘; 1202: mouse; 1204: keyboard;
1206:显示器; 1208:打印机; 1206: monitor; 1208: printer;
1212:随身碟; 1214:记忆卡; 1212: flash drive; 1214: memory card;
1216:固态硬盘; 1310:数位相机; 1216: SSD; 1310: Digital camera;
1310a:SD卡; 1310b:MMC卡; 1310a: SD card; 1310b: MMC card;
1310c:CF卡; 1310d:记忆棒; 1310c: CF card; 1310d: memory stick;
1310e:嵌入式储存装置; W1、W2、W3:指令; 1310e: embedded storage device; W1, W2, W3: instructions;
D1、D2、D3:数据; ADD1、ADD2、ADD3:实体地址; D1, D2, D3: data; ADD1, ADD2, ADD3: entity address;
CM1、CM2、CM3、CM4、CM5、CM6、CM7、CM8、CM9:指令; CM1, CM2, CM3, CM4, CM5, CM6, CM7, CM8, CM9: instructions;
T1、T2、T3:数据传输; B1、B2、B3:忙碌时间; T1, T2, T3: data transmission; B1, B2, B3: busy time;
S501、S503、S505、S507、S509、S511、S513、S515、S517:下达程序化指令的步骤。 S501, S503, S505, S507, S509, S511, S513, S515, S517: the step of issuing a programming instruction. the
具体实施方式 Detailed ways
闪存储存装置一般而言包括闪存芯片与控制器(也称,控制电路)。通常闪存储存装置会与主机系统一起使用,以使主机系统可将数据写入至闪存储存装置或从闪存储存装置中读取数据。另外,也有闪存储存装置是包括嵌入式闪存与可执行于主机系统上以实质地作为此嵌入式闪存控制器的软件。 A flash memory storage device generally includes a flash memory chip and a controller (also referred to as a control circuit). Typically, a flash storage device is used with a host system so that the host system can write data to or read data from the flash storage device. In addition, there are also flash storage devices that include embedded flash memory and software executable on a host system that essentially acts as a controller for the embedded flash memory. the
图2A是根据本发明实施例图示使用闪存储存装置的主机系统。 FIG. 2A illustrates a host system using a flash storage device according to an embodiment of the present invention. the
请参照图2A,主机系统290一般包括计算机1100与输入/输出(input/output,I/O)装置1106。计算机1100包括微处理器1102、随机存取内存(random access memory,RAM)1104、系统总线1108以及数据传输接口1110。输入/输出装置1106包括如图2B的鼠标1202、键盘1204、显示器1206与打印机1208。必须了解的是,图2B所示的装置非限制输入/输出装置1106,输入/输出装置1106可还包括其它装置。
Referring to FIG. 2A , the
在本发明实施例中闪存储存装置200是通过数据传输接口1110与主机系统290的其它组件电性连接。通过微处理器1102、随机存取内存1104与输入/输出装置1106的处理可将数据写入至闪存储存装置200或从闪存储存装置200中读取数据。例如,闪存储存装置200可以是如图2B所示的随身碟 1212、记忆卡1214或固态硬盘(Solid State Drive,SSD)1216。
In the embodiment of the present invention, the
一般而言,主机系统290可实质地为可储存数据的任意系统。虽然在本范例实施例中,主机系统290是以计算机系统来作说明,然而,在本发明另一范例实施例中主机系统290可以是数字相机、摄影机、通信装置、音讯播放器或视讯播放器等系统。例如,在主机系统为数字相机(摄影机)1310时,闪存储存装置则为其所使用的SD卡1310a、MMC卡1310b、CF卡1310c、记忆棒(memory stick)1310d或嵌入式储存装置1310e(如图2C所示)。嵌入式储存装置1310e包括嵌入式多媒体卡(Embedded MMC,eMMC)。值得一提的是,嵌入式多媒体卡是直接电性连接于主机系统的基板上。
In general,
图2D是图示图2A所示闪存储存装置200的详细方块图。
FIG. 2D is a detailed block diagram illustrating the
请参照图2D,闪存储存装置200包括连接器202、闪存控制器204与闪存芯片220。
Referring to FIG. 2D , the
连接器202是电性连接至闪存控制器204并且用以通过总线295连接主机系统290。在本范例实施例中,连接器202为序列先进附件(Serial AdvancedTechnology Attachment,SATA)连接器。特别是,连接器202支持原生指令排序(Native Command Queuing,NCQ)协议,并且主机系统290与闪存控制器204之间是以NCQ协议来传送写入指令。具体来说,当主机系统290与闪存控制器204之间以NCQ协议传送主机写入指令时,主机系统290会先将欲发送的多个主机写入指令一起传送给闪存控制器204,并且闪存控制器204向主机系统290响应其预期下达指令顺序,特别是,在此过程中主机系统290仅传送欲下达的指令给闪存控制器204,而不会传送欲写入的数据。之后,主机系统290依据闪存控制器204的响应来传送主机写入指令与数据,并且闪存控制器204于完成所有主机写入指令后再响应主机系统290每一个写入指令的执行状态。特别是,当发生程序化错误(program fail)时,主机系统290会根据闪存控制器204的回报信息(即,执行状态)来将对应发生程序化错误的指令与数据重新传送给闪存控制器204。或者,在本发明另一范例实 施例中,当发生程序化错误(program fail)时,主机系统290会将所有指令与数据重新传送给闪存控制器204。
The connector 202 is electrically connected to the flash memory controller 204 and used for connecting to the
此外,必须了解的是,在本发明范例实施例中,连接器202为支持NCQ的SATA连接器,然本发明不限于此,连接器202也可以是其它支持NCQ协议的连接器。 In addition, it must be understood that, in the exemplary embodiment of the present invention, the connector 202 is a SATA connector supporting NCQ, but the present invention is not limited thereto, and the connector 202 may also be other connectors supporting the NCQ protocol. the
闪存控制器204会执行以硬件型式或韧体型式实作的多个逻辑闸或控制指令,并且根据主机系统290的指令在闪存芯片220中进行数据的写入、读取与抹除等运作。闪存控制器204包括微处理器单元206、内存管理单元208、主机接口单元210、闪存接口单元212与缓冲存储器214。
The flash memory controller 204 executes a plurality of logic gates or control commands implemented in hardware or firmware, and writes, reads, and erases data in the flash memory chip 220 according to the instructions of the
微处理器单元206为闪存控制器204的主控单元,用以与内存管理单元208、主机接口单元210、闪存接口单元212与缓冲存储器214等协同合作以进行闪存储存装置200的各种运作。
The microprocessor unit 206 is the main control unit of the flash memory controller 204 , and cooperates with the memory management unit 208 , the host interface unit 210 , the flash memory interface unit 212 , and the buffer memory 214 to perform various operations of the flash
内存管理单元208是电性连接至微处理器单元206,用以执行根据本范例实施例的下达程序化指令与区块管理机制,内存管理单元208的运作将于以下配合图式作详细说明。 The memory management unit 208 is electrically connected to the microprocessor unit 206 for executing the programmed instructions and the block management mechanism according to the present exemplary embodiment. The operation of the memory management unit 208 will be described in detail below with reference to the drawings. the
在本范例实施例中,内存管理单元208是以一韧体型式实作在闪存控制器204中。例如,将包括多个控制指令的内存管理单元208烧录至一程序内存(例如,只读存储器(Read Only Memory,ROM))中并且将此程序内存嵌入在闪存控制器204中,当闪存储存装置200运作时,内存管理单元208的多个控制指令会由微处理器单元206来执行以完成根据本发明实施例的下达程序化指令与区块管理机制。
In this exemplary embodiment, the memory management unit 208 is implemented in the flash memory controller 204 in the form of a firmware. For example, burn the memory management unit 208 including a plurality of control instructions into a program memory (for example, read only memory (Read Only Memory, ROM)) and embed this program memory in the flash memory controller 204, when the flash memory stores When the
在本发明另一范例实施例中,内存管理单元208的控制指令也可以程序代码型式储存于闪存芯片220的特定区域(例如,闪存芯片中专用于存放系统数据的系统区)中。同样的,当闪存储存装置200运作时,内存管理单元208的多个控制指令会由微处理器单元206来执行。此外,在本发明另一范例实施例中,内存管理单元208也可以一硬件型式实作在闪存控制器204中。
In another exemplary embodiment of the present invention, the control instructions of the memory management unit 208 may also be stored in a specific area of the flash memory chip 220 (for example, a system area dedicated to storing system data in the flash memory chip) in the form of program code. Likewise, when the
主机接口单元210是电性连接至微处理器单元206并且用以接收与识别主机系统290所传送的指令与数据。也就是说,主机系统290所传送的指令与数据会通过主机接口单元210来传送至微处理器单元206。在本范例实施例中,主机接口单元210是对应连接器202为SATA接口。然而,必须了解的是本发明不限于此,主机接口单元210也可以是其它适合的数据传输接口。
The host interface unit 210 is electrically connected to the microprocessor unit 206 and used for receiving and identifying instructions and data transmitted by the
闪存接口单元212是电性连接至微处理器单元206并且用以存取闪存芯片220。也就是说,欲写入至闪存芯片220的数据会通过闪存接口单元212转换为闪存芯片220所能接受的格式。 The flash interface unit 212 is electrically connected to the microprocessor unit 206 and used for accessing the flash chip 220 . That is to say, the data to be written into the flash memory chip 220 will be converted into a format acceptable to the flash memory chip 220 through the flash memory interface unit 212 . the
缓冲存储器214是电性连接至微处理器单元206并且用以暂存来自于主机系统290的数据与指令或来自于闪存芯片220的数据。
The buffer memory 214 is electrically connected to the microprocessor unit 206 and used for temporarily storing data and instructions from the
此外,虽未图示于本范例实施例中,但闪存控制器204也还包括错误校正单元与电源管理单元等一般功能模块。 In addition, although not shown in this exemplary embodiment, the flash memory controller 204 also includes general functional modules such as an error correction unit and a power management unit. the
闪存芯片220是电性连接至闪存控制器204并且用以储存数据。闪存芯片220包括第0闪存模块300、第1闪存模块310、第2闪存模块320、第3闪存模块330、第4闪存模块340、第5闪存模块350、第6闪存模块360与第7闪存模块370。在本范例实施例中,第0闪存模块300、第1闪存模块310、第2闪存模块320、第3闪存模块330、第4闪存模块340、第5闪存模块350、第6闪存模块360与第7闪存模块370为多层存储器(Multi LevelCell,MLC)NAND闪存模块。然而,本发明不限于此,第0闪存模块300、第1闪存模块310、第2闪存模块320、第3闪存模块330、第4闪存模块340、第5闪存模块350、第6闪存模块360与第7闪存模块370也可是单层存储器(Single Level Cell,SLC)NAND闪存模块。 The flash chip 220 is electrically connected to the flash controller 204 and used for storing data. The flash memory chip 220 includes the 0th flash memory module 300, the 1st flash memory module 310, the 2nd flash memory module 320, the 3rd flash memory module 330, the 4th flash memory module 340, the 5th flash memory module 350, the 6th flash memory module 360 and the 7th flash memory module 370. In this exemplary embodiment, the 0th flash memory module 300, the 1st flash memory module 310, the 2nd flash memory module 320, the 3rd flash memory module 330, the 4th flash memory module 340, the 5th flash memory module 350, the 6th flash memory module 360 and the 7. The flash memory module 370 is a multi-level memory (Multi LevelCell, MLC) NAND flash memory module. However, the present invention is not limited thereto, the 0th flash memory module 300, the 1st flash memory module 310, the 2nd flash memory module 320, the 3rd flash memory module 330, the 4th flash memory module 340, the 5th flash memory module 350, the 6th flash memory module 360 and The seventh flash memory module 370 may also be a single-level memory (Single Level Cell, SLC) NAND flash memory module. the
在本范例实施例中,第0闪存模块300、第1闪存模块310、第2闪存模块320、第3闪存模块330、第4闪存模块340、第5闪存模块350、第6闪存模块360与第7闪存模块370是分别地电性连接至闪存控制器204。具体来说,闪存控制器204的闪存接口单元212分别地通过第0数据输入/输出总 线(Data input/output bus)302、第1数据输入/输出总线312、第2数据输入/输出总线322、第3数据输入/输出总线332、第4数据输入/输出总线342、第5数据输入/输出总线352、第6数据输入/输出总线362与第7数据输入/输出总线372传送数据给第0闪存模块300、第1闪存模块310、第2闪存模块320、第3闪存模块330、第4闪存模块340、第5闪存模块350、第6闪存模块360与第7闪存模块370。 In this exemplary embodiment, the 0th flash memory module 300, the 1st flash memory module 310, the 2nd flash memory module 320, the 3rd flash memory module 330, the 4th flash memory module 340, the 5th flash memory module 350, the 6th flash memory module 360 and the 7. The flash memory modules 370 are electrically connected to the flash memory controller 204 respectively. Specifically, the flash memory interface unit 212 of the flash memory controller 204 passes through the 0th data input/output bus (Data input/output bus) 302, the first data input/output bus 312, and the second data input/output bus 322 respectively. , the 3rd data input/output bus 332, the 4th data input/output bus 342, the 5th data input/output bus 352, the 6th data input/output bus 362 and the 7th data input/output bus 372 transmit data to the 0th The flash memory module 300 , the first flash memory module 310 , the second flash memory module 320 , the third flash memory module 330 , the fourth flash memory module 340 , the fifth flash memory module 350 , the sixth flash memory module 360 and the seventh flash memory module 370 . the
在本范例实施例中,第0闪存模块300包括第0闪存晶粒(die)400与第1闪存晶粒410,第1闪存模块310包括第2闪存晶粒420与第3闪存晶粒430,第2闪存模块320包括第4闪存晶粒440与第5闪存晶粒450,第3闪存模块330包括第6闪存晶粒460与第7闪存晶粒470,第4闪存模块340包括第8闪存晶粒480与第9闪存晶粒490,第5闪存模块350包括第10闪存晶粒500与第11闪存晶粒510,第6闪存模块360包括第12闪存晶粒520与第13闪存晶粒530以及第7闪存模块370包括第14闪存晶粒540与第15闪存晶粒550。 In this exemplary embodiment, the 0th flash memory module 300 includes a 0th flash memory die 400 and a first flash memory die 410, and the first flash memory module 310 includes a second flash memory die 420 and a third flash memory die 430, The 2nd flash memory module 320 includes the 4th flash memory die 440 and the 5th flash memory die 450, the 3rd flash memory module 330 includes the 6th flash memory die 460 and the 7th flash memory die 470, the 4th flash memory module 340 includes the 8th flash memory die 480 and the 9th flash memory die 490, the 5th flash memory module 350 includes the 10th flash memory die 500 and the 11th flash memory die 510, the sixth flash memory module 360 includes the 12th flash memory die 520 and the 13th flash memory die 530 and The seventh flash memory module 370 includes a fourteenth flash memory die 540 and a fifteenth flash memory die 550 . the
值得一提的是,在本发明范例实施例中,第0闪存模块300、第1闪存模块310、第2闪存模块320、第3闪存模块330、第4闪存模块340、第5闪存模块350、第6闪存模块360与第7闪存模块370和闪存控制器204之间分别地配置第0数据输入/输出总线302、第1数据输入/输出总线312、第2数据输入/输出总线322、第3数据输入/输出总线332、第4数据输入/输出总线342、第5数据输入/输出总线352、第6数据输入/输出总线362与第7数据输入/输出总线372,因此内存管理单元208会使用平行模式(parallelmode)同时通过多条数据输入/输出总线来传送写入数据至对应的闪存模块,以提升存取速度。此外,每一闪存模块包括两个闪存晶粒,因此内存管理单元208会使用一交错模式(interleave mode)来将写入数据交错地传送至同一闪存模块内的两个闪存晶粒,以更增加存取效能。更详细来说,如上所述,在闪存晶粒中写入数据的过程包括数据传输(transfer)以及数据程序化 (program)两个部分,而交错模式(interleave mode)就是在使用同一条数据输入/输出总线传输数据的两个闪存晶粒的例子中,利用其中一个闪存晶粒正执行数据程序化的期间传送数据给另一个闪存晶粒。 It is worth mentioning that, in the exemplary embodiment of the present invention, the 0th flash memory module 300, the 1st flash memory module 310, the 2nd flash memory module 320, the 3rd flash memory module 330, the 4th flash memory module 340, the 5th flash memory module 350, The 0th data input/output bus 302, the first data input/output bus 312, the second data input/output bus 322, the third The data input/output bus 332, the 4th data input/output bus 342, the 5th data input/output bus 352, the 6th data input/output bus 362 and the 7th data input/output bus 372, so the memory management unit 208 will use Parallel mode transmits write data to corresponding flash memory modules through multiple data input/output buses at the same time, so as to improve access speed. In addition, each flash memory module includes two flash memory dies, so the memory management unit 208 uses an interleave mode to interleave write data to the two flash memory dies in the same flash memory module to further increase access performance. In more detail, as mentioned above, the process of writing data in the flash memory grain includes two parts: data transfer and data programming (program), and the interleave mode (interleave mode) is to use the same data input In the example of two flash dies that transfer data via the I/O bus, data is transferred to the other flash die while one of the flash dies is performing data programming. the
图3是根据本发明范例实施例所图示的闪存晶粒的概要方块图。在此,第0闪存晶粒400、第1闪存晶粒410、第2闪存晶粒420、第3闪存晶粒430、第4闪存晶粒440、第5闪存晶粒450、第6闪存晶粒460、第7闪存晶粒470、第8闪存晶粒480、第9闪存晶粒490、第10闪存晶粒500、第11闪存晶粒510、第12闪存晶粒520、第13闪存晶粒530、第14闪存晶粒540与第15闪存晶粒550的结构与运作方式皆相同,以下仅以第0闪存晶粒400来进行说明。 FIG. 3 is a schematic block diagram of a flash memory die illustrated according to an exemplary embodiment of the present invention. Here, the 0th flash memory die 400, the first flash memory die 410, the second flash memory die 420, the third flash memory die 430, the fourth flash memory die 440, the fifth flash memory die 450, and the sixth flash memory die 460, the seventh flash memory die 470, the eighth flash memory die 480, the ninth flash memory die 490, the tenth flash memory die 500, the eleventh flash memory die 510, the twelfth flash memory die 520, and the thirteenth flash memory die 530 The structure and operation of the 14th flash memory die 540 and the 15th flash memory die 550 are the same, and only the 0th flash memory die 400 will be described below. the
请参照图3,第0闪存晶粒400包括储存区402、第一缓冲区404与第二缓冲区406。
Referring to FIG. 3 , the 0th flash die 400 includes a
储存区402包括多个实体区块并且用以储存数据。实体区块为抹除的最小单位。亦即,每一实体区块含有最小数目的一并被抹除的存储器。每一实体区块具有数个页面(page)。在本范例实施例中,页面为程序化的最小单元。换言之,页面为写入数据或读取数据的最小单元。每一页面通常包括使用者数据区与冗余区。使用者数据区用以储存使用者的数据,而冗余区用以储存系统的数据(例如,错误检查与校正码(Error Checking and Correcting Code,ECC Code)。
The
值得一提的是,第0闪存晶粒400、第1闪存晶粒410、第2闪存晶粒420、第3闪存晶粒430、第4闪存晶粒440、第5闪存晶粒450、第6闪存晶粒460、第7闪存晶粒470、第8闪存晶粒480、第9闪存晶粒490、第10闪存晶粒500、第11闪存晶粒510、第12闪存晶粒520、第13闪存晶粒530、第14闪存晶粒540与第15闪存晶粒550中的实体区块会被内存管理单元208群组为多个实体单元来进行数据的写入、读取与抹除。特别是每一实体单元是由多个闪存晶粒中的实体区块所组成,因此内存管理单元208会使用上述 平行模式与交错模式来提升存取的速度。
It is worth mentioning that the 0th
再者,由于闪存的存储器仅能从“1”程序化为“0”,因此要更新实体区块内的数据时必须先抹除实体区块内的数据。然而,闪存的写入是以页面为单位,而抹除是以实体区块为单位,所以储存区402中的实体区块会以轮替方式来储存数据。具体来说,内存管理单元208会将分组的实体单元逻辑地分组为系统区(system area)、数据区(data area)、备用区(spare area)与取代区(replacement area),其中分组为系统区的实体单元是用以储存闪存储存装置的相关重要信息,而分组为取代区的实体单元是用以取代数据区或备用区中已损坏的实体单元,因此在一般存取状态下,主机系统290是无法存取系统区与取代区中的实体单元。至于分组为数据区的实体单元中会储存由主机写入指令所写入的数据,而备用区中的实体单元是用以在执行主机写入指令时替换数据区中的实体单元。例如,当闪存储存装置200接受到主机系统290的主机写入指令而欲更新(或写入)数据至数据区中某一实体单元的某一页面时,内存管理单元208会从备用区中提取一实体单元并且将欲被更新的实体单元中的有效旧数据与欲写入的新数据写入至从备用区中提取的实体单元中,并且将已写入有效旧数据与新数据的实体单元逻辑地关联为数据区,并且将数据区中欲被更新的实体单元进行抹除并逻辑地关联为备用区。为了能够让主机系统290能够顺利地存取以轮替方式储存数据的实体单元,闪存储存装置200会提供逻辑地址给主机系统290。也就是说,闪存储存装置200会通过在逻辑地址-实体地址对映表(logical address-physicaladdress mapping table)中记录与更新逻辑地址与数据区的实体单元之间的对映关系来反映实体单元的轮替,所以主机系统290仅需要针对所提供逻辑地址进行写入而闪存储存装置200会依据逻辑地址-实体地址对映表对所对映的实体单元的实体地址进行读取或写入数据。
Furthermore, since the memory of the flash memory can only be programmed from "1" to "0", the data in the physical block must be erased first when updating the data in the physical block. However, the flash memory is written in units of pages and erased in units of physical blocks, so the physical blocks in the
第一缓冲区404与第二缓冲区406是用以暂存闪存控制器204所传送的数据。如上所述,在第0闪存晶粒400中写入数据的过程包括数据传输以及 数据程序化两个部分。在数据传输的部分,闪存控制器204会将欲写入的数据传输至第一缓冲区404,并且之后,欲写入的数据会被搬移至第二缓冲区406。而在数据程序化的部分,欲写入的数据会从第二缓冲区406中写入至储存区402。在此,第一缓冲区404也称为数据快取(data cache)区,而第二缓冲区406也称为快取缓冲(cache buffer)区,其中第一缓冲区404与第二缓冲区406可分别暂存一个页面的写入数据以对应程序化单位(即,页面)。
The
具体来说,当内存管理单元208从主机系统290接收到主机写入指令与写入数据而需将写入数据写入至第0闪存晶粒400时,内存管理单元208会通过闪存接口单元212与数据输入/输出总线302下达程序化指令,而此程序化指令中的欲写入的数据从缓冲存储器214中被传输至第一缓冲区404,之后欲写入的数据会从第一缓冲区404中被搬移至第二缓冲区406,最后,数据会从第二缓冲区406被程序化至储存区402。特别是,在本范例实施例中,内存管理单元208仅会使用是由“指令W1”、“实体地址”、“写入数据”与“指令W3”等字符串所组成程序化指令来程序化数据,其中内存管理单元208通过“指令W1”指示第0闪存晶粒400准备执行程序化程序,通过“实体地址”指示第0闪存晶粒400欲程序化的实体地址,通过“写入数据”指示第0闪存晶粒400欲程序化的数据以及通过“指令W3”指示第0闪存晶粒400开始执行快取程序化(cache program)。在此,当使用程序化指令中的“指令W3”时,闪存控制器204会于数据已从第一缓冲区404中被搬移第二缓冲区406时就接收到第0闪存晶粒400的确认信息,而可处理下一个指令。
Specifically, when the memory management unit 208 receives the host write command and write data from the
例如,在闪存控制器204使用NCQ协议从主机系统290中接收到两个连续主机写入指令而需于第0闪存晶粒400的两个页面执行程序化的例子中,由于第0闪存晶粒400具有两个缓冲区(即,第一缓冲区404与第二缓冲区406),因此当第0闪存晶粒400已将第一个主机写入指令的数据从第一缓冲区404搬移至第二缓冲区406之后,第一缓冲区404就可被清除并接收第二个主机写入指令的数据。特别是,在第0闪存晶粒400正将第一个主机写入 指令的写入数据从第二缓冲区406中程序化至储存区402期间,第一缓冲区404可负责接收下一个程序化指令的写入数据(即,第二个主机写入指令的数据)。也就是说,通过使用“指令W3”可使得内存管理单元208在无需等待第0闪存晶粒400完成第一个主机写入指令的程序化的情况下,就可继续处理第二个主机写入指令,并将第二个主机写入指令的写入数据传输至第一缓冲区404中。因此,第0闪存晶粒400可同时地执行第一个主机写入指令的写入数据的数据程序化和第二个主机指令的写入数据的数据传输,而缩短执行主机写入指令的时间。
For example, in the example where the flash controller 204 receives two consecutive host write commands from the
图4A是根据本发明范例实施例所图示的闪存控制器透过数据输入/输出总线下达快取程序化指令的范例示意图,并且图4B是根据图4A所示的指令所图示闪存芯片的运作时序图。在图4A与图4B的范例中,内存管理单元208是使用NCQ协议从主机系统290中接收到3个主机写入指令。在此,此3个主机写入指令欲写入的逻辑地址为连续的3个逻辑地址,并且内存管理单元208会依据此些逻辑地址的顺序来产生下达指令顺序,以使主机系统290依据内存管理单元208所产生的下达指令顺序来下达此3个主机写入指令,其中第1个主机写入指令包括欲写入的逻辑地址及欲写入的数据D1,第2个主机写入指令包括欲写入的逻辑地址及欲写入的数据D2,第3个主机写入指令包括欲写入的逻辑地址及欲写入的数据D3,并且此3个主机写入指令欲于写入的逻辑地址是对映至第0闪存晶粒400的实体区块。
FIG. 4A is an exemplary schematic diagram of a flash memory controller illustrating a cache programming command through a data input/output bus according to an exemplary embodiment of the present invention, and FIG. 4B is a diagram of a flash memory chip illustrated according to the command shown in FIG. 4A Operation sequence diagram. In the example shown in FIG. 4A and FIG. 4B , the memory management unit 208 receives three host write commands from the
请参照图4A与图4B,当闪存控制器204的内存管理单元208依据该下达指令顺序接收到来自于主机系统290的第1个主机写入指令及欲写入的数据后,内存管理单元208会依据第1个主机写入指令中的逻辑地址与其欲写入的数据D1中向闪存芯片220下达由“指令W1”、“ADD1”、“数据D1”与“指令W3”等字符串所组成的快取程序化指令(如图4A所示的指令CM1、指令CM2、传输T1与指令CM3),其中“ADD1”表示程序化数据的实体地址。也是就说,内存管理单元208会依据逻辑地址-实体地址对映表将主机写入指 令中的逻辑地址所对映的实体地址传送给第0闪存晶粒400(即,指令CM2),并且将数据D1传输至第一缓冲区404(即,传输T1)。之后,第0闪存晶粒400会依据快取程序化指令(即,指令CM3)将数据D1从第一缓冲区404搬移至第二缓冲区406,并且在完成将数据D1从第一缓冲区404搬移至第二缓冲区406之后,将数据D1从第二缓冲区406中程序化至储存区402。特别是,在第0闪存晶粒400开始执行指令CM3时,第0闪存晶粒400会处于一忙碌状态,并且在完成将数据D1从第一缓冲区404搬移至第二缓冲区406之后即回复为一待命(ready)状态(即,忙碌时间B1)。在第0闪存晶粒400回复为待命状态时,内存管理单元208会响应主机系统290,从主机系统290中接收第2个主机写入指令与数据D2,并且对第0闪存晶粒400下达由“指令W1”、“ADD2”、“数据D2”与“指令W3”等字符串所组成的快取程序化指令(如图4A所示的指令CM4、指令CM5、传输T2与指令CM6)以将第2个主机写入指令的数据D2传输至第一缓冲区404(即,传输T2)。此时,数据D1的数据程序化与数据D2的数据传输是同时地进行。也就是说,由于第0闪存晶粒400中存有2个缓冲区(即,第一缓冲区404与第二缓冲区406),因此透过快取写入指令来将欲写入的数据从第一缓冲区404搬移至第二缓冲区406后,第二缓冲区406用于将数据程序化至储存区402,而第一缓冲区406就可继续从缓冲存储器214中接收数据。
Please refer to FIG. 4A and FIG. 4B, when the memory management unit 208 of the flash memory controller 204 receives the first host write command and the data to be written from the
接着,在传输数据D2之后,当第0闪存晶粒400完成数据D1的数据程序化后,第0闪存晶粒400会依据指令CM6将数据D2从第一缓冲区404搬移至第二缓冲区406,并且在完成将数据D2从第一缓冲区404搬移至第二缓冲区406之后,将数据D2从第二缓冲区406中程序化至储存区402。在第0闪存晶粒400开始执行指令CM6时,第0闪存晶粒400会处于忙碌状态,并且在完成将数据D2从第一缓冲区404搬移至第二缓冲区406之后即回复为待命状态(即,忙碌时间B2)。类似地,在第0闪存晶粒400回复为待命状态时,内存管理单元208会响应主机系统290,从主机系统290中接收第3个主机 写入指令与数据D3,并且对第0闪存晶粒400下达由“指令W1”、“ADD3”、“数据D3”与“指令W3”等字符串所组成的快取程序化指令(如图4A所示的指令CM7、指令CM8、传输T3与指令CM9)以将第3个主机写入指令的数据D3传输至第一缓冲区404(即,传输T3)。
Next, after the data D2 is transmitted, when the 0th flash memory die 400 completes the data programming of the data D1, the 0th flash memory die 400 will move the data D2 from the
接着,在传输数据D3之后,当第0闪存晶粒400完成数据D2的数据程序化后,第0闪存晶粒400会依据指令CM9将数据D3从第一缓冲区404搬移至第二缓冲区406,并且在完成将数据D3从第一缓冲区404搬移至第二缓冲区406之后,将数据D 3从第二缓冲区406中程序化至储存区402。类似地,在第0闪存晶粒400开始执行指令CM9时,第0闪存晶粒400会处于忙碌状态,并且在完成将数据D3从第一缓冲区404搬移至第二缓冲区406之后即回复为待命状态(即,忙碌时间B3)。
Next, after the data D3 is transmitted, when the 0th flash memory die 400 completes the data programming of the data D2, the 0th flash memory die 400 will move the data D3 from the
值得一提的是,在内存管理单元208从第0闪存晶粒400中收到回复为待命状态的确认信息中会包括快取状态位与实际忙碌状态位,其中快取状态位是表示第0闪存晶粒400是否已准备好再接收下一个写入资料,而实际忙碌状态位是表示第0闪存晶粒400目前是否正处于实际忙碌状态。由此,闪存控制器204通过确认信息中的信息可正确地判断第0闪存晶粒400是否正在程序化数据。在图4A与图4B的范例中,在忙碌时间B3之后,虽然第0闪存晶粒400已回复处于待命状态,然由于内存管理单元208已对此次通过NCQ协议所接收的所有主机写入指令完成下达程序化指令的动作,因此内存管理单元208会持续确认第0闪存晶粒400已完成所有数据的程序化(即,内存管理单元208会确认第0闪存晶粒400已处于非实际忙碌状态)之后,向主机系统290回复每一主机写入指令的执行状态。
It is worth mentioning that the memory management unit 208 will include the cache status bit and the actual busy status bit in the confirmation message that the memory management unit 208 receives from the 0th
图5是根据本发明范例实施例所图示的下达程序化指令的流程图。 FIG. 5 is a flowchart illustrating issuing a programmatic instruction according to an exemplary embodiment of the present invention. the
请参照图5,首先,在步骤S501中闪存储存装置200从主机系统290中接收主机写入指令。具体来说,在本范例实施例中,主机系统290是使用NCQ协议来传送多个主机写入指令(如图4A所述的2个主机写入指令)。因此,在 步骤S501中闪存储存装置200会先接收到主机系统290预计下达的多个主机写入指令。
Please refer to FIG. 5 , first, in step S501 , the
接着,在步骤S503中内存管理单元208会依据所接收的主机写入指令所对应的逻辑地址来产生一下达指令顺序。具体来说,在本实施例中,当内存管理单元208使用NCQ协议从主机系统290中接收到多个主机写入指令时,内存管理单元208会依据主机写入指令中的逻辑地址来排序以决定预期的执行主机写入指令的顺序。值得一提的是,在本范例另一范例实施例中,内存管理单元208也可不重新排列所接收到主机写入指令的顺序,而以主机系统290原本下达主机写入指令的顺序来产生下达指令顺序。
Next, in step S503 , the memory management unit 208 generates an instruction sequence according to the logical address corresponding to the received host write instruction. Specifically, in this embodiment, when the memory management unit 208 receives multiple host write commands from the
在步骤S505中内存管理单元208会将所产生的下达指令顺序传送给主机系统。之后,在步骤S507中内存管理单元208会依据下达指令顺序一个接着一个地从主机系统290中接收此些主机写入指令与对应此些主机写入指令的写入数据。
In step S505 , the memory management unit 208 transmits the generated command order to the host system. Afterwards, in step S507 , the memory management unit 208 receives the host write commands and the write data corresponding to the host write commands from the
之后,在步骤S509中内存管理单元208会向闪存芯片220下达快取程序化指令(例如,以“指令W1”、“实体地址”、“写入数据”与“指令W3”等字符串所组成程序化指令)。之后,在步骤S511中内存管理单元208会等候与接收闪存芯片220的确认信息,并且在步骤S513中判断是否已完成在步骤S501中主机系统290欲下达的所有主机写入指令。倘若在步骤S513中判断还未完成在步骤S501中主机系统290欲下达的所有主机写入指令时,则执行步骤S507继续接收下一个主机写入指令。
Afterwards, in step S509, the memory management unit 208 will issue a cache programming instruction to the flash memory chip 220 (for example, composed of character strings such as "command W1", "physical address", "write data" and "command W3") programmatic instructions). Afterwards, in step S511, the memory management unit 208 waits for and receives confirmation information from the flash memory chip 220, and in step S513 determines whether all host write commands to be issued by the
倘若在步骤S513中判断已完成在步骤S501中主机系统290欲下达的所有主机写入指令时,则在步骤S515中判断闪存芯片220是否处于实际忙碌状态。倘若在步骤S515中判断闪存芯片220非处于实际忙碌状态,则执行步骤S517响应主机系统290并结束图5的流程,反之,则继续执行步骤S511。
If it is determined in step S513 that all host write commands to be issued by the
基于上述,在使用NCQ协议来接收来自于主机系统290的多个主机写入指令的例子中,内存管理单元208会于此批依据NCQ协议所下达的所有主机 写入指令都执行完成后,向主机系统290回报所有主机写入指令的执行状态(例如,是否有发生程序化错误)。特别是,内存管理单元208会等候闪存芯片220从执行最后一个主机写入指令的实际忙碌状态回复为待命状态时,才向主机系统290回报所有主机写入指令的执行状态。
Based on the above, in the example of using the NCQ protocol to receive a plurality of host write commands from the
综上所述,本发明范例实施例的下达程序化指令方法仅使用快取程序化指令来对闪存芯片程序化,由此可大幅缩短执行主机写入指令的时间。此外,本发明范例实施例的下达程序化指令方法更利用NCQ协议来于主机系统与闪存储存装置之间传送指令,由此可避免主机系统无法正确地判断每一个主机写入指令的实际执行状态。再者,在上述范例实施例中,更利用NCQ协议来依据主机写入指令所欲写入的逻辑地址来重新排列下达主机写入指令的顺序,由此可更缩短执行主机写入指令所需的时间。 To sum up, the method for issuing a programming command according to the exemplary embodiment of the present invention only uses the cache programming command to program the flash memory chip, thereby greatly shortening the execution time of the host write command. In addition, the method for issuing programmed commands in the exemplary embodiment of the present invention further utilizes the NCQ protocol to transmit commands between the host system and the flash storage device, thereby preventing the host system from being unable to correctly determine the actual execution status of each host write command . Furthermore, in the above-mentioned exemplary embodiment, the NCQ protocol is used to rearrange the order of issuing the host write commands according to the logical addresses to be written by the host write commands, thereby shortening the time required for executing the host write commands. time. the
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。 Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still be Modifications are made to the technical solutions described in the foregoing embodiments, or equivalent replacements are made to some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention. the
Claims (12)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2009101721618A CN102023811B (en) | 2009-09-10 | 2009-09-10 | Method and system for issuing programmatic instructions to flash memory |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2009101721618A CN102023811B (en) | 2009-09-10 | 2009-09-10 | Method and system for issuing programmatic instructions to flash memory |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102023811A CN102023811A (en) | 2011-04-20 |
CN102023811B true CN102023811B (en) | 2012-11-28 |
Family
ID=43865147
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2009101721618A Active CN102023811B (en) | 2009-09-10 | 2009-09-10 | Method and system for issuing programmatic instructions to flash memory |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102023811B (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102707771A (en) * | 2012-04-01 | 2012-10-03 | 宜鼎国际股份有限公司 | Embedded memory module and host board inserted therein |
TWI544487B (en) * | 2015-01-22 | 2016-08-01 | 慧榮科技股份有限公司 | Data storage device and flash memory control method |
CN107632902B (en) * | 2016-07-18 | 2021-03-30 | 深圳衡宇芯片科技有限公司 | Method, controller and storage system for replying data in case of programming failure |
US20200073595A1 (en) * | 2018-09-02 | 2020-03-05 | Silicon Motion Inc. | Flash memory controller capable of improving IOPS performance and corresponding method |
TWI808229B (en) * | 2019-07-29 | 2023-07-11 | 宜鼎國際股份有限公司 | System and method capable of controlling electronic apparatus to execute program |
US11392499B2 (en) * | 2020-09-18 | 2022-07-19 | Kioxia Corporation | Dynamic buffer caching of storage devices |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6076137A (en) * | 1997-12-11 | 2000-06-13 | Lexar Media, Inc. | Method and apparatus for storing location identification information within non-volatile memory devices |
CN1841297A (en) * | 2005-04-01 | 2006-10-04 | 三星电子株式会社 | Flash memory and processing system including flash memory |
CN1914627A (en) * | 2004-02-03 | 2007-02-14 | 松下电器产业株式会社 | Memory card, data processor, memory card control method and memory card setting method |
CN101196850A (en) * | 2007-12-28 | 2008-06-11 | 祥硕科技股份有限公司 | Data access integration method and its system |
-
2009
- 2009-09-10 CN CN2009101721618A patent/CN102023811B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6076137A (en) * | 1997-12-11 | 2000-06-13 | Lexar Media, Inc. | Method and apparatus for storing location identification information within non-volatile memory devices |
CN1914627A (en) * | 2004-02-03 | 2007-02-14 | 松下电器产业株式会社 | Memory card, data processor, memory card control method and memory card setting method |
CN1841297A (en) * | 2005-04-01 | 2006-10-04 | 三星电子株式会社 | Flash memory and processing system including flash memory |
CN101196850A (en) * | 2007-12-28 | 2008-06-11 | 祥硕科技股份有限公司 | Data access integration method and its system |
Also Published As
Publication number | Publication date |
---|---|
CN102023811A (en) | 2011-04-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TWI424435B (en) | Method for giving program commands to flash memory chips, and controller and storage system using the same | |
US9183143B2 (en) | Memory device that specifies a size of a segment of write data | |
TWI409633B (en) | Flash memory storage device, controller thereof, and method for programming data | |
TWI435215B (en) | Method for giving read commands and reading data, and controller and storage system using the same | |
US8812784B2 (en) | Command executing method, memory controller and memory storage apparatus | |
TWI454906B (en) | Data read method, and flash memory controller and storage system using the same | |
US8812776B2 (en) | Data writing method, and memory controller and memory storage device using the same | |
CN103377129B (en) | Data writing method, memory controller and memory storage device | |
TWI446349B (en) | Non-volatile memory access method and system, and non-volatile memory controller | |
CN102023811B (en) | Method and system for issuing programmatic instructions to flash memory | |
TWI421870B (en) | Data writing method for a flash memory, and controller and storage system using the same | |
CN102043725B (en) | Data writing method for flash memory and its controller and storage system | |
CN102129353B (en) | Data writing system and data writing method | |
TWI494756B (en) | Method for giving read commands, flash memory controller and flash memory storage system using the same | |
CN102012788B (en) | Issuing read command and data read method, flash memory controller and storage system | |
CN104252317B (en) | Data writing method, memory controller and memory storage device | |
CN103914391A (en) | Data reading method, memory controller and memory storage device | |
CN102890653B (en) | Instruction execution method, memory controller and memory storage device | |
CN102999437B (en) | Data transfer method, memory controller and memory storage device | |
CN102890617B (en) | Memory control method, memory controller and memory storage device | |
CN102193870B (en) | Memory management and write-in method, memory controller and memory storage system | |
US9152348B2 (en) | Data transmitting method, memory controller and data transmitting system | |
CN104731710A (en) | Memory management method, memory control circuit unit and memory storage device | |
TWI813362B (en) | Partial erasing management method, memory storage device and memory control circuit unit | |
CN105573661B (en) | Data writing method, memory storage device and memory control circuit unit |
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 |