TWI719880B - Apparatus and method for programming data of page groups into flash units - Google Patents

Apparatus and method for programming data of page groups into flash units Download PDF

Info

Publication number
TWI719880B
TWI719880B TW109111754A TW109111754A TWI719880B TW I719880 B TWI719880 B TW I719880B TW 109111754 A TW109111754 A TW 109111754A TW 109111754 A TW109111754 A TW 109111754A TW I719880 B TWI719880 B TW I719880B
Authority
TW
Taiwan
Prior art keywords
page group
controller
flash memory
user data
interface
Prior art date
Application number
TW109111754A
Other languages
Chinese (zh)
Other versions
TW202125511A (en
Inventor
李安邦
Original Assignee
慧榮科技股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 慧榮科技股份有限公司 filed Critical 慧榮科技股份有限公司
Application granted granted Critical
Publication of TWI719880B publication Critical patent/TWI719880B/en
Publication of TW202125511A publication Critical patent/TW202125511A/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1076Parity data used in redundant arrays of independent storages, e.g. in RAID systems
    • G06F11/108Parity data distribution in semiconductor storages, e.g. in SSD
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • G06F12/0246Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/16Handling requests for interconnection or transfer for access to memory bus
    • G06F13/1668Details of memory controller
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/28Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

A method for programming data of page groups into flash modules is introduced to include: storing, by a host interface controller, user data of multiple pages in a random access memory (RAM) through bus architecture, and simultaneously outputting, by the host interface controller, the user data of the pages to an engine through an interface, thereby enabling the engine to calculate parities of a page group according to the user data of the pages.

Description

寫入頁面群組的資料到閃存模組的裝置及方法 Device and method for writing data of page group to flash memory module

本發明涉及儲存裝置,尤指一種寫入頁面群組的資料到閃存模組的裝置及方法。 The invention relates to a storage device, in particular to a device and method for writing data of a page group to a flash memory module.

閃存通常分為NOR閃存與NAND閃存。NOR閃存為隨機存取裝置,中央處理器(Host)可於位址腳位上提供任何存取NOR閃存的位址,並及時地從NOR閃存的資料腳位上獲得儲存於該位址上的資料。相反地,NAND閃存並非隨機存取,而是序列存取。NAND閃存無法像NOR閃存一樣,可以存取任何隨機位址,中央處理器反而需要寫入序列的位元組(Bytes)的值到NAND閃存中,用於定義請求命令(Command)的類型(如,讀取、寫入、抹除等),以及用在此命令上的位址。位址可指向一個頁面(閃存中寫入作業的最小資料塊)或一個區塊(閃存中抹除作業的最小資料塊)。 Flash memory is generally divided into NOR flash memory and NAND flash memory. NOR flash memory is a random access device. The central processing unit (Host) can provide any address to access the NOR flash memory on the address pin, and obtain the data stored at that address from the data pin of the NOR flash memory in time data. On the contrary, NAND flash memory is not random access, but serial access. NAND flash memory cannot access any random address like NOR flash memory. Instead, the central processing unit needs to write the value of the sequence of bytes (Bytes) into the NAND flash memory to define the type of request command (Command) (such as , Read, write, erase, etc.), and the address used in this command. The address can point to a page (the smallest data block for a write operation in the flash memory) or a block (the smallest data block for an erase operation in the flash memory).

閃存控制器通常使用糾錯碼(Error Correcting Code,ECC)來修復使用者資料於通過通道或儲存時發生的錯誤。在資料寫入時,閃存控制器編碼使用者資料來產生糾錯碼的冗餘資訊。這些冗餘資訊讓閃存控制器在資料讀取時,可以修正發生在使用者資料中任意位置的有限數目的錯誤位元,而不需要重讀。為了防止讀取頁面的使用者資料含有超過糾錯碼所能夠修正回來的錯誤位元而發生的重大錯誤,閃存控制器可讓預設數目的頁面形成一個頁面群組(Page Group),並且依據頁面群組的使用者資料產生頁面群組的奇偶校驗碼。然而,由於頁面群組的奇偶校驗碼的計算是一種跨頁面的資 料計算操作,需要耗費大量的時間和運算資源。因此,本發明提出一種寫入頁面群組的資料到閃存模組的裝置及方法,用於減少產生頁面群組的奇偶校驗碼時所需的時間和運算資源。 Flash memory controllers usually use Error Correcting Code (ECC) to repair errors that occur when user data passes through the channel or is stored. When data is written, the flash memory controller encodes user data to generate redundant information of error correction codes. This redundant information allows the flash memory controller to correct a limited number of error bits that occur anywhere in the user data when reading data, without the need for rereading. In order to prevent the user data from reading the page from containing more than the error correction code can correct the error bits and the major error occurs, the flash memory controller can make a preset number of pages form a page group, and according to The user data of the page group generates the parity check code of the page group. However, because the calculation of the parity check code of the page group is a cross-page resource Material calculation operations require a lot of time and computing resources. Therefore, the present invention provides an apparatus and method for writing data of a page group to a flash memory module, which is used to reduce the time and computing resources required for generating the parity check code of the page group.

有鑑於此,如何減輕或消除上述相關領域的缺失,實為有待解決的問題。 In view of this, how to reduce or eliminate the deficiencies in the above-mentioned related fields is indeed a problem to be solved.

本說明書涉及一種寫入頁面群組的資料到閃存模組的方法,由閃存控制器執行,包含:主機介面控制器從主機端取得頁面群組的使用者資料,其中,頁面群組包含多個頁面;主機介面控制器通過匯流排架構儲存頁面的使用者資料到隨機存取記憶體,同時通過介面輸出頁面的使用者資料至引擎,使得引擎依據頁面的使用者資料計算頁面群組的奇偶校驗碼;直接記憶體存取控制器從引擎獲取頁面群組的奇偶校驗碼,並且通過匯流排架構儲存頁面群組的奇偶校驗碼到隨機存取記憶體;以及閃存介面控制器通過匯流排架構從隨機存取記憶體獲取頁面的使用者資料和頁面群組的奇偶校驗碼,並且寫入頁面的使用者資料和頁面群組的奇偶校驗碼至閃存模組。 This specification relates to a method for writing data of a page group to a flash memory module, which is executed by the flash memory controller, and includes: the host interface controller obtains user data of the page group from the host, wherein the page group includes multiple Page; the host interface controller stores the user data of the page to the random access memory through the bus architecture, and outputs the user data of the page to the engine through the interface, so that the engine calculates the parity of the page group based on the user data of the page Code verification; the direct memory access controller obtains the parity check code of the page group from the engine, and stores the parity check code of the page group to the random access memory through the bus architecture; and the flash memory interface controller uses the bus The row structure obtains the user data of the page and the parity check code of the page group from the random access memory, and writes the user data of the page and the parity check code of the page group to the flash memory module.

本說明書更另涉及一種寫入頁面群組的資料到閃存模組的裝置,包含:匯流排架構;引擎;和主機介面控制器。主機介面控制器包含第一介面,耦接匯流排架構;第二介面,耦接主機端;第三介面,耦接引擎;以及控制器。控制器驅動第二介面從主機端取得頁面群組的使用者資料,頁面群組包含多個頁面;驅動第一介面以通過匯流排架構儲存頁面的使用者資料到隨機存取記憶體,同時驅動第三介面輸出頁面的使用者資料至引擎,使得引擎依據頁面的使用者資料計算頁面群組的奇偶校驗碼。 This specification also relates to a device for writing data of a page group to a flash memory module, which includes: a bus architecture; an engine; and a host interface controller. The host interface controller includes a first interface coupled to the bus structure; a second interface coupled to the host terminal; a third interface coupled to the engine; and a controller. The controller drives the second interface to obtain the user data of the page group from the host. The page group contains multiple pages; drives the first interface to store the user data of the page to the random access memory through the bus architecture, and drives at the same time The third interface outputs the user data of the page to the engine, so that the engine calculates the parity check code of the page group based on the user data of the page.

上述實施例的優點之一,通過如上所述的使用主機介面控制器直接輸出頁面的使用者資料到引擎以進行奇偶校驗碼的計算,可節省引擎通過匯流排架構從隨機存取記憶體讀取頁面的使用者資料的時間。 One of the advantages of the above embodiment is that by using the host interface controller to directly output the user data of the page to the engine to calculate the parity code, it can save the engine from reading from the random access memory through the bus architecture. The time when the user data of the page was fetched.

本發明的其他優點將搭配以下的說明和圖式進行更詳細的解說。 Other advantages of the present invention will be explained in more detail with the following description and drawings.

10:電子裝置 10: Electronic device

110:主機端 110: host side

130:閃存控制器 130: flash memory controller

131:主機介面控制器 131: Host Interface Controller

132:匯流排架構 132: bus architecture

134:處理單元 134: Processing Unit

135:直接記憶體存取控制器 135: Direct Memory Access Controller

136:隨機存取記憶體 136: Random Access Memory

137:獨立磁碟冗餘陣列糾錯碼引擎 137: Redundant Array of Independent Disks Error Correction Code Engine

139:閃存介面控制器 139: flash memory interface controller

150:閃存模組 150: Flash memory module

530:閃存控制器 530: flash memory controller

531:主機介面控制器 531: Host Interface Controller

535:直接記憶體存取控制器 535: Direct Memory Access Controller

537:獨立磁碟冗餘陣列糾錯碼引擎 537: Redundant Array of Independent Disks Error Correction Code Engine

610,650,673,677:介面 610,650,673,677: interface

圖1顯示頁面、奇偶校驗碼頁面及其糾錯碼的邏輯資料組織示意圖。 Figure 1 shows the logical data organization diagram of the page, the parity check code page and its error correction code.

圖2為一些實施方式的電子裝置的系統架構圖。 FIG. 2 is a system architecture diagram of an electronic device according to some embodiments.

圖3為基於圖2的系統架構下的頁面群組的使用者資料及其奇偶校驗碼的產生及寫入的示意圖。 FIG. 3 is a schematic diagram of the generation and writing of user data and parity check codes of the page group based on the system architecture of FIG. 2.

圖4為基於圖3所示的執行步驟的操作順序圖。 Fig. 4 is an operation sequence diagram based on the execution steps shown in Fig. 3.

圖5為依據本發明實施例的電子裝置的系統架構圖。 FIG. 5 is a system architecture diagram of an electronic device according to an embodiment of the invention.

圖6為依據本發明實施例的閃存控制器中元件的介面連接示意圖。 FIG. 6 is a schematic diagram of interface connections of components in a flash memory controller according to an embodiment of the present invention.

圖7為依據本發明實施例的從主機介面控制器傳輸多個頁面的使用者資料到獨立磁碟冗餘陣列糾錯碼引擎的時序圖。 FIG. 7 is a timing diagram of transmitting multiple pages of user data from a host interface controller to a redundant array of independent disks error correction code engine according to an embodiment of the present invention.

圖8為依據本發明實施例的從獨立磁碟冗餘陣列糾錯碼引擎傳輸頁面群組的奇偶校驗碼到直接記憶體控制器的時序圖。 FIG. 8 is a timing diagram of transmitting the parity check code of the page group from the redundant array of independent disks error correction code engine to the direct memory controller according to an embodiment of the present invention.

圖9為基於圖5的系統架構下的頁面群組的使用者資料及其奇偶校驗碼的產生及寫入的示意圖。 FIG. 9 is a schematic diagram of the generation and writing of user data and parity check codes of the page group based on the system architecture of FIG. 5.

以下說明為完成發明的較佳實現方式,其目的在於描述本發明的基本精神,但並不用以限定本發明。實際的發明內容必須參考之後的權利要求範圍。 The following descriptions are preferred implementations for completing the invention, and their purpose is to describe the basic spirit of the invention, but not to limit the invention. The actual content of the invention must refer to the scope of the claims that follow.

必須了解的是,使用於本說明書中的“包含”、“包括”等詞,用以表示存在特定的技術特徵、數值、方法步驟、作業處理、元件以及/或組件,但並不排除可加上更多的技術特徵、數值、方法步驟、作業處理、元件、組件,或以上的任意組合。 It must be understood that the words "including" and "including" used in this specification are used to indicate the existence of specific technical features, values, method steps, operations, elements, and/or components, but they do not exclude the possibility of adding More technical features, values, method steps, job processing, components, components, or any combination of the above.

於權利要求中使用如“第一”、“第二”、“第三”等詞是用來修飾權利要求中的元件,並非用來表示之間具有優先順序,前置關係,或者是一個元件先於另一個元件,或者是執行方法步驟時的時間先後順序,僅用來區別具有相同名字的元件。 Words such as "first", "second", and "third" in the claims are used to modify the elements in the claims, not to indicate that there is a priority, prerequisite relationship, or an element Prior to another element, or the chronological order of execution of method steps, is only used to distinguish elements with the same name.

必須了解的是,當元件描述為“連接”或“耦接”至另一元件時,可以是直接連結、或耦接至其他元件,可能出現中間元件。相反地,當元件描述為“直接連接”或“直接耦接”至另一元件時,其中不存在任何中間元件。使用來描述元件之間關係的其他語詞也可類似方式解讀,例如“介於”相對於“直接介於”,或者是“鄰接”相對於“直接鄰接”等等。 It must be understood that when an element is described as being “connected” or “coupled” to another element, it can be directly connected or coupled to other elements, and intervening elements may appear. Conversely, when an element is described as being "directly connected" or "directly coupled" to another element, there are no intervening elements. Other terms used to describe the relationship between elements can also be interpreted in a similar manner, such as "between" versus "directly between", or "adjacent" versus "directly adjacent" and so on.

為了達到資料的容錯性,閃存控制器可依據每頁的使用者資料產生糾錯碼(Error Correcting Code,ECC),並將使用者資料連同糾錯碼一起寫入閃存模組,使得將來能夠修正從閃存模組讀出的含有錯誤位元的使用者資料。糾錯碼可以是低密度奇偶較驗碼(Low-Density Parity Check Code,LDPC)、BCH碼(Bose-Chaudhuri-Hocquenghem Code)或其他種類的編碼。以每1K位元組的使用者資料為例,BCH碼可提供最多72個錯誤位元的修正能力,而LDPC可提供最多128個錯誤位元的修正能力。然而,讀取頁面的使用者資料可能含有超過糾錯碼所能夠修正回來的錯誤位元。因此,閃存控制器可讓預設數目的頁面形成一個頁面群組(Page Group),並且依據頁面群組的使用者資料產生奇偶校驗碼頁面(Parity Page)。參考圖1所示範例的資料組織,七個頁面P#0至P#6形成一個頁面群組,每個頁面包含4096位元的使用者資料,並據以產生相應的ECC。例如,第0頁面P#0的糾錯碼為ECC#0,第1頁面P#1的糾錯碼為ECC#1,依此類推。在這裡需注意的是,圖1所示的範例是一種邏輯觀點,並不代表一個頁面群組的使用者資料及其糾錯碼、奇偶校驗碼頁面及其糾錯碼實際儲存於同一個實體塊中。為了最佳化系統效能,一個頁面群組的使用者資料頁面及其糾錯碼、奇偶校驗碼頁面及其糾錯碼可能以並行的方式儲存在不同通道中多個邏輯單元號(Logical Number Unit,LUN)的實體塊,本發明並不因此受限。奇偶校驗碼頁面的資料可使用公式(1)產生: Pj=dp0,j⊕dp1,j⊕dp2,j⊕dp3,j⊕dp4,j⊕dp5,j⊕dp6,j,其中,j為從0到4095的任意整數,p0代表第0頁面,p1代表第1頁面,p2代表第2頁面,Pj代表奇偶校驗碼頁面中第j個位元的值,dp0,j代表第0頁面中第j個位元的值,dp1,j代表第1頁面中第j個位元的值,dp2,j代表第2頁面中第j個位元的值。當運用一個頁面的相應糾錯碼還無法修正其中的錯誤位元時,閃存控制器可捨棄此頁面,並依據頁面群組中的其他頁面和奇偶校驗碼頁面的內容使用互斥或運算來產生修復後的此頁面的使用者資料。假設第1頁面中的錯誤位元無法使用相應糾錯碼修正時,可使用公式(2)進行錯誤頁面的回復:dp1,j=dp0,j⊕dp2,j⊕dp3,j⊕dp4,j⊕dp5,j⊕dp6,j⊕Pj。頁面群組的奇偶校驗碼根據其作用又可稱為獨立磁碟冗餘陣列糾錯碼(Redundant Array of Independent Disks,RAID ECC)。 In order to achieve data fault tolerance, the flash memory controller can generate an Error Correcting Code (ECC) based on the user data of each page, and write the user data together with the error correction code into the flash memory module so that it can be corrected in the future User data with error bits read from the flash memory module. The error correction code can be a Low-Density Parity Check Code (LDPC), BCH code (Bose-Chaudhuri-Hocquenghem Code) or other types of codes. Taking user data per 1K byte as an example, the BCH code can provide correction capability of up to 72 error bits, while LDPC can provide correction capability of up to 128 error bits. However, the user data of the read page may contain more error bits than the error correction code can correct. Therefore, the flash memory controller allows a preset number of pages to form a page group, and generates a parity page according to the user data of the page group. Referring to the example data organization shown in FIG. 1, seven pages P#0 to P#6 form a page group, each page contains 4096 bits of user data, and the corresponding ECC is generated accordingly. For example, the error correction code of the 0th page P#0 is ECC#0, the error correction code of the 1st page P#1 is ECC#1, and so on. It should be noted here that the example shown in Figure 1 is a logical point of view, and does not mean that the user data and its error correction code of a page group, the parity code page and its error correction code are actually stored in the same In the physical block. In order to optimize system performance, the user data page and its error correction code, parity check code page and its error correction code of a page group may be stored in parallel in different channels with multiple logical unit numbers (Logical Number Unit, LUN), the present invention is not limited thereby. The data of the parity check code page can be generated using formula (1): P j = d p0,j ⊕d p1,j ⊕d p2,j ⊕d p3,j ⊕d p4,j ⊕d p5,j ⊕d p6 ,j , where j is any integer from 0 to 4095, p0 represents page 0, p1 represents page 1, p2 represents page 2, P j represents the value of the j-th bit in the parity code page, d p0,j represents the value of the jth bit in the 0th page, d p1,j represents the value of the jth bit in the first page, and d p2,j represents the value of the jth bit in the second page . When the error bits in a page cannot be corrected by the corresponding error correction code, the flash memory controller can discard the page and use the exclusive OR operation based on the content of the other pages in the page group and the parity check code page. Generate the repaired user data for this page. Assuming that the error bit in the first page cannot be corrected with the corresponding error correction code, the formula (2) can be used to reply to the error page: d p1,j = d p0,j ⊕d p2,j ⊕d p3,j ⊕ d p4,j ⊕d p5,j ⊕d p6,j ⊕P j . The parity check code of the page group can also be called the Redundant Array of Independent Disks (RAID ECC) according to its function.

為了完成以上所述的二維防護,圖2顯示一些實施方式的系統架構。電子裝置10包含主機端(Host Side)110、閃存控制器130及閃存模組150,並且閃存控制器130及閃存模組150可合稱為裝置端(Device Side)。電子裝置10可實施於個人電腦、筆記型電腦(Laptop PC)、平板電腦、手機、數位相機、數位攝影機等電子產品之中。主機端110與閃存控制器130的主機介面控制器(Host Interface Controller)131可以通用序列匯流排(Universal Serial Bus,USB)、先進技術附著(advanced technology attachment,ATA)、序列先進技術附著(serial advanced technology attachment,SATA)、快速周邊元件互聯(peripheral component interconnect express,PCI-E)、通用快閃記憶儲存(Universal Flash Storage,UFS)、快速非揮發記憶體(Non-Volatile Memory Express,NVMe)、嵌入式多媒體卡(Embedded Multi-Media Card,eMMC)等通訊協定彼此溝通。閃存控制器130的閃存介面控制器(Flash Interface Controller)139與閃存模組150可以雙倍資料率(Double Data Rate,DDR)通訊協定彼 此溝通,例如,開放NAND快閃(Open NAND Flash Interface,ONFI)、雙倍資料率開關(DDR Toggle)或其他通訊協定。閃存控制器130包含處理單元134,可使用多種方式實施,如使用通用硬體(例如,單一處理器、具平行處理能力的多處理器、圖形處理器或其他具運算能力的處理器),並且在執行軟體以及/或韌體指令時,提供之後描述的功能。處理單元134通過主機介面控制器131接收主機命令,例如讀取命令(Read Command)、寫入命令(Write Command)、抹除命令(Erase Command)等,排程並執行這些命令。閃存控制器130另包含隨機存取記憶體(Random Access Memory,RAM)136,可實施為動態隨機存取記憶體(Dynamic Random Access Memory,DRAM)、靜態隨機存取記憶體(Static Random Access Memory,SRAM)或上述兩者的結合,用於配置空間作為資料緩衝區,儲存從主機端110讀取並即將寫入閃存模組150的使用者資料(也可稱為主機資料)、奇偶校驗碼等,儲存從閃存模組150讀取並即將輸出給主機端110的使用者資料,以及儲存從閃存模組150讀取的用來進行資料修復的ECC、奇偶校驗碼等。隨機存取記憶體136另可儲存執行過程中需要的資料,例如,變數、資料表、主機-閃存對照表(Host-to-Flash,H2F Table)、閃存-主機對照表(Flash-to-Host,F2H Table)等。閃存介面控制器139包含NAND閃存控制器(NAND Flash Controller,NFC),提供存取閃存模組150時需要的功能,例如命令序列器(Command Sequencer)、ECC編碼器、ECC解碼器等。ECC編碼器用於依據一個使用者資料頁面或者RAID ECC頁面的內容產生相應的ECC。 In order to complete the two-dimensional protection described above, FIG. 2 shows the system architecture of some embodiments. The electronic device 10 includes a host side 110, a flash memory controller 130, and a flash memory module 150, and the flash memory controller 130 and the flash memory module 150 can be collectively referred to as a device side. The electronic device 10 can be implemented in electronic products such as a personal computer, a laptop PC, a tablet computer, a mobile phone, a digital camera, and a digital video camera. The host interface controller (Host Interface Controller) 131 of the host side 110 and the flash memory controller 130 can be attached to a universal serial bus (USB), advanced technology attachment (ATA), and serial advanced technology attachment (serial advanced). technology attachment, SATA), fast peripheral component interconnect express (PCI-E), universal flash storage (Universal Flash Storage, UFS), fast non-volatile memory (Non-Volatile Memory Express, NVMe), embedded Communication protocols such as Embedded Multi-Media Card (eMMC) communicate with each other. The flash memory interface controller (Flash Interface Controller) 139 and the flash memory module 150 of the flash memory controller 130 can communicate with each other through the Double Data Rate (DDR) communication protocol. This communication, for example, open NAND flash (Open NAND Flash Interface, ONFI), double data rate switch (DDR Toggle) or other communication protocols. The flash memory controller 130 includes a processing unit 134, which can be implemented in a variety of ways, such as using general-purpose hardware (for example, a single processor, a multi-processor with parallel processing capabilities, a graphics processor, or other processors with computing capabilities), and When executing software and/or firmware commands, it provides the functions described later. The processing unit 134 receives host commands, such as Read Command, Write Command, Erase Command, etc., through the host interface controller 131, schedules and executes these commands. The flash memory controller 130 further includes a random access memory (Random Access Memory, RAM) 136, which can be implemented as a dynamic random access memory (Dynamic Random Access Memory, DRAM) or a static random access memory (Static Random Access Memory, SRAM) or a combination of the above two, used to configure the space as a data buffer to store user data (also called host data) and parity code read from the host 110 and to be written into the flash memory module 150 It stores the user data read from the flash memory module 150 and will be output to the host 110, and stores the ECC and parity check codes read from the flash memory module 150 for data restoration. The random access memory 136 can also store data needed during execution, such as variables, data tables, Host-to-Flash (Host-to-Flash, H2F Table), and Flash-to-Host comparison table (Flash-to-Host). , F2H Table) and so on. The flash memory interface controller 139 includes a NAND Flash Controller (NFC), and provides functions required when accessing the flash memory module 150, such as a command sequencer (Command Sequencer), an ECC encoder, an ECC decoder, and the like. The ECC encoder is used to generate the corresponding ECC based on the content of a user data page or RAID ECC page.

