精简指集计算机.ppt
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_05.gif)
《精简指集计算机.ppt》由会员分享,可在线阅读,更多相关《精简指集计算机.ppt(64页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、William Stallings Computer Organization and Architecture5th EditionChapter 12Reduced InstructionSet Computers精简指令集计算机TopicsMajor Advances in Computers 计算机的主要改进Instruction Execution Characteristics 指令执行的特点Use of Large Register File 使用大的寄存器Compiler-Based Register Optimization 基于编译器的寄存器优化Reduced Instru
2、ction Set Architecture 精简指令集体系结构RISC Pipelining RISC流水线RISC vs.CISC Controversy RISC和CISC 的比较2Major Advances in Computers(1)The family concept 系列概念IBM System/360 1964DEC PDP-8Separates architecture from implementation 将体系结构和它的实现分开Microporgrammed control unit 微程序控制器Idea by Wilkes 1951Produced by IBM
3、S/360 1964Cache memory Cache存储器IBM S/360 model 85 19693Major Advances in Computers(2)Solid State RAM 固态存储器(See memory notes)Microprocessors 微处理器Intel 4004 1971Pipelining 流水Introduces parallelism into fetch execute cycleMultiple processors 多处理器4The Next Step-RISCRISC-Reduced Instruction Set Computer
4、RISC精简指令集计算机Key featuresLarge number of general purpose registers,or use of compiler technology to optimize register use 大量通用寄存器,使用编译技术优化寄存器的使用Limited and simple instruction set 一个有限简单的指令集Emphasis on optimising the instruction pipeline 强调指令流水的优化5Comparison of processors6Driving force for CISC(1)CISC
5、-Complex Instruction Set Computer CISC复杂指令集计算机Why CISC?Software costs far exceed hardware costs 软件成本高于硬件成本Increasingly complex high level languages 越来越复杂的高级语言Semantic gap:Difference between operations provided in HLLs and those provided in computer architecture 语义间隙问题:HLLs提供的操作和计算机体系结构提供的操作不同7Drivin
6、g force for CISC(2)to close the gapLeads to:Large instruction sets 指令集非常大More addressing modes 更多的寻址方式Hardware implementations of HLL statementse.g.CASE(switch)on VAXHLL描述的硬件的实现8Intention of CISC 复杂指令集体系结构的目的复杂指令集体系结构的目的Ease compiler writing 使编译器的编写更容易Improve execution efficiency 提高执行效率Complex opera
7、tions in microcode 因为复杂操作能以微代码实现Support more complex HLLs 提供更复杂的HLL支持A totally different approach:Simpler architecture 简化体系结构9Execution CharacteristicsDevelopments of RISCs were based on the study of instruction execution characteristics RISC的开发是基于指令的执行特性Operations performed 完成的操作determine functions
8、 to be performed and interaction with memory 决定了CPU所要完成的功能及其与存储器的相互作用Operands used(types and frequencies)使用的操作数及其类型和频率determine memory organization and addressing modes 决定了存储器如何组织存储它们和访问它们用的寻址方式Execution sequencingdetermines the control and pipeline organization 决定了控制和流水线的组织结构10Execution Characteris
9、ticsIn the remainder of this section,we summarize the results of a number of studies of high-level-language programs.All of the results are based on dynamic measurements.Dynamic studies are measured during the execution of the program.程序的执行中进行的动态测量。Static measurements merely perform these counts on
10、the source text of a program.静态测量只是在源程序文本上进行统计,这不能给出很有用的性能信息。11OperationsTable 4.9 reveal:Assignment statements predominateMovement of data is of high importance 数据的移动重要性 Preponderance of Conditional statements(IF,LOOP)条件语句Sequence control is important 指令集的顺序控制12Relative Dynamic Frequency Dynamic Ma
11、chine InstructionMemory Reference Occurrence(Weighted)(Weighted)PascalCPascalCPascalCAssign453813131415Loop5342323326Call151231334445If29431121713GoTo-3-Other61312113OperationsProcedure call-return is very time consuming 程序的调用花费大量时间Some HLL instruction lead to many machine code operations 一些HLL指令导致执
12、行大量机器代码14OperandsMainly local scalar variables 主要是局部,标量变量Optimisation should concentrate on accessing local variables 优化也应该集中在局部变量的访问 PascalCAverageInteger constant162320Scalar variable585355Array/structure26242515Procedure CallsVery time consuming 过程调用是编译后的HLL程序中最耗时的操作To implement efficiently,two a
13、spects are significant:Depends on number of parameters passed 依赖于传递的参数的数量Depends on level of nesting 依赖于嵌套深度Most programs do not do a lot of calls followed by lots of returns 程序一般不作大量的调用返回Most variables are local 大部分变量是局部的16ImplicationsMaking instruction set architecture close to HLL 使指令集与HLL相近 not
14、most effective 不是最有效的 Best support is given by optimising most used and most time consuming features 通过优化最经常使用的和最花费时间的,是最好的方案。17ImplicationsGeneralizing from the work of a number of researchers,three elements emerge that,by and large,characterize RISC architectures.1.Large number of registers 大量寄存器O
15、perand referencing optimization+locality of references memory references reduced 减少存储器访问2.Careful design of pipelines 精心设计流水线Conditional branch and procedure call 条件分支和过程调用3.Simplified(reduced)instruction set 精简指令集18Use of Large Register FileFrom the analysisLarge number of assignment statementsMost
16、 accesses to local scalars 主要访问本地标量 Heavy reliance on register storage 依赖于寄存器存储 Minimizing memory access 最小化内存访问19ApproachesSoftware solution to maximize register usage软件方法Require compiler to allocate registers to those most used variables in a given time 依赖于编译器,把寄存器分配给那些一定时间内使用最多的变量Requires sophist
17、icated program analysis 需要复杂的程序分析Hardware solution硬件方法Have more registers 大量寄存器Thus more variables will be in registers 寄存器中存放大量变量20Registers for Local VariablesStore local scalar variables in registers 在寄存器中存放本地标量变量 Reduces memory access 减少存储器访问Some problemsEvery procedure(function)call changes loc
18、ality 每一次过程调用都会改变局部性On every call,local variables must be saved to memory 每次调用变量必须被存储到存储器Parameters must be passed 必须传递参数On return,results must be returned and variables from calling programs must be restored 必须返回结果并且恢复调用程序的变量21Register WindowsSolution:Register windows Organization of registers to r
19、ealize the goal 为了实现解决前述问题的目标,而对寄存器采用的组织结构From the analysisOnly few parameters and local variables 少量参数和本地变量Limited range of depth of call 有限的调用深度Use multiple small sets of registers 使用多个小的寄存器组Calls switch to a different set of registers 过程调用时自动地切换来使用不同的寄存器组Returns switch back to a previously used s
20、et of registers 返回时切换回以前使用的寄存器组22Overlapping Register WindowsThree areas within a register set 窗口分为3个域:Parameter registers 参数寄存器域Local registers 局部寄存器域Temporary registers 临时寄存器域23Register Windows cont.Temporary registers from one set overlap parameter registers from the next 临时寄存器用于当前过程与下一级过程(被当前过程调
21、用的过程)交换参数和结果Temporary registers at one level are physically the same as the parameter registers at the next lower level.当前层的临时寄存器域和下一层的参数寄存器域物理上是同一个域。This allows parameter passing without moving data 这种重叠准许不用实际移动数据就能传递参数24Circular Buffer diagramThe actual organization of the register file is as a ci
22、rcular buffer of overlapping windows.寄存器集的实际组织结构是一个由重叠窗口组成的环形缓冲器。25Operation of Circular BufferWhen a call is made,a current window pointer(CWP)is moved to show the currently active register window 当一个调用发生时,当前窗口指针移动到当前活动寄存器窗口If all windows are in use,an interrupt is generated and the oldest window(t
23、he one furthest back in the call nesting)is saved to memory(only.in and.loc need to be saved)当所有窗口都在使用就会产生中断,最老的窗口会保存到内存(只保存参数、局部窗口的数据)A saved window pointer indicates where the next saved windows should restore to 保存窗口指针表明下一个保存窗口应该恢复的地方26Operation of Circular Buffer(2)Studies show:8 windows are eno
24、ugh to handle up to of call/return without save/restore 8个窗口足够处理99%的调用和返回E.g.,Berkeley RISC uses 8 windows of 16 registers each27Global Variables-2 OptionsAllocated by the compiler to memory 由编译器为全局变量指定存储器位置Straightforward 直截了当Inefficient for frequently accessed variables对经常访问的全局变量效率低下Have a set of
25、registers for global variables CPU中有一组全局寄存器e.g.,registers 0-7:global 8-31:local to current windowIncreased hardware burden 硬件负担增加Compiler must decide which global variables should be designed to registers 编译器也必须裁定什么样的全局变量应指派到寄存器。28Registers v Cache Large Register File CacheAll local scalars Recently
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 精简 计算机
![提示](https://www.taowenge.com/images/bang_tan.gif)
限制150内