一文了解存储行业的Flash闪存基本情况
RAM(Random Access Memory):随机存取存储器,也叫主存,是与CPU直接交换数据的内部存储器。
ROM(Read-Only Memory):只读内存。ROM所存数据,一般是装入整机前事先写好的,整机工作过程中只能读出,而不像随机存储器那样能快速地、方便地加以改写。
无论是电脑还是手机,容量小的那个一定是内存RAM,容量大的一定是存储(闪存)ROM,比如手机的3GB+64GB、4GB+64GB、6GB+128GB,前者都是内存后者都是存储(闪存);电脑也是如此,8GB+120GB、16GB+240GB(+3TB),前者都是内存后者都是闪存(或硬盘)。就像电脑的内存条,可能会有4G,可硬盘有1 TB,装个大的程序有几十G呢哦。为什么相差这么大呢,这是因为,亲们下载的程序在运行的时候只有调用的那部分进去内存,用完就出栈,所以并不需要这么大的RAM,另外业界公认的最大的原因是RAM的制造成本比ROM高太多了。
图1:存储器芯片分类
闪存是最主要的存储IC,主要为NOR Flash和NAND Flash两种。半导体存储芯片主要分为非易失性存储IC和易失性存储IC,其最主流的非易失性存储IC为闪存(Flashmemory),而Flash又可以分为NOR Flash和NAND Flash两大类。
NAND Flash根据存储原理分为SLC、MLC、TLC和QLC,从结构上又可分为2D、3D两大类。Flash技术主要分为SLC、MLC、TLC和QLC四大类,对应不同的空间结构,这四类技术可又分为2D结构和3D结构两大类。2D结构的存储单元仅布置在芯片的XY平面中,为了提高存储密度,制造商开发了3D NAND或V-NAND(垂直NAND)技术,该技术将Z平面中的存储单元堆叠在同一晶圆上。3D NAND正与不同的NAND技术相结合(SLC、QLC),未来更高堆叠层数的3D NAND是行业发展的趋势。
图2: 3D技术发展线路图
在SLC闪存中,每个存储单元仅存储1bit信息:逻辑0或逻辑1,而MLC闪存每个单元存储两位信息,有2的2次方个电平状态,TLC和QLC分布存储3、4位bit信息。每Cell单元存储数据越多,单位面积容量就越高,但同时导致不同电压状态越多,越难控制,所以导致颗粒稳定性越差,寿命低。
图3:Flash技术分类
SLC NAND单位存储容量最低,但性能也最佳。SLC NAND仅有两种不同的电压状态,因此性能最为稳定,寿命也最长(理论可擦写10W次),成本也最高,是最早的顶级颗粒,但因为成本问题,目前已经基本消失在普通消费者视野中。TCL和QLC刚刚问世的时候性能较差,但是经过一段时间的发展,两者各项参数都有了明显的进步,且两者的价格优势非常明显,已经成了NAND Flash技术的主流。
图4:Flash 参数对比
NOR Flash缺点明显,却具备NAND Flash所不具备的优势。与主流的NAND Flash相比,NOR Flash容量密度小、写入速度慢、擦除速度慢、价格高,但是NOR Flash由于其地址线和数据线分开的特性,不必再把代码读到系统RAM中,应用程序可以直接在NOR上运行(XIP, eXecute In Place),且NOR Flash还具备更快的读取速度、更强的可靠性和更长的使用寿命,这些因素的存在也注定了NOR Flash难以被市场淘汰。
图5:NAND 与 NOR 对比
UFS深入浅出 第二章 UFS结构 第四节 UFS分块图解
Section 4 UFS block diagram
第四节 UFS分块图解
In this section, we will have a high-level view of UFS block diagram. Meanwhile we will also have a data flow overview in-between each block. Detail of each block will be covered in the following chapter.
在这一节里,我们会比较笼统的看一下UFS的分块图解。同时,我们也会看一些各个块之间的数据流动。每个块的具体细节会在接下来的章节里面涵盖。
On left of the diagram is Host, is composed by SoC, RAM and UFS Host Controller. The Host here does not simply mean UFS host, but the host of the whole system. While the UFS device is on the right side, which contains UFS Device Controller with embedded SRAM and standalone NAND Flash media.
在分解图的左边是Host,由SoC,RAM和UFS 主机控制器组成。这里的主机不是简单的指UFS 主机,而是整个系统的主机。UFS器件则在右边,包括了UFS 器件控制器以及内嵌的SRAM和独立的NAND Flash 闪存。
If you look into detail of UFS Host Controller and UFS Device Controller, you will find they are quite similar like each other with the same internal layer structures. The difference is that there is a UFS Host Controller Interface called UFS HCI in Host Diagram to communicate with Host SoC, while UFS device controller has got a NAND interface to connect with NAND in which Logic Unit and Registers physically reside. The same part in both sides is defined in the JEDEC UFS specification (latest one is JESD220F UFS4.0). JEDEC also has a HCI Specification (latest one is JESD223E UFSHCI4.0) for UFS Host Controller Interface. Regarding NAND interface, JEDEC absorbs ONFI (Open NAND Flash Interface), and this part will be covered in the article NAND Step by Step.
如果你仔细看UFS 主机控制器和UFS 器件控制器,你会发现他们彼此非常相像,都有着一样的内部层结构。不同的地方是UFS 主机控制器里面有一个叫做UFS HCI的UFS 主机控制器接口与主机SoC通讯。而UFS 器件控制器则有一个NAND接口与保存逻辑单元和寄存器的NAND 闪存通讯。两边相同的地方是在JEDEC UFS规范(最新的是JESD220F UFS4.0)。JEDEC还有一个给UFS 主机控制器接口的HCI规范(最新的是JESD3F UFSHCI4.0)
Usually in a traditional small system, there will be a CPU, RAM, and Disk. When we take a full picture of this diagram, the SoC (System on Chip) here acts as CPU in embedded system, RAM here refers volatile Dynamic RAM memory normally,either DDR RAM or LPDDR (Low Power DDR) RAM,for high-speed code or data access. Disk here is our leading role UFS device, which is a non-volatile memory to store the code and data without power supply. Please take a note that, Disk here is not an accurate name. Disk originally refers to Hard Disk Drive (aka HDD) which uses magnetic material for data non-volatile storage. Now we use this terminology simply for all non-volatile memory for easy understanding.
通常在一个传统的小型系统里面会有CPU,RAM和Disk。当我们整体来看分解图的时候,SoC(片上系统)在嵌入式系统里面扮演了CPU的角色。RAM这里通常是指易失的动态RAM存储器,可以是DDD RAM或者是LPDDR(低功耗DDR)RAM,主要是为了高速代码或者数据的访问。这里的Disk是我们的主角UFS器件,不需要电的非易失存储器。请注意这里的Disk不是一个准确的名字。Disk原本指的是为了数据的非易失存储而使用磁存储介质的硬盘驱动器(也叫HDD)。为了便于理解,现在我们用这个术语简单指代所有非易失存储器。
If we zoom in to focus only on UFS device side, the internal SoC (Yes, there is one SoC inside UFS device controller as well, invisible in this Diagram)of UFS Device controller will be CPU, controller internal SRAM will act as volatile RAM, and NAND flash is non-volatile Disk. Since in this article, we illustrate UFS protocol only, hence we will not go deeper into UFS device small system.
如果我们放大聚焦在UFS器件这边,UFS器件控制器里面的 SoC (是的,在UFS器件控制器里面也有SoC,这个图解里面不可见) 是CPU,控制器内嵌的SRAM是易失的RAM,而NAND闪存就是非易失的Disk。因为这篇文章我们只解释UFS协议,所以我们不会深入探究UFS器件的小系统。
Back to the small system SoC, DRAM, UFS, the main function of Flash is to store data since it is non-volatile memory and could keep data inside without power supply. But in order to load and save data into the NAND Flash, Host SoC need go all the way down through each layer of the UFS host Controller to the physical signals and goes up back through the correlative layers of UFS Device Controller to communicate with NAND Flash. This is the way that we use NAND Flash to save data, the opposite direction is load data.
回到SoC,DRAM和UFS的小系统,Flash的主要功能是存储数据,因为它是非易失存储器,可以在没有电供应的情况下保持数据。但是为了提取和保存数据,主机SoC需要一路向下穿过UFS主机控制器的每一层直到物理信号,然后再往上穿过相对应的UFS器件控制器的每一层去和NAND闪存通讯。这个是我们用NAND闪存存数数据的方式,相反的方向则是提取数据的方向。
We could also use dot line with arrow to see how they communicate with each other logically. On the top is the pair of Host SoC and NAND Flash for read and write operation. In the very beginning, Host SoC do access NAND Flash directly, but limitation is quite obvious. NAND 8-bit parallel I/O is not good to increase data rate for long distance transmission. NAND is born with bit errors for cost effective higher density, hence ECC (Error Correction Code), BBM (Bad Block Management) which bring extra burden for SoC. It does not count WL(wear-leveling)for overcoming limited NAND Flash P/E(Program/Erase) characteristic and FTL (File Transfer Layer) of easily use NAND Flash which need be access by pages but not bit. This is the reason why NAND controller and complex protocol needed for higher and higher data rate.
我们还可以给每一层用虚线箭头来展示逻辑上它们是怎么互相联系的。在最上面是读写操作的一对,主机SoC和NAND闪存。在最开始,主机SoC确实是直接访问NAND的,但是局限性也非常明显。NAND的8比特并行I/O不利于在长距离传输提高数据传输率。NAND天生就是为了更高容量节省成本而有比特错误,所以ECC(错误纠正码),BBM(坏块管理)会给SoC额外的负担。这个还没算为了克服有限的NAND闪存的P/E(编程/擦除)特性而使用的WL (磨损均衡),以及为了方便管理NAND闪存这种使用页而不是比特访问而使用的FTL(文件转换层)。这个也是为了越来越高的速度需要使用NAND控制器以及复杂的协议的原因。
UCS (UFS Command Set) block use CDB (Command Descriptor block) for communication. CDB is defined by SCSI specification which implement not only read/write command but also other functional commands.
UCS(UFS指令集)模块用CDB(命令描述符块)来做通讯。CDB是SCSI协议定义的用来实现读写命令以及其它功能命令。
These commands CDB are embedded in in the next lower UTP (UFS transport Protocol) layer‘s UPIU (UFS Protocol Information Unit) Frame. Besides the communication to the peer layer, UPIU is also used internally by Task Manager block and Device Manager block.
这些命令CDB会嵌入到下面低一层的UTP(UFS传输层)的UPIU(UFS协议信息单元)帧里面。除了用于与对面对应层的通讯,UPIU也被用于内部的任务管理块和器件管理块。
Go deeper to UIC (UFS InterConnect) layer, UniPro is a software stack to hand so called credit-based flow control data transmission. PDU (Protocol data Unit) is the common name for the data packet in UniPro, each sub layer has its specific PDU name. UPIU from upper UTP layer will be divided here to fit for the PDU format. Device Manger block could skip UTP layer to access directly the DME (Device Manager Entity) in UniPro. This is like the internal employee private path for better control low level configuration.
在深一点去到UIC层, UniPro是一个软件协议栈用于处理被称为基于信用的流控数据传输。PDU (协议数据单元) 是UniPro里数据包的通用名字,每一个子层都有各自的专用PDU命名。从上面UTP层来的包在这里会被拆分来适配PDU格式。器件管理块能够越过UTP层直接访问UniPro里的DME(器件管理实体)。这个就像是内部员工的私人通道来更好地控制底层配置。
M-PHY in the UIC will finally encoded sending data or decoded receiving data into symbols and turn it to or from physical signals in the lane. M-PHY use 8b/10 line encoding to turns 8bit data into 10bit symbol for both High-Speed and Low-Speed. Regarding binary encoding,M-PHY for UFS use PWM (Pulse Width Modulation) for low Speed, while NRZ (Non Returned to Zero) for High Speed.
UIC里的M-PHY最终会把发送数据编码或者把接收数据编码成字符,然后转化成通道上的物理信号。高速或者低速M-PHY都使用8b/10b的线路编码把8比特字节转换成10比特的字符。而二进制编码,UFS的M-PHY的低速使用PWM(脉宽调制),高速则使用NRZ(非归零)。
The access point of in-between each diagram block is called SAP (Service Access Point), this could be thought of as logical API (Application Programming Interface).
在各个块之间的访问点被叫做SAP(服务访问点),这个可以被想象成为逻辑API(应用编程接口)。
SoC will utilize the system RAM to maintain the Task Manager request list and Command Transfer request list. These will notify UFS host controller for dispatching instructions by doorbell register which reside in UFS HCI. The name doorbell is quite vivid as if someone is knocking your door to tell you, hey, the tasks and commands are waiting for you to execute them. UFS device controller also maintains the task and command queue in its internal SRAM which is not defined in UFS specification and should be implemented by UFS device vendors.
SoC会使用系统RAM来维护任务管理请求列表和命令传输请求列表。这个会通过UFS HCI里面的门铃寄存器来通知UFS主机控制器分发指令。门铃寄存器这个名字非常生动,好像是有人正在敲门告诉你,嘿,任务和命令已经准备好等你执行了。UFS器件控制器同样在它内部的SRAM维护了任务和命令队列,这个在UFS规范里面没有定义,需要UFS器件厂家自己实现。
相关问答
Flash 是否有能力取代ROM?首先,这个题目写成一本书都不够说明清楚,所以在这里也不可能回答的非常仔细。题目本身其实问的不够“专业”,因为没有在根本上弄清楚什么是ROM,什么是Flash,...
EEPROM与 FLASH 闪存到底有什么区别?区别主要是他们的用途不同:现在的单片机,RAM主要是做运行时数据存储器,FLASH主要是程序存储器,EEPROM主要是用以在程序运行保存一些需要掉电不丢失的数据....
SRAM ,静态随机存储器,和 flash 闪存的区别, - 187****1007 ...SRAM是运行程序的空间,FLASH是存储程序的地方RAM(randomaccessmemory)随机存储器。存储单元的内容可按需随意取出或存入,且存取的速度与存储单元...
DRAM和RAM的区别是什么?DRAM这东西到底有什么用呢? - 136****...ROM和RAM指的都是半导体存储器,ROM是ReadOnlyMemory的缩写,RAM是RandomAccessMemory的缩写。ROM在系统停止供电的时候仍然可以保持数据,而RAM通常都...
视频播放时为何弹出Adobe Flash Player设置?-ZOL问答win7系统解决方法:请您打开控制面板,找到FLASHPLAYER,点高级,然后在浏览数据和设置那一栏点击,全部删除,然后再登录游戏即可。XP系统解决方法:请您随便打开...
Flash 安装步骤?1、启动Flash安装程式,然后点击下一步2、接受许可协议3、在安装选项中,只需选择“在桌面上生成快捷方式”项即可4、选中安装FlashPlayer项(记住是独立的,...
大学英语综合教程3第5课课文翻译_作业帮[回答]大学英语综合教程3第5课课文原文及翻译:WritingThreeThank-YouLettersAlexHaley1Itwas1943,duringWorldWarII,a...
怎么安装 flash ?启动Flash安装程式,然后点击下一步2、接受许可协议3、在安装选项中,只需选择“在桌面上生成快捷方式”项即可4、选中安装FlashPlayer项(记住是独立的,而不...
英语的12个单元音单词举例急用,每个单元音要带3个单词举例,要...[回答]很容易嘛,就是有些音标打不出来,后面的单词是100%正确的1.[i:]each,eveningread,teacher,police,tea,see,he,2.[i]is,in,busy,ci...
flash 插件怎么安装?1、启动Flash安装程式,然后点击下一步2、接受许可协议3、在安装选项中,只需选择“在桌面上生成快捷方式”项即可4、选中安装FlashPlayer项(记住是独立的,...