閃存控制器130中可配置匯流排架構(Bus Architecture) 132,用於讓元件之間彼此耦接以傳遞資料、位址、控制訊號等,這些元件包含主機介面控制器131、處理單元134、RAM 136、直接記憶體存取(Direct Memory Access,DMA)控制器135、閃存介面控制器139 等。於一些實施例中,主機介面控制器131、處理單元134、RAM 136、DMA控制器135與閃存介面控制器139可通過單一匯流排彼此耦接。於另一些實施例中,閃存控制器130中可配置高速匯流排,用於讓處理單元134、DMA控制器135與RAM 136彼此耦接,並且配置低速匯流排,用於讓處理單元134、DMA控制器135、主機介面控制器131與閃存介面控制器139彼此耦接。匯流排包含並行的物理線,連接閃存控制器130中兩個以上的組件。匯流排是一種共享的傳輸媒體,在任意的時間上,只能有兩個裝置可以使用這些線來彼此溝通,用於傳遞資料。資料及控制訊號能夠在組件間分別沿資料和控制線進行雙向傳播,但另一方面,位址訊號只能沿位址線進行單向傳播。例如,當處理單元134想要讀取RAM 136的特定位址上的資料時,處理單元134在位址線上傳送此位址給RAM 136。接著,此位址的資料會在資料線上回覆給處理單元134。為了完成資料讀取操作,控制訊號會使用控制線進行傳遞。 The flash memory controller 130 can be configured with a bus architecture 132 for coupling between components to transfer data, addresses, control signals, etc. These components include a host interface controller 131, a processing unit 134, and RAM 136. Direct Memory Access (DMA) controller 135, flash memory interface controller 139 Wait. In some embodiments, the host interface controller 131, the processing unit 134, the RAM 136, the DMA controller 135, and the flash memory interface controller 139 may be coupled to each other through a single bus. In other embodiments, a high-speed bus may be configured in the flash memory controller 130 for coupling the processing unit 134, the DMA controller 135, and the RAM 136 to each other, and a low-speed bus may be configured for the processing unit 134, DMA The controller 135, the host interface controller 131, and the flash memory interface controller 139 are coupled to each other. The bus bar includes parallel physical lines to connect more than two components in the flash memory controller 130. The bus is a shared transmission medium. At any time, only two devices can use these lines to communicate with each other for data transmission. Data and control signals can propagate in both directions along the data and control lines between components, but on the other hand, address signals can only propagate in one direction along the address line. For example, when the processing unit 134 wants to read data at a specific address of the RAM 136, the processing unit 134 transmits the address to the RAM 136 on the address line. Then, the data at this address will reply to the processing unit 134 on the data line. In order to complete the data reading operation, the control signal will be transmitted using the control line.

