William Stallings �Computer Organization �and Architecture�10th Edition
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
+
Chapter 14
Processor Structure and Function
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
+
Processor Organization
Processor Requirements:
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
+
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Register Organization
User-Visible Registers
Control and Status Registers
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
+
User-Visible Registers
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Referenced by means of the machine language that the processor executes
Categories:
Table 14.1�Condition Codes
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Control and Status Registers
Four registers are essential to instruction execution:
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
+
Program Status Word (PSW)
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Register or set of registers that contain status information
Common fields or flags include:
+
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Instruction Cycle
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Includes the following stages:
Fetch
Read the next instruction from memory into the processor
Execute
Interpret the opcode and perform the indicated operation
Interrupt
If interrupts are enabled and an interrupt has occurred, save the current process state and service the interrupt
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Pipelining Strategy
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Similar to the use of an assembly line in a manufacturing plant
New inputs are accepted at one end before previously accepted inputs appear as outputs at the other end
To apply this concept to instruction execution we must recognize that an instruction has a number of stages
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Additional Stages
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
+
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Pipeline Hazards
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Occur when the pipeline, or some portion of the pipeline, must stall because conditions do not permit continued execution
Also referred to as a pipeline bubble
There are three types of hazards:
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Types of Data Hazard
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
+
Control Hazard
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
+
Multiple Streams
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
A simple pipeline suffers a penalty for a branch instruction because it must choose one of two instructions to fetch next and may make the wrong choice
A brute-force approach is to replicate the initial portions of the pipeline and allow the pipeline to fetch both instructions, making use of two streams
Drawbacks:
Prefetch Branch Target
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
+
Loop Buffer
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
+
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Branch Prediction
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
+
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Intel 80486 Pipelining
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Write back
Updates registers and status flags modified during the preceding execute stage
Execute
Stage includes ALU operations, cache access, and register update
Decode stage 2
Expands each opcode into control signals for the ALU
Also controls the computation of the more complex addressing modes
Decode stage 1
All opcode and addressing-mode information is decoded in the D1 stage
3 bytes of instruction are passed to the D1 stage from the prefetch buffers
D1 decoder can then direct the D2 stage to capture the rest of the instruction
Fetch
Objective is to fill the prefetch buffers with new data as soon as the old data have been consumed by the instruction decoder
Operates independently of the other stages to keep the prefetch buffers full
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Table 14.2
x86
Processor
Registers
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Interrupt Processing
Interrupts and Exceptions
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
+
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Unshaded: exceptions
Shaded: interrupts
Table 14.3
x86 Exception and Interrupt Vector Table
The ARM Processor
ARM is primarily a RISC system with the following attributes:
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
+
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Processor Modes
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
ARM architecture supports seven execution modes
Most application programs execute in user mode
Remaining six execution modes are referred to as privileged modes
Advantages to defining so many different privileged modes
Exception Modes
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Have full access to system resources and can change modes freely
Entered when specific exceptions occur
Exception modes:
System mode:
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Table 14.4
ARM
Interrupt
Vector
Summary
Chapter 14
Processor Structure and Function
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
+