CPU Intro
CPU Intro
Description
Pipelining
Pipelining is an implementation technique whereby multiple instructions are overlapped in execution.
In this lab, we provide a three-stage pipelined CPU (Fig. 1 and Fig. 2) which is based on RISC
instruction set. Every instruction can be implemented at most 3 clock cycles. The 3 clock cycles are as
follows and the example figure is shown in Fig. 2.
i IF ID EXE
i+1 IF ID EXE
i+2 IF ID EXE
i+3 IF ID EXE
Instruction
In this simple 3-stage pipelined CPU, we use a RISC (reduced instruction set computer) architecture
to illustrate the basic concepts, although nearly all the ideas we introduce in this lab are applicable to
other processors. The instruction format is as follows.
R-type format:
I-type format:
Module
The simple 3-stage pipelined CPU consists of Controller, Register file and ALU. The description of
these blocks is as follows.
Controller:
Receive input instruction and according to the different instructions to output the corresponding
control signals. (RegWrite, RegDst, ALUSrc, and ALUOp are generated control signals)
Register file:
Input the address of registers, which we want to use, to Read addr1 and Read addr2, then the
Read data1 and Read data2 will output the corresponding address of register data. Likewise,
Write addr is the address of register we want to write the data into register file.
ALU:
Depend on the control signal from Controller to do the corresponding operation.
R-type 000000 1 1 0 10
ADDI 001000 1 0 1 00
SET 000001 1 0 1 00
10 000000 NOP
10 100000 ADD
10 100010 SUB
10 100100 AND
10 100101 OR
10 101000 XOR
10 101010 SLT
10 000011 SLL
10 000010 SRL