閃存控制器130可包含RAID ECC引擎137,包含互斥或閘和寄存器,用於完成如上所述公式(1)、公式(2)或類似的運算。DMA控制器135可包含指令佇列(Instruction Queue)。處理單元134可通過匯流排架構132發出資料存取指令給DMA控制器135,DMA控制器135則將這些指令依據到達時間儲存於指令佇列。每個資料存取指令可包含來源元件、來源位址、目的地元件、目的地位址等資訊。DMA控制器135依據資料存取指令,通過匯流排架構132在元件間遷移指定的資料,例如,讀取RAM 136中特定位址及長度的資料並輸入RAID ECC引擎137,將RAID ECC引擎137產生的奇偶校驗碼儲存到RAM 136中的特定位址等。 The flash memory controller 130 may include a RAID ECC engine 137, including mutual exclusion or gates and registers, for completing the above-mentioned formula (1), formula (2) or similar operations. The DMA controller 135 may include an instruction queue (Instruction Queue). The processing unit 134 can issue data access commands to the DMA controller 135 through the bus architecture 132, and the DMA controller 135 stores these commands in the command queue according to the arrival time. Each data access command can include source component, source address, destination component, destination address and other information. The DMA controller 135 transfers specified data between components through the bus architecture 132 according to the data access command, for example, reads the data of a specific address and length in the RAM 136 and inputs it to the RAID ECC engine 137 to generate the RAID ECC engine 137 The parity check code is stored in a specific address in RAM 136, etc.

