Chapter 12 CPU Structure and Function
来源:互联网 发布:护眼宝pc版 知乎 编辑:程序博客网 时间:2024/06/05 04:36
- It is unlikely that the more stages in the pipeline, the faster the execution rate:
- At each stage, there are some overhead involved in moving data from buffer to buffer and in performing various preparation and delivery function.
- The more stages, the more complex control logic circuits.
- Processer organization
- Steps: need ALU, CU, registers
- Fetch instructions
- Interpret instructions
- Fetch data
- Process data
- Write data
- Register organization
- The registers in the CPU serve two functions:
- User-visible registers
- Programmer can use these registers to reduce accessing main memory
- Categories:
- General purpose
- True general purpose
- Restricted
- Used for data or addressing
- Data
- Accumulator
- Address
- Segment pointers, index registers, stack pointers
- Condition codes
- Bits set by CPU hardware as the result of the last operations
- COAPZS
- positive, negative, zero, overflow ...
- Can be read implicitly by programs
- Usually cannot be set by programs
- Partially visible to programmers
- Design issues:
- Make them general purpose
- Pro: Increasing flexibility and programmer options
- Cons: Increasing instruction size and complexity
- Make them specialized
- Pros: Smaller instructions
- Cons: Less flexibility
- Control and status registers
- Used by CU and privileged program(OS) to control the execution of users' program
- Four sorts for instruction execution
- PC
- IR
- MAR: connected to address bus
- MBR: connected to data bus
- Instruction cycle
- Indirect addressing cycle
- May require memory access to fetch operands
- Indirect addressing requires more memory accesses
- Data flow(Instruction fetch)
- Fetch:
- PC contains address of next instruction
- Address moved to MAR
- Address placed on address bus
- Control unit requests memory read
- Result placed on data bus, copied to MBR, then to IR
- Meanwhile PC incremented by "1"
- Data flow(Indirect fetch)
- If indirect addressing is perfromed, indirect cycle is performed
- Right most N bits of MBR transferred to MAR
- Control unit requests memory read
- Result (address of operand) moved to MBR
- MBR→IR
- Data flow(Execute)
- Depends on how instruction being executed
- May include
- Memory read/write
- Input/Output
- Register transfer
- ALU operations
- Data flow(Interrupt)
- Current PC saved to allow resumption after interrupt
- Content of PC copied into MBR
- Special memory location loaded into MAR
- PC loaded with address of interrupt handling routine
- Instruction pipelining ----> improve performance
- Pre-fetch: can fetch next instruction during decoding and execution of current instruction
- An instruction has a number of stages: nearly equal duration
- Fetch instruction
- Decode instruction
- Calculate operands address
- Fetch operands
- Execute instructions
- Write operands
- Specifications
- Assuming that there is no conflicts and dependencies
- If are not of equal duration, short stages must wait
- Condition branch and interrupt will reduce the performance of pipeline
- Pipeline performance
- Dealing with branches
- Multiple Streams
- Have two pipelines
- Pre-fetch each branch into a separate pipeline
- Limits
- Leads to bus & register contention
- Multiple branches lead to further pipelines being needed
- Pre-fetch Branch Target
- Target of branch is pre-fetched in addtion to instructions following branch
- Keep target until branch is executed
- Loop buffer
- A small, very fast memory containing n most recently fetched in sequence instructions
- If a branch is to be taken, the hardware first checks buffer before fetching from memory
- Good for small loops
- Branch prediction
- Predict never taken: always fetch next instruction
- Predict always taken: always fetch target instruction
- Predict by Opcode: can get up to 75% success
- Taken/Not taken switch: based on previous history
- Branch history table/Branch target buffer
- Delayed branching
- Insert NULL operations
- Rearrange instructions
- Out-of-order execution
0 0
- Chapter 12 CPU Structure and Function
- !!!Chapter 12 Advanced Data Structure and Implementation
- Chapter 09–Storage Structure and Relationships
- TI DSP Function Structure and Calling Conventions
- Chapter 4– Functions and Program Structure of TCPL (Part 10)
- Chapter 4– Functions and Program Structure of TCPL (Part 11)
- Chapter 11: Using Menu-Based Controls--Defining menu structure and data
- Chapter 11: Using Menu-Based Controls Defining menu structure and data
- Objective-C’s Roots: Difference Between messaging structure and function calling; and the Runtime
- C++Primer-Function chapter
- Chapter 6 CPU Scheduling
- Structure of a Function Group
- Chapter 3 A top-level view of computer function and interconnection
- chapter 12 Data Files and Persistence
- Chapter 2-3 Operating-System Structure
- algorithm and data structure
- Storage Structure and Relationships
- algorithm and data structure
- LintCode 170-旋转链表
- 2016这一年
- springboot 使用hibernate进行双向关联json解析时死循环处理
- spring mvc 重定向后还能传递对象数据的方法
- Unity 关于手柄摇杆和键值的测试
- Chapter 12 CPU Structure and Function
- vmware复制虚拟机出现Error:No suitable device found:no device found for connection 'System eth0'
- Chapter 13 Reduced Instruction Set Computer
- pat-a1051. Pop Sequence (25)
- Chapter 14 Instruction level parallelism and superscalar processors
- 问题描述 已知一个正整数N,问从1~N中任选出三个数,他们的最小公倍数最大可以为多少。 输入格式 输入一个正整数N。 输出格式 输出一个整数,表示你找到的最小公倍数。 样例输入 9 样例输出 5
- Chapter 16 Control Unit Operation
- TFS 测试用例步骤数据统计
- Java反射机制