计算机组成原理 第二章“指令系统” 中科大11系 李曦
计算机组成原理 第二章“指令系统” 中科大11系 李曦
概要 ·指令系统:机器指令的集合 David Patterson,Andrew Waterman, The RISC-V Reader:An Open 一“程序控制” Architecture Atlas,2017 ·程序=顺序执行的指令流 一 机器语言,汇编语言(Assemble Language) Instruction Set Architecture (ISA) ·分类:CISC、RISC、VLIW David Patterson Andrew Waterman ·影响:处理器、C编译器、OS。。。 ·本章的内容 RISC-V RV指令系统 ·操作数:寄存器,存储器 (大小尾端,对齐),常数/立即数: ·指令功能,指令格式与编码,寻址方式(操作数,下一条指令) ·分支指令$2.7,大立即数处理2.10 ·过程调用$2.8,$2.13 ·汇编程序设计:COD4附录B -指令系统特征 一 编译过程:$2.12 ·可执行程序生成:编译,汇编,链接,加载 llxx@ustc.edu.cn 2/41
llxx@ustc.edu.cn 2/41 概要 • 指令系统:机器指令的集合 – “程序控制” • 程序=顺序执行的指令流 – 机器语言,汇编语言(Assemble Language) – Instruction Set Architecture(ISA) • 分类:CISC、RISC、VLIW • 影响:处理器、C编译器、OS。。。 • 本章的内容 – RV指令系统 • 操作数:寄存器,存储器(大小尾端,对齐),常数/立即数; • 指令功能,指令格式与编码,寻址方式(操作数,下一条指令) • 分支指令$2.7,大立即数处理$2.10 • 过程调用$2.8,$2.13 • 汇编程序设计:COD4附录B – 指令系统特征 – 编译过程:$2.12 • 可执行程序生成:编译,汇编,链接,加载 David Patterson,Andrew Waterman, The RISC-V Reader: An Open Architecture Atlas,2017
Architecture (ISA)&Interfaces (1D Application API Applications Programs 2 Libraries Libraries 3 ③ Software System Calls Operating System ABI. ④ 5 6 Operating Drivers Memory Scheduler Manager System 8 (8H 8 (8D ISA Execution Hardware ISA- (9 System ISA Memory User ISA 10 10 System Interconnect Translation (bus) T 12 Hardware Hardware Controllers Controllers 13 14 1/O devices and Main Networking Memory API-application programming i 图1-3 interface ppucat⊙ns software ■ ABI-application binary interface-HLL<->LLL 马 ISA-instruction set architecture (p14) Hardware -Architecture:formal specification of a system's interface and the logical behavior of its visible resources
Architecture(ISA)& Interfaces ◼ API – application programming interface ◼ ABI – application binary interface——HLL<->LLL ◼ ISA – instruction set architecture(p14) – Architecture: formal specification of a system’s interface and the logical behavior of its visible resources. 图1-3
Instruction-Set Processor Design Architecture (ISA)programmer/compiler view -"functional appearance to its immediate user/system Application >"hello Software world!" programmer" Operating -Opcodes,addressing modes,architected registers Systems IEEE floating point Architecture -机器语言 Micro- architecture Implementation (JArch)processor designer view -"logical structure or organization that performs the architecture" Digital Circuits o -functional units,pipelining,caches,physical registers Analog Circuits Realization (chip)chip/system designer view Devices -"physical structure that embodies the implementation' -Gates,cells,transistors,wires Physics
Instruction-Set Processor Design • Architecture (ISA) programmer/compiler view – “functional appearance to its immediate user/system programmer” – Opcodes, addressing modes, architected registers, IEEE floating point – 机器语言 • Implementation (µArch) processor designer view – “logical structure or organization that performs the architecture” – functional units, pipelining, caches, physical registers • Realization (chip) chip/system designer view – “physical structure that embodies the implementation” – Gates, cells, transistors, wires
体系结构的8种属性 ,数据表示 -硬件能直接辨识和操作的数据类型和格式 寻址方式 一最小可寻址单位、寻址方式的种类、地址运算 寄存器组织 操作寄存器、变址寄存器、控制寄存器及专用寄存器的定义、数量和使用 规则 ·指令系统 -机器指令的操作类型、格式、指令间排序和控制机构 存储系统 -最小编址单位、编址方式、主存容量、最大可编址空间 输入输出 输入输出的连接方式、处理机山存储器与输入输出设备间的数据交换方式、 数据交换过程的控制 ● 中断机构 中断类型、中断级别,以及中断响应方式等 ·信息保护 一信息保护方式、硬件信息保护机制
体系结构的8种属性 • 数据表示 – 硬件能直接辨识和操作的数据类型和格式 • 寻址方式 – 最小可寻址单位、寻址方式的种类、地址运算 • 寄存器组织 – 操作寄存器、变址寄存器、控制寄存器及专用寄存器的定义、数量和使用 规则 • 指令系统 – 机器指令的操作类型、格式、指令间排序和控制机构 • 存储系统 – 最小编址单位、编址方式、主存容量、最大可编址空间 • 输入输出 – 输入输出的连接方式、处理机/存储器与输入输出设备间的数据交换方式、 数据交换过程的控制 • 中断机构 – 中断类型、中断级别,以及中断响应方式等 • 信息保护 – 信息保护方式、硬件信息保护机制