文档介绍:上海交通大学
硕士学位论文
嵌入式Cache控制器的设计与实现
姓名:薛祎杰
申请学位级别:硕士
专业:通信与信息系统
指导教师:戒蒙恬
20070101
上海交通大学硕士学位论文
嵌入式 Cache 控制器的设计与实现
摘要
随着微处理器执行单元与存储器性能差异的日益加大,层次存储
系统越来越显得重要。对于嵌入式系统来说,尤为突显存储层次结构
的重要性,因为存储结构通常耗费大量的芯片面积和功耗,而面积和
功耗是嵌入式系统中的宝贵资源。所以,在嵌入式处理器的 Cache 设
计中,必须精心选择结构参数和优化技术,以较小的硬件代价来构建
一个高效,低功耗的 Cache 控制器。
本文研究了开源的 Leon2 处理器中的 Cache 控制器,该处理器基
于 32 位 SPARCv8 指令集,同时提供 AMBA 系统总线结构,被广泛
应用于嵌入式产品,如手机,掌上电脑,数码相机等等。
本文对其 Cache 控制器进行了重新设计。论文的主要工作如下:
1. 分析了层次存储系统的性能评价方法,确立了 Cache 控制器设计
和优化的原则及目标。
2. 研究了 Cache 一致性问题,提出了一种有效的系统总线(AHB 总
线)扩展方式,用以解决 CPU 与协处理器之间缓存一致性的问题。
3. 分析了 Cache 结构对功耗的影响。根据实验结果,考察了 Cache
容量,关联度,行大小以及替换策略对功耗的影响,并提出了一
种查找最优 Cache 结构的方法。本文通过硬件监测系统性能,软
件协助或者纯硬件计算功耗,并对 Cache 容量和组关联实现了可
- II -
上海交通大学硕士学位论文
重构。在保证性能的前提下,降低了 Cache 的功耗。
4. 对该 Cache 控制器进行了测试分析。首先分析了总线扩展带来的
资源消耗,验证了总线扩展机制的有效性。其次,分析了查找 Cache
最优结构所需的循环次数,和动态可重构 Cache 结构所带来的功
耗优化。
关键词:高速缓存,一致性,低功耗,可重构
- III -
上海交通大学硕士学位论文
THE DESIGN AND IMPLEMENTATION OF
EMBEDDED CACHE CONTROLLER
ABSTRACT
With the growth of performance gap between main memory and
execution module in microprocessor, the memory hierarchy structure has
e more and more important. When a cache module in embedded
processor is under designing, each parameter and optimization method
should be carefully chosen in order to implement a high performance and
low power system.
The paper is based on the cache controller in Leon2 processor,
which is an open source processor, licensed by GNU LGPL. Leon2 is
designed for embedded applications, with the following features on-chip:
separate instruction and data caches, hardware multiplier and divider,
interrupt controller, two 24-bit timers, two UARTs, watchdog, and 16-bit
I/O port. It has been widely used in industrial, consumer work
products.
In this paper, we redesign the cache controller in Leon2. The main
work is described as follows:
1. Analyze the performance evaluation method for memory hierarchy
an