存储NVRAM/FLASH/NVM的概念区别

存储NVRAM/FLASH/NVM的概念区别

NVRAM\FLASH\NVM的区别

NVRAM(Non-Volatile Random Access Memory):非易失性随机访问存储器。电子设备能快速地访问该存储空间的内容(大多数情况下此类设备都是以字节方式地访问这些内容,并且掉电后也能保存它们)。有多种技术能实现这一策略,其中EEPROM是比较常见的。但是需注意的是:在手机设计中,通常用ROM的一个或两个扇区(实际上更多的情况下这个ROM就是 FLASH)来模拟NVRAM,这样做的原因当然是节省花费了(因为ROM是必须的,而NVRAM则不一定)。

FLASH:是一种ROM(Read Only Memory),与其他ROM的不同在于半导体等级。注意:FLASH必须以扇区为单位访问,而NVRAM以字节为单位访问。这是NVRAM驱动必须实现一个算法(即一开始就复制一个扇区内的所有内容到RAM)的原因。

NVM:非易失性存储器。这是更普遍的概念,它涵盖了所有在掉电后仍能保持其内容的内存组件。在体系设计上这个技术是很有用的,它的技术详情此处省略。实际上,在一个工程中一个带有电池的DRAM(动态随机访问存储器)就能扮演NVM的角色,并且能很好地工作。

原文:

NVRAM: Non-Volatile RAM. The target is to have a electrical device that could be accessed quite fast, most of the time the content is calculated by bytes and the content could be saved after power down. There are different technical ways to implement this concept such as EEPROM which is very common. Please note, in mobile phone design, most of the time one or two sectors of ROM (most of the time it is FLASH) will be used to simulate NVRAM, the only reason is cost saving since ROM is a “must” but NVRAM is not.

FLASH: One kind of ROM and the difference to other ROM is semiconductor level. Please note, FLASH must be read/write by sectors but NVRAM should be read/write by bytes. It is why NVRAM driver have to implement an algorithm such as copying all the content in one sector to RAM first.

NVM: Non-volatie memory. It is more generic concept and covers all the memory components that could keeps its content after power off. It is useful during architecture design when the technical detail could be skipped. In fact, in one project, a DRAM with battery played as NVM and it worked quite good in that case.

参考:http://www.cnblogs.com/IamEasy_Man/archive/2010/12/18/1909786.html

Flash闪存分类

  • NOR FLASH
  • NAND FLASH

参考:http://www.metsky.com/archives/372.html


  • 6
    点赞
  • 56
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
这段代码是 NvM 模块中的一个函数,用于获取 ROM 块的地址。下面逐句解释每一行代码的作用: ```c static FUNC_P2VAR(uint8, NVM_APPL_DATA, NVM_CODE) NvM_MainFun_GetRomBlockAddr(void) { ``` 这是函数的定义,表示这个函数返回一个指向 uint8 类型的指针,该指针指向的内容位于 NVM_APPL_DATA 段中,并且该函数位于 NVM_CODE 段中。 ```c uint8 dateIndexTemp = NVM_INIT_0; uint8* retValue = NULL_PTR; Nvm_BlockManagment_st *blockMngmnt; const NvM_Block_Descriptor_Table_st blockTab; ``` 这里定义了一些变量,dateIndexTemp 用于存储数据索引,retValue 用于存储返回值,blockMngmnt 和 blockTab 用于存储当前作业的块管理信息和块描述信息。 ```c blockMngmnt = &NvM_gstaBlockVar[NvM_QueueCrrntJob.CurBlockId]; blockTab = &NvM_Block_Descriptor_Table[NvM_QueueCrrntJob.CurBlockId]; ``` 这里获取当前作业的块管理信息和块描述信息。 ```c if( (NVM_BLOCK_MANAGENMENT_DATASET == blockTab->ManagementType) && (blockMngmnt->DataIndex >= blockTab->NvBlockNum) ) { dateIndexTemp = blockMngmnt->DataIndex - blockTab->NvBlockNum; } else if( blockTab->RomAddr != NULL_PTR ) { retValue = blockTab->RomAddr; } else { // Do nothing. } ``` 这里根据块描述信息中的管理类型和块管理信息中的数据索引,判断 ROM 块是否存储在 NVRAM 中。如果 ROM 块存储在 NVRAM 中,则计算出 ROM 块在 NVRAM 中的索引。否则,如果块描述信息中的 ROM 地址不为空,则将 ROM 地址存储到 retValue 中。 ```c if( (dateIndexTemp < blockTab->RomBlockNum) && (blockTab->RomAddr != NULL_PTR) ) { if( (blockTab->ManagementType == NVM_BLOCK_MANAGENMENT_DATASET) && (blockMngmnt->DataIndex >= blockTab->NvBlockNum) ) { retValue = blockTab->RomAddr + (dateIndexTemp * (blockTab->NvBlockLength - Nvm_CrcCalc_Size_Table[blockTab->CrcType] - NVM_STATICID_LENGTH) ); } } ``` 如果 ROM 块存在且当前作业的块管理信息中的数据索引指向了 NVRAM 中的块,则计算出该 ROM 块在 NVRAM 中的地址,并将其存储到 retValue 中。最后将 retValue 返回。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值