閃存模組150提供大量的儲存空間,通常是數百個千兆位元組(Gigabytes,GB),甚至是數個兆兆位元組(Terabytes,TB),用於儲存大量的使用者資料,例如高解析度圖片、影片等。閃存模 組150中包含控制電路以及記憶體陣列,記憶體陣列中的記憶單元可包含單層式單元(Single Level Cells,SLCs)、多層式單元(Multiple Level Cells,MLCs)、三層式單元(Triple Level Cells,TLCs)、四層式單元(Quad-Level Cells,QLCs)或上述的任意組合。處理單元134通過閃存介面控制器139寫入使用者資料到閃存模組150中的指定位址(目的地位址),以及從閃存模組150中的指定位址(來源位址)讀取使用者資料。閃存介面控制器139使用數個電子訊號來協調閃存控制器130與閃存模組150間的資料與命令傳遞,包含資料線(Data Line)、時脈訊號(clock signal)與控制訊號(control signal)。資料線可用於傳遞命令、位址、讀出及寫入的資料;控制訊號線可用於傳遞晶片致能(Chip Enable,CE)、位址提取致能(Address Latch Enable,ALE)、命令提取致能(Command Latch Enable,CLE)、寫入致能(Write Enable,WE)等控制訊號。 The flash memory module 150 provides a large amount of storage space, usually hundreds of gigabytes (GB), or even several terabytes (Terabytes, TB) for storing large amounts of user data. For example, high-resolution pictures, videos, etc. Flash memory module Group 150 includes a control circuit and a memory array. The memory cells in the memory array can include single level cells (SLCs), multiple level cells (MLCs), and triple level cells. Cells, TLCs), Quad-Level Cells (QLCs) or any combination of the above. The processing unit 134 writes user data to the designated address (destination address) in the flash memory module 150 through the flash memory interface controller 139, and reads the user from the designated address (source address) in the flash memory module 150 data. The flash memory interface controller 139 uses several electronic signals to coordinate the data and command transfer between the flash memory controller 130 and the flash memory module 150, including data lines, clock signals, and control signals. . The data line can be used to transfer commands, addresses, read and write data; the control signal line can be used to transfer Chip Enable (CE), Address Latch Enable (ALE), and command extraction to enable Control signals such as Command Latch Enable (CLE) and Write Enable (WE).

然而,如上所示實施方式的架構會讓DMA控制器135必須等待主機介面控制器131將一頁的使用者資料儲存到RAM 136的指定位址後才能夠從RAM 136的指定位址讀取這頁的使用者資料並輸入到RAID ECC引擎137。詳細來說,參考圖3所示的步驟。 However, the architecture of the embodiment shown above requires the DMA controller 135 to wait for the host interface controller 131 to store a page of user data to the specified address of the RAM 136 before it can read it from the specified address of the RAM 136. The user information on the page is input to the RAID ECC engine 137. In detail, refer to the steps shown in FIG. 3.

步驟(1):主機介面控制器131從主機端110取得一個頁面的使用者資料,並儲存此頁面的使用者資料到RAM 136中的指定位址。 Step (1): The host interface controller 131 obtains a page of user data from the host terminal 110, and stores the user data of this page to a designated address in the RAM 136.

步驟(2):DMA控制器135從RAM 136中的指定位址讀取一個頁面的使用者資料,並且輸入RAID ECC引擎137。步驟(1)和(2)會不斷地在閃存控制器130中循環執行,直到一個頁面群組的使用者資料都輸入到RAID ECC引擎137來進行運算。 Step (2): The DMA controller 135 reads a page of user data from the designated address in the RAM 136 and inputs it to the RAID ECC engine 137. Steps (1) and (2) will be continuously cyclically executed in the flash memory controller 130 until the user data of a page group is input to the RAID ECC engine 137 for calculation.

步驟(3):DMA控制器135從RAID ECC引擎137取得此頁面群組的奇偶校驗碼,並儲存到RAM 136的指定位址。 Step (3): The DMA controller 135 obtains the parity check code of the page group from the RAID ECC engine 137 and stores it in the designated address of the RAM 136.

步驟(4):閃存介面控制器139從RAM 136中的指定位址讀取這些 頁面的使用者資料和頁面群組的奇偶校驗碼,並且寫入閃存模組150。 Step (4): The flash memory interface controller 139 reads these from the designated address in the RAM 136 The user data of the page and the parity check code of the page group are written into the flash memory module 150.

步驟(1)和步驟(2)的執行需要互相等待,拉長了資料寫入的時間。參考圖4,舉例來說,主機介面控制器131寫入第1頁面的使用者資料至RAM 136的操作P#1(W)需要等待DMA控制器135從RAM 136讀取第0頁面的使用者資料的讀取操作P#0(R),DMA控制器135從RAM 136讀取第1頁面的使用者資料的讀取操作P#1(R)需要等待主機介面控制器131寫入第1頁面的使用者資料至RAM 136的操作P#1(W),依此類推。另外,由於主機介面控制器131和DMA控制器135需要競爭匯流排架構132的控制權,步驟(1)和步驟(2)間可能會因為其他元件(例如,處理單元134、閃存介面控制器139等)佔據匯流排架構132的資源而更進一步拉長其前置時間(如圖4中所示的時間區間ts)。 The execution of step (1) and step (2) needs to wait for each other, which lengthens the time for data writing. Referring to FIG. 4, for example, the operation P#1(W) of the host interface controller 131 to write the user data of the first page to the RAM 136 requires the user to wait for the DMA controller 135 to read the 0th page from the RAM 136 The data read operation P#0(R), the DMA controller 135 reads the user data of the first page from the RAM 136. The read operation P#1(R) needs to wait for the host interface controller 131 to write the first page Operation P#1(W) of RAM 136 from the user data to RAM 136, and so on. In addition, since the host interface controller 131 and the DMA controller 135 need to compete for the control rights of the bus architecture 132, there may be due to other components (for example, the processing unit 134, the flash memory interface controller 139) between step (1) and step (2). Etc.) occupy the resources of the bus architecture 132 and further lengthen its lead time (time interval ts as shown in FIG. 4).

