CN106951374A - Method and device for checking block page address - Google Patents

Method and device for checking block page address Download PDF

Info

Publication number
CN106951374A
CN106951374A CN201610009789.6A CN201610009789A CN106951374A CN 106951374 A CN106951374 A CN 106951374A CN 201610009789 A CN201610009789 A CN 201610009789A CN 106951374 A CN106951374 A CN 106951374A
Authority
CN
China
Prior art keywords
microinstruction
address
user command
read
command
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.)
Granted
Application number
CN201610009789.6A
Other languages
Chinese (zh)
Other versions
CN106951374B (en
Inventor
孙明浩
王祎磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Starblaze Technology Co ltd
Original Assignee
Beijing Starblaze Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Starblaze Technology Co ltd filed Critical Beijing Starblaze Technology Co ltd
Priority to CN202210539163.1A priority Critical patent/CN114968099B/en
Priority to CN201610009789.6A priority patent/CN106951374B/en
Publication of CN106951374A publication Critical patent/CN106951374A/en
Application granted granted Critical
Publication of CN106951374B publication Critical patent/CN106951374B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The invention discloses a method for accessing NVM, which comprises the following steps: processing a first user command instructing to read NVM, checking whether a block address and a page address corresponding to the first user command are the same as a block address and a page address corresponding to a second user command instructing to read NVM, wherein the second user command occurs before the first user command, and the second command accesses the same first parallel unit as the first user command; and if the block address and the page address corresponding to the first user command are the same as those corresponding to the second user command, reading data from the first cache corresponding to the first parallel unit for responding to the first user command. By the technical scheme of the invention, whether the data exists in the cache of the storage controller or not can be flexibly judged, and a user of the storage equipment can participate in flexible control of cache utilization without depending on the storage controller to judge whether the data is cached or not.

Description

用于检查块页地址的方法及其装置Method and device for checking block page address

技术领域technical field

本发明涉及固态存储设备(Solid Storage Device,SSD),更具体地,本发明涉及存储器控制器中块/页地址检查微指令的执行。The present invention relates to a solid storage device (Solid Storage Device, SSD), and more particularly, the present invention relates to the execution of block/page address checking microinstructions in a memory controller.

背景技术Background technique

同机械式硬盘相类似,固态存储设备(SSD)也是用于计算机系统的大容量、非易失性存储设备。固态存储设备一般以例如的闪存(Flash)的非易失存储器(NVM,Non Volatile Memory)作为存储介质。如图1所示,为现有技术的存储系统的框图。其中主要包括主机系统110和固态存储设备120。其中,固态存储设备120包括接口模块130,存储控制器140,以及由多个闪存颗粒150组成的Flash阵列160。其中,接口模块130主要用于实现与主机系统通信的接口协议,例如SATA(Serial Advanced Technology Attachment,串行高级技术附件)、USB(Universal Serial Bus,通用串行总线)、PCIE(Peripheral ComponentInterconnect Express,快速外围组件互连)、NVMe(NVM Express)、SCSI(Small Computer System Interface,小型计算机系统接口)、iSCSI(internet Small Computer System Interface,因特网小型计算机系统接口)、IDE(Integrated Drive Electronics,集成驱动器电子)等。通过接口模块130,固态存储设备呈现给主机系统的是拥有一定逻辑地址空间或物理地址空间的标准存储设备。存储控制器140是整个存储设备的控制核心,主要负责接口模块130与闪存阵列160之间的控制信号及数据的传输、闪存管理、主机逻辑地址到闪存物理地址的转换或映射、磨损均衡、和/或坏块管理等。可由软件、硬件、固件或者其组合的多种方式实现存储控制器140。Similar to mechanical hard drives, solid-state storage devices (SSDs) are high-capacity, non-volatile storage devices used in computer systems. A solid-state storage device generally uses a non-volatile memory (NVM, Non Volatile Memory) such as a flash memory (Flash) as a storage medium. As shown in FIG. 1 , it is a block diagram of a storage system in the prior art. It mainly includes a host system 110 and a solid-state storage device 120 . Wherein, the solid state storage device 120 includes an interface module 130 , a storage controller 140 , and a Flash array 160 composed of a plurality of flash memory particles 150 . Wherein, the interface module 130 is mainly used to realize the interface protocol of communication with the host system, such as SATA (Serial Advanced Technology Attachment, serial advanced technology attachment), USB (Universal Serial Bus, universal serial bus), PCIE (Peripheral Component Interconnect Express, Fast Peripheral Component Interconnect), NVMe (NVM Express), SCSI (Small Computer System Interface, Small Computer System Interface), iSCSI (internet Small Computer System Interface, Internet Small Computer System Interface), IDE (Integrated Drive Electronics, integrated drive electronics )Wait. Through the interface module 130, the solid-state storage device presents to the host system as a standard storage device with a certain logical address space or physical address space. The storage controller 140 is the control core of the entire storage device, and is mainly responsible for the transmission of control signals and data between the interface module 130 and the flash memory array 160, flash memory management, conversion or mapping from the logical address of the host computer to the physical address of the flash memory, wear leveling, and /or bad block management etc. The storage controller 140 can be realized in various ways of software, hardware, firmware or combinations thereof.

存储控制器140通过向闪存阵列160中的闪存颗粒150发送命令来访问闪存颗粒150。访问闪存颗粒150的命令包括,例如,读出、编程和/或擦除等。按页向闪存颗粒150写入或读出数据。闪存颗粒150提供了预定的页大小,每个页的大小是例如2KB、4KB、8KB或16KB。The storage controller 140 accesses the flash memory particles 150 by sending commands to the flash memory particles 150 in the flash memory array 160 . Commands for accessing the flash memory particles 150 include, for example, reading, programming and/or erasing. Data is written or read from the flash memory particles 150 by page. The flash memory particle 150 provides a predetermined page size, and the size of each page is, for example, 2KB, 4KB, 8KB or 16KB.

主机110的文件系统或设备驱动也按照预定大小的数据块来访问存储设备。预定大小的数据块可被称为块(block)、页(page)或区段(sector)。这里数据块的大小同闪存颗粒150的页大小相同或不同。The file system or device driver of the host 110 also accesses the storage device according to data blocks of a predetermined size. A data block of a predetermined size may be called a block, page, or sector. Here the size of the data block is the same as or different from the page size of the flash memory particle 150 .

在公开号为CN1414468A的中国专利申请中,提供了通过执行微指令序列来处理CPU(Central Processing Unit,中央处理单元)指令的方案。当CPU要处理特定指令时,转换逻辑电路将特定指令转换成与之对应的微指令序列,通过执行微指令序列来实现特定指令的功能。微指令序列或者微指令序列的模板存储在ROM(Read Only Memory,只读存储器)中。在将特定指令转换成微指令序列过程中,可对微指令序列模板进行填充,使之与特定指令相对应。In the Chinese patent application with publication number CN1414468A, a solution for processing CPU (Central Processing Unit, central processing unit) instructions by executing microinstruction sequences is provided. When the CPU wants to process a specific instruction, the conversion logic circuit converts the specific instruction into a corresponding microinstruction sequence, and realizes the function of the specific instruction by executing the microinstruction sequence. The microinstruction sequence or the template of the microinstruction sequence is stored in a ROM (Read Only Memory, read-only memory). In the process of converting a specific instruction into a microinstruction sequence, the microinstruction sequence template can be filled to correspond to the specific instruction.

存储器目标(Target)是闪存颗粒150封装内的共享芯片使能(CE,Chip Enable)信号的一个或多个逻辑单元(Logic Unit)。每个逻辑单元具有逻辑单元号(LUN,Logic Unit Number)。NAND闪存封装内可包括一个或多个管芯(Die)。典型地,逻辑单元对应于单一的管芯。逻辑单元可包括多个平面(Plane)。逻辑单元内的多个平面可以并行存取,而NAND闪存芯片内的多个逻辑单元可以彼此独立地执行命令和报告状态。在可从The memory target (Target) is one or more logic units (Logic Unit) sharing a chip enable (CE, Chip Enable) signal in the package of the flash memory particle 150 . Each logical unit has a logical unit number (LUN, Logic Unit Number). A NAND flash memory package may include one or more dies. Typically, a logic unit corresponds to a single die. A logical unit may include multiple planes. Multiple planes within a logic unit can be accessed in parallel, while multiple logic units within a NAND flash chip can execute commands and report status independently of each other. available from

http://www.micron.com/~/media/Documents/Products/Other%20Documents/ONFI3_0Gold.ashx获得的“Open NAND Flash Interface Specification(Revision 3.0)”中,提供了关于目标(target)、逻辑单元、LUN、平面(Plane)的含义。In the "Open NAND Flash Interface Specification (Revision 3.0)" obtained from http://www.micron.com/~/media/Documents/Products/Other%20Documents/ONFI3_0Gold.ashx, it provides information about the target (target), logic unit , LUN, plane (Plane) meaning.

公开号为CN102177556A的中国专利申请公开了一种闪存转换层(FTL),其展示了用于FTL的并行单元的查找表的例子。由于闪存芯片中的逻辑单元(Logic Unit)可以并行方式存取,因而,并行单元可以是逻辑单元。逻辑单元内可包括多个平面(Plane),并行单元也可为平面。Chinese patent application publication number CN102177556A discloses a flash translation layer (FTL), which shows an example of a look-up table for a parallel unit of the FTL. Since logic units in a flash memory chip can be accessed in parallel, the parallel units can be logic units. A logic unit may include multiple planes, and a parallel unit may also be a plane.

发明内容Contents of the invention

在一些应用场景中,NVM的页大小不同于应用所请求的页大小。例如操作系统的IO访问请求的数据单元大小为512字节,而NVM的页大小为4KB、8KB或16KB。为响应一个IO访问请求而从NVM读出数据后,大量被读出的数据并未被当前的IO请求所使用。但由于数据访问的局部性或其他原因,从NVM中被读出的数据可能在随后的IO访问请求中被使用。因而在需要从闪存颗粒读出数据时,希望有灵活的方式判断数据是否已存在于存储控制器的缓存中。数据被缓存的原因有多种,希望判断数据是否已存在于存储控制器的缓存中的方式能够适应不同的原因。并且被期待的是,存储设备的用户能够参与缓存利用的灵活控制,而不是依赖于存储控制器判断数据是否被缓存。In some application scenarios, the page size of the NVM is different from the page size requested by the application. For example, the data unit size of the IO access request of the operating system is 512 bytes, while the page size of the NVM is 4KB, 8KB or 16KB. After reading data from NVM in response to an IO access request, a large amount of read data is not used by the current IO request. However, due to the locality of data access or other reasons, the data read from the NVM may be used in subsequent IO access requests. Therefore, when it is necessary to read data from the flash memory particles, it is desirable to have a flexible way to determine whether the data already exists in the cache memory of the storage controller. There are many reasons why data is cached, and it is hoped that the method of judging whether data already exists in the cache of the storage controller can adapt to different reasons. And it is expected that users of storage devices can participate in flexible control of cache utilization, rather than relying on the storage controller to determine whether data is cached.

为实现上述目的,本发明通过微指令序列的执行来响应来自主机或用户的命令。通过微指令执行单元对微指令序列的执行,向闪存颗粒发出操作命令和/或接收从闪存颗粒读出的数据或其他信息。存储设备的用户通过对微指令序列的编程、更新和/或修改,能够参与对存储控制器的缓存利用的灵活控制。To achieve the above object, the present invention responds to commands from the host or the user through the execution of microinstruction sequences. The microinstruction execution unit executes the sequence of microinstructions to issue operation commands to the flash memory particles and/or receive data or other information read from the flash memory particles. Users of the memory device are able to participate in flexible control of the memory controller's cache utilization through programming, updating and/or modifying the sequence of microinstructions.

根据本发明的第一个方面,提供了一种访问NVM的方法,包括:处理指示读NVM的第一用户命令,检查所述第一用户命令对应的块地址和页地址与第二用户命令对应的块地址和页地址是否相同,其中,所述第二用户命令指示读NVM,所述第二用户命令出现于所述第一用户命令之前,且所述第二命令与所述第一用户命令访问相同的第一并行单元;若所述第一用户命令对应的块地址和页地址与第二用户命令对应的块地址和页地址相同,从与所述第一并行单元对应的第一缓存中读出数据,用来响应所述第一用户命令。According to a first aspect of the present invention, a method for accessing NVM is provided, including: processing a first user command indicating to read NVM, and checking that the block address and page address corresponding to the first user command correspond to the second user command Whether the block address and the page address are the same, wherein the second user command indicates to read NVM, the second user command appears before the first user command, and the second command is the same as the first user command Accessing the same first parallel unit; if the block address and page address corresponding to the first user command are the same as the block address and page address corresponding to the second user command, from the first cache corresponding to the first parallel unit Data is read out for responding to the first user command.

根据本发明的第一方面的一个实施方式,进一步包括:若所述第一用户命令对应的块地址和页地址与第二用户命令对应的块地址和页地址不同,向NVM发出NVM读命令。According to an implementation manner of the first aspect of the present invention, it further includes: if the block address and page address corresponding to the first user command are different from the block address and page address corresponding to the second user command, sending an NVM read command to the NVM.

根据本发明的第一方面的一个实施方式,其中,为访问第一并行单元的第一用户命令提供第一缓存,为访问第二并行单元的第一用户命令提供第二缓存。According to an embodiment of the first aspect of the present invention, the first cache is provided for the first user command accessing the first parallel unit, and the second cache is provided for the first user command accessing the second parallel unit.

根据本发明的第一方面的一个实施方式,其中,响应于所述第二用户命令,将从NVM中读出与所述第二用户命令对应的块地址和页地址对应的数据写入所述第一缓存。According to an implementation manner of the first aspect of the present invention, wherein, in response to the second user command, data corresponding to the block address and page address read from the NVM and corresponding to the second user command are written into the First cache.

根据本发明的第一方面的一个实施方式,其中,若所述第一用户命令对应的块地址和页地址与第二用户命令对应的块地址和页地址相同,设置标志寄存器;以及若所述第一用户命令对应的块地址和页地址与第二用户命令对应的块地址和页地址不同,清除标志寄存器。According to an embodiment of the first aspect of the present invention, wherein, if the block address and page address corresponding to the first user command are the same as the block address and page address corresponding to the second user command, a flag register is set; and if the The block address and page address corresponding to the first user command are different from the block address and page address corresponding to the second user command, and the flag register is cleared.

根据本发明的第一方面的一个实施方式,其中,若所述第一用户命令对应的块地址和页地址与第二用户命令对应的块地址和页地址相同,跳转执行第一微指令序列,以从与所述第一并行单元对应的第一缓存中读出数据;以及若所述第一用户命令对应的块地址和页地址与第二用户命令对应的块地址和页地址不同,跳转执行第二微指令序列,以向NVM发出NVM读命令。According to an embodiment of the first aspect of the present invention, wherein, if the block address and page address corresponding to the first user command are the same as the block address and page address corresponding to the second user command, jump to execute the first microinstruction sequence , to read data from the first cache corresponding to the first parallel unit; and if the block address and page address corresponding to the first user command are different from the block address and page address corresponding to the second user command, jump Turn to execute the second microinstruction sequence to send the NVM read command to the NVM.

根据本发明的第一方面的一个实施方式,其中,响应于所述第一用户命令,若所述第一用户命令对应的块地址和页地址与第二用户命令对应的块地址和页地址不同,进一步从NVM中读出与所述第一用户命令对应的块地址和页地址对应的数据,并写入所述第一缓存。According to an implementation manner of the first aspect of the present invention, wherein, in response to the first user command, if the block address and page address corresponding to the first user command are different from the block address and page address corresponding to the second user command , further reading data corresponding to the block address and page address corresponding to the first user command from the NVM, and writing it into the first cache.

根据本发明的第一方面的一个实施方式,其中,所述第一用户命令对应第一区段地址,所述第二用户命令对应第二区段地址。According to an implementation manner of the first aspect of the present invention, the first user command corresponds to a first segment address, and the second user command corresponds to a second segment address.

根据本发明的第一方面的一个实施方式,其中,所述第一用户命令指示获取第一地址范围的数据,所述第二用户命令指示获取第二地址范围的数据。According to an implementation manner of the first aspect of the present invention, the first user command indicates to acquire data in a first address range, and the second user command indicates to acquire data in a second address range.

根据本发明的第一方面的一个实施方式,其中,响应于所述第二用户命令,从NVM中读出与所述第二用户命令对应的块地址和页地址对应的页数据写入所述第一缓存,所述页数据包括第一区段数据与第二区段数据。According to an implementation manner of the first aspect of the present invention, wherein, in response to the second user command, the page data corresponding to the block address and the page address corresponding to the second user command are read from the NVM and written into the In the first cache, the page data includes first segment data and second segment data.

根据本发明的第一方面的一个实施方式,进一步包括:处理指示读NVM的第三用户命令,根据所述第三用户命令访问第二并行单元,将从NVM中读出与所述第三用户命令对应的块地址和页地址对应的数据写入第二缓存。According to an embodiment of the first aspect of the present invention, it further includes: processing a third user command indicating to read NVM, accessing the second parallel unit according to the third user command, and reading from NVM with the third user command The block address corresponding to the command and the data corresponding to the page address are written into the second cache.

根据本发明的第一方面的一个实施方式,其中,若所述标志寄存器被设置,跳转执行第一微指令序列,以从与所述第一并行单元对应的第一缓存中读出数据;以及若所述标志寄存器被清除,跳转执行第二微指令序列,以向NVM发出NVM读命令。According to an implementation manner of the first aspect of the present invention, wherein, if the flag register is set, jump to execute the first microinstruction sequence to read data from the first cache corresponding to the first parallel unit; And if the flag register is cleared, jump to execute the second microinstruction sequence to send the NVM read command to the NVM.

根据本发明的第二方面,还提供了一种访问NVM的方法,包括:处理指示读NVM的第一用户命令,检查所述第一用户命令对应的块地址和页地址与第二用户命令对应的块地址和页地址是否相同,其中,所述第二用户命令指示写NVM,所述第二用户命令出现于所述第一用户命令之前,且所述第二命令与所述第一用户命令访问相同的并行单元;若所述第一用户命令对应的块地址和页地址与第二用户命令对应的块地址和页地址相同,从与所述并行单元对应的缓存中读出数据,用来响应所述第一用户命令。According to the second aspect of the present invention, there is also provided a method for accessing NVM, including: processing a first user command indicating to read NVM, and checking that the block address and page address corresponding to the first user command correspond to the second user command Whether the block address and the page address are the same, wherein the second user command indicates writing to NVM, the second user command appears before the first user command, and the second command is identical to the first user command Access to the same parallel unit; if the block address and page address corresponding to the first user command are the same as the block address and page address corresponding to the second user command, read data from the cache corresponding to the parallel unit for Responding to the first user command.

根据本发明的第二方面的一个实施方式,进一步包括:若所述用户命令对应的块地址和页地址与第二用户命令对应的块地址和页地址不同,向NVM发出NVM读命令。According to an implementation manner of the second aspect of the present invention, it further includes: if the block address and page address corresponding to the user command are different from the block address and page address corresponding to the second user command, sending an NVM read command to the NVM.

根据本发明的第三方面,还提供了一种NVM控制器,包括:微指令存储器,用于存储微指令序列;微指令执行单元,用于对微指令进行译码并执行微指令所对应的操作;程序计数器,用于指示微指令存储器中微指令的存储位置;通用寄存器组,其中通过所述微指令序列中的微指令能够访问所述通用寄存器组中的寄存器;用户命令存储器,用于存储用户命令;上下文存储器,用于存储微指令序列对应的上下文信息。According to a third aspect of the present invention, there is also provided a NVM controller, including: a microinstruction memory, used to store microinstruction sequences; a microinstruction execution unit, used to decode the microinstructions and execute the microinstructions corresponding operation; a program counter for indicating a storage location of a microinstruction in a microinstruction memory; a general-purpose register set, wherein a register in the general-purpose register set can be accessed by a microinstruction in the microinstruction sequence; a user command memory for Store user commands; context storage, used to store context information corresponding to microinstruction sequences.

根据本发明的第三方面的一个实施方式,其中,依据程序计数器,所述微指令执行单元从微指令存储器中获取第一微指令;所述微指令执行单元对第一微指令进行解码,当第一微指令是读地址检查微指令时,所述微指令执行单元,依据读地址检查微指令的偏移值访问用户命令存储器,获取第一块地址与第一页地址;所述微指令执行单元,访问上下文存储器,获得当前微指令序列的上下文信息中存储的第二块地址与第二页地址;所述微指令执行单元比较第一块地址与第二块地址,第一页地址与第二页地址,若所述第一块地址与第二块地址相同,且第一页地址与第二页地址相同,所述微指令执行单元则依据所述读地址检查微指令的寄存器索引设置通用寄存器组中由所述寄存器索引所指示的通用寄存器。According to an embodiment of the third aspect of the present invention, wherein, according to the program counter, the microinstruction execution unit obtains the first microinstruction from the microinstruction memory; the microinstruction execution unit decodes the first microinstruction, when When the first microinstruction is a read address check microinstruction, the microinstruction execution unit accesses the user command memory according to the offset value of the read address check microinstruction, and obtains the first block address and the first page address; the microinstruction executes The unit accesses the context memory to obtain the second block address and the second page address stored in the context information of the current microinstruction sequence; the microinstruction execution unit compares the first block address with the second block address, and the first page address with the second page address Two page addresses, if the first block address is identical to the second block address, and the first page address is identical to the second page address, the microinstruction execution unit then checks the register index of the microinstruction according to the read address and sets the general The general-purpose register in the register file indicated by the register index.

根据本发明的第三方面的一个实施方式,其中,若所述第一块地址与第二块地址不同,或第一页地址与第二页地址不同,所述微指令执行单元则依据所述读地址检查微指令的寄存器索引清除通用寄存器组中由所述寄存器索引所指示的通用寄存器;以及所述微指令执行单元使所述程序计数器递增。According to an embodiment of the third aspect of the present invention, wherein, if the first block address is different from the second block address, or the first page address is different from the second page address, the microinstruction execution unit will A register index of a read address checking microinstruction clears a general purpose register in a general purpose register set indicated by the register index; and the microinstruction execution unit increments the program counter.

根据本发明的第三方面的一个实施方式,其中,所述微指令执行单元访问用户命令存储器,进一步获取第一并行单元地址;所述微指令执行单元访问用户命令存储器,依据所述第一并行单元地址获得当前微指令序列的上下文信息中存储的第二块地址与第二页地址。According to an implementation manner of the third aspect of the present invention, wherein the microinstruction execution unit accesses the user command memory, and further obtains the address of the first parallel unit; the microinstruction execution unit accesses the user command memory, according to the first parallel unit address The unit address obtains the second block address and the second page address stored in the context information of the current microinstruction sequence.

根据本发明的第三方面的一个实施方式,其中,响应于用户命令存储器中的用户命令而发起微指令序列的执行,依据所述用户命令所访问的并行单元而为所述微指令序列执行第一上下文存储器,所述微指令执行单元访问第一上下文存储器,获得当前微指令序列的上下文信息中存储的第二块地址与第二页地址。According to an embodiment of the third aspect of the present invention, wherein the execution of the microinstruction sequence is initiated in response to a user command in the user command memory, and the first execution of the microinstruction sequence is performed according to the parallel unit accessed by the user command. A context memory, the microinstruction execution unit accesses the first context memory to obtain the second block address and the second page address stored in the context information of the current microinstruction sequence.

根据本发明的第四方面,还提供了一种NVM控制器,包括:微指令存储器,用于存储微指令序列;微指令执行单元,用于对微指令进行译码并执行微指令所对应的操作;程序计数器,用于指示微指令存储器中微指令的存储位置;用户命令存储器,用于存储用户命令;上下文存储器,用于存储微指令序列对应的上下文信息。According to the fourth aspect of the present invention, there is also provided an NVM controller, including: a microinstruction memory, used to store microinstruction sequences; a microinstruction execution unit, used to decode the microinstructions and execute the microinstructions corresponding operation; a program counter, used to indicate the storage location of the microinstructions in the microinstruction memory; a user command memory, used to store user commands; a context memory, used to store context information corresponding to the microinstruction sequence.

根据本发明的第四方面的一个实施方式,其中,依据程序计数器,所述微指令执行单元从微指令存储器中获取第一微指令,所述微指令执行单元对第一微指令进行解码,当第一微指令是读地址检查微指令时,所述微指令执行单元,依据读地址检查微指令的偏移值访问用户命令存储器,获取第一块地址与第一页地址;所述微指令执行单元,访问上下文存储器,获得当前微指令序列的上下文信息中存储的第二块地址与第二页地址;所述微指令执行单元比较第一块地址与第二块地址,第一页地址与第二页地址,其中,若所述第一块地址与第二块地址相同,且第一页地址与第二页地址相同,所述微指令执行单元则依据所述读地址检查微指令的第一地址设置所述程序计数器;若所述第一块地址与第二块地址不同,或第一页地址与第二页地址不同,所述微指令执行单元使所述程序计数器递增为第二地址。According to an implementation manner of the fourth aspect of the present invention, wherein, according to the program counter, the microinstruction execution unit obtains the first microinstruction from the microinstruction memory, and the microinstruction execution unit decodes the first microinstruction, when When the first microinstruction is a read address check microinstruction, the microinstruction execution unit accesses the user command memory according to the offset value of the read address check microinstruction, and obtains the first block address and the first page address; the microinstruction executes The unit accesses the context memory to obtain the second block address and the second page address stored in the context information of the current microinstruction sequence; the microinstruction execution unit compares the first block address with the second block address, and the first page address with the second page address Two page addresses, wherein, if the first block address is the same as the second block address, and the first page address is the same as the second page address, the microinstruction execution unit checks the first address of the microinstruction according to the read address The address sets the program counter; if the first block address is different from the second block address, or the first page address is different from the second page address, the microinstruction execution unit increments the program counter to the second address.

根据本发明的第四方面的一个实施方式,其中,依据程序计数器,所述微指令执行单元从微指令存储器中获取第一微指令,所述微指令执行单元对第一微指令进行解码,当第一微指令是读地址检查微指令时,所述微指令执行单元,依据读地址检查微指令的偏移值访问用户命令存储器,获取第一块地址与第一页地址;所述微指令执行单元,访问上下文存储器,获得当前微指令序列的上下文信息中存储的第二块地址与第二页地址;所述微指令执行单元比较第一块地址与第二块地址,第一页地址与第二页地址,其中,若所述第一块地址与第二块地址不同,或第一页地址与第二页地址不同,所述微指令执行单元则依据所述读地址检查微指令的第一地址设置所述程序计数器;若所述第一块地址与第二块地址相同,且第一页地址与第二页地址相同,所述微指令执行单元使所述程序计数器递增为第二地址。According to an implementation manner of the fourth aspect of the present invention, wherein, according to the program counter, the microinstruction execution unit obtains the first microinstruction from the microinstruction memory, and the microinstruction execution unit decodes the first microinstruction, when When the first microinstruction is a read address check microinstruction, the microinstruction execution unit accesses the user command memory according to the offset value of the read address check microinstruction, and obtains the first block address and the first page address; the microinstruction executes The unit accesses the context memory to obtain the second block address and the second page address stored in the context information of the current microinstruction sequence; the microinstruction execution unit compares the first block address with the second block address, and the first page address with the second page address Two page addresses, wherein, if the first block address is different from the second block address, or the first page address is different from the second page address, the microinstruction execution unit checks the first address of the microinstruction according to the read address. The address sets the program counter; if the first block address is the same as the second block address, and the first page address is the same as the second page address, the microinstruction execution unit increments the program counter to the second address.

根据本发明的第四方面的一个实施方式,其中,所述上下文存储器中进一步存储在处理所述用户命令之前在NVM的第二块地址与第二页地址中读出的数据。According to an implementation manner of the fourth aspect of the present invention, the context memory further stores data read from the second block address and the second page address of the NVM before processing the user command.

根据本发明的第四方面的一个实施方式,其中,所述上下文存储器中进一步存储在处理所述用户命令之前向NVM的第二块地址与第二页地址中写入的数据。According to an implementation manner of the fourth aspect of the present invention, wherein the context memory further stores data written to the second block address and the second page address of the NVM before processing the user command.

根据本发明的第四方面的一个实施方式,其中,所述微指令存储器从所述第一地址开始存储用于从缓存中获取数据的微指令序列。According to an implementation manner of the fourth aspect of the present invention, wherein the microinstruction memory stores a sequence of microinstructions for obtaining data from the cache starting from the first address.

根据本发明的第四方面的一个实施方式,其中,所述微指令存储器从所述第二地址开始存储用于向NVM发出NVM读命令的微指令序列。According to an implementation manner of the fourth aspect of the present invention, wherein the microinstruction memory stores a sequence of microinstructions for issuing an NVM read command to the NVM starting from the second address.

根据本发明的第四方面的一个实施方式,其中,所述微指令存储器从所述第一地址开始存储用于向NVM发出NVM读命令的微指令序列。According to an implementation manner of the fourth aspect of the present invention, wherein the microinstruction memory stores a microinstruction sequence for issuing an NVM read command to the NVM starting from the first address.

根据本发明的第四方面的一个实施方式,其中,所述微指令存储器从所述第二地址开始存储用于从缓存中获取数据的微指令序列。According to an implementation manner of the fourth aspect of the present invention, wherein the microinstruction memory stores a sequence of microinstructions for obtaining data from the cache starting from the second address.

根据本发明的第五方面,还提供了一种在NVM接口控制器中执行读地址检查微指令的方法,包括:取出第一微指令;对所述第一微指令进行解码,确定所述第一微指令是读地址检查微指令,其中所述读地址检查微指令包括寄存器索引与偏移值,所述寄存器索引用于指示存储所述读地址检查指令执行结果的标志寄存器,所述偏移值用于指示用户命令的存储位置;依据所述偏移值获取所述用户命令对应的第一块地址与第一页地址;依据所述读地址检查微指令的上下文信息获取第二块地址与第二页地址,若所述第一块地址与第二块地址相同,且第一页地址与第二页地址相同,则依据寄存器索引设置标志寄存器;所述第一块地址与第二块地址不同,或第一页地址与第二页地址不同,则依据寄存器索引清除标志寄存器。According to the fifth aspect of the present invention, there is also provided a method for executing a read address checking microinstruction in an NVM interface controller, including: fetching a first microinstruction; decoding the first microinstruction, and determining the first microinstruction A microinstruction is a read address check microinstruction, wherein the read address check microinstruction includes a register index and an offset value, and the register index is used to indicate a flag register storing the execution result of the read address check instruction, and the offset The value is used to indicate the storage location of the user command; the first block address and the first page address corresponding to the user command are obtained according to the offset value; the second block address and the first page address are obtained according to the context information of the read address check microinstruction. The second page address, if the first block address is the same as the second block address, and the first page address is the same as the second page address, then set the flag register according to the register index; the first block address and the second block address different, or the address of the first page is different from the address of the second page, the flag register is cleared according to the register index.

根据本发明的第六方面,还提供了一种在NVM接口控制器中执行读地址检查微指令的方法,包括:取出所述读地址检查微指令,其中所述读地址检查微指令包括寄存器索引与偏移值,所述寄存器索引用于指示存储所述读地址检查指令执行结果的标志寄存器,所述偏移值用于指示用户命令的存储位置;对所述读地址检查微指令进行解码;依据所述偏移值获取所述用户命令对应的第一块地址与第一页地址;依据所述读地址检查微指令的上下文信息获取第二块地址与第二页地址,若所述第一块地址与第二块地址相同,且第一页地址与第二页地址相同,则依据寄存器索引设置标志寄存器;若所述第一块地址与第二块地址不同,或第一页地址与第二页地址不同,则依据寄存器索引清除标志寄存器。According to a sixth aspect of the present invention, there is also provided a method for executing a read address check microinstruction in an NVM interface controller, including: fetching the read address check microinstruction, wherein the read address check microinstruction includes a register index With an offset value, the register index is used to indicate the flag register storing the execution result of the read address check instruction, and the offset value is used to indicate the storage location of the user command; the read address check microinstruction is decoded; Obtain the first block address and the first page address corresponding to the user command according to the offset value; obtain the second block address and the second page address according to the context information of the read address check microinstruction, if the first The block address is the same as the second block address, and the first page address is the same as the second page address, then the flag register is set according to the register index; if the first block address is different from the second block address, or the first page address is the same as the second page address If the addresses of the two pages are different, the flag register is cleared according to the register index.

根据本发明的第六方面的一个实施方式,其中,所述第二块地址与第二页地址是发生于所述用户命令之前的用户命令所对应的访问NVM的块地址和页地址。According to an implementation manner of the sixth aspect of the present invention, the second block address and the second page address are a block address and a page address for accessing NVM corresponding to a user command occurring before the user command.

根据本发明的第六方面的一个实施方式,其中,所述用户命令指示读取NVM的第一块地址以及第一页地址所对应的存储位置的数据。According to an implementation manner of the sixth aspect of the present invention, the user command indicates to read the data of the storage location corresponding to the first block address and the first page address of the NVM.

根据本发明的第六方面的一个实施方式,其中,其余用户命令是指示从NVM读出数据的命令或向NVM写入数据的命令。According to an implementation manner of the sixth aspect of the present invention, the remaining user commands are commands indicating to read data from the NVM or to write data to the NVM.

根据本发明的第七方面,还提供了一种在NVM接口控制器中执行读地址检查微指令的方法,包括:取出所述读地址检查微指令,其中所述读地址检查微指令包括寄存器索引与偏移值,所述寄存器索引用于指示存储所述读地址检查指令执行结果的标志寄存器,所述偏移值用于指示用户命令的存储位置;对所述读地址检查微指令进行解码;依据所述偏移值获取所述用户命令对应的第一并行单元地址、第一块地址与第一页地址;依据所述第一并行单元地址获取第二块地址与第二页地址,其中,若所述第一块地址与第二块地址相同,且第一页地址与第二页地址相同,则依据寄存器索引设置标志寄存器;若所述第一块地址与第二块地址不同,或第一页地址与第二页地址不同,则依据寄存器索引清除标志寄存器。According to the seventh aspect of the present invention, there is also provided a method for executing a read address check microinstruction in an NVM interface controller, including: fetching the read address check microinstruction, wherein the read address check microinstruction includes a register index With an offset value, the register index is used to indicate the flag register storing the execution result of the read address check instruction, and the offset value is used to indicate the storage location of the user command; the read address check microinstruction is decoded; Obtaining the first parallel unit address, the first block address and the first page address corresponding to the user command according to the offset value; obtaining the second block address and the second page address according to the first parallel unit address, wherein, If the first block address is the same as the second block address, and the first page address is the same as the second page address, then set the flag register according to the register index; if the first block address is different from the second block address, or the first page address is the same as the second page address; If the address of the first page is different from the address of the second page, the flag register is cleared according to the register index.

根据本发明的第七方面的一个实施方式,其中,所述第二块地址与第二页地址是发生于所述用户命令之前的其余用户命令所对应的访问NVM的块地址和页地址。According to an implementation manner of the seventh aspect of the present invention, the second block address and the second page address are block addresses and page addresses corresponding to other user commands that occur before the user command for accessing the NVM.

根据本发明的第七方面的一个实施方式,其中,所述用户命令指示读取NVM的第一块地址以及第一页地址所对应的存储位置的数据。According to an implementation manner of the seventh aspect of the present invention, the user command indicates to read the data of the storage location corresponding to the first block address and the first page address of the NVM.

根据本发明的第七方面的一个实施方式,其中,所述其余用户命令是指示从NVM读出数据的命令或向NVM写入数据的命令。According to an implementation manner of the seventh aspect of the present invention, the remaining user commands are commands indicating to read data from the NVM or to write data to the NVM.

根据本发明的第八方面,还提供了一种在NVM接口控制器中执行读地址检查微指令的方法,包括:取出所述读地址检查微指令,其中所述读地址检查微指令包括寄存器索引与偏移值,所述寄存器索引用于指示存储所述读地址检查指令执行结果的标志寄存器,所述偏移值用于指示用户命令的存储位置,所述读地址检查指令还包括第一地址;对所述读地址检查微指令进行解码;依据所述偏移值获取所述用户命令对应的第一块地址与第一页地址;依据所述读地址检查微指令的上下文信息获取第二块地址与第二页地址,其中,若所述第一块地址与第二块地址相同,且第一页地址与第二页地址相同,则将所述NVM接口控制器的程序计数器设置为所述第一地址;其中从所述第一地址开始存储从缓存中获取数据的微指令序列。According to an eighth aspect of the present invention, there is also provided a method for executing a read address check microinstruction in an NVM interface controller, comprising: fetching the read address check microinstruction, wherein the read address check microinstruction includes a register index and an offset value, the register index is used to indicate the flag register storing the execution result of the read address check instruction, the offset value is used to indicate the storage location of the user command, and the read address check instruction also includes a first address ; Decode the read address check microinstruction; obtain the first block address and the first page address corresponding to the user command according to the offset value; obtain the second block according to the context information of the read address check microinstruction address and the second page address, wherein, if the first block address is the same as the second block address, and the first page address is the same as the second page address, then the program counter of the NVM interface controller is set to the A first address; where the microinstruction sequence for obtaining data from the cache is stored starting from the first address.

根据本发明的第八方面的一个实施方式,其中,若所述第一块地址与第二块地址不同,或第一页地址与第二页地址不同,则将所述NVM接口控制器的程序计数器设置为第二地址;其中所述第二地址开始存储向NVM发出NVM读命令的微指令序列。According to an embodiment of the eighth aspect of the present invention, wherein, if the address of the first block is different from the address of the second block, or the address of the first page is different from the address of the second page, the program of the NVM interface controller The counter is set to a second address; wherein the second address starts storing a sequence of microinstructions that issue an NVM read command to the NVM.

根据本发明的第八方面的一个实施方式,其中,若所述第一块地址与第二块地址相同,且第一页地址与第二页地址相同,所述方法进一步包括:依据寄存器索引设置标志寄存器。According to an implementation manner of the eighth aspect of the present invention, wherein, if the first block address is the same as the second block address, and the first page address is the same as the second page address, the method further includes: setting according to the register index flags register.

根据本发明的第八方面的一个实施方式,其中,若所述第一块地址与第二块地址不同,或第一页地址与第二页地址不同,所述方法进一步包括:依据寄存器索引清除标志寄存器。According to an embodiment of the eighth aspect of the present invention, wherein, if the first block address is different from the second block address, or the first page address is different from the second page address, the method further includes: clearing the flags register.

根据本发明的第九方面,还提供了一种在NVM接口控制器中执行读地址检查微指令的方法,包括:取出所述读地址检查微指令,其中所述读地址检查微指令包括寄存器索引与偏移值,所述寄存器索引用于指示存储所述读地址检查指令执行结果的标志寄存器,所述偏移值用于指示用户命令的存储位置,所述读地址检查指令还包括第一地址;对所述读地址检查微指令进行解码;依据所述偏移值获取所述用户命令对应的第一块地址与第一页地址;依据所述读地址检查微指令的上下文信息获取第二块地址与第二页地址,若所述第一块地址与第二块地址相同,且第一页地址与第二页地址不同,则将所述NVM接口控制器的程序计数器设置为所述第一地址;其中从所述第一地址开始存储向NVM发出NVM读命令的微指令序列。According to a ninth aspect of the present invention, there is also provided a method for executing a read address check microinstruction in an NVM interface controller, including: fetching the read address check microinstruction, wherein the read address check microinstruction includes a register index and an offset value, the register index is used to indicate the flag register storing the execution result of the read address check instruction, the offset value is used to indicate the storage location of the user command, and the read address check instruction also includes a first address ; Decode the read address check microinstruction; obtain the first block address and the first page address corresponding to the user command according to the offset value; obtain the second block according to the context information of the read address check microinstruction address and the second page address, if the first block address is the same as the second block address, and the first page address is different from the second page address, then the program counter of the NVM interface controller is set to the first address; where the first address starts to store a sequence of microinstructions that issue an NVM read command to the NVM.

根据本发明的第九方面的一个实施方式,其中,若所述第一块地址与第二块地址不同,或第一页地址与第二页地址不同,则将所述NVM接口控制器的程序计数器设置为第二地址;其中所述第二地址开始存储从缓存中获取数据的微指令序列。According to an implementation manner of the ninth aspect of the present invention, wherein, if the first block address is different from the second block address, or the first page address is different from the second page address, the program of the NVM interface controller The counter is set to a second address; wherein the second address begins to store a sequence of microinstructions for obtaining data from the cache.

根据本发明的第九方面的一个实施方式,其中,若所述第一块地址与第二块地址相同,且第一页地址与第二页地址相同,所述方法进一步包括:依据寄存器索引设置标志寄存器。According to an implementation manner of the ninth aspect of the present invention, wherein, if the first block address is the same as the second block address, and the first page address is the same as the second page address, the method further includes: setting according to the register index flags register.

根据本发明的第九方面的一个实施方式,其中,若所述第一块地址与第二块地址不同,或第一页地址与第二页地址不同,所述方法进一步包括:依据寄存器索引清除标志寄存器。According to an implementation manner of the ninth aspect of the present invention, wherein, if the first block address is different from the second block address, or the first page address is different from the second page address, the method further includes: clearing the flags register.

根据本发明的第十方面,提供一种包含计算机程序代码的计算机程序,当被载入计算机系统并在计算机系统上执行时,所述计算机程序代码使所述计算机系统执行上面所述的方法。According to a tenth aspect of the present invention, there is provided a computer program comprising computer program code which, when loaded into and executed on a computer system, causes the computer system to perform the method described above.

根据本发明的第十一方面,提供一种包括程序代码的程序,当被载入存储设备并在存储设备上执行时,所述计程序代码使所述存储设备执行上面所述的方法。According to an eleventh aspect of the present invention, there is provided a program including program code, and when loaded into and executed on a storage device, the program code causes the storage device to execute the method described above.

通过本发明的技术方案,能够灵活判断数据是否已存在于存储控制器的缓存中,存储设备的用户能够参与缓存利用的灵活控制,而不依赖于存储控制器判断数据是否被缓存。Through the technical solution of the present invention, it is possible to flexibly determine whether data exists in the cache of the storage controller, and the user of the storage device can participate in the flexible control of cache utilization without relying on the storage controller to determine whether the data is cached.

附图说明Description of drawings

通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。其中在附图中,参考数字之后的字母标记指示多个相同的部件,当泛指这些部件时,将省略其最后的字母标记。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiment. The drawings are only for the purpose of illustrating a preferred embodiment and are not to be considered as limiting the invention. Also throughout the drawings, the same reference numerals are used to designate the same parts. Wherein in the drawings, letter marks after reference numerals indicate a plurality of identical components, and when referring to these components generally, the last letter marks thereof will be omitted. In the attached picture:

图1示出了现有技术的存储系统的框图;FIG. 1 shows a block diagram of a storage system in the prior art;

图2示出了根据本发明的一个实施方式的存储器控制器的处理微指令的部件的结构框图;Fig. 2 shows the structural block diagram of the parts of processing microinstructions of the memory controller according to one embodiment of the present invention;

图3示出了根据本发明的一个实施方式的块/页读地址检查微指令的格式的示意图;FIG. 3 shows a schematic diagram of the format of a block/page read address check microinstruction according to an embodiment of the present invention;

图4-1示出了根据本发明的一个实施方式的访问NVM的方法的流程图;Fig. 4-1 shows the flowchart of the method for accessing NVM according to an embodiment of the present invention;

图4-2示出了根据本发明的一个实施方式的访问NVM的方法的流程图;Fig. 4-2 shows the flowchart of the method for accessing NVM according to an embodiment of the present invention;

图4-3示出了根据本发明的一个实施方式的访问NVM的方法的流程图;Fig. 4-3 shows the flowchart of the method for accessing NVM according to an embodiment of the present invention;

图5示出了根据本发明另一实施方式的访问NVM的方法流程图;FIG. 5 shows a flowchart of a method for accessing NVM according to another embodiment of the present invention;

图6A示出了根据本发明的另一方面的一个实施方式的在NVM接口控制器中执行读地址检查微指令的方法的流程图;FIG. 6A shows a flow chart of a method for executing a read address check microinstruction in an NVM interface controller according to an embodiment of another aspect of the present invention;

图6B示出了根据本发明另一方面的另一个实施方式的在NVM接口控制器中执行读地址检查微指令的方法及其后续操作的流程图;6B shows a flow chart of a method for executing a read address check microinstruction in an NVM interface controller and its subsequent operations according to another embodiment of another aspect of the present invention;

图7A示出了根据本发明另一方面的一个实施方式的在NVM接口控制器中执行读地址检查微指令的方法的流程图;以及FIG. 7A shows a flow chart of a method for executing a read address check microinstruction in an NVM interface controller according to an embodiment of another aspect of the present invention; and

图7B示出了根据本发明另一方面的一个实施方式的在NVM接口控制器中执行读地址检查微指令的方法及其后续操作的流程图。FIG. 7B shows a flowchart of a method for executing a read address checking microinstruction in an NVM interface controller and its subsequent operations according to an embodiment of another aspect of the present invention.

在附图中,使用相同或类似的标号来指代相同或类似的元素。In the drawings, the same or similar reference numerals are used to refer to the same or similar elements.

具体实施方式detailed description

下面结合附图和具体的实施方式对本发明作进一步的描述。The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.

图2示出了根据本发明一个实施方式的存储器控制器的处理微指令的部件的结构框图。为实现对微指令的处理,存储设备的存储器控制器可包括微指令执行单元210、命令队列220、接口控制器230、微指令存储器240、上下文存储器260和/或通用寄存器250。FIG. 2 shows a structural block diagram of components for processing microinstructions of a memory controller according to an embodiment of the present invention. To implement processing of microinstructions, the memory controller of the storage device may include a microinstruction execution unit 210 , a command queue 220 , an interface controller 230 , a microinstruction memory 240 , a context memory 260 and/or a general register 250 .

微指令存储器240用于存储微指令。微指令执行单元210从微指令存储器240中读取并执行微指令。微指令使得微指令执行单元210通过接口控制器230向闪存颗粒发出访问闪存颗粒的命令,包括,例如,读出、编程、擦除、暂停、读取闪存颗粒特征和/或读设置闪存颗粒特征等命令。微指令也使得微指令执行单元210通过接口控制器230获得从闪存颗粒读出的数据。一条微指令或多条微指令可对应于读出、编程、擦除和/或暂停等访问闪存颗粒的命令之一。微指令还包括分支、跳转微指令,其使得微指令执行单元改变执行微指令的顺序。微指令还包括块/页读地址检查微指令。后文中将结合图3详细介绍块/页读地址检查微指令。The microinstruction memory 240 is used to store microinstructions. The microinstruction execution unit 210 reads and executes microinstructions from the microinstruction memory 240 . The microinstructions make the microinstruction execution unit 210 send commands to the flash memory particles through the interface controller 230 to access the flash memory particles, including, for example, reading, programming, erasing, suspending, reading the characteristics of the flash memory particles and/or reading the characteristics of the flash memory particles Wait for the order. The microinstructions also enable the microinstruction execution unit 210 to obtain the data read from the flash memory particles through the interface controller 230 . One microinstruction or multiple microinstructions may correspond to one of commands for accessing flash memory particles such as read, program, erase and/or suspend. The microinstructions also include branch and jump microinstructions, which cause the microinstruction execution unit to change the order in which microinstructions are executed. Microinstructions also include block/page read address checking microinstructions. The block/page read address checking microinstruction will be introduced in detail later in conjunction with FIG. 3 .

微指令存储器240中可存储一段或多段微指令序列。作为举例,在图2的微指令存储器240中,存储了n段微指令序列,包括微指令序列1、微指令序列2……以及微指令序列n。微指令序列1、微指令序列2……以及微指令序列n的每段包括多条微指令。One or more microinstruction sequences can be stored in the microinstruction memory 240 . As an example, in the microinstruction memory 240 in FIG. 2 , n segments of microinstruction sequences are stored, including microinstruction sequence 1 , microinstruction sequence 2 . . . and microinstruction sequence n. Each segment of microinstruction sequence 1 , microinstruction sequence 2 . . . and microinstruction sequence n includes a plurality of microinstructions.

在微指令序列中的多条微指令可由微指令执行单元210执行。每段微指令序列拥有自己的执行状态,从而每段微指令的执行可被暂停和恢复。微指令执行单元210能够暂停正在执行的微执行序列,并选择执行其他微指令序列。也可以在微指令序列中提供让步微指令,当执行到让步微指令时,微指令执行单元210可调度并执行其他微指令序列。微指令执行单元210暂停正在执行的微指令序列,或者执行让步微指时,正在执行的微指令序列的执行状态被保存;当微指令执行单元恢复微指令序列的执行时,读出被保存的执行状态,从而继续被恢复的微指令序列的执行。Multiple microinstructions in the microinstruction sequence can be executed by the microinstruction execution unit 210 . Each microinstruction sequence has its own execution state, so that the execution of each microinstruction can be suspended and resumed. The microinstruction executing unit 210 can suspend the executing microinstruction sequence and choose to execute other microinstruction sequences. A yielding microinstruction may also be provided in the microinstruction sequence. When the yielding microinstruction is executed, the microinstruction execution unit 210 may schedule and execute other microinstruction sequences. When the microinstruction execution unit 210 suspends the microinstruction sequence being executed, or executes the concession microfinger, the execution state of the microinstruction sequence being executed is preserved; when the microinstruction execution unit resumes the execution of the microinstruction sequence, the saved Execution state, thereby continuing execution of the resumed sequence of microinstructions.

接口控制器230同闪存颗粒相耦合,用于向闪存颗粒发出访问闪存颗粒的命令,包括,例如,读出、编程、擦除、暂停和/或恢复等;也用于获得从闪存颗粒读出的数据。The interface controller 230 is coupled with the flash memory particle, and is used to issue commands to the flash memory particle to access the flash memory particle, including, for example, reading, programming, erasing, suspending and/or resuming, etc.; The data.

命令队列220用于缓存来自用户或上层系统的命令。来自用户或上层系统的命令可包括读出、写入、删除、标记为无效等命令,还可以包括读取存储设备状态、读取/设置闪存颗粒特征等命令,以及也可以包括用户自定义命令。命令队列220可由存储器、先进先出存储器寄存器堆等实现。微指令执行单元210可访问命令队列220。例如,在执行微指令时,依据微指令,微指令执行单元210访问命令队列220。The command queue 220 is used for buffering commands from users or upper systems. Commands from the user or the upper system can include commands such as read, write, delete, and mark as invalid, and can also include commands such as reading storage device status, reading/setting flash memory particle characteristics, and user-defined commands . The command queue 220 can be realized by a memory, a first-in-first-out memory register file, and the like. The microinstruction execution unit 210 can access the command queue 220 . For example, when executing a microinstruction, the microinstruction execution unit 210 accesses the command queue 220 according to the microinstruction.

在处理命令队列220中的命令时,获取与该命令对应的微指令序列,并由微指令执行单元210执行该微指令序列,以完成对命令队列220中的命令的处理。可由转换电路(未示出)实现从处理命令队列220中的命令到微指令序列的转换。也可以由微指令执行单元210实现从处理命令队列220中的命令到微指令序列的转换。在获取微指令序列的过程中,可以基于命令队列220中的命令对微指令序列进行填充或适配,以使微指令序列同命令队列220中的命令相适应。微指令序列还控制微指令执行单元210访问并处理命令队列220中的命令。并依据命令队列220中的命令来选择执行对应的微指令序列。When processing a command in the command queue 220 , the microinstruction sequence corresponding to the command is obtained, and the microinstruction execution unit 210 executes the microinstruction sequence to complete the processing of the command in the command queue 220 . Conversion from processing commands in command queue 220 to sequences of microinstructions may be accomplished by conversion circuitry (not shown). The conversion from processing commands in the command queue 220 to microinstruction sequences can also be implemented by the microinstruction execution unit 210 . During the process of obtaining the microinstruction sequence, the microinstruction sequence may be filled or adapted based on the commands in the command queue 220 , so that the microinstruction sequence is compatible with the commands in the command queue 220 . The microinstruction sequence also controls the microinstruction execution unit 210 to access and process commands in the command queue 220 . And according to the commands in the command queue 220, the corresponding microinstruction sequence is selected and executed.

通用寄存器250耦合到微指令执行单元210,用于保存和提供微指令序列的执行状态。微指令序列的执行状态包括程序计数器(PC)、通用寄存器(GR)、物理地址寄存器和/或定时器等。程序计数器用于指示微指令序列中当前执行的微指令地址。物理地址寄存器用于指示微指令序列访问的闪存颗粒的地址。The general purpose register 250 is coupled to the microinstruction execution unit 210 and is used for saving and providing the execution state of the microinstruction sequence. The execution state of the microinstruction sequence includes a program counter (PC), a general register (GR), a physical address register and/or a timer, and the like. The program counter is used to indicate the address of the currently executing microinstruction in the sequence of microinstructions. The physical address register is used to indicate the address of the flash memory particle accessed by the microinstruction sequence.

上下文存储器260用于保存微指令序列的执行状态。上下文存储器260保存的微指令序列的执行状态可包括通用寄存器250的内容。在上下文存储器260中,可保存一条或多条微指令序列的执行状态。在上下文存储器260中保存了状态信息的微指令序列,可被调度恢复执行。通过将上下文存储器260中保存的对应于一条微指令序列的状态信息恢复到通用寄存器250中,微指令执行单元210可恢复该微指令序列的执行。将执行的微指令序列称作线程。同一微指令序列在每次执行时拥有自己的执行状态,从而可基于同一微指令序列创建多个线程。在上下文存储器260中,为每个线程存储执行状态。The context memory 260 is used to store the execution state of the microinstruction sequence. The execution state of the sequence of microinstructions stored in the context memory 260 may include the contents of the general purpose registers 250 . In the context memory 260, the execution state of one or more microinstruction sequences may be saved. Microinstruction sequences that store state information in the context memory 260 can be scheduled to resume execution. By restoring the state information corresponding to a microinstruction sequence stored in the context memory 260 to the general register 250, the microinstruction execution unit 210 can resume the execution of the microinstruction sequence. The sequence of microinstructions executed is called a thread. Each execution of the same sequence of microinstructions has its own execution state, allowing multiple threads to be created based on the same sequence of microinstructions. In context memory 260, execution state is stored for each thread.

在根据本发明的实施例中,基于所要访问的并行单元来创建或使用线程。例如使用第1线程来访问第1并行单元,和/或使用第2线程来访问第2并行单元。在一个例子中,上下文存储器260可容纳的线程数量同图2的处理微指令的部件所耦合的闪存颗粒的并行单元的数量相同;为每一个并行单元分配或保留线程;当处理对一个并行单元的请求时,调度与该并行单元相对应的线程。在一个例子中,上下文存储器260可容纳的线程数量小于同图2的处理微指令的部件所耦合的并行单元的数量。当处理对一个并行单元的请求时,使用已分配来处理该并行单元的线程或者分配新线程来处理该请求。In an embodiment in accordance with the invention, threads are created or used based on the parallel units to be accessed. For example, the first thread is used to access the first parallel unit, and/or the second thread is used to access the second parallel unit. In one example, the number of threads that the context memory 260 can hold is the same as the number of parallel units of the flash memory particles coupled to the parts that process the microinstructions of FIG. 2; for each parallel unit, threads are allocated or reserved; When a request is made, schedule the thread corresponding to this unit of parallelism. In one example, the number of threads that the context memory 260 can accommodate is less than the number of parallel units coupled to the microinstruction-processing components of FIG. 2 . When processing a request for a parallel unit, use the thread already allocated to process the parallel unit or allocate a new thread to handle the request.

提供并行单元缓存来存储从并行单元读出或向并行单元写入的数据。为每个线程提供并行单元缓存。并行单元缓存的大小对应于闪存颗粒150(参见图1)的页大小。提供更大尺寸的并行单元缓存对提高性能是有利的。在一个例子中,在上下文存储器260中提供并行单元缓存。在另一个例子中,由DRAM或其他外部于图2的处理微指令的部件的存储器来提供并行单元缓存。A parallel unit cache is provided to store data read from or written to the parallel unit. Provides a parallel unit cache for each thread. The size of the parallel cell cache corresponds to the page size of the flash particle 150 (see FIG. 1 ). It is beneficial to provide a larger size parallel cell cache to improve performance. In one example, a parallel unit cache is provided in context memory 260 . In another example, the parallel unit cache is provided by DRAM or other memory external to the microinstruction-processing components of FIG. 2 .

图3示出了根据本发明实施例的块/页读地址检查微指令的格式。块/页读地址检查微指令包括操作码(OpCode)字段、寄存器(Reg)字段与偏移值(Offset)字段。操作码字段通过特定标识符或值指示微指令是块/页读地址检查微指令。寄存器字段指示该块/页读地址检查微指令所修改的通用寄存器(参见图2,通用寄存器250)的名字或编号。偏移值字段指示该块/页读地址检查微指令所对应的命令在命令队列220(参见图2)中的位置。在一个例子中,偏移值字段指示待检查的命令在命令队列220中的存储位置。例如,待检查的命令是当前正在处理的命令之前被处理的读命令或编程命令。FIG. 3 shows the format of a block/page read address check microinstruction according to an embodiment of the present invention. The block/page read address checking microinstruction includes an operation code (OpCode) field, a register (Reg) field and an offset value (Offset) field. The opcode field indicates by a specific identifier or value that the uop is a block/page read address checking uop. The register field indicates the name or number of the general register (see FIG. 2, general register 250) modified by the block/page read address check microinstruction. The offset value field indicates the position of the command corresponding to the block/page read address checking microinstruction in the command queue 220 (see FIG. 2 ). In one example, the offset value field indicates where the command to be checked is stored in the command queue 220 . For example, the command to be checked is a read command or a program command that was processed before the command currently being processed.

在一个例子中,在基地址上累加偏移值字段指示的值,获得命令在命令队列220中的存储位置。注意到在该块/页读地址检查微指令中并未包括基地址字段,而是为线程或各个微指令提供全局的基地址寄存器或基地址索引,使得在执行该块/页读地址检查微指令时可获得基地址。在另一个例子中,单独使用偏移值字段获得命令在命令队列220中的存储位置。在依然另一个例子中,偏移值字段指示带检查的命令与当前正在处理的命令的偏移。在又一个例子中,偏移值字段是寄存器地址或编号,从而得以通过微指令序列的执行来修改寄存器的内容来在运行时修改偏移值信息。In one example, the value indicated by the offset value field is accumulated on the base address to obtain the storage location of the command in the command queue 220 . Note that the base address field is not included in the block/page read address check microinstruction, but provides a global base address register or base address index for the thread or each microinstruction, so that when the block/page read address check microinstruction is executed The base address can be obtained at instruction time. In another example, the storage position of the command in the command queue 220 is obtained by using the offset value field alone. In yet another example, the offset value field indicates the offset of the checked command from the command currently being processed. In yet another example, the offset value field is a register address or number, so that the offset value information can be modified at runtime by modifying the content of the register through the execution of the microinstruction sequence.

在命令队列220内的命令中,提供该命令所访问的并行单元地址、块地址与页地址,从而基于并行单元地址、块地址与页地址可确定特定的闪存颗粒150(参见图1)的特定块与页。例如,由user_cmd[base+offset].block_page_address表示在命令队列220(参照图2)中由偏移值字段索引的命令所提供的块地址与页地址的组合。In the command in the command queue 220, the parallel unit address, block address and page address accessed by the command are provided, so that based on the parallel unit address, block address and page address, the specific location of the specific flash memory particle 150 (see FIG. 1 ) can be determined. blocks and pages. For example, a combination of a block address and a page address provided by the command indexed by the offset value field in the command queue 220 (refer to FIG. 2 ) is represented by user_cmd[base+offset].block_page_address.

在根据本发明的实施例中,为各线程提供可作为线程上下文的块地址寄存器与页地址寄存器,用于分别存储块地址与页地址。可由多种方式存储块地址与页地址,例如,将块地址与页地址组合存放于同一寄存器。例如,由block_page_address表示作为某一线程上下文的块地址与页地址的组合。属于同一线程的微指令,可访问作为线程上下文的块地址与页地址。In the embodiment according to the present invention, each thread is provided with a block address register and a page address register, which can be used as thread context, for storing the block address and the page address respectively. The block address and the page address can be stored in various ways, for example, the combination of the block address and the page address is stored in the same register. For example, block_page_address represents a combination of a block address and a page address as a thread context. Microinstructions belonging to the same thread can access the block address and page address as the thread context.

在执行根据本发明的块/页读地址检查微指令时,微指令执行单元210(参见图2)比较作为线程上下文的块地址与页地址与该线程所处理的命令队列220中的命令的块地址与页地址是否相同,如果相同,在该块/页读地址检查微指令的寄存器(Reg)字段所指示的通用寄存器置位。如果作为线程上下文的块地址与页地址与该线程所处理的命令队列220中的命令的块地址与页地址不同,将该块/页读地址检查微指令的寄存器(Reg)字段所指示的通用寄存器清除。寄存器置位操作可对应于在寄存器的特定位置写入逻辑“1”或逻辑“0”,寄存器清除操作在寄存器的特定位置中写入的值与寄存器置位操作相反。作为举例,块/页读地址检查微指令的语义表示如下:GR[Reg]=(block_page_address==user_cmd[base+offset].block_page_address)?1:0。当block_page_address与user_cmd[base+offset].block_page_address相同时,将通用寄存器GR[Reg]设置为1,否则设置为0。When executing the block/page read address check microinstruction according to the present invention, the microinstruction execution unit 210 (referring to FIG. 2 ) compares the block address and page address as the thread context with the block of the command in the command queue 220 processed by the thread Whether the address is the same as the page address, and if they are the same, the general register indicated by the register (Reg) field of the microinstruction is checked to be set at the block/page read address. If the block address and the page address as the thread context are different from the block address and the page address of the command in the command queue 220 processed by this thread, the general purpose indicated by the register (Reg) field of the block/page read address check microinstruction Registers are cleared. A register set operation may correspond to writing a logic "1" or a logic "0" in a specific location of the register, and a register clear operation writes a value in the specific location of the register inversely to the register set operation. As an example, the semantic representation of the block/page read address checking microinstruction is as follows: GR[Reg]=(block_page_address==user_cmd[base+offset].block_page_address)? 1:0. When block_page_address is the same as user_cmd[base+offset].block_page_address, set the general register GR[Reg] to 1, otherwise to 0.

在根据本发明的实施例中,还提供条件分支微指令。条件分支微指令在执行时,检查指定的通用寄存器。依据指定的通用寄存器被置位或清除,条件分支微指令将程序计数器(PC)设置为两个不同的值之一,以指示微指令执行单元210从微指令存储器240的不同位置获取下一条要执行的微指令。In an embodiment according to the present invention, a conditional branch microinstruction is also provided. When the conditional branch microinstruction is executed, the specified general register is checked. The conditional branch microinstruction sets the program counter (PC) to one of two different values according to the specified general-purpose register being set or cleared, to instruct the microinstruction execution unit 210 to fetch the next request from a different location in the microinstruction memory 240. microinstructions executed.

在根据本发明的又一实施例中,将块/页读地址检查微指令与条件分支微指令的操作相结合,而提供融合微指令。融合微指令,除了操作码(OpCode)字段、寄存器(Reg)字段与偏移值(Offset)字段外,还包括分支目标字段。In yet another embodiment of the present invention, the operations of the block/page read address check microinstruction and the conditional branch microinstruction are combined to provide a fused microinstruction. The fused microinstruction includes a branch target field in addition to an operation code (OpCode) field, a register (Reg) field, and an offset value (Offset) field.

在执行融合微指令时,微指令执行单元210(参见图2)比较作为线程上下文的块地址与页地址与该线程所处理的命令队列220中的命令的块地址与页地址是否相同。依据比较结果,将程序计数器(PC)设置为不同的值,以指示微指令执行单元210从微指令存储器的不同位置获取下一条要执行的微指令。例如,在比较结果为真时,指示微指令执行单元210从当前微指令的下一条微指令地址处获取要执行的微指令;而在比较结果为假时,指示微指令执行单元210从分支目标字段指示的地址处获取要执行的微指令。以此方式,不必再使用分离的块/页读地址检查微指令与条件分支微指令,而将条件分支语义融合到执行块/页读地址检查微指令中,从而减少微指令序列的长度,并减少微指令序列在微指令存储器240中占用的存储空间。When executing the fused microinstruction, the microinstruction execution unit 210 (see FIG. 2 ) compares whether the block address and page address as the thread context are the same as the block address and page address of the commands in the command queue 220 processed by the thread. According to the comparison result, the program counter (PC) is set to different values to instruct the microinstruction execution unit 210 to obtain the next microinstruction to be executed from different locations in the microinstruction memory. For example, when the comparison result is true, instruct the microinstruction execution unit 210 to obtain the microinstruction to be executed from the next microinstruction address of the current microinstruction; The microinstruction to be executed is fetched at the address indicated by the field. In this way, it is no longer necessary to use separate block/page read address check microinstructions and conditional branch microinstructions, but the conditional branch semantics is integrated into the execution block/page read address check microinstructions, thereby reducing the length of the microinstruction sequence, and The storage space occupied by the microinstruction sequence in the microinstruction memory 240 is reduced.

在根据本发明的另一实施例中,在执行又一融合微指令时,微指令执行单元210(参见图2)比较作为线程上下文的块地址与页地址与该线程所处理的命令队列220中的命令的块地址与页地址是否相同。依据比较结果,将程序计数器(PC)设置为不同的值,以指示微指令执行单元210从微指令存储器的不同位置获取下一条要执行的微指令;并且,将该块/页读地址检查微指令的寄存器(Reg)字段所指示的通用寄存器置位或清除。In another embodiment according to the present invention, when executing yet another fused microinstruction, the microinstruction execution unit 210 (referring to FIG. 2 ) compares the block address and the page address as the thread context with the command queue 220 processed by the thread. Whether the block address of the command is the same as the page address. According to the comparison result, the program counter (PC) is set to different values to indicate that the microinstruction execution unit 210 obtains the next microinstruction to be executed from different positions of the microinstruction memory; and, the block/page read address check microinstruction The general register indicated by the register (Reg) field of the instruction is set or cleared.

图4-1示出了根据本发明的一个实施方式的访问NVM的方法的流程图。Fig. 4-1 shows a flowchart of a method for accessing NVM according to an embodiment of the present invention.

如图4-1所示,访问NVM的方法包括:步骤410:处理第一用户命令;步骤420:检查第一用户命令的块地址和页地址与第二用户命令对应的块地址和页地址是否相同;步骤430:如果第一用户命令的块地址和页地址与第二用户命令对应的块地址和页地址相同,从第一缓存中取得数据。As shown in Figure 4-1, the method for accessing NVM includes: step 410: process the first user command; step 420: check whether the block address and page address of the first user command correspond to the block address and page address of the second user command Same; Step 430: If the block address and page address of the first user command are the same as the block address and page address corresponding to the second user command, get data from the first cache.

在步骤410,作为举例,第一用户命令是第一读命令,开始处理第一读命令。返回参看图2,从命令队列220中取得下一待处理器的命令,并确定其为第一读命令。微指令执行单元210执行相应的微指令序列来处理第一读命令。在步骤420,微指令执行单元210执行根据本发明提供的块/页读地址检查微指令(也参见图3),来判断第一读命令的块地址和/或页地址与第二用户命令的块地址和/或页地址是否相同。第二用户命令是微指令执行单元210在处理第一读命令之前从命令队列210获取并处理的命令。若相同,进行到步骤430,从缓存中取得第一读指令所需的数据。在根据本发明的实施例中,第二用户命令可以是读命令或写命令,在处理第二用户命令时,与第二用户命令的块地址和/或页地址对应的数据被搬运到缓存中。因而当第一读命令与第二用户命令具有相同的块地址和/或页地址时,第一读命令所需要的数据已经存在于缓存中,从缓存中能够获得第一读命令要读取的数据,并无需再发出NVM读命令,从而加快了第一读命令的处理速度。In step 410, as an example, the first user command is a first read command, and processing of the first read command starts. Referring back to FIG. 2 , the next command to be processed is obtained from the command queue 220 and determined to be the first read command. The microinstruction execution unit 210 executes a corresponding microinstruction sequence to process the first read command. In step 420, the microinstruction executing unit 210 executes the block/page read address checking microinstruction (also referring to FIG. 3 ) provided according to the present invention to judge the block address and/or page address of the first read command and the second user command's Whether the block address and/or page address are the same. The second user command is a command obtained and processed by the microinstruction execution unit 210 from the command queue 210 before processing the first read command. If they are the same, proceed to step 430 to obtain the data required by the first read instruction from the cache. In an embodiment according to the present invention, the second user command may be a read command or a write command, and when the second user command is processed, the data corresponding to the block address and/or page address of the second user command is moved to the cache . Thus when the first read command has the same block address and/or page address as the second user command, the data required by the first read command already exists in the cache, and the data to be read by the first read command can be obtained from the cache. data, and there is no need to issue an NVM read command, thereby speeding up the processing speed of the first read command.

图4-2示出了根据本发明的一个实施方式的访问NVM的方法的流程图。Fig. 4-2 shows a flowchart of a method for accessing NVM according to an embodiment of the present invention.

如图4-2所示,访问NVM的方法包括:步骤410:处理第一用户命令;步骤420:检查第一用户命令的块地址和页地址与第二用户命令对应的块地址和页地址是否相同;步骤430:如果第一用户命令的块地址和页地址与第二用户命令对应的块地址和页地址相同,从第一缓存中取得数据。在图4-2中示出的访问NVM的方法进一步包括步骤440:如果第一用户命令的块地址和页地址与第二用户命令对应的块地址和页地址不相同,向NVM发出NVM读命令。As shown in Figure 4-2, the method for accessing NVM includes: step 410: process the first user command; step 420: check whether the block address and page address of the first user command correspond to the block address and page address of the second user command Same; Step 430: If the block address and page address of the first user command are the same as the block address and page address corresponding to the second user command, get data from the first cache. The method for accessing NVM shown in Figure 4-2 further includes step 440: if the block address and page address corresponding to the second user command are different from the block address and page address of the first user command, send an NVM read command to NVM .

图4-3示出了根据本发明的一个实施方式的访问NVM的方法的流程图。4-3 show a flowchart of a method for accessing NVM according to an embodiment of the present invention.

如图4-3所示,访问NVM的方法包括:步骤410:处理第一用户命令;步骤420:检查第一用户命令的块地址和页地址与第二用户命令对应的块地址和页地址是否相同;步骤430:如果第一用户命令的块地址和页地址与第二用户命令对应的块地址和页地址相同,从第一缓存中取得数据;步骤440:如果第一用户命令的块地址和页地址与第二用户命令对应的块地址和页地址不相同,向NVM发出NVM读命令。在图4-3中示出的访问NVM的方法,在步骤440向NVM发出NVM读命令后,进一步包括步骤450:从NVM读出数据,将数据写入第一缓存。As shown in Figure 4-3, the method for accessing NVM includes: step 410: process the first user command; step 420: check whether the block address and page address of the first user command correspond to the block address and page address of the second user command Same; step 430: if the block address and page address of the first user command are identical to the block address and page address corresponding to the second user command, obtain data from the first cache; step 440: if the block address of the first user command and The page address is different from the block address and page address corresponding to the second user command, and an NVM read command is sent to the NVM. In the method for accessing NVM shown in FIG. 4-3 , after sending an NVM read command to the NVM at step 440, it further includes step 450: reading data from the NVM, and writing the data into the first cache.

在步骤450中,响应于第二用户命令,将从NVM中读出与所述第二用户命令对应的块地址和页地址对应的数据写入所述第一缓存。In step 450, in response to the second user command, write data corresponding to the block address and the page address read from the NVM and corresponding to the second user command into the first cache.

在进一步的实施例中,为NVM的每个并行单元(LUN)分配专用的缓存,从而在访问缓存时(例如向缓存搬运数据,或将数据从缓存搬出),能够容易获得缓存的地址,并降低了缓存管理的开销。In a further embodiment, a dedicated cache is allocated for each parallel unit (LUN) of the NVM, so that when accessing the cache (such as moving data to the cache or moving data out of the cache), the address of the cache can be easily obtained, and Reduced cache management overhead.

实施例1Example 1

在根据本发明的实施例1中,在NVM的页中包括多个扇区,第一读命令与第二用户命令访问相同并行单元,并携带相同的块地址与页地址,但访问的扇区不同,其中第一命令访问第一扇区而第二用户命令访问第二扇区。第二用户命令是读命令,且在第一读命令之前被放入命令队列(参看图2,命令队列220)。尽管第二用户命令读取的是第二扇区的数据,但NVM接口能够按页大小传输数据,在根据第二用户命令访问NVM时,将包括第二扇区的整页数据传输到缓存中。随后第一读命令被放入命令队列220。通过执行微指令来处理第一读命令(参见图4-1,步骤410)。执行块/页读地址检查微指令,比较第一读命令与第二用户命令的块地址与页地址(参见图4-1,步骤420),发现第一读命令的块地址与第二用户命令的块地址相同,以及第一读命令的页地址与第二用户命令的页地址相同。这意味着由于第二用户命令的执行,第一读命令所需要的数据已经被搬移到缓存中。作为举例,执行块/页读地址检查微指令,依据比较结果,在通用寄存器(参看图2,通用寄存器250)中设置标志。下一微指令依据所设置的标志,决定执行与步骤430对应的微指令。因而,继续执行微指令来从缓存中取得数据(参见图4-1,步骤430)。以此方式,无需再向NVM发出数据读取命令即可获得要访问的数据,节省了第一读命令的执行时间,提高了效率。In Embodiment 1 of the present invention, a page of NVM includes multiple sectors, the first read command and the second user command access the same parallel unit, and carry the same block address and page address, but the accessed sector Different, where the first command accesses the first sector and the second user command accesses the second sector. The second user command is a read command and is put into the command queue (see FIG. 2, command queue 220) before the first read command. Although the second user command reads the data of the second sector, the NVM interface can transfer data by page size. When accessing NVM according to the second user command, the entire page data including the second sector is transferred to the cache . The first read command is then placed into the command queue 220 . The first read command is processed by executing microinstructions (see FIG. 4-1, step 410). Execute the block/page read address check microinstruction, compare the block address and page address of the first read command and the second user command (see Figure 4-1, step 420), and find the block address of the first read command and the second user command the same block address, and the page address of the first read command is the same as the page address of the second user command. This means that due to the execution of the second user command, the data required by the first read command has already been moved into the cache. As an example, a block/page read address check microinstruction is executed, and a flag is set in a general register (see FIG. 2, general register 250) according to the comparison result. The next microinstruction decides to execute the microinstruction corresponding to step 430 according to the set flag. Therefore, continue to execute microinstructions to fetch data from the cache (see FIG. 4-1, step 430). In this way, the data to be accessed can be obtained without sending a data read command to the NVM, which saves the execution time of the first read command and improves efficiency.

实施例2Example 2

在根据本发明的实施例2中,页为读取NVM的基本单元,第一读命令与第二用户命令访问相同并行单元,并携带相同的块地址与页地址。第二用户命令是读命令,且在第一读命令之前被放入命令队列(参看图2,命令队列220)。因而第一读命令与第二用户命令是对相同地址的连续的读命令。在根据在前的第二用户命令访问NVM时,将整页数据传输到缓存中。随后第一读命令被放入命令队列220。通过执行微指令来处理第一读命令(参见图4-1,步骤410)。执行块/页读地址检查微指令,比较第一读命令与第二用户命令的块地址与页地址(步骤420),发现第一读命令的块地址与第二用户命令的块地址相同,以及第一读命令的页地址与第二用户命令的页地址相同。这意味着由于第二用户命令的执行,第一读命令所需要的数据已经被搬移到缓存中。因而,继续执行微指令来从缓存中取得数据(步骤430)。以此方式,无需再向NVM发出数据读取命令即可获得要访问的数据,节省了第一读命令的执行时间,提高了效率。In Embodiment 2 of the present invention, a page is a basic unit for reading NVM, and the first read command and the second user command access the same parallel unit and carry the same block address and page address. The second user command is a read command and is put into the command queue (see FIG. 2, command queue 220) before the first read command. Therefore, the first read command and the second user command are consecutive read commands for the same address. When accessing the NVM according to the previous second user command, the entire page of data is transferred into the cache. The first read command is then placed into the command queue 220 . The first read command is processed by executing microinstructions (see FIG. 4-1, step 410). Execute the block/page read address check microinstruction, compare the block address and the page address (step 420) of the first read command and the second user command, find that the block address of the first read command is identical with the block address of the second user command, and The page address of the first read command is the same as the page address of the second user command. This means that due to the execution of the second user command, the data required by the first read command has already been moved into the cache. Therefore, continue to execute microinstructions to fetch data from the cache (step 430). In this way, the data to be accessed can be obtained without sending a data read command to the NVM, which saves the execution time of the first read command and improves efficiency.

实施例3Example 3

在根据本发明的实施例3中,页为读取NVM的基本单元,第一读命令与第二用户命令访问相同并行单元。但第一读命令与第二用户命令携带的块地址和/或页地址不同。第二用户命令是读命令,且在第一读命令之前被放入命令队列(参看图2,命令队列220)。在根据在前的第二用户命令访问NVM时,将整页数据传输到缓存中。随后第一读命令被放入命令队列220。通过执行微指令来处理第一读命令(参见图4-3,步骤410)。执行块/页读地址检查微指令,比较第一读命令与第二用户命令的块地址与页地址(步骤420),发现第一读命令的块地址与第二用户命令的块地址不同,或者第一读命令的页地址与第二用户命令的页地址不同。因而第一读命令所需要的数据以很大几率并不在缓存中。作为举例,执行块/页读地址检查微指令,依据比较结果,在通用寄存器(参看图2,通用寄存器250)中设置标志。下一微指令依据所设置的标志,决定执行与步骤440对应的微指令。因而,继续执行微指令来向NVM发出NVM读命令(步骤440)。微指令通过操作接口控制器(参看图2,接口控制器230)来发出NVM读命令。以及通过执行微指令来接收从NVM读出的数据并将数据写入缓存中(步骤450)。当在第一读命令之后出现在命令队列(参看图2,命令队列220)的第三用户命令的块地址与页地址同第一读命令的块地址与页地址分别相同时,意味着第三用户命令所要访问的数据已经存在于缓冲。可从缓存中获取第三用户命令所需的数据而无需再向NVM发出数据读取命令。In Embodiment 3 of the present invention, a page is a basic unit for reading NVM, and the first read command and the second user command access the same parallel unit. However, the block address and/or page address carried by the first read command and the second user command are different. The second user command is a read command and is put into the command queue (see FIG. 2, command queue 220) before the first read command. When accessing the NVM according to the previous second user command, the entire page of data is transferred into the cache. The first read command is then placed into the command queue 220 . The first read command is processed by executing microinstructions (see FIG. 4-3, step 410). Execute the block/page read address check microinstruction, compare the block address and the page address (step 420) of the first read command and the second user command, find that the block address of the first read command is different from the block address of the second user command, or The page address of the first read command is different from the page address of the second user command. Therefore, the data required by the first read command is not in the cache with high probability. As an example, a block/page read address check microinstruction is executed, and a flag is set in a general register (see FIG. 2, general register 250) according to the comparison result. The next microinstruction decides to execute the microinstruction corresponding to step 440 according to the set flag. Thus, the microinstructions continue to be executed to issue the NVM read command to the NVM (step 440). The microinstructions issue NVM read commands by operating the interface controller (see FIG. 2, interface controller 230). And receiving the data read from the NVM and writing the data into the cache by executing microinstructions (step 450 ). When the block address and the page address of the third user command appearing in the command queue (referring to FIG. 2, command queue 220) after the first read command are respectively identical with the block address and the page address of the first read command, it means that the third The data to be accessed by the user command already exists in the buffer. Data required by the third user command can be obtained from the cache without sending a data read command to the NVM.

图5示出了根据本发明另一实施方式的访问NVM的方法流程图。通过执行微指令序列,使得微指令执行单元210(参看图2)执行在图5中展示的访问NVM的方法。Fig. 5 shows a flowchart of a method for accessing NVM according to another embodiment of the present invention. By executing the microinstruction sequence, the microinstruction execution unit 210 (see FIG. 2 ) executes the method for accessing NVM shown in FIG. 5 .

如图5所示,访问NVM的方法包括:步骤510:处理第一读命令;步骤520:从NVM读出第一数据,将第一数据写入第一缓存;步骤530:处理第二读命令:步骤540:检查第一读命令的块地址和页地址与第二读命令的块地址和页地址是否相同;步骤550:如果第一读命令的块地址和页地址与第二读命令的块地址和页地址相同,从第一缓存中取得第一数据;步骤560:如果第一读命令的块地址和页地址与第二读命令的块地址和页地址不相同,发出NVM读命令;步骤570:取得从NVM读出的第二数据,将第二数据写入缓存。As shown in Figure 5, the method for accessing NVM includes: step 510: processing the first read command; step 520: reading the first data from NVM, and writing the first data into the first cache; step 530: processing the second read command : Step 540: check whether the block address and the page address of the first read command are identical to the block address and the page address of the second read command; Step 550: if the block address and the page address of the first read command are the same as the block address of the second read command Address is identical with page address, obtains the first data from the first cache; Step 560: if the block address of the first read command and the page address are not identical with the block address of the second read command and the page address, send the NVM read command; Step 570: Obtain second data read from the NVM, and write the second data into the cache.

在步骤510,在命令队列220(如图2所示)中出现未处理的第一读命令时,通过执行微指令序列来处理第一读命令。在步骤520,通过执行微指令序列来依据第一读命令从NVM读出数据,并将读出的数据写入缓存。在一个例子中,依据第一读命令从NVM读出数据时,也执行根据本发明的块/页读地址检查微指令,并确定第一读命令的块地址与页地址不同于在前的读/写命令的块地址和页地址,从而依据第一读命令向NVM发送NVM读命令。在另一个例子中,依据第一读命令是命令队列220(参看图2)中仅有的读命令或写命令,从而确定缓存中不存在第一读命令所需的数据。在步骤530,响应于命令队列中出现第二读命令,通过执行微指令序列来处理第二读命令。在步骤540,执行根据本发明的块/页读地址检查微指令,并确定第二读命令的块地址与页地址与在前的读/写命令(在本例中,为第一读命令)的块地址和页地址是否相同。In step 510, when an unprocessed first read command appears in the command queue 220 (shown in FIG. 2 ), the first read command is processed by executing a sequence of microinstructions. In step 520, read data from the NVM according to the first read command by executing the microinstruction sequence, and write the read data into the cache. In one example, when reading data from NVM according to the first read command, the block/page read address check microinstruction according to the present invention is also executed, and it is determined that the block address and page address of the first read command are different from the previous read /write the block address and page address of the command, so as to send the NVM read command to the NVM according to the first read command. In another example, according to the fact that the first read command is the only read command or write command in the command queue 220 (see FIG. 2 ), it is determined that the data required by the first read command does not exist in the cache. In step 530, in response to the occurrence of the second read command in the command queue, the second read command is processed by executing a sequence of microinstructions. In step 540, execute the block/page read address checking microinstruction according to the present invention, and determine the block address and page address of the second read command and the previous read/write command (in this example, the first read command) Whether the block address and page address are the same.

若第二读命令的块地址与页地址与第一读命令的块地址与页地址分别相同,意味着第二读命令所需的数据已经由对第一读命令的执行而被搬运到缓存中,在步骤550,通过执行相应的微指令从缓存中取得第二读命令所需的数据。在进一步的例子中,对第一读命令的处理尚未完成,暂时挂起对第二读命令的处理,并设置在由第一读命令取回数据后,恢复对第二读命令的处理,并从缓存中取得第二读命令所需的数据。If the block address and page address of the second read command are the same as the block address and page address of the first read command, it means that the data required by the second read command has been moved to the cache by the execution of the first read command , in step 550, obtain the data required by the second read command from the cache by executing corresponding microinstructions. In a further example, the processing of the first read command has not been completed, the processing of the second read command is temporarily suspended, and after the data is retrieved by the first read command, the processing of the second read command is resumed, and Obtain data required by the second read command from the cache.

若第二读命令的块地址与页地址与第一读命令的块地址与页地址不同,意味着第二读命令所需的数据在缓存中的可能性极低,在步骤560,通过执行微指令向NVM发出NVM读命令。在步骤570,通过执行微指令取得从NVM读出的数据,并将数据写入缓存。If the block address and page address of the second read command are different from the block address and page address of the first read command, it means that the possibility that the data required by the second read command is in the cache is extremely low. In step 560, by executing micro The instruction issues an NVM read command to the NVM. In step 570, the data read from the NVM is obtained by executing the microinstruction, and the data is written into the cache.

通过以下的具体实施例详细描述:Describe in detail by the following specific examples:

实施例4Example 4

在根据本发明的实施例4中,命令队列220(参看图2)中在前的第一用户命令是写命令,在后的第二用户命令是读命令。第一用户命令与第二用户命令访问相同的并行单元,并携带相同的块地址与页地址。响应于命令队列220中出现未处理的第一用户命令,通过执行微指令序列将第一用户命令要写入的数据搬运到缓存中,并通过接口控制器230(参看图2)向NVM发出NVM编程命令。响应于命令队列220中出现未处理的第二用户命令,通过微指令执行单元210(参看图2)执行根据本发明的块/页读地址检查微指令确定第一用户命令与第二用户命令访问的块地址与页地址分别相同。据此判断第二用户命令所需的数据存在于缓存中,并通过执行微指令从缓存中取得数据。In Embodiment 4 of the present invention, the preceding first user command in the command queue 220 (see FIG. 2 ) is a write command, and the subsequent second user command is a read command. The first user command and the second user command access the same parallel unit and carry the same block address and page address. In response to an unprocessed first user command occurring in the command queue 220, the data to be written by the first user command is moved to the cache by executing the microinstruction sequence, and the NVM is sent to the NVM by the interface controller 230 (see FIG. 2 ). programming commands. In response to an unprocessed second user command occurring in the command queue 220, the block/page read address check microinstruction according to the present invention is executed by the microinstruction execution unit 210 (referring to FIG. 2 ) to determine that the first user command and the second user command access The block address is the same as the page address respectively. Based on this, it is judged that the data required by the second user command exists in the cache, and the data is obtained from the cache by executing the microinstruction.

实施例5Example 5

在根据本发明的实施例5中,命令队列220(参看图2)中在前的第一用户命令是写命令,在后的第二用户命令是读命令。第一用户命令与第二用户命令访问相同的并行单元,并携带相同的块地址与页地址。第一用户命令要写入一整页数据,而第二用户命令读出页数据的部分。由第二用户命令中携带的地址范围来指示要读出的页数据的部分。响应于命令队列220中出现未处理的第一用户命令,通过执行微指令序列将第一用户命令要写入的整页数据搬运到缓存中,并通过接口控制器230(参看图2)向NVM发出NVM编程命令。响应于命令队列220中出现未处理的第二用户命令,通过微指令执行单元210(参看图2)执行根据本发明的块/页读地址检查微指令确定第一用户命令与第二用户命令访问的块地址与页地址分别相同。据此判断第二用户命令所需的数据存在于缓存中,并通过执行微指令从缓存中取得所需的部分页数据。In Embodiment 5 of the present invention, the first user command preceding in the command queue 220 (see FIG. 2 ) is a write command, and the second user command following is a read command. The first user command and the second user command access the same parallel unit and carry the same block address and page address. The first user command is to write a full page of data, while the second user command reads out a portion of the page data. The part of the page data to be read is indicated by the address range carried in the second user command. In response to an unprocessed first user command occurring in the command queue 220, the entire page of data to be written by the first user command is transferred to the cache by executing the microinstruction sequence, and sent to the NVM by the interface controller 230 (see FIG. 2 ). Issue the NVM programming command. In response to an unprocessed second user command occurring in the command queue 220, the block/page read address check microinstruction according to the present invention is executed by the microinstruction execution unit 210 (referring to FIG. 2 ) to determine that the first user command and the second user command access The block address is the same as the page address respectively. Based on this, it is judged that the data required by the second user command exists in the cache, and the required partial page data is obtained from the cache by executing the microinstruction.

实施例6Example 6

在根据本发明的实施例6中,命令队列220(参看图2)中在前的第一用户命令是读命令,在第一用户命令之后的第二用户命令是读ID命令,在第二用户命令之后的第三用户命令是读命令。第一用户命令与第三用户命令访问相同的并行单元,并携带相同的块地址与页地址。响应于命令队列220中出现未处理的第一用户命令,通过执行微指令序列将第一用户命令要写入的数据搬运到缓存中,并通过接口控制器230(参看图2)向NVM发出NVM编程命令。响应于命令队列220中出现未处理的第二用户命令,通过执行微指令序列向NVM发出NVM读ID命令。响应于命令队列220中出现未处理的第三用户命令,通过微指令执行单元210(参看图2)执行根据本发明的块/页读地址检查微指令确定第一用户命令与第二用户命令访问的块地址与页地址不同,以及再次执行根据本发明的块/页读地址检查微指令确定第一用户命令与第三用户命令访问的块地址与页地址分别相同。据此判断第三用户命令所需的数据存在于缓存中,并通过执行微指令从缓存中取得数据。In Embodiment 6 according to the present invention, the first user command in front of the command queue 220 (see FIG. 2) is a read command, and the second user command after the first user command is a read ID command. The third user command after the command is a read command. The first user command and the third user command access the same parallel unit and carry the same block address and page address. In response to an unprocessed first user command occurring in the command queue 220, the data to be written by the first user command is moved to the cache by executing the microinstruction sequence, and the NVM is sent to the NVM by the interface controller 230 (see FIG. 2 ). programming commands. In response to an unprocessed second user command appearing in the command queue 220, an NVM read ID command is issued to the NVM by executing a sequence of microinstructions. In response to the unprocessed third user command occurring in the command queue 220, the block/page read address check microinstruction according to the present invention is executed by the microinstruction execution unit 210 (referring to FIG. 2 ) to determine that the first user command and the second user command access The block address is different from the page address, and the block/page read address check microinstruction according to the present invention is executed again to determine that the block address accessed by the first user command and the third user command are the same as the page address respectively. Based on this, it is judged that the data required by the third user command exists in the cache, and the data is obtained from the cache by executing the microinstruction.

实施例7Example 7

在根据本发明的实施例7中,命令队列220(参看图2)中在前的第一用户命令是读命令,在第一用户命令之后的第二用户命令是Set Feature命令,在第二用户命令之后的第三用户命令是读命令。第一用户命令与第三用户命令访问相同的并行单元,并携带相同的块地址与页地址。响应于命令队列220中出现未处理的第一用户命令,通过执行微指令序列将第一用户命令要写入的数据搬运到缓存中,并通过接口控制器230(参看图2)向NVM发出NVM编程命令。响应于命令队列220中出现未处理的第二用户命令,通过执行微指令序列向NVM发出NVM Set Feature命令。响应于命令队列220中出现未处理的第三用户命令,通过执行微指令确定命令队列中的第二用户命令将使得第三用户命令所期待的数据不同于第一用户命令所读到的数据,因而不再执行根据本发明的块/页读地址检查微指令或者忽略块/页读地址检查微指令的检查结果,并依据第三用户命令向NVM发出NVM读命令。In Embodiment 7 according to the present invention, the first user command in front of the command queue 220 (see FIG. 2 ) is a read command, and the second user command after the first user command is a Set Feature command. The third user command after the command is a read command. The first user command and the third user command access the same parallel unit and carry the same block address and page address. In response to an unprocessed first user command occurring in the command queue 220, the data to be written by the first user command is moved to the cache by executing the microinstruction sequence, and the NVM is sent to the NVM by the interface controller 230 (see FIG. 2 ). programming commands. In response to an unprocessed second user command appearing in the command queue 220, an NVM Set Feature command is issued to the NVM by executing the microinstruction sequence. In response to an unprocessed third user command occurring in the command queue 220, determining that the second user command in the command queue by executing the microinstruction will cause the data expected by the third user command to be different from the data read by the first user command, Therefore, the block/page read address check microinstruction according to the present invention is no longer executed or the checking result of the block/page read address check microinstruction is ignored, and the NVM read command is sent to the NVM according to the third user command.

图6A示出了根据本发明的另一方面的一个实施方式的在NVM接口控制器中执行读地址检查微指令的方法的流程图。FIG. 6A shows a flow chart of a method for executing a read address checking microinstruction in an NVM interface controller according to an embodiment of another aspect of the present invention.

如图6A所示,在NVM接口控制器中执行读地址检查微指令的方法包括:步骤610:获取第一微指令;步骤620:解码第一微指令,确定第一微指令是读地址检查微指令;步骤630:获取用户命令对应的第一块地址与第一页地址;步骤640:检查第一块地址和第一页地址与已存储块地址和页地址是否相同,如果相同的话,则进入步骤650:设置标志寄存器;如果不相同的话,则进入步骤660:清除标志寄存器。As shown in Figure 6A, the method for executing the read address checking microinstruction in the NVM interface controller includes: step 610: obtaining the first microinstruction; step 620: decoding the first microinstruction, and determining that the first microinstruction is a read address checking microinstruction instruction; step 630: obtain the first block address and the first page address corresponding to the user command; step 640: check whether the first block address and the first page address are the same as the stored block address and page address, and if they are the same, enter Step 650: Set the flag register; if not, go to step 660: Clear the flag register.

在步骤610,微指令执行单元210依据通用寄存器250中的程序计数器(PC)而从微指令存储器240(参见图2)的指定位置取出块/页读地址检查微指令微指令。作为举例,块/页读地址检查微指令是用于处理读命令的微指令序列中的一条微指令。在步骤620,微指令执行单元210解码从微指令存储器240中读到的微指令,并且确定该微指令为块/页读地址检查微指令。在步骤630,微指令执行单元210依据块/页读地址检查微指令的偏移值字段(参看图3)访问命令队列220,并从中获取当前读命令之前的第一命令的块地址与页地址。微指令执行单元210还从上下文存储器260中获取当前读命令的块地址与页地址。在步骤640,微指令执行单元210比较第一命令的块地址与页地址与当前读命令的块地址与页地址是否均分别相同。若相同,在步骤650,微指令执行单元210依据块/页读地址检查微指令的Reg字段(参见图3)提供的通用寄存器索引设置通用寄存器250中的标志寄存器;若不相同,在步骤660,微指令执行单元210依据块/页读地址检查微指令的Reg字段(参见图3)提供的通用寄存器索引清除通用寄存器250中的标志寄存器。In step 610 , the microinstruction execution unit 210 fetches the block/page read address checking microinstruction from the specified location of the microinstruction memory 240 (see FIG. 2 ) according to the program counter (PC) in the general register 250 . As an example, the block/page read address checking microinstruction is a microinstruction in the sequence of microinstructions for processing a read command. In step 620, the microinstruction execution unit 210 decodes the microinstruction read from the microinstruction memory 240, and determines that the microinstruction is a block/page read address checking microinstruction. In step 630, the microinstruction execution unit 210 checks the offset value field (see FIG. 3 ) of the microinstruction according to the block/page read address to access the command queue 220, and obtains therefrom the block address and the page address of the first command before the current read command . The microinstruction execution unit 210 also acquires the block address and page address of the current read command from the context memory 260 . In step 640, the microinstruction execution unit 210 compares whether the block address and page address of the first command are the same as the block address and page address of the current read command. If identical, in step 650, microinstruction execution unit 210 checks the flag register in the general purpose register 250 provided by the general register index provided by the Reg field (referring to Fig. 3) of block/page read address inspection microinstruction; If not identical, in step 660 , the microinstruction execution unit 210 clears the flag register in the general register 250 according to the general register index provided by the Reg field (see FIG. 3 ) of the microinstruction checked by the block/page read address.

在上面的例子中,微指令执行单元210从上下文存储器260中获取当前读命令的块地址与页地址。In the above example, the microinstruction execution unit 210 acquires the block address and page address of the current read command from the context memory 260 .

可选地,在根据本发明的另一实施例中,块/页读地址检查微指令中提供第二偏移值字段,用以指示当前读命令在命令队列220(参看图2)中的存储位置。并且微指令执行单元210依据第二偏移值字段从命令队列220中取得当前读命令的块地址与页地址,并与由第一偏移值字段所指示的第一命令的块地址与页地址进行比较。Optionally, in another embodiment according to the present invention, a second offset value field is provided in the block/page read address check microinstruction to indicate the storage of the current read command in the command queue 220 (see FIG. 2 ). Location. And the microinstruction execution unit 210 obtains the block address and the page address of the current read command from the command queue 220 according to the second offset value field, and compares it with the block address and the page address of the first command indicated by the first offset value field Compare.

依然可选地,在根据本发明的又一实施例中,微指令执行单元210(参看图2)维护上下文标识符,用以标识微指令序列的上下文,特别是微指令序列的上下文在上下文存储器260(参看图2)中的存储位置。从而无需在每条微指令中指示上下文标识符。微指令执行单元210依据上下文标识符,从上下文存储器260中取得当前读指令的块地址与页地址。Still optionally, in another embodiment according to the present invention, the microinstruction execution unit 210 (see FIG. 2 ) maintains a context identifier to identify the context of the microinstruction sequence, especially the context of the microinstruction sequence in the context memory 260 (see Figure 2). This eliminates the need to indicate a context identifier in every microinstruction. The microinstruction execution unit 210 obtains the block address and page address of the current read instruction from the context memory 260 according to the context identifier.

依然可选地,在根据本发明的又一实施例中,命令队列220(参看图2)中的未处理的命令引起微指令执行单元210(参看图2)执行微指令序列,在命令中提供上下文标识符,用以标识微指令序列的上下文,特别是微指令序列的上下文在上下文存储器260(参看图2)中的存储位置。并将命令中携带的块地址与页地址存储在上下文存储260中。在执行块/页地址检查微指令时,微指令执行单元210(参看图2)依据上下文标识符,从上下文存储器260中取得当前读指令的块地址与页地址。Still optionally, in another embodiment according to the present invention, unprocessed commands in the command queue 220 (see FIG. 2 ) cause the microinstruction execution unit 210 (see FIG. 2 ) to execute the microinstruction sequence, provided in the command The context identifier is used to identify the context of the microinstruction sequence, especially the storage location of the context of the microinstruction sequence in the context memory 260 (see FIG. 2 ). And store the block address and page address carried in the command in the context storage 260 . When executing the block/page address checking microinstruction, the microinstruction execution unit 210 (see FIG. 2 ) obtains the block address and page address of the current read instruction from the context memory 260 according to the context identifier.

依然可选地,在根据本发明的又一实施例中,命令队列220(参看图2)中的未处理的命令引起微指令执行单元210(参看图2)执行微指令序列,在命令中提供并行单元标识符,并使用并行单元标识符来标识微指令序列的上下文,特别是微指令序列的上下文在上下文存储器260(参看图2)中的存储位置。从而为访问相同并行单元的命令分配相同的上下文。以及将命令中携带的块地址与页地址存储在上下文存储260中。在执行块/页地址检查微指令时,微指令执行单元210依据并行单元标识符,从上下文存储器260中取得当前读指令的块地址与页地址。Still optionally, in another embodiment according to the present invention, unprocessed commands in the command queue 220 (see FIG. 2 ) cause the microinstruction execution unit 210 (see FIG. 2 ) to execute the microinstruction sequence, provided in the command parallel unit identifier, and use the parallel unit identifier to identify the context of the microinstruction sequence, especially the storage location of the context of the microinstruction sequence in the context memory 260 (see FIG. 2 ). Commands that access the same parallel unit are thus assigned the same context. And store the block address and page address carried in the command in the context storage 260 . When executing the block/page address checking microinstruction, the microinstruction execution unit 210 obtains the block address and page address of the current read instruction from the context memory 260 according to the parallel unit identifier.

依然可选地,在根据本发明的又一实施例中,微指令执行单元210(参看图2)维护线程标识符,用以标识微指令序列所属的线程。以及在上下文存储器260(参看图2)中存储线程的上下文信息。并且依据线程标识符确定线程上下文在上下文存储器260中的存储位置。微指令执行单元210依据线程标识符,从上下文存储器260中取得当前读指令的块地址与页地址。Still optionally, in another embodiment according to the present invention, the microinstruction execution unit 210 (see FIG. 2 ) maintains a thread identifier for identifying the thread to which the microinstruction sequence belongs. And the context information of the thread is stored in the context memory 260 (see FIG. 2 ). And the storage location of the thread context in the context memory 260 is determined according to the thread identifier. The microinstruction execution unit 210 obtains the block address and page address of the current read instruction from the context memory 260 according to the thread identifier.

图6B示出了根据本发明另一方面的另一个实施方式的在NVM接口控制器中执行读地址检查微指令的方法及其后续操作的流程图。FIG. 6B shows a flowchart of a method for executing a read address checking microinstruction in an NVM interface controller and its subsequent operations according to another embodiment of another aspect of the present invention.

如图6B所示,在NVM接口控制器中执行读地址检查微指令后,还依据读地址检查微指令的执行结果,执行步骤680从第一缓存读出数据;或者执行步骤670:从NVM读出第二数据,将第二数据写入第一缓存。As shown in Figure 6B, after executing the read address check microinstruction in the NVM interface controller, also check the execution result of the microinstruction according to the read address, execute step 680 to read data from the first cache; or execute step 670: read from the NVM output the second data, and write the second data into the first cache.

在步骤680中,块/页读地址检查微指令的后续微指令(例如,分支微指令)检查标志寄存器,依据标志寄存器被置位,相应修改程序计数器(PC)的值,使得微指令执行单元依据更新的程序计数器(PC)的值取得下一条微指令,并通过执行该下一条微指令以及后续微指令序列,从缓存中读出当前读命令所需要的数据。在步骤670中,块/页读地址检查微指令的后续微指令(例如,分支微指令)检查标志寄存器,依据标志寄存器被清除,相应修改程序计数器PC的值,使得微指令执行单元依据更新的程序计数器PC的值取得下一条微指令,并通过执行该下一条微指令以及后续微指令序列,向NVM发出NVM读命令,取得从NVM读出的数据并写入缓存。In step 680, the follow-up microinstruction (for example, branch microinstruction) of the block/page read address check microinstruction checks the flag register, and is set according to the flag register, correspondingly revises the value of the program counter (PC), so that the microinstruction execution unit The next microinstruction is obtained according to the value of the updated program counter (PC), and the data required by the current read command is read from the cache by executing the next microinstruction and subsequent microinstruction sequence. In step 670, the block/page read address checks the follow-up microinstruction (for example, branch microinstruction) of the microinstruction to check the flag register, according to the flag register is cleared, correspondingly revises the value of the program counter PC, makes the microinstruction execution unit according to the updated The value of the program counter PC obtains the next microinstruction, and by executing the next microinstruction and the subsequent microinstruction sequence, an NVM read command is issued to the NVM, and the data read from the NVM is obtained and written into the cache.

图7A示出了根据本发明另一方面的一个实施方式的在NVM接口控制器中执行读地址检查微指令的方法的流程图。FIG. 7A shows a flow chart of a method for executing a read address checking microinstruction in an NVM interface controller according to an embodiment of another aspect of the present invention.

如图7A所示,在NVM接口控制器中执行读地址检查微指令的方法包括:步骤710:获取第一微指令;步骤720:解码第一微指令,确定第一微指令是读地址检查微指令;步骤730:获取用户命令对应的第一块地址与第一页地址;步骤740:检查第一块地址和第一页地址与已存储第二块地址和第二页地址是否相同,如果相同的话,则进入步骤750:将程序计数器设置为第一地址;如果不相同的话,则进入步骤760:将程序计数器设置为第二地址。As shown in Figure 7A, the method for performing read address checking microinstruction in NVM interface controller comprises: Step 710: obtain the first microinstruction; Step 720: decode the first microinstruction, determine that the first microinstruction is a read address inspection microinstruction Instruction; step 730: obtain the first block address and the first page address corresponding to the user command; step 740: check whether the first block address and the first page address are the same as the stored second block address and the second page address, if they are the same If yes, go to step 750: set the program counter to the first address; if not, go to step 760: set the program counter to the second address.

在步骤710,微指令执行单元210依据通用寄存器250中的程序计数器(PC)而从微指令存储器240(参见图2)的指定位置取出第一微指令。在步骤720,微指令执行单元210解码从微指令存储器240中读到的第一微指令,并且确定该第一微指令为块/页读地址检查微指令。在步骤730,微指令执行单元210依据块/页读地址检查微指令的偏移值字段(参看图3)访问命令队列220,并从中获取当前读命令之前的第一命令的块地址与页地址。微指令执行单元210还从上下文存储器260中获取当前读命令的块地址与页地址。在步骤740,微指令执行单元210比较第一命令的块地址与页地址与当前读命令的块地址与页地址是否均分别相同。若相同,在步骤750,微指令执行单元210将通用寄存器250中的程序计数器(PC)设置为第一值;若不相同,在步骤760,微指令执行单元210将通用寄存器250中的程序计数器(PC)设置为第二值。至此,块/页读地址检查微指令执行完成。In step 710 , the microinstruction execution unit 210 fetches the first microinstruction from the specified location of the microinstruction memory 240 (see FIG. 2 ) according to the program counter (PC) in the general purpose register 250 . In step 720, the microinstruction execution unit 210 decodes the first microinstruction read from the microinstruction memory 240, and determines that the first microinstruction is a block/page read address checking microinstruction. In step 730, the microinstruction execution unit 210 checks the offset value field (see FIG. 3 ) of the microinstruction according to the block/page read address to access the command queue 220, and obtains therefrom the block address and the page address of the first command before the current read command . The microinstruction execution unit 210 also acquires the block address and page address of the current read command from the context memory 260 . In step 740, the microinstruction execution unit 210 compares whether the block address and page address of the first command are the same as the block address and page address of the current read command. If the same, in step 750, the program counter (PC) in the general-purpose register 250 is set to the first value by the microinstruction execution unit 210; (PC) is set as the second value. So far, the execution of the block/page read address checking microinstruction is completed.

图7B示出了根据本发明另一方面的一个实施方式的在NVM接口控制器中执行读地址检查微指令的方法及其后续操作的流程图。FIG. 7B shows a flowchart of a method for executing a read address checking microinstruction in an NVM interface controller and its subsequent operations according to an embodiment of another aspect of the present invention.

如图7B所示,在NVM接口控制器中执行读地址检查微指令后,还依据读地址检查微指令的执行结果,执行步骤770:从程序计数器指示的地址获取第二微指令。As shown in FIG. 7B , after the read address check microinstruction is executed in the NVM interface controller, the execution result of the read address check microinstruction is also checked, and step 770 is performed: obtaining the second microinstruction from the address indicated by the program counter.

在步骤770中,微指令执行单元210(参见图2)依据更新的程序计数器PC的值取得下一条微指令,并通过执行该下一条微指令以及后续微指令序列,当在步骤750将程序计数器PC的值设置为第一值时,微指令执行单元通过执行该下一条微指令以及后续微指令序列,从缓存中读出当前读命令所需要的数据;当在步骤760将程序计数器PC的值设置为第二值时,微指令执行单元通过执行该下一条微指令以及后续微指令序列,向NVM发出NVM读命令,取得从NVM读出的数据并写入缓存。In step 770, the microinstruction execution unit 210 (referring to FIG. 2 ) obtains the next microinstruction according to the value of the updated program counter PC, and by executing the next microinstruction and subsequent microinstruction sequence, when the program counter is set in step 750 When the value of PC was set to the first value, the microinstruction execution unit read out the required data of the current read command from the buffer memory by executing the next microinstruction and the subsequent microinstruction sequence; when the value of the program counter PC in step 760 When it is set to the second value, the microinstruction execution unit executes the next microinstruction and the subsequent microinstruction sequence, sends an NVM read command to the NVM, obtains the data read from the NVM, and writes it into the cache.

在可选的实施例中,通过执行块/页读地址检查微指令,在微指令执行单元210(参见图2)将程序计数器(PC)设置为第一值时,还依据块/页读地址检查微指令的Reg字段(参见图3)提供的通用寄存器索引置位通用寄存器250中的标志寄存器;在微指令执行单元210将程序计数器(PC)设置为第二值时,还依据块/页读地址检查微指令的Reg字段(参见图3)提供的通用寄存器索引清除通用寄存器250中的标志寄存器。In an optional embodiment, the microinstruction is checked by executing the block/page read address, and when the program counter (PC) is set to the first value by the microinstruction execution unit 210 (see FIG. Check the flag register in the general register index set general register 250 that the Reg field (referring to Fig. 3) of microinstruction that provides; The general register index provided by the Reg field (see FIG. 3 ) of the read address check microinstruction clears the flag register in the general register 250 .

本发明中NVM的例子是闪存。所属领域技术人员将意识到本发明的实施例也可应用于其他类型的存储介质,例如相变存储器、电阻存储器、铁电存储器等。An example of NVM in the present invention is flash memory. Those skilled in the art will appreciate that embodiments of the present invention are also applicable to other types of storage media, such as phase change memory, resistive memory, ferroelectric memory, and the like.

根据本发明的一个方面,本发明还提供一种包含计算机程序代码的计算机程序,当被载入计算机系统并在计算机系统上执行时,所述计算机程序代码使所述计算机系统执行上面所述的方法。According to one aspect of the present invention, the present invention also provides a computer program comprising computer program code, which when loaded into a computer system and executed on the computer system, causes the computer system to perform the above-mentioned method.

根据本发明的另一个方面,还提供一种包括程序代码的程序,当被载入存储设备并在存储设备上执行时,所述计程序代码使所述存储设备执行上面所述的方法。According to another aspect of the present invention, there is also provided a program including program code. When loaded into a storage device and executed on the storage device, the program code causes the storage device to execute the method described above.

通过本发明的技术方案,能够灵活判断数据是否已存在于存储控制器的缓存中,存储设备的用户能够参与缓存利用的灵活控制,而不依赖于存储控制器判断数据是否被缓存。Through the technical solution of the present invention, it is possible to flexibly determine whether data exists in the cache of the storage controller, and the user of the storage device can participate in the flexible control of cache utilization without relying on the storage controller to determine whether the data is cached.

应该理解,框图和流程图的每个框以及框图和流程图的框的组合可以分别由包括计算机程序指令的各种装置来实施。这些计算机程序指令可以加载到通用计算机、专用计算机或其他可编程数据控制设备上以产生机器,从而在计算机或其他可编程数据控制设备上执行的指令创建了用于实现一个或多个流程图框中指定的功能的装置。It will be understood that each block of the block diagrams and flowchart illustrations, and combinations of blocks in the block diagrams and flowchart illustrations, respectively, can be implemented by various means including computer program instructions. These computer program instructions can be loaded into a general purpose computer, special purpose computer, or other programmable data controlled device to produce a machine, whereby the instructions executed on the computer or other programmable data controlled device create a process for implementing one or more flow chart blocks device for the functions specified in .

这些计算机程序指令还可以存储在可以引导计算机或其他可编程数据控制设备的计算机可读存储器中从而以特定方式起作用,从而能够利用存储在计算机可读存储器中的指令来制造包括用于实现一个或多个流程图框中所指定功能的计算机可读指令的制品。计算机程序指令还可以加载到计算机或其他可编程数据控制设备上以使得在计算机或其他可编程数据控制设备上执行一系列的操作步骤,从而产生计算机实现的过程,进而在计算机或其他可编程数据控制设备上执行的指令提供了用于实现一个或多个流程图框中所指定功能的步骤。These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data-controlled device to act in a specific manner, so that the instructions stored in the computer-readable memory can be used to manufacture, including for implementing a or an article of manufacture of computer readable instructions for the functions specified in the flowchart blocks. Computer program instructions can also be loaded onto a computer or other programmable data-controlled device to cause a series of operational steps to be performed on the computer or other programmable data-controlled device, thereby producing a computer-implemented process, which in turn can be performed on the computer or other programmable data-controlled device. The instructions executed on the control device provide steps for implementing the functions specified in one or more of the flowchart blocks.

因而,框图和流程图的框支持用于执行指定功能的装置的组合、用于执行指定功能的步骤的组合和用于执行指定功能的程序指令装置的组合。还应该理解,框图和流程图的每个框以及框图和流程图的框的组合可以由执行指定功能或步骤的、基于硬件的专用计算机系统实现,或由专用硬件和计算机指令的组合实现。Accordingly, blocks of the block diagrams and flowchart illustrations support combinations of means for performing the specified functions, combinations of steps for performing the specified functions and program instruction means for performing the specified functions. It will also be understood that each block of the block diagrams and flowchart illustrations, and combinations of blocks in the block diagrams and flowchart illustrations, can be implemented by special purpose hardware-based computer systems which perform the specified functions or steps, or combinations of special purpose hardware and computer instructions.

上述的不同块、操作以及技术的至少一部分可以被执行,通过使用硬件,控制设备执行固件指令,控制设备执行软件指令,或者及其任意组合。当采用执行固件以及软件指令的控制设备执行时,软件或固件指令可以被存储在任意计算机可读存储介质中,例如磁盘,光盘或者其他存储介质,在RAM或者ROM或者flash存储器,控制设备,硬盘,光盘,磁盘等等。同样地,软件和固件指令可以被传输到用户或者系统,通过任意已知的或者期望的传输方式包括,例如,在计算机可读盘或者其他便携式计算机存储机制或者通过通信媒介。通信媒介典型地具体化计算机可读指令,数据结构,序模块或者在已调制数据信号中的其它数据例如载波或者其他传输机制。通过示例,并非限制,通信介质包括有线介质例如有线网络或者单线连接,以及无线媒介,例如声、无线频率,红外以及其它无线介质。从而,软件和固件指令可以被传输给用户或者系统,通过通信信道,例如电话线,DSL线,电缆电视线,光纤线缆,无线信道,因特网,等等(通过便携式存储介质提供这样的软件,其被看作是相同的或者可互换的)。软件或者固件指令可以包括机器可读指令,这些可读指令在由控制设备执行时,导致控制设备执行不同动作。当在硬件中执行时,硬件可以包括一个或多个离散组件,集成电路,应用的集成电路(ASIC),等等。At least some of the various blocks, operations, and techniques described above can be performed using hardware, controlling a device executing firmware instructions, controlling a device executing software instructions, or any combination thereof. When executed by a control device that executes firmware and software instructions, the software or firmware instructions can be stored in any computer-readable storage medium, such as a magnetic disk, optical disk or other storage medium, in RAM or ROM or flash memory, control device, hard disk , discs, disks and more. Likewise, software and firmware instructions may be transmitted to the user or system by any known or desired transmission means including, for example, on a computer readable disk or other portable computer storage mechanism or via a communication medium. Communication media typically embodies computer readable instructions, data structures, sequence modules or other data in a modulated data signal such as a carrier wave or other transport mechanism. By way of example, and not limitation, communication media includes wired media such as a wired network or a single-wire connection, and wireless media such as acoustic, radio frequency, infrared and other wireless media. Thus, software and firmware instructions may be transmitted to a user or system over a communication channel, such as a telephone line, DSL line, cable television line, fiber optic cable, wireless channel, the Internet, etc. (providing such software via a portable storage medium, are considered the same or interchangeable). The software or firmware instructions may include machine readable instructions which, when executed by the control device, cause the control device to perform various actions. When implemented in hardware, the hardware may include one or more discrete components, integrated circuits, application integrated circuits (ASICs), and the like.

需要理解的是,本发明可以以纯软件、纯硬件、固件以及上述的各种组合来实现。硬件例如可以是控制设备、专用集成电路、大规模集成电路等等。It should be understood that the present invention can be realized by pure software, pure hardware, firmware and various combinations of the above. Hardware can be, for example, control devices, application-specific integrated circuits, large-scale integrated circuits, and the like.

虽然当前发明参考的示例被描述,其只是为了解释的目的而不是对本发明的限制,对实施方式的改变,增加和/或删除可以被做出而不脱离本发明的范围。Although the present invention has been described with reference to examples, it is for the purpose of explanation only and not to limit the present invention, changes, additions and/or deletions to the embodiments may be made without departing from the scope of the present invention.

这些实施方式所涉及的、从上面描述和相关联的附图中呈现的教导获益的领域中的技术人员将认识到这里记载的本发明的很多修改和其他实施方式。因此,应该理解,本发明不限于公开的具体实施方式,旨在将修改和其他实施方式包括在所附权利要求书的范围内。尽管在这里采用了特定的术语,但是仅在一般意义和描述意义上使用它们并且不是为了限制的目的而使用。Many modifications and other embodiments of the inventions described herein will come to mind to those skilled in the art to which these embodiments pertain having the benefit of the teachings presented in the foregoing descriptions and the associated drawings. Therefore, it is to be understood that the inventions are not to be limited to the particular embodiments disclosed and that modifications and other embodiments are intended to be included within the scope of the appended claims. Although specific terms are employed herein, they are used in a generic and descriptive sense only and not for purposes of limitation.

Claims (10)

1.一种访问NVM的方法,包括:1. A method of accessing NVM comprising: 处理指示读NVM的第一用户命令,检查所述第一用户命令对应的块地址和页地址与第二用户命令对应的块地址和页地址是否相同,其中,所述第二用户命令指示读NVM,所述第二用户命令出现于所述第一用户命令之前,且所述第二命令与所述第一用户命令访问相同的第一并行单元;Processing a first user command indicating to read NVM, checking whether the block address and page address corresponding to the first user command are the same as the block address and page address corresponding to the second user command, wherein the second user command indicates to read NVM , the second user command appears before the first user command, and the second command accesses the same first parallel unit as the first user command; 若所述第一用户命令对应的块地址和页地址与第二用户命令对应的块地址和页地址相同,从与所述第一并行单元对应的第一缓存中读出数据,用来响应所述第一用户命令。If the block address and page address corresponding to the first user command are the same as the block address and page address corresponding to the second user command, read data from the first cache corresponding to the first parallel unit to respond to the Describe the first user command. 2.根据权利要求1所述的方法,进一步包括:2. The method of claim 1, further comprising: 若所述第一用户命令对应的块地址和页地址与第二用户命令对应的块地址和页地址不同,向NVM发出NVM读命令。If the block address and page address corresponding to the first user command are different from the block address and page address corresponding to the second user command, send an NVM read command to the NVM. 3.根据权利要求1所述的方法,其中,为访问第一并行单元的第一用户命令提供第一缓存,为访问第二并行单元的第一用户命令提供第二缓存。3. The method of claim 1, wherein a first buffer is provided for a first user command accessing a first parallel unit, and a second buffer is provided for a first user command accessing a second parallel unit. 4.根据权利要求2所述的方法,其中,响应于所述第二用户命令,将从NVM中读出与所述第二用户命令对应的块地址和页地址对应的数据写入所述第一缓存。4. The method according to claim 2, wherein, in response to the second user command, the data corresponding to the block address and the page address read from the NVM and corresponding to the second user command are written into the first a cache. 5.根据权利要求1-4其中之一所述的方法,其中,5. The method according to any one of claims 1-4, wherein, 若所述第一用户命令对应的块地址和页地址与第二用户命令对应的块地址和页地址相同,设置标志寄存器;以及If the block address and page address corresponding to the first user command are the same as the block address and page address corresponding to the second user command, setting a flag register; and 若所述第一用户命令对应的块地址和页地址与第二用户命令对应的块地址和页地址不同,清除标志寄存器。If the block address and page address corresponding to the first user command are different from the block address and page address corresponding to the second user command, the flag register is cleared. 6.根据权利要求5所述的方法,其中,6. The method of claim 5, wherein, 若所述第一用户命令对应的块地址和页地址与第二用户命令对应的块地址和页地址相同,跳转执行第一微指令序列,以从与所述第一并行单元对应的第一缓存中读出数据;以及If the block address and page address corresponding to the first user command are the same as the block address and page address corresponding to the second user command, jump to execute the first microinstruction sequence to start from the first microinstruction corresponding to the first parallel unit read data from the cache; and 若所述第一用户命令对应的块地址和页地址与第二用户命令对应的块地址和页地址不同,跳转执行第二微指令序列,以向NVM发出NVM读命令。If the block address and page address corresponding to the first user command are different from the block address and page address corresponding to the second user command, jump to execute the second microinstruction sequence to send an NVM read command to the NVM. 7.根据权利要求3或4所述的方法,其中,响应于所述第一用户命令,若所述第一用户命令对应的块地址和页地址与第二用户命令对应的块地址和页地址不同,进一步从NVM中读出与所述第一用户命令对应的块地址和页地址对应的数据,并写入所述第一缓存。7. The method according to claim 3 or 4, wherein, in response to the first user command, if the block address and page address corresponding to the first user command are the same as the block address and page address corresponding to the second user command Differently, the data corresponding to the block address and the page address corresponding to the first user command are further read from the NVM, and written into the first cache. 8.根据权利要求1-7其中之一所述的方法,其中,所述第一用户命令对应第一区段地址,所述第二用户命令对应第二区段地址。8. The method according to any one of claims 1-7, wherein the first user command corresponds to a first segment address, and the second user command corresponds to a second segment address. 9.一种NVM控制器,包括:9. A NVM controller comprising: 微指令存储器,用于存储微指令序列;A microinstruction memory for storing microinstruction sequences; 微指令执行单元,用于对微指令进行译码并执行微指令所对应的操作;The microinstruction execution unit is used to decode the microinstruction and execute the operation corresponding to the microinstruction; 程序计数器,用于指示微指令存储器中微指令的存储位置;a program counter for indicating the storage location of the microinstruction in the microinstruction memory; 通用寄存器组,其中通过所述微指令序列中的微指令可访问所述通用寄存器组中的寄存器;a general-purpose register set, wherein registers in the general-purpose register set can be accessed by microinstructions in the microinstruction sequence; 用户命令存储器,用于存储用户命令;以及a user command memory for storing user commands; and 上下文存储器,用于存储微指令序列对应的上下文信息。The context memory is used to store context information corresponding to the microinstruction sequence. 10.根据权利要求9所述的NVM控制器,其中依据程序计数器,所述微指令执行单元从微指令存储器中获取第一微指令,10. The NVM controller according to claim 9, wherein according to the program counter, the microinstruction execution unit obtains the first microinstruction from the microinstruction memory, 所述微指令执行单元对第一微指令进行解码,当第一微指令是读地址检查微指令时,所述微指令执行单元,依据读地址检查微指令的偏移值访问用户命令存储器,获取第一块地址与第一页地址;所述微指令执行单元,访问上下文存储器,获得当前微指令序列的上下文信息中存储的第二块地址与第二页地址;所述微指令执行单元比较第一块地址与第二块地址,第一页地址与第二页地址;若所述第一块地址与第二块地址相同,且第一页地址与第二页地址相同,所述微指令执行单元则依据所述读地址检查微指令的寄存器索引设置通用寄存器组中由所述寄存器索引所指示的通用寄存器。The microinstruction execution unit decodes the first microinstruction, and when the first microinstruction is a read address inspection microinstruction, the microinstruction execution unit accesses the user command memory according to the offset value of the read address inspection microinstruction, and obtains The first block address and the first page address; the microinstruction execution unit accesses the context memory to obtain the second block address and the second page address stored in the context information of the current microinstruction sequence; the microinstruction execution unit compares the second page address One block address and the second block address, the first page address and the second page address; if the first block address is the same as the second block address, and the first page address is the same as the second page address, the microinstruction is executed The unit then sets the general register indicated by the register index in the general register set according to the register index of the read address checking microinstruction.
CN201610009789.6A 2016-01-06 2016-01-06 Method for checking block page address and apparatus thereof Active CN106951374B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210539163.1A CN114968099B (en) 2016-01-06 2016-01-06 Method for accessing NVM (non-volatile memory) and NVM controller
CN201610009789.6A CN106951374B (en) 2016-01-06 2016-01-06 Method for checking block page address and apparatus thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610009789.6A CN106951374B (en) 2016-01-06 2016-01-06 Method for checking block page address and apparatus thereof

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN202210539163.1A Division CN114968099B (en) 2016-01-06 2016-01-06 Method for accessing NVM (non-volatile memory) and NVM controller

Publications (2)

Publication Number Publication Date
CN106951374A true CN106951374A (en) 2017-07-14
CN106951374B CN106951374B (en) 2022-06-10

Family

ID=59465862

Family Applications (2)

Application Number Title Priority Date Filing Date
CN201610009789.6A Active CN106951374B (en) 2016-01-06 2016-01-06 Method for checking block page address and apparatus thereof
CN202210539163.1A Active CN114968099B (en) 2016-01-06 2016-01-06 Method for accessing NVM (non-volatile memory) and NVM controller

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN202210539163.1A Active CN114968099B (en) 2016-01-06 2016-01-06 Method for accessing NVM (non-volatile memory) and NVM controller

Country Status (1)

Country Link
CN (2) CN106951374B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109508205A (en) * 2017-09-15 2019-03-22 北京忆恒创源科技有限公司 Support NVM chip, its operating method and the solid storage device of manipulation in situ
CN110580227A (en) * 2018-06-07 2019-12-17 北京忆恒创源科技有限公司 adaptive NVM command generation method and apparatus
CN111400988A (en) * 2018-12-27 2020-07-10 北京忆芯科技有限公司 Bump (Bump) board layout method for integrated circuit chip
CN111488298A (en) * 2017-12-29 2020-08-04 贵阳忆芯科技有限公司 Method and device for optimizing NVM interface command execution sequence
CN111736779A (en) * 2018-04-25 2020-10-02 贵阳忆芯科技有限公司 Method and device for optimizing execution of NVM interface command
CN115630002A (en) * 2022-10-31 2023-01-20 深圳云豹智能有限公司 Access command processing method, device, computer device and storage medium
CN116188247A (en) * 2023-02-06 2023-05-30 格兰菲智能科技有限公司 Register information processing method, device, computer equipment, storage medium

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4156906A (en) * 1977-11-22 1979-05-29 Honeywell Information Systems Inc. Buffer store including control apparatus which facilitates the concurrent processing of a plurality of commands
US4161026A (en) * 1977-11-22 1979-07-10 Honeywell Information Systems Inc. Hardware controlled transfers to microprogram control apparatus and return via microinstruction restart codes
CN1168729A (en) * 1994-10-17 1997-12-24 艾利森电话股份有限公司 System and method for processing memory data and communication system including the same
US5740418A (en) * 1995-05-24 1998-04-14 Mitsubishi Denki Kabushiki Kaisha Pipelined processor carrying out branch prediction by BTB
CN101196850A (en) * 2007-12-28 2008-06-11 祥硕科技股份有限公司 Data access integration method and its system
CN101876944A (en) * 2009-11-26 2010-11-03 威盛电子股份有限公司 Dynamic random access memory controller and control method
CN101887398A (en) * 2010-06-25 2010-11-17 浪潮(北京)电子信息产业有限公司 Method and system for dynamically enhancing input/output (I/O) throughput of server
CN101916227A (en) * 2010-08-13 2010-12-15 中兴通讯股份有限公司 A kind of RLDRAM SIO memory access control method and device
CN102346711A (en) * 2010-07-23 2012-02-08 台湾积体电路制造股份有限公司 Memory module and method of manufacturing the same
WO2013147820A1 (en) * 2012-03-29 2013-10-03 Intel Corporation System and method for managing persistence with a multi-level memory hierarchy including non-volatile memory
CN104106061A (en) * 2012-02-08 2014-10-15 国际商业机器公司 Forward progress mechanism for stores in the presence of load contention in a system favoring loads
US20150089119A1 (en) * 2013-09-23 2015-03-26 Seagate Technology Llc Command execution using existing address information

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4156278A (en) * 1977-11-22 1979-05-22 Honeywell Information Systems Inc. Multiple control store microprogrammable control unit including multiple function register control field
US4768148A (en) * 1986-06-27 1988-08-30 Honeywell Bull Inc. Read in process memory apparatus
JP2559382B2 (en) * 1986-11-05 1996-12-04 株式会社日立製作所 Information processing device
US5117487A (en) * 1988-08-26 1992-05-26 Kabushiki Kaisha Toshiba Method for accessing microprocessor and microinstruction control type microprocessor including pointer register
CN101477443B (en) * 2008-01-03 2011-05-04 上海奇码数字信息有限公司 NAND control system and control method
CN102207916B (en) * 2011-05-30 2013-10-30 西安电子科技大学 Instruction prefetch-based multi-core shared memory control equipment
JP2015176309A (en) * 2014-03-14 2015-10-05 株式会社東芝 Semiconductor memory device

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4156906A (en) * 1977-11-22 1979-05-29 Honeywell Information Systems Inc. Buffer store including control apparatus which facilitates the concurrent processing of a plurality of commands
US4161026A (en) * 1977-11-22 1979-07-10 Honeywell Information Systems Inc. Hardware controlled transfers to microprogram control apparatus and return via microinstruction restart codes
CN1168729A (en) * 1994-10-17 1997-12-24 艾利森电话股份有限公司 System and method for processing memory data and communication system including the same
US5740418A (en) * 1995-05-24 1998-04-14 Mitsubishi Denki Kabushiki Kaisha Pipelined processor carrying out branch prediction by BTB
CN101196850A (en) * 2007-12-28 2008-06-11 祥硕科技股份有限公司 Data access integration method and its system
CN101876944A (en) * 2009-11-26 2010-11-03 威盛电子股份有限公司 Dynamic random access memory controller and control method
CN101887398A (en) * 2010-06-25 2010-11-17 浪潮(北京)电子信息产业有限公司 Method and system for dynamically enhancing input/output (I/O) throughput of server
CN102346711A (en) * 2010-07-23 2012-02-08 台湾积体电路制造股份有限公司 Memory module and method of manufacturing the same
CN101916227A (en) * 2010-08-13 2010-12-15 中兴通讯股份有限公司 A kind of RLDRAM SIO memory access control method and device
CN104106061A (en) * 2012-02-08 2014-10-15 国际商业机器公司 Forward progress mechanism for stores in the presence of load contention in a system favoring loads
WO2013147820A1 (en) * 2012-03-29 2013-10-03 Intel Corporation System and method for managing persistence with a multi-level memory hierarchy including non-volatile memory
US20150089119A1 (en) * 2013-09-23 2015-03-26 Seagate Technology Llc Command execution using existing address information

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
舒继武: ""一种高可扩展存储网络系统TH-MSNS的研究与实现"", 《计算机学报》 *

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109508205A (en) * 2017-09-15 2019-03-22 北京忆恒创源科技有限公司 Support NVM chip, its operating method and the solid storage device of manipulation in situ
CN109508205B (en) * 2017-09-15 2024-04-05 北京忆恒创源科技股份有限公司 NVM chip supporting in-situ operation, operation method thereof and solid-state storage device
CN111488298A (en) * 2017-12-29 2020-08-04 贵阳忆芯科技有限公司 Method and device for optimizing NVM interface command execution sequence
CN111736779A (en) * 2018-04-25 2020-10-02 贵阳忆芯科技有限公司 Method and device for optimizing execution of NVM interface command
CN111736779B (en) * 2018-04-25 2022-01-11 上海忆芯实业有限公司 Method and device for optimizing execution of NVM interface command
CN110580227A (en) * 2018-06-07 2019-12-17 北京忆恒创源科技有限公司 adaptive NVM command generation method and apparatus
CN110580227B (en) * 2018-06-07 2024-04-12 北京忆恒创源科技股份有限公司 Adaptive NVM command generation method and device
CN111400988A (en) * 2018-12-27 2020-07-10 北京忆芯科技有限公司 Bump (Bump) board layout method for integrated circuit chip
CN111400988B (en) * 2018-12-27 2023-08-22 北京忆芯科技有限公司 Bump (Bump) pad layout method for integrated circuit chip
CN115630002A (en) * 2022-10-31 2023-01-20 深圳云豹智能有限公司 Access command processing method, device, computer device and storage medium
CN116188247A (en) * 2023-02-06 2023-05-30 格兰菲智能科技有限公司 Register information processing method, device, computer equipment, storage medium
CN116188247B (en) * 2023-02-06 2024-04-12 格兰菲智能科技有限公司 Register information processing method, device, computer equipment, and storage medium

Also Published As

Publication number Publication date
CN114968099B (en) 2026-02-03
CN114968099A (en) 2022-08-30
CN106951374B (en) 2022-06-10

Similar Documents

Publication Publication Date Title
CN106951374A (en) Method and device for checking block page address
CN114546293B (en) Method for internally moving data in flash memory and device using the method
CN102411549B (en) Memory system, host controller and method for controlling DMA
US9785545B2 (en) Method and apparatus for providing dual memory access to non-volatile memory
TWI435215B (en) Method for giving read commands and reading data, and controller and storage system using the same
CN104781801B (en) Solid state drive is set to be configured to the technology operated using memory module or memory mode
TWI592865B (en) Data reading method, data writing method and storage controller using the same
US20160124649A1 (en) METHOD TO REDUCE FLASH MEMORY IOs WITH HOST MAINTAINED ADDRESS MAPPING TABLE
CN111813703B (en) Data storage device and method for updating logical to physical address mapping table
CN111857813B (en) Method and device for scheduling microinstruction sequence
TWI710905B (en) Data storage device and method for loading logical-to-physical mapping table
JP2015228235A (en) Storage device virtualization
JP2012508428A (en) Method and system for queuing transfers of multiple non-contiguous address ranges with a single command
WO2016099664A1 (en) Apparatus, system and method for caching compressed data background
US20220083274A1 (en) Memory system and data processing system
TW201814526A (en) Memory management method and storage controller using the same
WO2019062202A1 (en) Method, hard disk, and storage medium for executing hard disk operation instruction
CN108628759B (en) Method and device for executing NVM commands out of sequence
KR20150057068A (en) Data storage device and operating method thereof
CN116185892B (en) Flash memory controller and method for accessing flash memory particles
US20220300182A1 (en) Memory system
CN116185891B (en) Descriptor Management Methods
CN111488298A (en) Method and device for optimizing NVM interface command execution sequence
TWI494756B (en) Method for giving read commands, flash memory controller and flash memory storage system using the same
KR20220036169A (en) Memory system and data processing system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
EC01 Cancellation of recordation of patent licensing contract

Assignee: BEIJING MEMBLAZE TECHNOLOGY Co.,Ltd.

Assignor: Shanghai Pleiades Microelectronics Co.,Ltd.

Contract record no.: 2016110000016

Date of cancellation: 20211026

EC01 Cancellation of recordation of patent licensing contract
GR01 Patent grant
GR01 Patent grant