TW202008371A - Data processing system and data processing method - Google Patents
Data processing system and data processing method Download PDFInfo
- Publication number
- TW202008371A TW202008371A TW107127283A TW107127283A TW202008371A TW 202008371 A TW202008371 A TW 202008371A TW 107127283 A TW107127283 A TW 107127283A TW 107127283 A TW107127283 A TW 107127283A TW 202008371 A TW202008371 A TW 202008371A
- Authority
- TW
- Taiwan
- Prior art keywords
- processor
- memory
- erase
- data processing
- memory controller
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0604—Improving or facilitating administration, e.g. storage management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0626—Reducing size or complexity of storage systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0646—Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
- G06F3/0652—Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/0671—In-line storage system
- G06F3/0673—Single storage device
- G06F3/0679—Non-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)
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
Description
本發明係關於一種資料處理系統與資料處理方法,特別是一種可有效降低記憶體之擦除操作對於系統運作之干擾的資料處理系統與資料處理方法。The invention relates to a data processing system and a data processing method, in particular to a data processing system and a data processing method which can effectively reduce the interference of the erase operation of the memory to the system operation.
非揮發性記憶體(Non-volatile memory)為一種斷電後重新啟動後也可以保留資料的記憶體。當應用於電腦裝置或處理器裝置時,非揮發性記憶體通常可被切分出用於儲存應用程式碼的程式碼執行區域(code execution region),或稱應用程式碼區域(application code region),以及用於儲存系統運作時需要被改變或紀錄的資料或參數的資料紀錄區域(data log region)。Non-volatile memory (Non-volatile memory) is a kind of memory that can retain data even after power-off and restart. When applied to a computer device or a processor device, the non-volatile memory can usually be divided into a code execution region (application code region) for storing application code And a data log region used to store data or parameters that need to be changed or recorded during system operation.
一般而言,非揮發性記憶體的寫入(write)操作需花費數個至數十微秒(uS),而擦除(erase)操作需花費數個至數十毫秒(mS),因此,當系統運作過程中需要改變或紀錄資料或參數時,處理器都只會執行寫入動作。亦即,即使資料或參數需要再次被更改或者記錄,為避免造成系統處理程序的延宕,也是將資料或者參數直接寫入新的記憶資料頁或記憶體區塊,而不是在原來的記憶資料頁或記憶體區塊上做擦除及覆寫。Generally speaking, the write operation of non-volatile memory takes several to tens of microseconds (uS), and the erase operation takes several to tens of milliseconds (mS). Therefore, When the system needs to change or record data or parameters during operation, the processor will only perform write operations. That is, even if the data or parameters need to be changed or recorded again, in order to avoid delays in system processing procedures, the data or parameters are written directly to the new memory data page or memory block, rather than the original memory data page Or erase and overwrite on the memory block.
而當資料紀錄區域的使用率達到一定程度時,仍必需執行擦除操作,將資料紀錄區域中無效的資料擦除,以釋放出記憶體空間。When the usage rate of the data recording area reaches a certain level, it is still necessary to perform an erasing operation to erase invalid data in the data recording area to free up memory space.
為使系統運作(例如,應用程式碼區域的存取)不會因資料擦除的進行而受影響,且系統處理程序不會因資料擦除的進行而被迫延宕或中斷,本發明提出一種資料處理系統及適用於此系統的資料處理方法,用以控制資料紀錄區域的擦除操作。In order that the system operation (for example, access to the application code area) will not be affected by the data erasure, and the system processing procedure will not be forced to be delayed or interrupted by the data erasure, the present invention proposes a A data processing system and a data processing method suitable for this system are used to control the erasing operation of the data recording area.
本發明揭露一種資料處理系統,包括記憶體裝置、處理器、記憶體控制器以及偵測電路。記憶體裝置包括第一區域以及第二區域,其中第一區域被配置用以儲存複數程式碼,第二區域被配置用以儲存系統資料。處理器被配置用以根據程式碼執行至少一指令,其中處理器發出一存取控制信號用以取得程式碼之至少一部分。記憶體控制器耦接於處理器與記憶體裝置之間,被配置用以因應存取控制信號存取記憶體裝置。偵測電路耦接至記憶體控制器,被配置用以偵測處理器是否已進入一閒置狀態。當偵測電路偵測到處理器已進入閒置狀態時,偵測電路發出一處理器閒置信號。因應處理器閒置信號,記憶體控制器發出一擦除命令。因應擦除命令,記憶體裝置擦除第二區域所儲存之至少一部分資料。The invention discloses a data processing system including a memory device, a processor, a memory controller and a detection circuit. The memory device includes a first area and a second area, wherein the first area is configured to store a plurality of program codes, and the second area is configured to store system data. The processor is configured to execute at least one instruction according to the code, wherein the processor issues an access control signal to obtain at least a part of the code. The memory controller is coupled between the processor and the memory device, and is configured to access the memory device in response to the access control signal. The detection circuit is coupled to the memory controller and is configured to detect whether the processor has entered an idle state. When the detection circuit detects that the processor has entered an idle state, the detection circuit sends a processor idle signal. In response to the processor idle signal, the memory controller issues an erase command. In response to the erase command, the memory device erases at least a part of the data stored in the second area.
本發明揭露一種資料處理方法,適用於一資料處理系統,資料處理系統包括記憶體裝置、處理器以及記憶體控制器,記憶體裝置包括第一區域以及第二區域,第一區域被配置用以儲存複數程式碼,第二區域被配置用以儲存系統資料,處理器發出存取控制信號用以取得程式碼之至少一部分,並根據取得之程式碼執行至少一指令,記憶體控制器因應存取控制信號存取記憶體裝置,資料處理方法包括:接收一擦除控制信號;偵測處理器是否已進入一閒置狀態;當偵測到處理器已進入閒置狀態時,發出一處理器閒置信號;因應處理器閒置信號,發出一擦除命令;以及因應擦除命令,擦除第二區域所儲存之至少一部分資料。The invention discloses a data processing method suitable for a data processing system. The data processing system includes a memory device, a processor and a memory controller. The memory device includes a first area and a second area. The first area is configured to Store a plurality of code, the second area is configured to store system data, the processor sends an access control signal to obtain at least a part of the code, and executes at least one command according to the obtained code, the memory controller responds to the access The control signal accesses the memory device. The data processing method includes: receiving an erase control signal; detecting whether the processor has entered an idle state; and sending a processor idle signal when it is detected that the processor has entered the idle state; An erase command is issued in response to the processor idle signal; and at least a portion of the data stored in the second area is erased in response to the erase command.
為讓本發明之目的、特徵和優點能更明顯易懂,下文特舉出本發明之具體實施例,並配合所附圖式,作詳細說明如下。目的在於說明本發明之精神而非用以限定本發明之保護範圍,應理解下列實施例可經由軟體、硬體、韌體、或上述任意組合來實現。In order to make the purpose, features and advantages of the present invention more obvious and understandable, specific embodiments of the present invention are specifically listed below, and in conjunction with the accompanying drawings, detailed descriptions are as follows. The purpose is to illustrate the spirit of the present invention rather than to limit the protection scope of the present invention. It should be understood that the following embodiments can be implemented by software, hardware, firmware, or any combination of the above.
如上述,非揮發性記憶體通常可被分為用於儲存應用程式碼的程式碼執行區域(code execution region),或稱應用程式碼區域(application code region),以及用於儲存系統運作時需要被改變或紀錄的資料或參數的資料紀錄區域(data log region)。當系統運作過程中需要改變或紀錄資料或參數時,處理器都只會執行寫入動作。即使資料或參數需要再次被更改或者記錄,為避免造成系統處理程序的延宕,也是將資料或者參數直接寫入新的記憶資料頁或記憶體區塊,而不是在原來的記憶資料頁或記憶體區塊上做擦除及覆寫。As mentioned above, non-volatile memory can generally be divided into a code execution region, or application code region, for storing application code, as well as storage system operation needs. The data log region of the changed or recorded data or parameters. When the system needs to change or record data or parameters during operation, the processor will only perform write operations. Even if the data or parameters need to be changed or recorded again, in order to avoid delays in system processing procedures, the data or parameters are written directly to the new memory data page or memory block, rather than the original memory data page or memory Erase and overwrite on the block.
然而,當資料紀錄區域的使用率達到一定程度時,仍必需執行擦除操作,將資料紀錄區域中無效的資料擦除,以釋放出記憶體空間。However, when the usage rate of the data recording area reaches a certain level, it is still necessary to perform an erasing operation to erase invalid data in the data recording area to free up memory space.
由於一般快閃記憶體的設計會將應用程式碼區域與資料紀錄區域配置於同一塊快閃記憶體,因此當需要對資料紀錄區域進行擦除時,系統便無法對應用程式碼區域進行存取。也就是,程式必須停止運行,直到資料紀錄區域的擦除操作完成。Since the design of the general flash memory will arrange the application code area and the data recording area in the same flash memory, when the data recording area needs to be erased, the system cannot access the application code area . That is, the program must stop running until the erase operation of the data recording area is completed.
為了不影響系統程式的執行,現行的一種解決方法為先將應用程式碼區域內所儲存的程式碼(Application code) 搬移至另一記憶體裝置(例如,一靜態隨機存取記憶體(Static Random-Access Memory,SRAM)),再將系統的處理器導向至SRAM執行,同時對快閃記憶體進行擦除。待快閃記憶體擦除操作完畢後,再將處理器導向回原來快閃記憶體上執行。然而,這種方式會增加程式設計的複雜度與困難度,同時系統也必須預留額外一塊可以容納程式碼大小的SRAM,導致系統成本增加。In order not to affect the execution of system programs, a current solution is to first move the application code stored in the application code area to another memory device (for example, a static random access memory (Static Random -Access Memory, SRAM)), then direct the system's processor to SRAM for execution, and at the same time erase the flash memory. After the flash memory erase operation is completed, the processor is directed back to the original flash memory for execution. However, this method will increase the complexity and difficulty of programming. At the same time, the system must reserve an additional SRAM that can accommodate the size of the code, resulting in an increase in system cost.
現行的另一種解決方法為將應用程式碼區域與資料紀錄區域分別配置於兩個完全獨立的快閃記憶體庫(bank) 中,或是配置在同一個快閃記憶體,但各自有獨立的擦除/寫入控制電路(Erase/Program Control Circuit),使得系統在對資料紀錄區域進行擦除操作時,應用程式碼區域仍可被系統的處理器存取。然而,這種方式會增加硬體電路成本,且需要應用於特別客製化的快閃記憶體。Another current solution is to configure the application code area and data record area in two completely independent flash memory banks (banks), or in the same flash memory, but each has its own independent The Erase/Program Control Circuit makes the application code area still accessible by the system processor when the system is erasing the data recording area. However, this method will increase the cost of the hardware circuit, and needs to be applied to a specially customized flash memory.
為使系統運作(例如,應用程式碼區域的存取)不會因資料擦除的進行而受影響,且系統處理程序不會因資料擦除的進行而被迫延宕或中斷,本發明提出一種資料處理系統及適用於此系統的資料處理方法,用以控制資料紀錄區域的擦除操作。藉由本發明所提出之系統與方法,無須大幅增加硬體成本與系統程式開發複雜度,便可達到不中斷系統程式正常運行的結果,並且相較於現有技術,可有效地把擦除操作對於系統運作的干擾程度降至最低。以下將針對本發明所提出之資料處理系統及資料處理方法做更詳細的介紹。In order that the system operation (for example, access to the application code area) will not be affected by the data erasure, and the system processing procedure will not be forced to be delayed or interrupted by the data erasure, the present invention proposes a A data processing system and a data processing method suitable for this system are used to control the erasing operation of the data recording area. With the system and method proposed by the present invention, without significantly increasing the cost of hardware and the complexity of system program development, the result of uninterrupted normal operation of the system program can be achieved, and compared with the prior art, the erasing operation can be effectively The degree of interference of system operation is minimized. The data processing system and data processing method proposed in the present invention will be described in more detail below.
第1圖係顯示根據本發明之一實施例所述之一資料處理系統方塊圖。根據本發明之一實施例,資料處理系統100可為一微控制器(Micro-Controller Unit,MCU)。資料處理系統100可包括一記憶體裝置110、一記憶體控制器120以及一處理器130。值得注意的是,第1圖為一簡化過的方塊圖,其中僅顯示出與本發明相關的元件。任何熟悉此項技藝者當可理解一資料處理系統亦可包含其他未示於第1圖之元件。Figure 1 shows a block diagram of a data processing system according to an embodiment of the invention. According to an embodiment of the present invention, the
根據本發明之一實施例,記憶體裝置110包括一第一區域以及一第二區域,第一區域可為上述之程式碼執行區域(code execution region),或稱應用程式碼區域(application code region),被配置用以儲存複數程式碼,第二區域可為上述之資料紀錄區域(data log region),被配置用以儲存系統運作時需要被改變或紀錄的資料或參數(以下稱為系統資料)。根據本發明之一實施例,記憶體裝置110可為一快閃記憶體。According to an embodiment of the invention, the
記憶體控制器120耦接於處理器130與記憶體裝置110之間,被配置用以控制記憶體裝置110的存取。The
處理器130可向記憶體控制器120發出一存取控制信號,記憶體控制器120因應存取控制信號存取記憶體裝置110。即,處理器130係透過記憶體控制器120存取記憶體裝置110之應用程式碼區域及資料紀錄區域,以取得(fetch)所欲執行的程式碼及所需之系統資料,其中程式碼可包含一或多個指令(Instruction),處理器130可根據程式碼內容執行對應之指令。The
更具體的說,處理器130可透過一雙向的匯流排(bus)21耦接至記憶體控制器120,用以傳送複數控制信號,例如,存取控制信號、擦除控制信號等至記憶體控制器120,以及接收透過記憶體控制器120自記憶體裝置110取得之程式碼與系統資料。More specifically, the
記憶體控制器120亦可透過複數匯流排耦接至記憶體裝置110,其中,控制匯流排22用以傳送複數控制指令(Command),位址匯流排23用以傳送所欲存取之資料的位址,資料匯流排24為一雙向的匯流排,用以傳送欲寫入記憶體裝置110之資料,以及接收自記憶體裝置110取得之資料。The
第2圖係顯示根據本發明之另一實施例所述之一資料處理系統方塊圖。根據本發明之一實施例,資料處理系統200可為一微控制器(MCU)。資料處理系統200所包含的大部分元件與資料處理系統100相同,因此,相關的說明可參考以上第1圖的介紹,並於此不在贅述。Figure 2 is a block diagram of a data processing system according to another embodiment of the invention. According to an embodiment of the invention, the
根據本發明之一實施例,資料處理系統200可更包括一直接記憶體存取(Direct Memory Access,DMA)控制器240。DMA控制器240透過雙向的匯流排25耦接至記憶體控制器220,被配置用以透過記憶體控制器220存取記憶體裝置210。匯流排25用以將直接記憶體存取請求傳送至記憶體控制器220,以及接收自記憶體裝置210取得之資料。According to an embodiment of the present invention, the
根據本發明之一實施例,記憶體裝置110/210可更包括複數暫存器。於本發明之一實施例中,各記憶體區塊可被配置一可獨立地被設定及控制的暫存器。於本發明之另一實施例中,各記憶體資料頁可被配置一可獨立地被設定及控制的暫存器。各暫存器用以儲存一擦除位元,用以指示該暫存器所對應之一記憶體資料頁或一記憶體區塊所儲存之資料是否需被擦除。According to an embodiment of the invention, the
第3圖係顯示根據本發明之一實施例所述之於複數暫存器所儲存之擦除位元示意圖。各擦除位元可對應於一記憶體資料頁或一記憶體區塊。當擦除位元被設定為1時,代表對應之一記憶體資料頁或一記憶體區塊所儲存之資料需被擦除。因此,於此實施例中,當記憶體控制器120/220對記憶體裝置110/210發出擦除命令以進行擦除操作時,只有記憶體區塊編號或記憶體資料頁編號為2跟3的記憶體區塊或記憶體資料頁所儲存之資料會被擦除,其他的記憶體區塊或記憶體資料頁所儲存之資料則不受影響。根據本發明之一實施例,記憶體裝置120/220可包括一擦除控制電路111/211。因應記憶體控制器120/220所發出之擦除命令,擦除控制電路111/211可根據如第3圖所示之擦除位元所夾帶之資訊擦除第二區域(資料紀錄區域)所儲存之至少一部分資料,例如,第2、3個記憶體區塊或記憶體資料頁所儲存之資料。FIG. 3 is a schematic diagram showing erase bits stored in a complex register according to an embodiment of the invention. Each erase bit may correspond to a memory data page or a memory block. When the erase bit is set to 1, it means that the data stored in a corresponding memory data page or a memory block needs to be erased. Therefore, in this embodiment, when the
第4圖係顯示根據本發明之一實施例所述之一資料處理方法範例流程圖。首先,記憶體控制器120/220可自處理器130/230接收一擦除控制信號(步驟S402)。根據本發明之一實施例,當系統需要對第二區域(資料紀錄區域)的某些記憶體區塊或記憶體資料頁進行擦除時,便會向記憶體控制器120/220發出擦除控制信號。於此,所述之系統係指針對此資料處理系統100/200所設計的軟體與韌體程式及執行此軟體與韌體程式之處理器130/230的一個整體。因此,擦除控制信號可於處理器130/230執行對應之程式碼的過程中,經由一些對應的判斷認為需要執行擦除操作時發出。FIG. 4 is a flowchart showing an example of a data processing method according to an embodiment of the invention. First, the
根據本發明之一實施例,擦除控制信號夾帶著第二區域(資料紀錄區域)之哪些位址(或者,記憶體區塊或記憶體資料頁之編號)所儲存之資料需被擦除之資訊。接著,記憶體控制器120/220可根據擦除控制信號夾帶的資訊設定對應之暫存器所儲存之擦除位元(步驟S404)。例如,將需被擦除之記憶體區塊或記憶體資料頁所對應之擦除位元設定為一特定數值。待擦除位元設定完成後,處理器130/230會再對記憶體控制器120/220發出擦除記憶體區塊/記憶體資料頁之命令(亦為一種控制信號)。值得注意的是,於本發明之其他實施例中,記憶體區塊/記憶體資料頁之擦除命令亦可與擦除控制信號一併被發出,或者可整合為同一個控制信號。According to an embodiment of the present invention, the data stored in the addresses (or the number of the memory block or memory data page) in the second area (data recording area) with the erasure control signal needs to be erased News. Then, the
根據本發明之一實施例,記憶體控制器120/220可包含一擦除進行計時器(Erase Elapse Timer)121/221。記憶體控制器120/220在收到擦除命令後,並不會立刻對記憶體裝置110/210執行擦除記憶體區塊/記憶體資料頁的工作,而是先設定好擦除進行計時器的時間,此計時器儲存著擦除記憶體區塊/記憶體資料頁所需要的時間。值得注意的是,於本發明之實施例中,當複數個記憶體區塊/記憶體資料頁需被擦除時,這些記憶體區塊/記憶體資料頁的擦除操作係同時被執行的。因此,擦除進行計時器121/221所儲存的時間無須隨著需被擦除之記憶體區塊/記憶體資料頁的數量改變而變化。於本發明之實施例中,步驟S404亦可包含擦除進行計時器121/221的設定。According to an embodiment of the invention, the
根據本發明之一實施例,待擦除位元及擦除進行計時器121/221被設定後,記憶體控制器120/220仍不會立刻對記憶體裝置110/210執行擦除記憶體區塊/記憶體資料頁的工作,而是等待直到資料處理系統100/200或處理器130/230閒置時,才會執行擦除記憶體區塊/記憶體資料頁的工作。According to an embodiment of the present invention, after the erasing bit and erasing
根據本發明之一實施例,記憶體控制器120/220可更包括一偵測電路122/222,被配置用以偵測處理器130/230是否已進入一閒置狀態(步驟S406)。根據本發明之一實施例,當偵測電路122/222偵測到處理器130/230已進入閒置狀態時,會發出一處理器閒置信號Processor_Idle給記憶體控制器120/220(步驟S408),做後續的工作判斷依據。根據本發明之一實施例,偵測電路122/222可將處理器閒置信號Processor_Idle位元數值設定為’1’,用以代表處理器130/230已進入閒置狀態。According to an embodiment of the invention, the
根據本發明如第1圖所示之實施例,因應處理器閒置信號Processor_Idle之接收,記憶體控制器120才對記憶體裝置110發出擦除命令以進行擦除操作(步驟S412)(於此實施例中,步驟S410被略過),同時啟動擦除進行計時器121/221開始計時。根據本發明如第2圖所示之實施例,因應處理器閒置信號Processor_Idle之接收,記憶體控制器220會進一步判斷DMA控制器240是否未發出一直接記憶體存取請求(步驟S410)。當判斷DMA控制器240並未發出直接記憶體存取請求時,記憶體控制器220才對記憶體裝置210發出擦除命令以進行擦除操作(步驟S412),同時啟動擦除進行計時器121/221開始計時。According to the embodiment shown in FIG. 1 of the present invention, in response to the reception of the processor idle signal Processor_Idle, the
最後,因應記憶體控制器120/220所發出之擦除命令,擦除控制電路111/211可根據擦除位元所夾帶之資訊擦除第二區域(資料紀錄區域)所儲存之至少一部分資料(步驟S414)。Finally, in response to the erase command issued by the
值得注意的是,於本發明之多種可實施架構中,偵測電路與擦除進行計時器並不限於被設置於記憶體控制器內。第5圖係顯示根據本發明之又另一實施例所述之資料處理系統方塊圖。資料處理系統500可為一微控制器(MCU)。資料處理系統500所包含的大部分元件與資料處理系統100/200相同,因此,相關的說明可參考以上第1、2圖的介紹,並於此不在贅述。It is worth noting that, in various implementable architectures of the present invention, the detection circuit and the erase progress timer are not limited to being installed in the memory controller. Figure 5 is a block diagram of a data processing system according to yet another embodiment of the present invention. The
於此實施例中,擦除進行計時器521與偵測電路522係被配置於記憶體控制器520外部,並且可透過對應之匯流排及/或信號走線與記憶體控制器520溝通。In this embodiment, the
值得注意的是,以上所介紹之控制方法、流程與各元件所執行的操作均可適用於如第5圖所示之記憶體裝置510、擦除控制電路511、記憶體控制器520、擦除進行計時器521、偵測電路522、處理器530、以及DMA控制器540等。因此,相關的說明可參考以上的介紹,並於此不在贅述。It is worth noting that the control methods, processes and operations performed by the components described above can be applied to the memory device 510, the erase
根據本發明之一實施例,偵測電路122/222/522可藉由解碼處理器130/230/530所執行之該指令,判斷處理器130/230/530是否已進入閒置狀態。舉例而言,偵測電路122/222/522可解譯(interprete)處理器130/230/530所欲取得之程式碼,以解碼出處理器130/230/530目前所執行或即將執行的指令。根據本發明之一實施例,當處理器130/230/530執行到等待(wait)、while迴圈、反覆跳躍(jump)至同一行程式碼或維持(hold)等相關指令時,偵測電路122/222/522可根據相關指令內容判斷處理器130/230/530是否已進入閒置狀態。According to an embodiment of the present invention, the
更具體的說,舉例而言,當處理器130/230/530執行到用以等待外界週邊裝置發出中斷信號的WFI(Wait For Interrupt)指令時,偵測電路122/222/522可判斷處理器130/230/530已進入閒置狀態。舉另一例而言,當處理器130/230/530執行到用以等待特定事件的WFE(Wait For Event) 指令時,偵測電路122/222/522可判斷處理器130/230/530已進入閒置狀態。舉又另一例而言,當處理器130/230/530執行到while(1)迴圈或JMP $等類似的指令,使其會持續停留於或反覆跳躍至同一行程式碼執行時,偵測電路122/222/522可判斷處理器130/230/530已進入閒置狀態。More specifically, for example, when the
根據本發明之另一實施例,偵測電路122/222/522亦可偵測處理器130/230/530所欲取得之程式碼所對應之位址是否改變,據以判斷處理器130/230/530是否已進入閒置狀態。舉例而言,當處理器130/230/530送給記憶體控制器110/210/520的位址(所欲存取之程式碼的位址)與先前的一或多個存取請求相同時,偵測電路122/222/522可判斷處理器130/230/530已進入閒置狀態。According to another embodiment of the present invention, the
根據本發明之又另一實施例,偵測電路122/222/522亦可根據處理器130/230/530是否於執行某特定指令後,或者於一段時間內並未向記憶體控制器120/220/520發出存取控制信號用以自應用程式碼區域取得(fetch)所欲執行的程式碼,判斷處理器130/230/530是否已進入閒置狀態。舉例而言,若處理器130/230/530於執行某特定指令後,或者於一段時間內並未向記憶體控制器120/220/520發出存取控制信號用以自應用程式碼區域取得(fetch)所欲執行的程式碼,偵測電路122/222/522可判斷處理器130/230/530已進入閒置狀態。According to yet another embodiment of the present invention, the
於本發明之實施例中,只要指令解碼結果、程式碼位址是否改變的判斷結果、及是否未發出存取控制信號以取得所欲執行的程式碼的判斷結果的其中一者成立,偵測電路122/222/522即可據以判斷處理器130/230/530已進入閒置狀態。In the embodiment of the present invention, as long as one of the instruction decoding result, the judgment result of whether the program code address is changed, and whether the access control signal is not issued to obtain the code to be executed is established, the detection The
根據本發明之一實施例,當擦除控制電路111/211/511根據擦除位元所夾帶之資訊擦除第二區域(資料紀錄區域)所儲存之資料時,記憶體控制器120/220/520可進一步根據擦除進行計時器121/221/521的計時結果判斷擦除操作是否完成。當擦除進行計時器121/221/521發生溢位時(例如,計時器預定計數的時間屆滿),會發出溢位信號Time_out通知記憶體控制器120/220/520,記憶體控制器120/220/520可藉此推斷擦除操作應該已經完成。According to an embodiment of the present invention, when the erasing
於接獲溢位信號Time_out後,記憶體控制器120/220/520可讀取需被擦除之記憶體區塊/記憶體資料頁內的資料,用以確認擦除操作是否成功。舉例而言,若需被擦除之記憶體區塊/記憶體資料頁內的資料為一特定值,例如,各位元所記錄的內容均為1,則記憶體控制器120/220/520可判斷擦除操作已成功完成,並且可設定記憶體控制器120/220/520內部之一狀態暫存器(例如,一擦除完畢旗標),用以通知系統擦除操作已成功完成。若記憶體控制器120/220/520判斷擦除操作並未成功,記憶體控制器120/220/520可重新設定擦除進行計時器121/221/521的時間,並且再次對記憶體裝置110/210/510發出擦除命令以進行擦除操作,同時再度啟動擦除進行計時器121/221/521進行計時。此流程可被反覆進行,直到記憶體控制器120/220/520確認擦除操作已成功完成。After receiving the overflow signal Time_out, the
值得注意的是,若於擦除操作的過程中,記憶體控制器120/220/520偵測到處理器閒置信號Processor_Idle的狀態改變,例如,由原先代表處理器130/230/530已進入閒置狀態的位元’1’轉變為代表處理器130/230/530進入非閒置狀態的位元’0’,或者,於另一實施例中,於擦除操作的過程中,記憶體控制器120/220/520自DMA控制器140/240/540接收到直接記憶體存取請求時,記憶體控制器120/220/520將立刻向記憶體裝置110/210/510發出中斷命令,以中斷擦除操作。同時間,記憶體控制器120/220/520亦會暫停擦除進行計時器121/221/521的計時。根據本發明之一實施例,直到記憶體控制器120/220/520再度偵測到處理器閒置信號Processor_Idle指示處理器130/230/530已進入閒置狀態時(例如,轉變為位元’1’時),記憶體控制器120/220/520再度對記憶體裝置110/210/510發出擦除命令以進行擦除操作,同時再次啟動擦除進行計時器121/221/521進行計時。或者,於另一實施例中,直到記憶體控制器120/220/520再度偵測到處理器閒置信號Processor_Idle指示處理器130/230/530已進入閒置狀態時且判斷DMA控制器140/240/540並未發出直接記憶體存取請求時,記憶體控制器120/220/520再度對記憶體裝置110/210/510發出擦除命令以進行擦除操作,同時再次啟動擦除進行計時器121/221/521進行計時。It is worth noting that if the
第6圖係顯示根據本發明之一實施例所述之資料處理方法之一範例流程圖,用以說明於擦除操作開始後的資料處理方法流程。於此實施例中所介紹的流程係為記憶體控制器120/220/520所執行的控制流程。當系統沒有向記憶體控制器120/220/520發出擦除控制信號前,記憶體控制器120/220/520係執行其正常工作。當系統向記憶體控制器120/220/520發出擦除控制信號及/或擦除命令後,記憶體控制器120/220/520可根據擦除控制信號夾帶的資訊設定對應之暫存器所儲存之擦除位元,並且設定好擦除進行計時器的時間,以及清除擦除完畢旗標(步驟S602)。接著,記憶體控制器120/220/520判斷處理器130/230/530是否已進入閒置狀態(步驟S604)。FIG. 6 is an exemplary flowchart of a data processing method according to an embodiment of the present invention, for illustrating the flow of the data processing method after the start of the erasing operation. The process described in this embodiment is a control process executed by the
若否,則流程回到步驟S604。若是,則記憶體控制器220/520進一步判斷是否自DMA控制器接收到直接記憶體存取請求(步驟S606)(於一些實施例中,步驟S606可省略)。若是,則流程回到步驟S604。If not, the flow returns to step S604. If yes, the
若處理器130/230/530已進入閒置狀態,且並未接收到直接記憶體存取請求,則記憶體控制器120/220/520啟動擦除進行計時器121/221/521進行計時(步驟S608),並且對記憶體裝置110/210/510發出擦除命令以使其執行擦除操作(步驟S610)。如上述,擦除控制電路111/211/5111可根據擦除位元的設定值擦除資料紀錄區域所儲存之至少一部分資料。If the
於擦除操作執行的過程中,記憶體控制器120/220/520會持續偵測處理器閒置信號Processor_Idle的狀態是否改變,以判斷處理器是否仍處於閒置狀態(步驟S612),並且持續判斷是否自DMA控制器接收到直接記憶體存取請求(步驟S614)(於一些實施例中,步驟S614可省略)。若處理器仍處於閒置狀態,且並未自DMA控制器接收到直接記憶體存取請求,則記憶體控制器120/220/520進一步根據擦除進行計時器121/221/521的計時結果判斷擦除操作是否完成(步驟S616)。若擦除操作尚未完成,則流程回到步驟S612。若擦除操作已完成,則記憶體控制器120/220/520進一步確認擦除操作是否成功(步驟S618)。若是,則記憶體控制器120/220/520設定擦除完畢旗標(步驟S620),用以通知系統擦除操作已成功完成。若否,則流程回到步驟S602。During the execution of the erase operation, the
另一方面,於擦除操作執行的過程中,若記憶體控制器120/220/520偵測到處理器已進入非閒置狀態,或自DMA控制器接收到直接記憶體存取請求,則記憶體控制器120/220/520停止擦除進行計時器121/221/521 (步驟S622),並且向記憶體裝置110/210/510發出中斷命令(步驟S624),以中斷擦除操作。接著,流程回到步驟S604,記憶體控制器120/220/520回復執行其正常工作,並且持續等待處理器閒置信號Processor_Idle的狀態再度改變(例如,位元數值再度改變為’1’),以及/或直接記憶體存取請求的判斷為否(即,未自DMA控制器接收到直接記憶體存取請求,或於先前接獲的直接記憶體存取請求完成後並未再接收到新的直接記憶體存取請求)時,再命令記憶體裝置110/210/510繼續執行先前未完成的擦除操作,直到擦除進行計時器121/221/521發生溢位(Time_out)並且確認擦除操作成功為止。On the other hand, during the execution of the erase operation, if the
如上述,與現有技術不同之處在於,藉由本發明所提出之資料處理系統及適用於此系統的資料處理方法,無須大幅增加硬體成本與系統程式開發複雜度,便可達到不中斷系統程式正常運行的結果,並且相較於現有技術,本發明所提出之資料處理系統及方法可有效地把擦除操作對於系統運作的干擾程度降至最低。As described above, the difference from the prior art is that the data processing system and the data processing method applicable to the system proposed by the present invention can achieve uninterrupted system programs without significantly increasing the hardware cost and the complexity of system program development The result of normal operation, and compared with the prior art, the data processing system and method proposed by the present invention can effectively minimize the degree of interference of the erase operation with the system operation.
申請專利範圍中用以修飾元件之“第一”、“第二”等序數詞之使用本身未暗示任何優先權、優先次序、各元件之間之先後次序、或方法所執行之步驟之次序,而僅用作標識來區分具有相同名稱(具有不同序數詞)之不同元件。The use of ordinal numbers such as "first" and "second" in the scope of the patent application to modify an element itself does not imply any priority, priority order, order between elements, or order of steps performed by the method, It is only used as a logo to distinguish different components with the same name (with different ordinal numbers).
雖然本發明已以較佳實施例揭露如上,然其並非用以限定本發明,任何熟悉此項技藝者,在不脫離本發明之精神和範圍內,當可做些許更動與潤飾,因此本發明之保護範圍當視後附之申請專利範圍所界定者為準。Although the present invention has been disclosed as above with preferred embodiments, it is not intended to limit the present invention. Anyone who is familiar with this skill can do some modifications and retouching without departing from the spirit and scope of the present invention. Therefore, the present invention The scope of protection shall be as defined in the scope of the attached patent application.
21、22、23、24、25‧‧‧匯流排;100、200、500‧‧‧資料處理系統;110、210、510‧‧‧記憶體裝置;111、211、511‧‧‧擦除控制電路;120、220、520‧‧‧記憶體控制器;121、221、521‧‧‧擦除進行計時器;122、222、522‧‧‧偵測電路;130、230、530‧‧‧處理器;240、540‧‧‧DMA控制器。21, 22, 23, 24, 25‧‧‧‧ bus; 100, 200, 500‧‧‧‧ data processing system; 110, 210, 510‧‧‧ memory device; 111, 211, 511‧‧‧ erasing control Circuit; 120, 220, 520‧‧‧ memory controller; 121, 221, 521‧‧‧ erasing timer; 122, 222, 522‧‧‧ detection circuit; 130, 230, 530‧‧‧ processing Controller; 240, 540 ‧‧‧ DMA controller
第1圖係顯示根據本發明之一實施例所述之一資料處理系統方塊圖。 第2圖係顯示根據本發明之另一實施例所述之一資料處理系統方塊圖。 第3圖係顯示根據本發明之一實施例所述之於複數暫存器所儲存之擦除位元示意圖。 第4圖係顯示根據本發明之一實施例所述之一資料處理方法範例流程圖。 第5圖係顯示根據本發明之又另一實施例所述之資料處理系統方塊圖。 第6圖係顯示根據本發明之一實施例所述之資料處理方法之一範例流程圖。Figure 1 shows a block diagram of a data processing system according to an embodiment of the invention. Figure 2 is a block diagram of a data processing system according to another embodiment of the invention. FIG. 3 is a schematic diagram showing erase bits stored in a complex register according to an embodiment of the invention. FIG. 4 is a flowchart showing an example of a data processing method according to an embodiment of the invention. Figure 5 is a block diagram of a data processing system according to yet another embodiment of the present invention. FIG. 6 is an exemplary flowchart of a data processing method according to an embodiment of the invention.
21、22、23、24、25‧‧‧匯流排 21, 22, 23, 24, 25 ‧‧‧ bus
200‧‧‧資料處理系統 200‧‧‧Data processing system
210‧‧‧記憶體裝置 210‧‧‧Memory device
211‧‧‧擦除控制電路 211‧‧‧Erase control circuit
220‧‧‧記憶體控制器 220‧‧‧Memory controller
221‧‧‧擦除進行計時器 221‧‧‧Erase progress timer
222‧‧‧偵測電路 222‧‧‧ detection circuit
230‧‧‧處理器 230‧‧‧ processor
240‧‧‧DMA控制器 240‧‧‧DMA controller
Claims (10)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW107127283A TWI676987B (en) | 2018-08-06 | 2018-08-06 | Data processing system and data processing method |
CN201811100135.XA CN110806836B (en) | 2018-08-06 | 2018-09-20 | Data processing system and data processing method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW107127283A TWI676987B (en) | 2018-08-06 | 2018-08-06 | Data processing system and data processing method |
Publications (2)
Publication Number | Publication Date |
---|---|
TWI676987B TWI676987B (en) | 2019-11-11 |
TW202008371A true TW202008371A (en) | 2020-02-16 |
Family
ID=69188856
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW107127283A TWI676987B (en) | 2018-08-06 | 2018-08-06 | Data processing system and data processing method |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN110806836B (en) |
TW (1) | TWI676987B (en) |
Family Cites Families (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5509134A (en) * | 1993-06-30 | 1996-04-16 | Intel Corporation | Method and apparatus for execution of operations in a flash memory array |
US5930175A (en) * | 1997-08-22 | 1999-07-27 | Micron Technology, Inc. | Voltage pump switch |
JP4110000B2 (en) * | 2003-01-28 | 2008-07-02 | 株式会社ルネサステクノロジ | Storage device |
US8261130B2 (en) * | 2007-03-02 | 2012-09-04 | Infineon Technologies Ag | Program code trace signature |
US8688894B2 (en) * | 2009-09-03 | 2014-04-01 | Pioneer Chip Technology Ltd. | Page based management of flash storage |
US9235719B2 (en) * | 2011-09-29 | 2016-01-12 | Intel Corporation | Apparatus, system, and method for providing memory access control |
TWI530954B (en) * | 2013-11-22 | 2016-04-21 | 新唐科技股份有限公司 | Apparatuses for securing software code stored in a non-volatile memory |
CN106155940A (en) * | 2015-04-17 | 2016-11-23 | 扬智科技股份有限公司 | The System on Chip/SoC of code and the code protection method of System on Chip/SoC can be protected |
KR20170036195A (en) * | 2015-09-23 | 2017-04-03 | 에스케이하이닉스 주식회사 | Semiconductor device and semiconductor system |
US10282251B2 (en) * | 2016-09-07 | 2019-05-07 | Sandisk Technologies Llc | System and method for protecting firmware integrity in a multi-processor non-volatile memory system |
WO2018108035A1 (en) * | 2016-12-13 | 2018-06-21 | 腾讯科技(深圳)有限公司 | Information processing and virtual resource exchange method, apparatus, and device |
-
2018
- 2018-08-06 TW TW107127283A patent/TWI676987B/en active
- 2018-09-20 CN CN201811100135.XA patent/CN110806836B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN110806836A (en) | 2020-02-18 |
TWI676987B (en) | 2019-11-11 |
CN110806836B (en) | 2023-03-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4317604B2 (en) | Data processing system, non-volatile memory, and method for extending write / erase functions in flash memory | |
TWI684868B (en) | Memory controller and operating method thereof, and controlling method of a memory system | |
EP3436922B1 (en) | Methods and apparatus to perform erase-suspend operations in memory devices | |
US8327161B2 (en) | Command decoder for microcontroller based flash memory digital controller system | |
US7234049B2 (en) | Computer system with NAND flash memory for booting and storage | |
US5923838A (en) | Microcomputer with built-in flash memory | |
KR100725417B1 (en) | Apparatus and method for operating flash memory according to priority | |
KR100444537B1 (en) | Data processor | |
JP2007058840A5 (en) | ||
JP4960364B2 (en) | Hardware-assisted device configuration detection | |
US20060245274A1 (en) | Apparatus and method for controlling NAND flash memory | |
JP4136359B2 (en) | Microcomputer | |
JP2009517741A (en) | Flash memory digital controller system with microcontroller | |
JP2004030438A (en) | Microcomputer | |
US5940861A (en) | Method and apparatus for preempting operations in a nonvolatile memory in order to read code from the nonvolatile memory | |
US5603010A (en) | Performing speculative system memory reads prior to decoding device code | |
JP2008059052A (en) | Semiconductor integrated circuit and microcomputer | |
TWI676987B (en) | Data processing system and data processing method | |
JP2004227635A (en) | Nonvolatile semiconductor memory and microcomputer including nonvolatile semiconductor memory | |
US10901919B2 (en) | Circuit and method for managing access to memory | |
JP2007034554A (en) | Semiconductor integrated circuit and microcomputer | |
US7487287B2 (en) | Time efficient embedded EEPROM/processor control method | |
JPH11260075A (en) | Microcomputer with built-in flash memory and data rewrite method | |
JPH05314052A (en) | Processor | |
JP2004110407A (en) | Serial eeprom interface |