為了解決如上所述實施方式的問題,本發明實施例提出一種新的閃存控制器,修改主機介面控制器131、DMA控制器135和RAID ECC引擎137間的介面設置,用於避免通過DMA控制器135佔據匯流排架構132的資源來從RAM 136讀取頁面群組的使用者資料並輸入到RAID ECC引擎137。參考圖5所示的電子裝置50,主機介面控制器531和RAID ECC引擎537增加互相連接的介面,用於讓主機介面控制器531從主機端110取得一個頁面的使用者資料後,通過匯流排架構132儲存此頁面的使用者資料到RAM 136中的指定位址,並同時通過新設置的介面傳送此頁面的使用者資料到RAID ECC引擎537。主機介面控制器531在傳送一個頁面群組的使用者資料給RAID ECC引擎537後,發出控制訊號給DMA控制器535,讓DMA控制器535從RAID ECC引擎537取得此頁面群組的奇偶校驗碼,並通過匯流排架構132儲存到RAM 136的指定位址。 In order to solve the problems of the above-mentioned embodiments, the embodiment of the present invention proposes a new flash memory controller, which modifies the interface settings among the host interface controller 131, the DMA controller 135, and the RAID ECC engine 137 to avoid passing through the DMA controller. 135 occupies the resources of the bus architecture 132 to read the user data of the page group from the RAM 136 and input it to the RAID ECC engine 137. Referring to the electronic device 50 shown in FIG. 5, the host interface controller 531 and the RAID ECC engine 537 add interfaces to each other to allow the host interface controller 531 to obtain a page of user data from the host terminal 110 and then use the bus The framework 132 stores the user data of this page to a designated address in the RAM 136, and at the same time transmits the user data of this page to the RAID ECC engine 537 through the newly configured interface. After the host interface controller 531 sends the user data of a page group to the RAID ECC engine 537, it sends a control signal to the DMA controller 535 so that the DMA controller 535 obtains the parity of the page group from the RAID ECC engine 537 The code is stored in the designated address of the RAM 136 through the bus structure 132.

參考圖6的介面連接示意圖。RAID ECC引擎537設置介面673,連接 主機介面控制器531中的介面610,用於直接從主機介面控制器531獲取頁面群組中每一頁的使用者資料以進行頁面群組的奇偶校驗碼的編碼,而不通過任何DMA控制器從RAM 136獲取。在開始資料傳輸前,主機介面控制器531可進入初始化階段,通過介面610通知RAID ECC引擎537每個頁面群組包含多少個頁面、操作模式等資訊。搭配參考圖7的時序圖,詳細來說,針對一個頁面群組的頁面總數設定,RAID ECC引擎537可讓設定引擎就緒訊號(Set RAID Ready Signal,set_raid_rdy)生效(assert)一段時間t71,通知主機介面控制器531可以在這段期間設定頁面總數。在期間t71中,主機介面控制器531可將頁面總數放在群組容量資料線(Group Size Data Lines,grp_size[2:0])並在設定引擎脈衝訊號(Set Pulse Signal,set_raid_pls)上產生一個方波,用於讓RAID ECC引擎537在方波的上升緣於群組容量資料線上提取頁面群組的頁面總數,並儲存於其中的寄存器。針對操作模式設定,RAID ECC引擎537可讓設定模式就緒訊號(Set Mode Ready Signal,set_mode_rdy)生效一段時間t73,通知主機介面控制器531可以在這段期間設定操作模式。在期間t73中,主機介面控制器531可將操作模式(例如,編碼模式mode=0)放在操作模式資料線(Operation Mode Data Lines,op_mode[1:0])並在設定模式脈衝訊號(Set Mode Pulse Signal,set_mode_pls)上產生一個方波,用於讓RAID ECC引擎537在方波的上升緣於操作模式資料線上提取指示的操作模式,並儲存於其中的寄存器。 Refer to Figure 6 for the interface connection diagram. RAID ECC engine 537 setting interface 673, connection The interface 610 in the host interface controller 531 is used to directly obtain the user data of each page in the page group from the host interface controller 531 to encode the parity check code of the page group without any DMA control The device is obtained from RAM 136. Before starting the data transmission, the host interface controller 531 may enter the initialization phase, and inform the RAID ECC engine 537 of how many pages each page group contains, the operation mode, and other information through the interface 610. With reference to the timing diagram in Figure 7, in detail, for the total number of pages set in a page group, the RAID ECC engine 537 can enable the Set RAID Ready Signal (Set RAID Ready Signal, set_raid_rdy) to take effect (assert) for a period of t71 and notify the host The interface controller 531 can set the total number of pages during this period. During the period t71, the host interface controller 531 can place the total number of pages on the group size data lines (Group Size Data Lines, grp_size[2:0]) and generate one on the set pulse signal (Set Pulse Signal, set_raid_pls) The square wave is used to allow the RAID ECC engine 537 to extract the total number of pages of the page group on the group capacity data line and store the total number of pages in the register therein. For the operation mode setting, the RAID ECC engine 537 can enable the Set Mode Ready Signal (set_mode_rdy) to take effect for a period of t73, and notify the host interface controller 531 that the operation mode can be set during this period. During the period t73, the host interface controller 531 can place the operation mode (for example, encoding mode mode=0) on the operation mode data lines (Operation Mode Data Lines, op_mode[1:0]) and set the pulse signal (Set A square wave is generated on the Mode Pulse Signal (set_mode_pls), which is used for the RAID ECC engine 537 to extract the indicated operation mode from the operation mode data line on the rise of the square wave and store it in the register therein.

完成初始化階段後,RAID ECC引擎537可讓編碼就緒訊號(Encode Ready Signal,enc_rdy)生效,直到接收完一個頁面群組的使用者資料(例如,期間t75),用於通知主機介面控制器531可以在生效期間傳送使用者資料。主機介面控制器531可讓編碼使能訊號(Encode Enabling Signal,enc_en)生效,直到傳送完最後一個頁面的使用者資料(例如,期間t77)。在期間t77中,主機介面控制 器531可搭配時鐘訊號(Clock Signal,未顯示在圖7)將每個頁面的使用者資料放在編碼資料線(Encode Data Lines,enc_dat[63:0]),讓RAID ECC引擎537提取。RAID ECC引擎537可使用公式(1)計算提取的使用者資料,產生頁面群組的奇偶校驗碼。主機介面控制器531可包含傳送計數器,初始為0,並且在傳送完一個頁面的使用者資料後加1。當傳送計數器的數值等於頁面群組的頁面總數後,主機介面控制器531可讓結束確認訊號(Termination Valid Signal,term_valid)生效一段時間,通知DMA控制器535可以開始從RAID ECC引擎537獲取頁面群組的奇偶校驗碼,並通過匯流排架構132儲存到RAM 136的指定位址。 After completing the initialization phase, the RAID ECC engine 537 can enable the Encode Ready Signal (enc_rdy) to take effect until the user data of a page group is received (for example, during t75), which is used to notify the host interface controller 531 that it can Send user data during the effective period. The host interface controller 531 can enable the Encode Enabling Signal (enc_en) to take effect until the user data of the last page is transmitted (for example, during t77). During t77, the host interface controls The device 531 can be used with a clock signal (Clock Signal, not shown in FIG. 7) to place the user data of each page on the Encode Data Lines (enc_dat[63:0]) for the RAID ECC engine 537 to extract. The RAID ECC engine 537 can use the formula (1) to calculate the extracted user data to generate the parity check code of the page group. The host interface controller 531 may include a transmission counter, which is initially 0 and increments by 1 after the user data of a page is transmitted. When the value of the transfer counter is equal to the total number of pages in the page group, the host interface controller 531 can let the termination confirmation signal (Termination Valid Signal, term_valid) take effect for a period of time, and notify the DMA controller 535 that it can start to obtain the page group from the RAID ECC engine 537 The parity check code of the group is stored in the designated address of the RAM 136 through the bus architecture 132.

在初始化階段,RAID ECC引擎537中的控制器(未顯示於圖5和圖6)可驅動介面673來讓設定引擎就緒訊號生效一段時間,並且讓設定模式就緒訊號生效一段時間。主機介面控制器531中的控制器(未顯示於圖5和圖6)可驅動介面610來偵測設定引擎就緒訊號,將頁面總數放在群組容量資料線,在設定引擎脈衝訊號上產生一個方波,偵測設定模式就緒訊號,將操作模式放在操作模式資料線,並且在設定模式脈衝訊號上產生一個方波。 In the initialization phase, the controller (not shown in FIG. 5 and FIG. 6) in the RAID ECC engine 537 can drive the interface 673 to allow the setting engine ready signal to take effect for a period of time, and to allow the setting mode ready signal to take effect for a period of time. The controller in the host interface controller 531 (not shown in Figures 5 and 6) can drive the interface 610 to detect and set the engine ready signal, place the total number of pages on the group capacity data line, and generate a pulse signal on the set engine Square wave, detect the setting mode ready signal, put the operation mode on the operation mode data line, and generate a square wave on the setting mode pulse signal.

在資料傳輸階段,RAID ECC引擎537中的控制器(未顯示於圖5和圖6)可驅動介面673來讓編碼就緒訊號生效一段時間。主機介面控制器531中的控制器(未顯示於圖5和圖6)可驅動介面610來讓編碼使能訊號生效一段時間,將每個頁面的使用者資料放在編碼資料線,並且讓結束確認訊號生效一段時間。 During the data transmission phase, the controller (not shown in FIGS. 5 and 6) in the RAID ECC engine 537 can drive the interface 673 to enable the encoding ready signal for a period of time. The controller (not shown in FIGS. 5 and 6) in the host interface controller 531 can drive the interface 610 to enable the encoding enable signal for a period of time, put the user data of each page on the encoding data line, and let the end Confirm that the signal takes effect for a period of time.

在這裡需要注意的是,主機介面控制器531另可設置連接至主機端110的第一介面(未顯示於圖5和圖6)和連接至匯流排架構132的第二介面(未顯示於圖5和圖6)。主機介面控制器531中的控制器(未顯示於圖5和圖6)可驅動第一介面以使用通訊協定從主機端110獲取每個頁面的使用者資料,並且驅動第二介面以使用進階可 擴充介面(Advanced eXtensible Interface,AXI)通訊協定來獲取匯流排架構132的控制權,並通過匯流排架構132儲存每個頁面的使用者資料到RAM 136中的指定位址。主機介面控制器531中的控制器、第一介面和第二介面的電路結構和功能是所屬技術領域技術人員的公知技術,為求簡明不再贅述。 It should be noted here that the host interface controller 531 can also be provided with a first interface (not shown in FIGS. 5 and 6) connected to the host terminal 110 and a second interface (not shown in the figure) connected to the bus structure 132. 5 and Figure 6). The controller in the host interface controller 531 (not shown in FIGS. 5 and 6) can drive the first interface to obtain user data of each page from the host 110 using the communication protocol, and drive the second interface to use advanced can The Advanced eXtensible Interface (AXI) communication protocol is used to obtain the control right of the bus architecture 132, and the user data of each page is stored to the designated address in the RAM 136 through the bus architecture 132. The circuit structures and functions of the controller, the first interface and the second interface in the host interface controller 531 are well-known techniques of those skilled in the art, and will not be repeated for the sake of brevity.

