Lecture 4.4 - The Processor - Pipelining
Lecture 4.4 - The Processor - Pipelining
§ Interrupt
§ An exception that comes from outside of the processor.
§ Some architectures use the term interrupt for all exceptions.
§ The addresses are separated by 32 bytes or eight instructions, and the OS must record
the reason for the exception and may perform some limited processing in this
sequence.
Pipeline with Exceptions
Pipeline with Exceptions
The key additions include a new input
with the value 0000 0000 1C09
0000hex in the multiplexor that
supplies the new PC value; a SCAUSE
register to record the cause of the
exception; and an SEPC register to
save the address of the instruction
that caused the exception.
§ Imprecise Interrupt
§ Interrupts or exceptions in pipelined computers that are not
associated with the exact instruction that was the cause of
the interrupt or exception.
Multiple Issue
§ A scheme where multiple instructions are launched in one clock cycle.
§ Static multiple issue
§ An approach to implementing multiple-issue processor where many
decisions are made by the compiler before execution.
§ Compiler groups instructions to be issued together
§ Packages them into “issue slots” – instructions could be issued in a given CC
§ Compiler detects and avoids hazards
§ Dynamic multiple issue
§ An approach to implementing a multiple-issue processor where many
decisions are made during execution by the processor.
§ CPU examines instruction stream and chooses instructions to issue each cycle
§ Compiler can help by reordering instructions
§ CPU resolves hazards using advanced techniques at runtime
Speculation
§ An approach where the compiler or processor guesses the outcome of
an instruction to remove it as a dependence in executing other
instructions.
§ “Guess” what to do with an instruction
§ Start operation as soon as possible
§ Check whether guess was right
§ If so, complete the operation
§ If not, roll-back and do the right thing
§ Static speculation
§ Can add ISA support for deferring exceptions
§ Dynamic speculation
§ Can buffer exceptions until instruction completion (which may not occur)
Static Multiple Issue
§ Issue Packet:
§ Compiler groups instructions into “issue packets”
§ Set of instructions that
§ Group of instructions that can be issued on a single cycle issues together in one
§ Determined by pipeline resources required clock cycle, the packet
may be determined
statically by the compiler
or dynamically by the
§ Think of an issue packet as a very long instruction processor.
§ Specifies multiple concurrent operations
§ Þ Very Long Instruction Word (VLIW)
§ A style of ISA that launches many operations that are
defined to be independent in a single-wide instruction,
typically with many separate opcode fields.
Scheduling Static Multiple Issue
§ Compiler must remove some/all hazards
§ Reorder instructions into issue packets
§ No dependencies with a packet
§ Possibly some dependencies between packets
§ Varies between ISAs; compiler must know!
§ Pad with nop if necessary
Static Two-Issue Pipeline in Operation Example
§ The ALU and data transfer instructions
are issued at the same time. Here we
have assumed the same five-stage
structure as used for the single-issue
pipeline.
§ Although, this is not strictly necessary, it
does have some advantages. In keeping
the register writes at the end of the
pipeline, it simplifies the handling of
exceptions and the maintenance of a
precise exception model, which become
more difficult in multiple-issue
processors
RISC-V with Static Dual Issue