Flash Software Design Concept
Flash Software Design Concept
Flash Software Design Concept
Macronix International Co. LTD. designs and produces flash memories since
1989. Now it is the leading company of “Read-Only Memory” (ROM) and serial
flash manufacture. Macronix starts to produce NAND flash from 2011, and
continually focus on new technology of flash memories, such as advanced
manufacture technique “Bandgap Engineered SONOS” (BE-SONOS), 3
Dimensions Vertical Gate techniques (3DVG), “Phase Change Memory” (PCM)
and “Resistive Random Access Memory” (ReRAM).
We will introduce the design issues of flash memory in this document. You could
find more detailed information on our web. Welcome to contact with us if you
have any problem or suggestion: [email protected].
Flash Characteristics
Generally, there are three main characteristics related to flash software design:
Data reliability
Some kinds of flash memories may lose electrons easily after storing data
and thus causes the data error. So we need to use special detecting or
correcting mechanisms to resolve it. This problem occurs with different
variation according to different architectures or component characteristics
of flash memories. Till now, there is no concern on some memories, such as
“Macronix’s NOR flash” for this problem.
The above flash characteristics make designers focus on data type accessing
and data arrangement. Most of solutions are achieved by software algorithms
which have been discussed for many years. Macronix had researched in flash
software and firmware design since 2009 and we’ll have more achievements in
recent years. You can get some fundamental information about software design
in chapter “Software Design Issue”.
NOR or NAND
Flash memory can be classified to “NOR” or “NAND” type by their manufacture
method. The advantages of NOR flash are faster reading speed, smaller unit of
program and higher data reliability. NAND flash has better performance on
programming and erasing. So most of NOR flash are applied to "code storage"
such as game card or “Basic Input/Output System” (BIOS). NAND flash is used
in "data storage", such as: memory card, USB drive…etc. The demand required
for NAND grows as the demand for mobile devices. NAND flash is widely used,
even includes “Embedded Multi Media Card” (eMMC) and “Solid State Drive”
【Table 1】 represents the comparison of Serial NOR and NAND flash (Note 1).
Macronix produces two kinds of NOR flash: Serial and Parallel. Serial NOR flash
is more popular in mobile devices, because of its smaller packaged size with low
pin count. The table describes the performance of flash in fast read mode (We
don’t use QPI mode here because it needs hardware support). You can find the
datasheet on Macronix web at: http://www.macronix.com.tw/.
NOR NAND
Type MX25L12835E MX30LF1G08AA
Programming unit 1 Byte 2 KByte
Read performance About 200 MB / s About 25 MB / s
Write performance About 0.2 MB / s About 8 MB / s
Erase delay 600 ms 2 ms
Error correcting No need Need
(Note1) The performance of flash is estimated from datasheet, not standing for real condition
For NAND flash, it is more difficult to deal with fragments of storage if they occur,
because basic programming unit of NAND flash is "Page" and it is not the same
as "Byte" which is used for NOR flash. Frequent "Page" programming certainly
causes fragments of storage, which will shorten the lifetime of NAND flash.
Hence, general software design for NAND is more important than for NOR, such
as Wear Leveling technique for flash.
For cost saving purpose, the evolution of manufacturing process continues all
the time. However, the more process evolution proceeds, the more problems
happen on new process, due to the physical phenomenon that the quantity of
electrons stored in memory cells is decreased, which causes lower reliability of
data storage. Besides, for the tolerance and performance of NAND flash, lower
cost "Multi Level Cell (MLC, 2 bits in one cell)" NAND or even "Triple Level Cell
(TLC, 3 bits in one cell)" NAND are getting worse than "Single Level Cell" (SLC,
1 bit in one cell) NAND. Therefore, applying complex design such as "Error
Checking and Correcting (ECC)" is required for better tolerance and
performance. All of these concerns above result in more challenges for software
(firmware) design in data programming and storage.
Address Translation
We need to erase old data before we program the new one to flash, but it
costs lots of time on erasing before programming to the same place every
time. So we usually program data to other place which is cleared. The
addresses of that place needs to be recorded. That’s the problem called
“Address Translation” or “Data Rearrangement”. The unit of recorded
addresses could be a page, double page or a block. According to the unit of
recorded addresses, we simply classify the translation algorithms as
“Fine-Grained Mapping” or “Coarse-Grained Mapping”.
When the data is mapped to a new address, the old address of the data is
marked as “Invalid” and avoided to be used. After repeating above actions
continually, the flash will be filled with invalid data and no more usable
space available. Then we need to erase blocks to free space. However,
there may have some “Valid” data in blocks such that we need to move
them to other free place. We call this behavior “Garbage Collection” which
will cause another address translation.
Wear Leveling
Wear leveling is used to extend flash’s lifetime, and avoid bad block
occurrence. Its main ideas are “reducing erase times” and “averaging each
block’s erase times”. These two things are always related to garbage
collection. For achieving wear leveling, we may need to record the erase
times of each block, and classify the data according to different access
behavior. So that we can put the data to the proper place. We’ll also need to
handle bad blocks by “Bad Block Management”.