參考圖6的介面連接示意圖。RAID ECC引擎537設置介面677,連接DMA控制器535中的介面650,用於輸出頁面群組的奇偶校驗碼給DMA控制器535。搭配參考圖8的時序圖,詳細來說,當DMA控制器535接收到結束確認訊號後,DMA控制器535可讓結束輸出有效訊號(Termination Out Valid,term_out_valid)生效,直到接收完頁面群組的奇偶校驗碼(例如,期間t81),用於通知RAID ECC引擎537可以在生效期間傳送頁面群組的奇偶校驗碼。RAID ECC引擎537可讓結束輸出使能訊號(Termination Out Enabling Signal,term_out_en)生效,直到傳送完頁面群組的奇偶校驗碼(例如,期間t83)。在期間t83中,RAID ECC引擎537可搭配時鐘訊號(Clock Signal,未顯示在圖8)將頁面群組的奇偶校驗碼放在結束輸出奇偶校驗碼資料線(Termination Out Parity Data Lines,term_out_pty[63:0]),讓DMA控制器535提取。 Refer to Figure 6 for the interface connection diagram. The RAID ECC engine 537 is provided with an interface 677, which is connected to the interface 650 in the DMA controller 535, and is used to output the parity check code of the page group to the DMA controller 535. With reference to the timing diagram of Figure 8, in detail, when the DMA controller 535 receives the end confirmation signal, the DMA controller 535 can make the end output valid signal (Termination Out Valid, term_out_valid) take effect until the end of the page group is received. The parity check code (for example, period t81) is used to notify the RAID ECC engine 537 that the parity check code of the page group can be transmitted during the effective period. The RAID ECC engine 537 can enable the Termination Out Enabling Signal (term_out_en) to take effect until the parity check code of the page group is transmitted (for example, the period t83). During the period t83, the RAID ECC engine 537 can be used with a clock signal (Clock Signal, not shown in Figure 8) to place the parity check code of the page group on the Termination Out Parity Data Lines (Termination Out Parity Data Lines, term_out_pty[ 63:0]), let the DMA controller 535 extract.

在奇偶校驗碼的傳送階段,DMA控制器535中的控制器(未顯示於圖5和圖6)可驅動介面650來偵測結束確認訊號,以及讓結束輸出有效訊號生效一段期間。RAID ECC引擎537中的控制器(未顯示於圖5和圖6)可驅動介面677來讓結束輸出使能訊號生效一段時間,以及將頁面群組的奇偶校驗碼放在結束輸出奇偶校驗碼資料線。 During the transmission phase of the parity check code, the controller (not shown in FIGS. 5 and 6) in the DMA controller 535 can drive the interface 650 to detect the end confirmation signal and make the end output valid signal valid for a period of time. The controller in the RAID ECC engine 537 (not shown in Figures 5 and 6) can drive the interface 677 to enable the end output enable signal to take effect for a period of time, and place the parity check code of the page group in the end output parity code Data line.

在這裡需要注意的是,DMA控制器535另可設置連接至匯流排架構132的介面(未顯示於圖5和圖6)。DMA控制器535中的控制器(未顯示於圖5和圖6)可驅動此介面使用進階可擴充介面通訊協定來獲取匯流排架構132的控制權,並通過匯流排架構132儲存頁面群組的 奇偶校驗碼到RAM 136中的指定位址。DMA控制器535中的控制器和介面的電路結構和功能是所屬技術領域技術人員的公知技術,為求簡明不再贅述。 It should be noted here that the DMA controller 535 can also be provided with an interface connected to the bus structure 132 (not shown in FIGS. 5 and 6). The controller in the DMA controller 535 (not shown in Figures 5 and 6) can drive this interface to use the advanced and expandable interface protocol to obtain control of the bus architecture 132, and store the page group through the bus architecture 132 of Parity check code to the designated address in RAM 136. The circuit structure and functions of the controller and the interface in the DMA controller 535 are well-known techniques of those skilled in the art, and will not be repeated for the sake of simplicity.

根據本發明實施例的架構,詳細來說,參考圖9所示的步驟。 According to the architecture of the embodiment of the present invention, in detail, refer to the steps shown in FIG. 9.

步驟(5):主機介面控制器531從主機端110取得一個頁面的使用者資料,並通過匯流排架構132儲存此頁面的使用者資料到RAM 136中的指定位址,同時通過介面610輸出此頁面的使用者資料到RAID ECC引擎537進行編碼。步驟(5)會不斷地在閃存控制器530中循環執行,直到一個頁面群組的使用者資料都輸入到RAID ECC引擎537來進行運算。 Step (5): The host interface controller 531 obtains the user data of a page from the host 110, and stores the user data of this page to the specified address in the RAM 136 through the bus framework 132, and outputs the data through the interface 610 The user data of the page is encoded in the RAID ECC engine 537. Step (5) is continuously executed in the flash controller 530 in a loop until the user data of a page group is input to the RAID ECC engine 537 for calculation.

步驟(6):主機介面控制器531通過介面610發送結束確認訊號給DMA控制器535,通知DMA控制器535可以開始從RAID ECC引擎537獲取頁面群組的奇偶校驗碼。 Step (6): The host interface controller 531 sends an end confirmation signal to the DMA controller 535 via the interface 610, informing the DMA controller 535 that it can start acquiring the parity code of the page group from the RAID ECC engine 537.

步驟(7):DMA控制器535通過介面650從RAID ECC引擎537取得此頁面群組的奇偶校驗碼,並通過匯流排架構132儲存到RAM 136的指定位址。 Step (7): The DMA controller 535 obtains the parity check code of the page group from the RAID ECC engine 537 through the interface 650, and stores it to the designated address of the RAM 136 through the bus architecture 132.

