1. Field of the Invention
The present invention relates to a memory device and a controlling method of the memory, and in particular to a memory device a nonvolatile semiconductor memory.
2. Description of the Related Art
Memory devices, such as a memory card, are used as a media for storing music data or video data. They devices use nonvolatile semiconductor memories, such as flash memories. Memory devices typically include a controller for controlling the memory. A file system of a host into which such a memory device is inserted assigns logical addresses to data, and requests the memory device to write this data. The controller instructs the flash memory to store the write data in free memory areas. Moreover, the controller manages relation between logical addresses assigned to data by the file system, and memory areas in the flash memory which store the corresponding data.
Typical examples of the flash memory used for memory devices include a NAND flash memory. In the NAND flash memory, data is written in the unit called a page which consists of more than one bits. The NAND flash memory can erase data only in the unit called a block which consists of more than one pages.
A user may want to know performance of the memory device through the host device. Such performance includes recording speed, time required for record, recordable time, etc. A technique for predicting such performance is described in Jpn. Pat. Appln. KOKAI Publication No. 2006-178923. This technique uses the following principles.
As described above, the NAND flash memory can erase data only in the unit of block. That is, it cannot overwrite data. In order to update data in the memory, a new block needs to be prepared, the data not to be updated needs to be copied in the new block, and the data to be updated needs to be written in the new block. For this reason, data in the flash memory is written fast in continuous free pages, and slowly written in a block including pages storing data and ones without data. That is, data write speed varies according to distribution of written pages in a block (fragmentation). Using this, the write speed of each block is calculated, and recordable time of the memory device is calculated from the number of blocks which satisfy the write speed required by application in a host which will store data in the memory device. However, such a technique using fragmentation requires complicated calculation of performance, and a long time for execution. For this reason, a need arises for the memory device which allows for simpler performance prediction.
Moreover, the increased memory capacity, improved memory device performance, and diversified contents required to be recorded by the user generate a variety of types of usage of memory devices. For example, a request arises for recording two videos such as two TV programs, or recording a picture while recording videos. It is, however, impossible to fulfill the demand to write data for multiple files in parallel into the memory device in real time because the inability of data overwrite requires the above-mentioned data copy, which takes a long time to result in a low speed of writing accompanied by data copy.
According to an aspect of the present invention, there is provided a memory device comprising: a memory which has memory areas; and a controller configured to, upon receipt of write data, write data in the memory areas while managing correspondence between logical addresses of write data and memory areas which store corresponding write data, and which has a first mode and a second mode, wherein a plurality of the memory areas constitutes a management unit, the controller in the first mode is able to write pieces of data in respective memory areas and configured to maintain data in one or more memory areas in one management unit which contains data to be updated, the controller in the second mode is configured to write pieces of data in respective memory areas in the ascending order of logical addresses of the pieces of data and configured to invalidate data in one or more memory areas in one management unit which contains updated data.
According to another aspect of the present invention, there is provided a memory device comprising: a memory which has memory areas; and a controller configured to, upon receipt of write data, write data in the memory areas while managing correspondence between logical addresses of the write data and memory areas which store corresponding write data, configured to recognize a logical address group which consists of successive logical addresses, and configured to, upon receipt of a first command, shift to a real-time write enable mode, wherein upon receipt of a data writing instruction, the controller in the real-time write enable mode writes data in a work area temporarily prepared for a logical address group which contains the logical address of the write data in the ascending order of logical addresses of pieces of the write data, and assigns a logical address to the work area after completion of data writing to the last memory area in the work area.
According to another aspect of the present invention, there is provided a method of controlling a memory device comprising memory areas, the method comprising: upon receipt of write data, writing data in the memory areas while managing correspondence between logical addresses of the write data and memory areas which store corresponding write data; in a first mode, writing pieces of data in respective memory areas and maintaining data in one or more memory areas in one management unit which contains data to be updated, wherein a plurality of the memory areas constitute one management unit; in a second mode, writing pieces of data in respective memory areas in the ascending order of logical addresses of the pieces of the pieces of data and invalidating data in one or more memory areas in one management unit which contains updated data.
Embodiments of the present invention will now be described with reference to drawings. In the following, the same components are indicated with the same reference numbers throughout the figures, and repetitive description will be given only when required. Note that drawings are merely illustrative.
In the following, description will be given of a memory device according to embodiments of the present invention with a memory card, in particular SD card, taken as an example. Any memory device that has a memory and a controller for controlling thereof which is described herein is, however, included within the scope of the present invention.
Configuration of the memory card according to the first embodiment of the present invention will be described with reference to
The host device (referred to as a host hereinafter) 1 has software 11, such as application and/or an operating system. The software 11 is instructed by a user to write data to a memory card 2, and to read data therefrom. The software 11 instructs the file system 12 to write/read data 12. The file system 12 is mechanism for managing file data stored in storage medium, record management information in memory areas in the storage medium, and uses this management information to manage the file data.
The host 1 has an SD interface 13. The SD interface 13 consists of hardware and software to allow the host 1 to be interfaced with the memory card 2. The host 1 communicates with the memory card 2 via the SD interface 13. The SD interface 13 specifies various agreements for communication between the host 1 and the memory card 2. The SD interface 13 and the SD interface 31 of the memory card 2 (to be described later) provide various kinds of commands recognizable by both the interfaces. The SD interface 13 also includes hardware configuration (e.g., pin arrangement, number of pins, etc.) which can be connected to the SD interface 31.
The memory card 2 has a NAND flash memory 21 and a controller 22 for controlling the memory 21. The memory card 2 starts to receive power, when connected to the host 1 or when the host 1 is turned on with the memory card 2 inserted, to perform initialization and then processing according to access from the host 1.
The memory 21 nonvolatily stores data, and writes and reads data in the unit called a page which consists of multiple memory cells. A page has a physical address unique to the page. The memory 21 erases data in the unit called a physical block (erase block) which consists of multiple pages. A physical address may be assigned to a physical block.
The controller 22 manages data storage state in the memory 21. Management of memory states includes management between a physical address of a page (or a physical block) and a logical address of data stored in the page, and which page (or physical block) contains no data or invalid data.
The controller 22 includes the SD interface 31, micro processing unit (MPU) 32, read only memory (ROM) 33, random access memory (RAM) 34, and NAND interface 35. The SD interface 31 consists of hardware and software to allow the host 1 to be interfaced with the controller 22.
The SD interface 31 specifies agreements which enable communication with the SD interface 13, includes various kinds of commands, and includes hardware configuration (e.g., a pin arrangement, and the number of pins, etc.), as the SD interface 13. The memory card 2 (controller 22) communicates with the host 1 via the SD interface 31. The SD interface 31 includes a register 36.
The MPU 32 manages the overall operation of the memory card 2. The MPU 32 reads firmware (control program) stored in the ROM 33 onto the RAM 34 to perform predetermined processing when, for example, the memory card 2 starts to receive power. The MPU 32 creates various kinds of tables (to be described later) on the RAM 34 according to the control program and performs predetermined processing to the memory 21 according to commands received from the host 1.
The ROM 33 stores the control program for the MPU 32, etc. The RAM 34 is used as a work area for the MPU 32, and temporarily stores control programs and various kinds of tables. The tables include a translation table (logical/physical table) of a physical address of a page which stores data with a logical address assigned by the file system 12. The NAND interface 35 allows the controller 22 to be interfaced with the memory 21.
Memory areas in the memory 21 include, for example, a system data area, a security data area, a protected data area, a user data area, etc., defined in accordance with a type of stored data. The system data area is reserved by the controller 22 for storing data required for its operation. The security data area stores key information for encryption and security data for authentication, and is inaccessible by the host 1. The protected data area stores important data and secure data. The user data area can be accessed and used by the host 1, and stores, for example, user data, such as AV content files and image data. When the description “the memory 21” is used to refer to the memory space of the memory 21, it refers to the user data area. The controller 22 reserves a part of the user data area, where it stores control data (e.g., logical/physical table) required for its own operation.
The register 36 has various registers, such as a card status register, CID, RCA, DSR, CSD, SCR, and OCR as illustrated in
The register 36 (for example, CSD) stores a class of the memory card 2, the time required for data copy, an AU size, etc. The class is defined by the minimum write speed guaranteed by the memory card belonging to this class. The highest write speed is determined by the class. Therefore, the host 1 can read the data indicative of the AU size from the register 36 to use this information for the management of the memory card 2, and can read the data indicative of the class from the register 36 to learn the maximum write performance of the memory card 2. Moreover, the CSD may further store performance information, such as performance information described in Jpn. Pat. Appln. KOKAI Publication No. 2006-178923.
Each memory cell consists of a so-called stacked-gate metal oxide semiconductor field effect transistor (MOSFET). Each memory cell transistor stores information according to its threshold voltage which varies according to the number of electrons captured in a floating gate electrode. The memory 21 may be configured so that a memory cell transistor can take more than two different threshold voltages, that is, a memory cell can store multiple levels (multiple bits).
Control gate electrodes of the memory cell transistors belonging to the same row are connected to the same word line. Selection gate transistors are provided in the both ends of a chain of serially-connected memory cell transistors which belong to the same column. One of the selection gate transistors is connected to a bit line. Data is written or read in a unit of the set of the serially-connected memory cell transistors. The memory area which consists of this set of the memory cell transistors corresponds to one page.
In an example of
As illustrated in
The file system 12 also uses a concept of AU (allocation unit) which consists of a predetermined number of sequential RUs which belong to a predetermined range. The controller 22 can recognize the boundary of the AU by looking at high bits of the logical address of the data. An AU size is an integral multiple of the block (physical block) capacity. Thus, the RU size is equal to the size of combined pages, and the AU size is equal to the size of combined blocks. For this reason, description will be given with the RU and AU each used as a unit of a reading/writing of the data in the memory card 2 below. That is, the “RU” used for the memory card 2 means combined sequential pages of the same size as the RU, and the “AU” used for the memory card 2 means combined sequential blocks of the same size as the AU. Specifically, the data which the file system 12 assigned to an RU is stored in an RU in the memory card 2, the memory card 2 manages the RU (logical address) assigned to the data by the file system 12, and the RU in the memory 21 which stores this write data with a table.
Referring to
Referring to
First, the first to Nth RUs belonging to AU1 in the memory card 2 store data 1 to N. In this state, the host 1 wishes to write data 20 to 22 in the fourth to sixth RUs in AU1. Since the flash memory 21, however, cannot carry out this update instruction directly by overwriting the data, it performs the following operations. First, as shown in
As shown in
As shown in
The sequential write mode will now be described with reference to
First, the memory card 2 is in the random write mode, and as shown in
As shown in FIG, 11, the host 1 wishes to write data 20 to 22 in the fourth to sixth RUs in AU1. That is, the host 1 wishes to update the fourth to sixth RUs with data 20 to 22. In order to perform this writing, as shown in
In the sequential write mode, the data of the RU which will not be updated is not copied to the RU in the work AU. Therefore, as shown in
As shown in
As shown in
Since the write request has been completed, as shown in
Parallel recording of data for multiple files using the first example will now be described with reference to
First, the memory card 2 is in the random write mode. As shown in
As shown in
The memory card 2 in the sequential write mode, in response to a write request, always prepares a free work AU and writes data in it as described above. Therefore, as shown in an
As shown in
Upon receipt of the write request of data B1 to B3, the memory card 2 determines that it constitutes a different file from that of data A1 to A5 previously requested to be written from their AUs as described above. As a result of this determination, as shown in
Further, as shown in
As shown in
Since the write request has been completed, as shown in
Note that, the second example illustrates data group for two files, i.e., two streams which comprise a file by data A1 to A7, and another file by data B1 to B6. The present embodiment, however, can also be applied to three or more streams in accordance with the principle described in the specification. How many streams of data can simultaneously be written by the memory card 2 depends on how many work AUs can be prepared by the memory card 2. The number of the works AU simultaneously prepared can be determined according to the write speed and/or storage capacity of the memory card 2, or specification.
The technique for closing the work AU at required timing will now be described with reference to
First, the memory card 2 is in the random write mode. In this state, as shown in
As shown in
Upon receipt of this write request, as shown in
As shown in
Then, in order to complete the writing of the file constituted by data B1 to B3 while continuing the writing of the file partly constituted by data A1 to A5, the host 1 supplies a work AU close command to the memory 2. Upon receipt of this command, the memory card 2 performs a closing processing to the work AU into which data has been written just before this command. As a result, the further work AU can be provided instead of work AU2. For example, if the memory card 2 can write two files in parallel, it will be ready to write file data after the closing processing to work AU2. The close command can also be realized by specifying an argument which requires the closing processing in the sequential write end command.
The close command has an argument which specifies the target work AU for the closing processing. This argument can specify the last work AU into which data has been written as described above, any work AU among multiple work AUs, or all the work AUs.
As shown in
Since the write request has been completed, as shown in
As described above, the memory card according to the first embodiment has the random write mode and sequential write mode. In the sequential write mode, in response to update request of data, the data in the RUs belonging to the AU which contains the RUs not to be updated is not copied to the new AU. Therefore, in the sequential write mode, data is always written in continuous free RUs. The speed of such writing is the maximum one realizable by the flash memory 21. To be allowed to write data with the maximum performance is very beneficial to the host 1. The maximum write speed depends on the inherent performance of the flash memory 21 and is almost constant. For this reason, the time required to complete the instructed writing can be easily calculated from the maximum write speed and the number of AUs (RUs) derived from the data size required to be written by the host 1. Such calculation is easy, which requires short time.
Moreover, in the memory card 2, data is written in continuous RU pages in order of the logical address of the write data. Such data writing can draw the maximum write speed out of the memory 21. Furthermore, the memory card does not copy data in the sequential write mode, it can keep writing in response to a write request. As described above, since the speed by such writing is the maximum for the memory 21, the memory card 2 can keep writing by the maximum write speed in the sequential write mode.
Since the memory card 2 can maintain the maximum write speed in the sequential write mode, providing an exclusive work AU to data for each of two or more separate files allows for saving data for two or more files in parallel as described in relations with the second example.
Moreover, according to the memory card according to the first embodiment, a work AU close command is provided. With this command, the memory card 2 which is writing data for multiple files in parallel can perform the closing processing to selected work AUs, without waiting for supply of the sequential write end command. As a result, it can release the work AU for write-completed file data to provide anew work AU for other file data. This is useful when this function is realized with hardware because how many streams can be written in parallel is limited.
In a second embodiment, the exclusive command for transition to a specific writing ready state is provided. The memory card according to the second embodiment has the same configuration as and operates differently from the first embodiment (
Operation of the first example of the second embodiment will be described with reference to
First, as shown in
As shown in
Upon receipt of a write request, the memory card 2 in the real-time write enable state prepares the work AU for the AU of write target (AU1) unless it has previously received a continuation command (to be described later) as shown in
This write request requests the writing from a non-leading RU in the AU. The memory card 2 in the immediate write state does not copy data in lower RUs (first to third RUs) than the write-data RUs in the AU (AU1) to which the write data belong to (fourth to sixth RUs in this example) to the work AU. Therefore, as shown in
The host 1 wishes to update data 7 and 8 of the seventh and eighth RUs in AU1 by data 23 and 24, and update data 9 to 11 of the first to third RUs in AU2 by data 25 to 27. In order to perform this update, as in an
As shown in an
Since the write request has been completed, as shown in
In the second embodiment, operations other than those in the real-time write enable state remain the same as those in the random write mode of the first embodiment.
Parallel recording of data for multiple files using the first example will now be described with reference to
As shown in
As shown in
As described above, the memory card 2 in the real-time write enable state prepares a new work AU unless it has previously received the continuation command (to be described later). For this reason, as shown in
The host 1 wishes to write data for a different file from the file partly constituted by data A1 to A5 in parallel. For this reason, it expects to write data in work AU1 later. For this reason, as shown in
As shown in
As described above, upon receipt of the write command, the memory card 2 in the real-time write enable state creates a new work AU unless continuous use of the existing word AU is required by the continuation command. Since data B1 to B3 belong to the AU (AU2) different from AU to which data A1 to A3 belong (AU1), as shown in
Then, in order to write the data following data A5, as shown in
As shown in
Since the memory card 2 maintains work AU1 for AU1 as shown in
Then, in order to write the data following data B3, as shown in
As shown in
As shown in
As shown in
Since the write request has been completed, as shown in
Another illustrative parallel recording of data for multiple files using the first example will now be described with reference to
As shown in
As shown in
As described above, since the memory card 2 in the real-time write enable state prepares a new work unless it has previously received the continuation command, the memory card 2 prepares work AU1 for AU1, as shown in
The host 1 wishes to write data for a different file from that partly constituted by data A1 to A5 in parallel. For this reason, as shown in
As shown in
Since data B1 to B3 belong to a different AU from AU1 to which data has been written previously, as shown in
Since the writing of the file constituted by data B1 to B3 has been completed, as shown in
As shown in
Since the memory card 2 maintains work AU1 for AU1 as shown in
As the writing of the file which consists of data A1 to A7 has been completed, as shown in
Data C1 to C3 belong to a different AU from AU1 to which the previous writing has been performed. Moreover, AU1 still includes the non-updated data X8. The memory card 2 which has received the write command in this state without receiving the continuation command copies the non-updated data in AU1 to which the last writing has been performed in the work Au. That is, as shown in
Then, the memory card 2 prepares work AU3 for AU3. Since writing of data C1 to C3 correspond to the writing from the leading RU in AU3, their copy is unnecessary. Therefore, as shown in an
Since writing the data for the file constituted by data A1 to A7, and the data for the file constituted by data C1 to C3 has been completed, as shown in
As described above, according to the memory card of the second embodiment, the real-time writing state is defined. Upon receipt of the write command, the memory card in the real-time writing state prepares the work AU which consists of only free RUs and writes data in the RUs in the work AU in the order of the logical addresses of the write data. The speed of writing to such continuous free RUs is the maximum realized by the flash memory 21. The maximum write speed depends on the inherent performance of the flash memory 21 and is almost constant. For this reason, the time required to complete the instructed writing can be easily calculated from the maximum write speed and the number of AUs (RUs) derived from the data size required to be written by the host 1. Such calculation is easy, which requires short time.
Moreover, the continuation command is provided in the memory card according to the second embodiment. With the continuation command, the closing processing is not necessary to a work AU to prepare another work AU. For this reasons, providing an exclusive work AU to data for each of two or more separate files allows for recording data for two or more files in parallel.
Note that all the continuation command instructs is to suspend the writing to a created work AU. For this reason, even if the memory card receives the continuation command as in the second example, it writes data in only free RUs without suspending the writing as in the first example.
Additional advantages and modifications will readily occur to those skilled in the art. Therefore, the invention in its broader aspects is not limited to the specific details and representative embodiments shown and described herein. Accordingly, various modifications may be made without departing from the spirit or scope of the general inventive concept as defined by the appended claims and their equivalents.
Number | Date | Country | Kind |
---|---|---|---|
2008-316066 | Dec 2008 | JP | national |
One or more continuation reissue applications have been filed based on U.S. Pat. No. 9,110,781. These applications are the present application and application Ser. No. 15/464,095 filed on Mar. 20, 2017, now U.S. Pat. No. RE48,983. The present application is a reissue continuation of application Ser. No. 15/464,095. This is a Continuation Application of PCT Application No. PCT/JP2009/071069, filed Dec. 11, 2009, which was published under PCT Article 21(2) in English. This application is based upon and claims the benefit of priority from prior Japanese Patent Application No. 2008-316066, filed Dec. 11, 2008, the entire contents of which are incorporated herein by reference.
Number | Name | Date | Kind |
---|---|---|---|
5745418 | Ma | Apr 1998 | A |
6230245 | Manning | May 2001 | B1 |
6438635 | Date et al. | Aug 2002 | B1 |
6480916 | Shishizuka et al. | Nov 2002 | B1 |
6480936 | Ban et al. | Nov 2002 | B1 |
6604151 | Date et al. | Aug 2003 | B1 |
6697898 | Shishizuka et al. | Feb 2004 | B1 |
6850995 | Shishizuka et al. | Feb 2005 | B1 |
7457897 | Lee | Nov 2008 | B1 |
7877569 | Honda | Jan 2011 | B2 |
RE44052 | Kim | Mar 2013 | E |
RE48983 | Fujimoto | Mar 2022 | E |
20050080985 | Sasaki | Apr 2005 | A1 |
20050240813 | Okada et al. | Oct 2005 | A1 |
20060059384 | Helliker | Mar 2006 | A1 |
20070067598 | Fujimoto | Mar 2007 | A1 |
20080071969 | Lin | Mar 2008 | A1 |
20080109589 | Honda | May 2008 | A1 |
20090282203 | Haustein et al. | Nov 2009 | A1 |
20100299312 | Suryanarayanan et al. | Nov 2010 | A1 |
20120254524 | Fujimoto | Oct 2012 | A1 |
20130173857 | Cheon | Jul 2013 | A1 |
Number | Date | Country |
---|---|---|
1516835 | Jul 2004 | CN |
1950803 | Apr 2007 | CN |
1 498 817 | Jan 2005 | EP |
1 746 510 | Jan 2007 | EP |
2006-99210 | Apr 2006 | JP |
2006-178923 | Jul 2006 | JP |
I220250 | Aug 2004 | TW |
200837562 | Sep 2008 | TW |
I340899 | Apr 2011 | TW |
WO 2008033952 | Mar 2008 | WO |
WO 2009013877 | Jan 2009 | WO |
Entry |
---|
Combined Office Action and Search Report dated Apr. 23, 2013 in Taiwanese Application No. 098142639 (With English Translation). |
Office Action dated Apr. 28, 2015, in Chinese Patent Application No. 200980149510.2 (with English-language Translation). |
Extended European Search Report dated Jun. 6, 2012 in European Patent Application No. 09831999.9. |
International Search Report dated Mar. 30, 2010 in PCT/JP2009/071069 dated Dec. 11, 2009. |
International Written Opinion dated Mar. 30, 2010 in PCT/JP2009/071069 dated Dec. 11, 2009. |
Combined Chinese Office Action and Search Report dated Aug. 26, 2013, in Chinese Patent Application No. 200980149510.2 with English translation and English translation of category of cited documents. |
Combined Chinese Office Action and Search Report issued Aug. 26, 2013, in Chinese Patent Application No. 200980149510.2 with English translation and Engligh translation of category of cited documents. |
Number | Date | Country | |
---|---|---|---|
Parent | 15464095 | Mar 2017 | US |
Child | 17377952 | US | |
Parent | PCT/JP2009/071069 | Dec 2009 | US |
Child | 13158126 | US |
Number | Date | Country | |
---|---|---|---|
Parent | 13158126 | Jun 2011 | US |
Child | 15464095 | US | |
Parent | 13158126 | Jun 2011 | US |
Child | 17377952 | US |