本文在计算机组成原理实验的Cache的基础上,详细论述了计算机组成原理虚拟实验室-Cache模块的设计和实现方案。
摘要:随着计算机硬件技术的成长,CPU的运行速度快速提高,存储器的速度远远达不到处理器速率提高的水平。因为CPU不能实时获得存储器提供的数据而难以施展其高速的性能优势,存储器的速度已成为制约整个系统性能提高的壁垒。Cache是计算机存储系统中至关重要的组成部分,能够解决处理器与存储器速度不匹配的矛盾,同时Cache部分也是整个《计算机组成原理》课程的难点之一。本文介绍的计算机组成原理虚拟实验室的Cache模块(Principles of Computer Organization Virtual Lab-Cache module,以下简称PCOVL-Cache),用可视化方法实现并展示与Cache有关的技术环节,方便使用者做验证性及对比性实验,深入理解Cache的基本工作原理、实现方法,以及如何在计算机系统中提升效率。该系统使用面向对象的软件开发技术,采用Java语言编码,能够满足计算机组成原理中Cache实验的需要,具有良好的开放性、通用性以及平台无关性。
关键词:计算机组成原理;虚拟实验室;Cache;计算机存储系统
The Design and Implementation of cache Module for Principles of Computer Organization Virtual Laboratory
Abstract:With the development of computer hardware technology, the speed of the CPU increases rapidly, and the speed of memory is far from the speed of processor speed. Because the CPU can't get the memory in time to provide data and hard to take advantage of its high-speed performance, the speed of the memory become important bottleneck to improve the performance of the whole system. Cache is a vital component in the computer storage system, to solve the contradiction between the processor and memory speed does not match, at the same time the Cache part is one of the difficulties of the course. In this paper, Principles of Computer Organization Virtual Lab-Cache module (Principles of Computer Organization Virtual Lab-Cache module, hereinafter referred to as PCOVL-Cache), using visualization method and show all technical processes related to the Cache, convenient for the user to do the verification and comparative experiments, deeply understand the basic working principle and realization method of the Cache, as well as the role of in the computer system. The system adopts the Java language implementation to meet the needs of the Cache experiment in the organization of computer composition, with good openness, universality and platform independence.
Key words: Computer Organization; Virtual Laboratory; Cache; Computer storage system
目 录
摘要 1
关键词 1
Abstract 1
Key words 1
1 绪论 2
1.1 研究背景 2
1.2 国内外研究状况 2
2 Cache系统分析 3
2.1 Cache理论知识 3
2.1.1 Cache的基本原理 3
2.1.2 Cache的命中率 3
2.2 本项目研究目的和内容 4
2.3 系统分析 4
2.3.1 总体功能分析图 4
2.3.2 顶层模块图 5
2.3.3 PCOVL-Cache模块类图 6
3 Cache系统实现 6
3.1 核心功能顺序图 6
3.2 模拟器类设计与实现 7
3.3 Cache初始化的实现 9
3.4 指令执行过程实现 11
3.4.1 映像策略 14
3.4.2 替换策略 16
3.4.3 写策略 18
3.4.4 冯诺依曼结构Cache和哈佛结构Cache 19
3.5 实验数据文件处理 19
3.6 界面设计与实现 20
4 Cache系统测试 21
5 总结与展望 25
5.1 总结 25
5.2 同类工具比较 25
TEC-5组成原理辅助实验软件-Cache仿真实验 25
5.3 后续工作展望 26
致谢 27
参考文献 27
计算机组成原理虚拟实验室-Cache模块的设计与实现
1 绪论
1.1 研究背景
《计算机组成原理》是计算机科学与技术学科的一门核心专业基础课程,重点讲授单处理器的组成和工作原理,在此基础上拓展讲授并行体系结构[1]。计算机组成原理的实验从实践的角度出发,是《计算机组成原理》课程的重要组成部分,学习者通过实验不仅能巩固理论知识,还能够清晰地建立计算机系统概念。现有的计算机组成原理实验在电子实验仪器上进行,目前还缺失Cache部分的实验设备。由于硬件动作的透明性,以及实验仪器元器件易坏且占地面积大,使得现有《计算机组成原理》实验成本高、实验效果不明显和位置不可移动的弊端[2]。Cache部分是计算机组成原理课程的难点,高速缓冲存储器(Cache)技术是分层存储思想的核心,理解Cache的实现原理对于理解现代计算机的组成具有重要意义。Cache的所有功能都是用硬件来实现的,因此它对于应用程序员和系统程序员来说都是透明的。这就导致了大多数的学习者对Cache缺乏深度理解,没有意识到掌握Cache原理的重要性,以及如何应用到程序中以提升系统效率。