步驟(8):閃存介面控制器139從RAM 136中的指定位址讀取這些頁面的使用者資料和頁面群組的奇偶校驗碼,並且寫入閃存模組150。閃存介面控制器139更可依據每個頁面的使用者資料產生糾錯碼,依據頁面群組的奇偶校驗碼產生糾錯碼,並且將每個頁面的糾錯碼和奇偶校驗碼的糾錯碼寫入閃存模組150。 Step (8): The flash memory interface controller 139 reads the user data of these pages and the parity check codes of the page groups from the designated address in the RAM 136, and writes them into the flash memory module 150. The flash memory interface controller 139 can further generate an error correction code according to the user data of each page, generate an error correction code according to the parity check code of the page group, and combine the error correction code of each page and the error correction code of the parity check code. The wrong code is written into the flash memory module 150.

相較於圖4所示相應於先前實施方式的時序圖,應用本發明實施例的新架構,可節省先前設計的DMA控制器135從RAM 136的多個頁面的讀取操作P#0(R)至P#6(R),此外,也可避免其他元件和DMA控制器135因爭奪匯流排架構132的控制權產生的碰撞,並避免其他元件因等待這些讀取操作P#0(R)至P#6(R)的完成所需要的前置時間。 Compared with the timing diagram shown in FIG. 4 corresponding to the previous embodiment, the application of the new architecture of the embodiment of the present invention can save the previously designed DMA controller 135 from reading multiple pages of RAM 136. P#0(R ) To P#6(R), in addition, it can also avoid collisions between other components and the DMA controller 135 due to competing for control of the bus architecture 132, and avoid other components waiting for these read operations P#0(R) The lead time required to complete P#6(R).

雖然圖5~6和9中包含了以上描述的元件,但不排除在不違反發明 的精神下,使用更多其他的附加元件,已達成更佳的技術效果。此外,雖然圖9的步驟採用指定的順序來執行,但是在不違反發明精神的情況下,熟習此技藝人士可以在達到相同效果的前提下,修改這些步驟間的順序,所以,本發明並不侷限於僅使用如上所述的順序。此外,熟習此技藝人士亦可以將若干步驟整合為一個步驟,或者是除了這些步驟外,循序或平行地執行更多步驟,本發明亦不因此而侷限。 Although the above-described elements are included in Figures 5 to 6 and 9, it is not ruled out that they do not violate the invention. Under the spirit of using more other additional components, a better technical effect has been achieved. In addition, although the steps in FIG. 9 are executed in a specified order, those skilled in the art can modify the order of these steps on the premise of achieving the same effect without violating the spirit of the invention. Therefore, the present invention does not It is limited to using only the sequence described above. In addition, those skilled in the art can also integrate several steps into one step, or in addition to these steps, perform more steps sequentially or in parallel, and the present invention is not limited thereby.

雖然本發明使用以上實施例進行說明,但需要注意的是,這些描述並非用以限縮本發明。相反地,此發明涵蓋了熟習此技藝人士顯而易見的修改與相似設置。所以,申請權利要求範圍須以最寬廣的方式解釋來包含所有顯而易見的修改與相似設置。 Although the present invention is described using the above embodiments, it should be noted that these descriptions are not intended to limit the present invention. On the contrary, this invention covers modifications and similar arrangements that are obvious to those skilled in the art. Therefore, the scope of applied claims must be interpreted in the broadest way to include all obvious modifications and similar settings.

50:電子裝置 50: electronic device

110:主機端 110: host side

132:匯流排架構 132: bus architecture

134:處理單元 134: Processing Unit

136:隨機存取記憶體 136: Random Access Memory

139:閃存介面控制器 139: flash memory interface controller

150:閃存模組 150: Flash memory module

531:主機介面控制器 531: Host Interface Controller

535:直接記憶體存取控制器 535: Direct Memory Access Controller

537:獨立磁碟冗餘陣列糾錯碼引擎 537: Redundant Array of Independent Disks Error Correction Code Engine

Claims (10)

一種寫入頁面群組的資料到閃存模組的方法,由一閃存控制器執行,包含:一主機介面控制器從一主機端取得一頁面群組的一使用者資料,其中,上述頁面群組包含多個頁面;上述主機介面控制器通過一匯流排架構儲存上述頁面群組的上述使用者資料到一隨機存取記憶體,通過一介面輸出上述頁面群組的上述使用者資料至一引擎,其中,上述引擎依據上述頁面群組的上述使用者資料計算上述頁面群組的一奇偶校驗碼;一直接記憶體存取控制器從上述引擎獲取上述頁面群組的上述奇偶校驗碼,並且通過上述匯流排架構儲存上述頁面群組的上述奇偶校驗碼到上述隨機存取記憶體;以及一閃存介面控制器通過上述匯流排架構從上述隨機存取記憶體獲取上述頁面群組的上述使用者資料和上述頁面群組的上述奇偶校驗碼,並且寫入上述頁面群組的上述使用者資料和上述頁面群組的上述奇偶校驗碼至一閃存模組。 A method for writing data of a page group to a flash memory module, executed by a flash memory controller, includes: a host interface controller obtains a user data of a page group from a host side, wherein the page group Contains multiple pages; the host interface controller stores the user data of the page group to a random access memory through a bus architecture, and outputs the user data of the page group to an engine through an interface, Wherein, the engine calculates a parity check code of the page group according to the user data of the page group; a direct memory access controller obtains the parity check code of the page group from the engine, and Store the parity check code of the page group in the random access memory through the bus architecture; and a flash memory interface controller acquires the use of the page group from the random access memory through the bus architecture The user data and the parity check code of the page group, and the user data of the page group and the parity check code of the page group are written to a flash memory module. 如請求項1所述的寫入頁面群組的資料到閃存模組的方法,其中,上述主機介面控制器不通過上述匯流排架構輸出上述頁面群組的上述使用者資料至上述引擎。 The method for writing data of a page group to a flash memory module according to claim 1, wherein the host interface controller does not output the user data of the page group to the engine through the bus architecture. 如請求項1所述的寫入頁面群組的資料到閃存模組的方法,包含:上述主機介面控制器通過上述介面輸出上述頁面群組的上述使用者資料至上述引擎完成後,通過另一介面傳送一結束確認訊號給上述直接記憶體存取控制器,用於通知上述直接記憶體存取控制器開始從上述引擎獲取上述頁面群組的上述奇偶校驗碼。 The method for writing data of a page group to a flash memory module as described in claim 1, comprising: the host interface controller outputs the user data of the page group to the engine through the interface, and then through another The interface sends an end confirmation signal to the direct memory access controller to notify the direct memory access controller to start acquiring the parity check code of the page group from the engine. 如請求項1所述的寫入頁面群組的資料到閃存模組的方法,包含:上述閃存介面控制器依據每個上述頁面的上述使用者資料產生一第一糾錯碼,依據上述頁面群組的上述奇偶校驗碼產生一第二糾錯碼,以及寫入上述第一糾錯碼和上述第二糾錯碼至上述閃存模組。 The method for writing data of a page group to a flash memory module as described in claim 1, comprising: the flash memory interface controller generates a first error correction code according to the user data of each of the pages, and according to the page group The group of the parity check codes generates a second error correction code, and the first error correction code and the second error correction code are written to the flash memory module. 一種寫入頁面群組的資料到閃存模組的裝置,包含:一匯流排架構;一引擎;以及一主機介面控制器,包含:一第一介面,耦接上述匯流排架構;一第二介面,耦接一主機端;一第三介面,耦接上述引擎;以及一第一控制器,其中,上述第一控制器驅動上述第二介面從上述主機端取得一頁面群組的一使用者資料,上述頁面群組包含多個頁面;驅動上述第一介面以通過上述匯流排架構儲存上述頁面群組的上述使用者資料到一隨機存取記憶體,驅動上述第三介面輸出上述頁面群組的上述使用者資料至上述引擎,其中,上述引擎依據上述頁面群組的上述使用者資料計算上述頁面群組的一奇偶校驗碼。 A device for writing data of a page group to a flash memory module includes: a bus architecture; an engine; and a host interface controller, including: a first interface coupled to the above bus architecture; and a second interface , Coupled to a host; a third interface, coupled to the engine; and a first controller, wherein the first controller drives the second interface to obtain a user data of a page group from the host The page group includes a plurality of pages; the first interface is driven to store the user data of the page group to a random access memory through the bus architecture, and the third interface is driven to output the data of the page group The user data is sent to the engine, wherein the engine calculates a parity check code of the page group according to the user data of the page group. 如請求項5所述的寫入頁面群組的資料到閃存模組的裝置,包含:一直接記憶體存取控制器,包含:一第四介面,耦接上述匯流排架構;一第五介面,耦接上述引擎和上述主機介面控制器;以及 一第二控制器,其中,上述第二控制器驅動上述第五介面從上述引擎獲取上述頁面群組的上述奇偶校驗碼,並且驅動上述第四介面通過上述匯流排架構儲存上述頁面群組的上述奇偶校驗碼到上述隨機存取記憶體。 The device for writing data of a page group to a flash memory module as described in claim 5 includes: a direct memory access controller, including: a fourth interface coupled to the above-mentioned bus structure; and a fifth interface , Coupled to the engine and the host interface controller; and A second controller, wherein the second controller drives the fifth interface to obtain the parity code of the page group from the engine, and drives the fourth interface to store the parity of the page group through the bus architecture The parity check code is stored in the random access memory. 如請求項6中所述的寫入頁面群組的資料到閃存模組的裝置,其中,上述第一控制器通過上述第三介面輸出上述頁面群組的上述使用者資料至上述引擎完成後,通過上述第三介面傳送一結束確認訊號給上述直接記憶體存取控制器,用於通知上述直接記憶體存取控制器開始從上述引擎獲取上述頁面群組的上述奇偶校驗碼。 The device for writing the data of the page group to the flash memory module as described in claim 6, wherein the first controller outputs the user data of the page group to the engine through the third interface, An end confirmation signal is sent to the direct memory access controller through the third interface for informing the direct memory access controller to start acquiring the parity check code of the page group from the engine. 如請求項6所述的寫入頁面群組的資料到閃存模組的裝置,包含:一閃存介面控制器,耦接上述匯流排架構,通過上述匯流排架構從上述隨機存取記憶體獲取上述頁面群組的上述使用者資料和上述頁面群組的上述奇偶校驗碼,並且寫入上述頁面群組的上述使用者資料和上述頁面群組的上述奇偶校驗碼至一閃存模組。 The device for writing data of a page group to a flash memory module according to claim 6, comprising: a flash memory interface controller, coupled to the above-mentioned bus architecture, and obtaining the above-mentioned random access memory from the above-mentioned random access memory through the above-mentioned bus architecture The user data of the page group and the parity code of the page group, and the user data of the page group and the parity code of the page group are written to a flash memory module. 如請求項8所述的寫入頁面群組的資料到閃存模組的裝置,其中,上述閃存介面控制器依據每個上述頁面的上述使用者資料產生一第一糾錯碼,依據上述頁面群組的上述奇偶校驗碼產生一第二糾錯碼,以及寫入上述第一糾錯碼和上述第二糾錯碼至上述閃存模組。 The device for writing data of a page group to a flash memory module according to claim 8, wherein the flash memory interface controller generates a first error correction code according to the user data of each of the pages, and according to the page group The group of the parity check codes generates a second error correction code, and the first error correction code and the second error correction code are written to the flash memory module. 如請求項5至9中任一項所述的寫入頁面群組的資料到閃存模組的裝置,其中,上述引擎不通過上述匯流排架構獲取上述頁面群組的上述使用者資料。 The device for writing data of a page group to a flash memory module according to any one of claim items 5 to 9, wherein the engine does not obtain the user data of the page group through the bus architecture.
TW109111754A 2019-12-16 2020-04-08 Apparatus and method for programming data of page groups into flash units TWI719880B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US201962948516P 2019-12-16 2019-12-16
US62/948,516 2019-12-16

