北京工业大学 毕业设计(论文)任务书
题目基于FPGA的CPU设计与实现专业电子信息工程学号12521323姓名麻宇鹏
主要内容、基本要求、主要参考资料等:
【主要内容】
课题需要进行多方案比较,实现基于FPGA的CPU设计。 建议采用Altera CycloneIII,学院裕兴杯比赛用开发板实现。 【基本要求】
1、通过调研、学习等方式明确项目研究的方向、意义及必要性,确定具体的内容与实现方式。
2、研究项目实现的方法、建立开发研究的软件平台。 3、选择确立设计开发的方案。 4、制定系统的测试方案。 5、实施开发方案及测试方案。 6、设计优化及调整,做毕业论文。
【主要参考资料】
【1】 金明录、刘倩.数字系统设计与VHDL[M].北京:电子工业大学出版社.2008.8 【2】 吴厚航.FPGA设计实战演练(逻辑篇) [M].北京:清华大学出版社.2015.1 【3】 于斌、米秀杰.ModelSim电子系统分析仿真[M].北京:电子工业出版社,2011.12
完成期限:2016年6月 指导教师签章: 专业负责人签章:
2016年1月
北工大学实验学院(论文)
摘 要
随着计算机行业不断发展,基于流水线结构CPU的研究是计算机体系结构中的重要研究方向。设计现代处理器的几种最基本的结构处理技术主要有:RISC结构、指令流水线结构等等。RISC结构支持指令流水并强调指令流水的优化作用,它们的目标是开发处理器的指令级并行性,提高处理器的执行速度。
本设计是基于流水线技术的8位RISC CPU 设计。在本次设计中的RISC CPU是高档微机中所采用的一种带有精简指令集的CPU。它的特点是:指令系统小,一个时钟周期内可以执行一条或者多条指令;采用标准长度指令;存储器访问只使用加载和存储两个指令等;采用硬布线逻辑控制为主。流水线技术CPU 是一种将指令分解为多步,并让不同指令的各步操作重叠,从而实现几条指令并行处理,以加速程序运行过程的技术。指令的每步有各自独立的电路来处理,每完成一步,就进到下一步,而前一步则处理后续指令。流水线增大了CPU的指令吞吐量,即单位时间完成的指令条数,但是它没有减少指令各自的执行时间。完成一些简单的加减乘除运算,并仿真产生相对应的波形。
关键词: 精简指令集;RISC CPU;指令流水线;吞吐量;
I
北工大学实验学院(论文)
Abstract
As the computer industry development, based on the research of pipeline structure CPU is an important research direction in computer architecture. Design several kinds of most basic structure of modern processor processing technology mainly include: RISC structure, the structure of the command line, and so on. RISC structure support instructions flowing water and to emphasize the optimization of water, their goal is to develop the processor's instruction level parallelism, improve the execution speed of the processor.
This design is based on the assembly line of 8-bit RISC CPU design. In the design of RISC CPU is adopted in high-grade microcomputer with a reduced
instruction set of the CPU. Its features are: small instruction system, a clock cycle can perform one or more instructions; Use standard length instruction; Memory access using only load and store two instructions, etc. The hard wiring logic control is given priority to. Pipeline technology is a CPU instructions) multiple steps, each step and make different instructions operation overlap, so as to realize a few instructions parallel processing, to speed up the technology in the process of program is running. Instruction of each has a separate circuit to deal with, each step, into the next, and subsequent handling instructions in the previous step. Lines increased CPU
instruction throughput, per unit of time to complete the instructions article number, but it did not reduce the instruction execution time. Operation to complete some simple addition, subtraction, multiplication, and division, and the simulation waveform should be relative.
Key words: Reduced instruction set. RISC CPU. Command line; handling capacity;
II
北工大学实验学院(论文)
目录
摘 要.............................................................................................................................. I Abstract ......................................................................................................................... II 目录.............................................................................................................................. III 1 绪 论.......................................................................................................................... 1 1.1 课题研究背景与意义
1.2.2 超标量技术........................................................................................ 1 1.2 CPU技术主要成果 ......................................................................................... 2 1.3 CPU技术研究的发展趋势和存在的问题 ..................................................... 3 1.4 论文章节安排................................................................................................. 4 2 主要技术及工具简介................................................................................................ 5
2.1 EDA和QUARTUS ......................................................................................... 5 2.2 QUARTUS II 13.0开发流程 .......................................................................... 5 2.3 FPGA器件 ...................................................................................................... 7 3.8位RISC设计 ........................................................................................................... 9
3.1 方案论证......................................................................................................... 9 3.2 整体结构设计............................................................................................... 10 3.3 指令集设计................................................................................................... 11 3.2.1 寄存器型(R型) .................................................................................... 11
3.2.2 立即数型(I型) ............................................................................. 12 3.2.3 立即移位型(J型) ......................................................................... 12 3.4 本章小结....................................................................................................... 13 4 基于QuartusII的8位RISC实现 ......................................................................... 14
4.1 取指阶段....................................................................................................... 14 4.2 译码阶段....................................................................................................... 15 4.3 执行阶段....................................................................................................... 18 4.4 访存阶段和回写阶段设计........................................................................... 19 4.5 本章小结....................................................................................................... 20 5 系统仿真.................................................................................................................. 21
5.1 8位RISC整体设计与仿真 .......................................................................... 21 5.2 系统软件仿真.............................................................................................. 21 5.3 硬件实物验证............................................................................................... 25 5.4 本章小结....................................................................................................... 25
III
北工大学实验学院(论文)
6 总结.......................................................................................................................... 26 致谢.............................................................................................................................. 27 参考文献...................................................................................................................... 28
IV