Thursday, 15 November 2012

Memory Hierarchy in Embedded Systems

                                  
       In design process of an embedded systems we came across lots of constraints including area, performance and power consumption etc. Among them memory is also one of the crucial factor.To get high performance from the embedded system, we need to have fast,flexible and large size memory. To overcome this constraints our designers have designed a common memory hierarchy, which is flexible and customizable as our needs.  

        This  Memory Hierarchy gives the relationship between the speed,size and cost with respect to the distance from the Processor. Following diagram shows the memory hierarchy for an embedded systems.

Memory Hierarchy
     As we see in the diagram top memory elements will be faster and small in size. similarly bottom memory elements will be slower and large in size.  CPU registers, L1 and L2 SRAM Caches and DRAM are comes under Primary storage devices[Once we power off the device the contents will be erased]. Remaining devices will be comes under secondary memory devices.

    Now we will discuss each memory element in the hierarchy.

1. CPU Registers : These registers will be present inside the processor, so faster in speed compared to other memory elements. These registers will be limited in number because if we increase the number, size and cost of the processor will get increase.

2. L1 and L2 SRAM Caches. : Level 1(L1) and Level 2(L2)  caches may be present in the internal RAM(Static RAM) or some times they might present outside the  SRAM also. Static RAM will present inside the processor and small in size, again it because of cost and size of the processor. (Note : In some processor SRAM will not be present).
   Level 1 Cache is nearer to processor compared to DRAM. It works at very high speed and it is expensive compared to other memory elements. Many times this Level 1 cache will lie in the static RAM, which is present inside the processor.
  Level 2 Cache is similar to the Level 1 but it some what far compared to level 1 cache. It may lie in the SRAM or sometimes might lie outside the SRAM( means present in the DRAM). It is slower than Level 1 cache and faster than the RAM. Totally combination of lelel1 and level2 caches will give better performance. 

This high cost is one of the major restriction why we can not use lots of cache in embedded systems.
The general thumb rule is, higher the cache memory faster would be the working of the processor.

3. RAM Main Memory  : It is third level memory element in the memory hierarchy. RAM basically stores all the data that the computer needs while it is running. RAM is also faster but slower than the caches. The higher the size of the RAM, faster will be the system.

4. Secondary storage(Flash memory, Hard disk) : It is last level memory element in the memory hierarchy. These memory elements are non-volatile type memory elements, means it will store the data after the power off. Size of the these memory elements will be more, cost is less compared to other memory elements. They are slower in operations compared to other memory elements.









No comments:

Post a Comment