Publications (2)

Publication Number Publication Date
TWI719880B true TWI719880B (en) 2021-02-21
TW202125511A TW202125511A (en) 2021-07-01

Family

ID=75745882

Family Applications (1)

Application Number Title Priority Date Filing Date
TW109111754A TWI719880B (en) 2019-12-16 2020-04-08 Apparatus and method for programming data of page groups into flash units

Country Status (2)

Country Link
CN (1) CN112988449B (en)
TW (1) TWI719880B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116701264B (en) * 2023-08-02 2024-02-23 广东匠芯创科技有限公司 Control method of DMA control system and DMA control system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI227395B (en) * 2003-06-02 2005-02-01 Genesys Logic Inc Method for parallel processing of memory data and error correction code and related device thereof
US9021343B1 (en) * 2014-06-13 2015-04-28 Sandisk Technologies Inc. Parity scheme for a data storage device
US20180091172A1 (en) * 2016-03-04 2018-03-29 Western Digital Technologies, Inc. Ecc and raid-type decoding
US20180129563A1 (en) * 2016-11-07 2018-05-10 Samsung Electronics Co., Ltd. Memory system performing error correction of address mapping table
TW201917582A (en) * 2017-10-27 2019-05-01 韓商愛思開海力士有限公司 Memory system and operating method thereof
US20190173492A1 (en) * 2016-04-27 2019-06-06 Silicon Motion Inc. Flash memory apparatus and storage management method for flash memory

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070022364A1 (en) * 2001-06-14 2007-01-25 Mcbryde Lee Data management architecture
US20090210620A1 (en) * 2008-02-19 2009-08-20 Jibbe Mahmoud K Method to handle demand based dynamic cache allocation between SSD and RAID cache
US8533564B2 (en) * 2009-12-23 2013-09-10 Sandisk Technologies Inc. System and method of error correction of control data at a memory device
US8583868B2 (en) * 2011-08-29 2013-11-12 International Business Machines Storage system cache using flash memory with direct block access
TWI523025B (en) * 2013-12-27 2016-02-21 慧榮科技股份有限公司 Data storage device and error correction method thereof
TWI555028B (en) * 2015-02-12 2016-10-21 慧榮科技股份有限公司 Data storage device and error correction method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI227395B (en) * 2003-06-02 2005-02-01 Genesys Logic Inc Method for parallel processing of memory data and error correction code and related device thereof
US9021343B1 (en) * 2014-06-13 2015-04-28 Sandisk Technologies Inc. Parity scheme for a data storage device
US20180091172A1 (en) * 2016-03-04 2018-03-29 Western Digital Technologies, Inc. Ecc and raid-type decoding
US20190173492A1 (en) * 2016-04-27 2019-06-06 Silicon Motion Inc. Flash memory apparatus and storage management method for flash memory
US20180129563A1 (en) * 2016-11-07 2018-05-10 Samsung Electronics Co., Ltd. Memory system performing error correction of address mapping table
TW201917582A (en) * 2017-10-27 2019-05-01 韓商愛思開海力士有限公司 Memory system and operating method thereof

Also Published As

Publication number Publication date
CN112988449B (en) 2023-08-15
TW202125511A (en) 2021-07-01
CN112988449A (en) 2021-06-18

Similar Documents

Publication Publication Date Title
US11151027B2 (en) Methods and apparatuses for requesting ready status information from a memory
US9015553B2 (en) Data integrity in memory controllers and methods
US20140149706A1 (en) Storage device and data transfering method thereof
US8869004B2 (en) Memory storage device, memory controller thereof, and data transmission method thereof
TWI676991B (en) Methods for testing a storage unit and apparatuses using the same
KR20200093362A (en) Memory system and operating method thereof
TW201407349A (en) Data management method, memory controller and memory storage device
US9135168B2 (en) Apparatus and method for generating descriptors to reaccess a non-volatile semiconductor memory of a storage drive due to an error
TWI719880B (en) Apparatus and method for programming data of page groups into flash units
TW201502977A (en) Command executing method, connector and memory storage device
US11748025B2 (en) Nonvolatile memory device, data storage device including the same and operating method thereof
US9804983B2 (en) Controlling method, connector, and memory storage device
TWI797905B (en) Apparatus and method for driving redundant array of independent disks (raid) engine
US20230205461A1 (en) Apparatus and method for driving redundant array of independent disks (raid) engine
US20210241819A1 (en) Dual SLC/QLC Programming and Resource Releasing
US11216207B2 (en) Apparatus and method for programming user data on the pages and the parity of the page group into flash modules
US9152348B2 (en) Data transmitting method, memory controller and data transmitting system
US20220334999A1 (en) System including pipe5 to pipe4 converter and method thereof
TWI740454B (en) Method and apparatus for accessing to data in response to a power-supply event
KR20150017601A (en) Storage system and method for operating the same
TWI771707B (en) Method and apparatus and computer program product for configuring reliable command
US11513980B2 (en) Method and apparatus for performing access management of memory device with aid of universal asynchronous receiver-transmitter connection
TWI835027B (en) Method and computer program product and apparatus for updating host-to-flash address mapping table
TW202321921A (en) Method and computer program product and apparatus for updating host-to-flash address mapping table
JP2006119830A (en) Storage device, data processing system and storage control method