95
The MIPS Processor Datapath

The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

  • Upload
    others

  • View
    9

  • Download
    4

Embed Size (px)

Citation preview

Page 1: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

The MIPS Processor Datapath

Page 2: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Module Outline

● MIPS datapath implementation– Register File, Instruction memory, Data memory

● Instruction interpretation and execution. ● Combinational control● Assignment: Datapath design and Control Unit

design using SystemC.

Page 3: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Logic Design Fundamentals

● Information encoded in binary– Low voltage = 0, High voltage = 1

– One wire per bit

– Multi-bit data encoded on multi-wire buses

Page 4: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Logic Design Fundamentals

● Information encoded in binary– Low voltage = 0, High voltage = 1

– One wire per bit

– Multi-bit data encoded on multi-wire buses

● Combinational element–

● State (sequential) elements–

Page 5: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Logic Design Fundamentals

● Information encoded in binary– Low voltage = 0, High voltage = 1

– One wire per bit

– Multi-bit data encoded on multi-wire buses

● Combinational element– Operate on data

– Output is a function of input

● State (sequential) elements–

Page 6: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Logic Design Fundamentals

● Information encoded in binary– Low voltage = 0, High voltage = 1

– One wire per bit

– Multi-bit data encoded on multi-wire buses

● Combinational element– Operate on data

– Output is a function of input

● State (sequential) elements– Store information

Page 7: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Combinational Elements

● AND-gate– Y = A & B

AB

Y

I0I1

YMux

S

Multiplexer Y = S ? I1 : I0

A

B

Y+

A

B

YALU

F

Adder Y = A + B

Arithmetic/Logic Unit Y = F(A, B)

Page 8: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Sequential Elements● Register: stores data in a circuit

– Uses a clock signal to determine when to update the stored value

– Edge-triggered: update when Clk changes from 0 to 1

Page 9: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Sequential Elements● Register: stores data in a circuit

– Uses a clock signal to determine when to update the stored value

– Edge-triggered: update when Clk changes from 0 to 1

D

Clk

Q

Clk

D

Q

Page 10: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Sequential Elements● Register with write control

– Only updates on clock edge when write control input is 1

– Used when stored value is required later

Page 11: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Sequential Elements● Register with write control

– Only updates on clock edge when write control input is 1

– Used when stored value is required later

D

Clk

Q

Write

Write

D

Q

Clk

Page 12: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Clocking Methodology● Combinational logic transforms data during

clock cycles–

Page 13: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Clocking Methodology● Combinational logic transforms data during

clock cycles– Between clock edges– Input from state elements, output to state element–

Page 14: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Clocking Methodology● Combinational logic transforms data during

clock cycles– Between clock edges– Input from state elements, output to state element–

Page 15: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Clocking Methodology● Combinational logic transforms data during

clock cycles– Between clock edges– Input from state elements, output to state element– Longest delay determines clock period

Page 16: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Building a Datapath

● Datapath–

Page 17: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Building a Datapath

● Datapath– Elements that process data and addresses

in the CPU●

Page 18: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Building a Datapath

● Datapath– Elements that process data and addresses

in the CPU● Registers, ALUs, muxes, memories, …

Page 19: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Building a Datapath

● Datapath– Elements that process data and addresses

in the CPU● Registers, ALUs, muxes, memories, …

● We will build a MIPS datapath incrementally

Page 20: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

A Basic MIPS Implementation

● Memory-reference instructions – Load Word (lw) and Store Word (sw)

● ALU instructions – add, sub, AND, OR and slt● Branch on equal (beq)

Page 21: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Instruction Execution – Steps

Page 22: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Instruction Execution – Steps

● Instruction Fetch

Page 23: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Instruction Execution – Steps

● Instruction Fetch● Instruction Decode/Register Fetch

Page 24: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Instruction Execution – Steps

● Instruction Fetch● Instruction Decode/Register Fetch● Execute

– ALU

– Effective Address Calculation

Page 25: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Instruction Execution – Steps

● Instruction Fetch● Instruction Decode/Register Fetch● Execute

– ALU

– Effective Address Calculation

● Memory Access

Page 26: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Instruction Execution – Steps

● Instruction Fetch● Instruction Decode/Register Fetch● Execute

– ALU

– Effective Address Calculation

● Memory Access● Write back (Update RF)

Page 27: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Instruction Fetch – Actions

Page 28: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Instruction Fetch – Actions

● Read Program Counter

Page 29: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Instruction Fetch – Actions

● Read Program Counter● Fetch instruction from Instruction memory

pointed to by the PC

Page 30: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Instruction Fetch – Actions

● Read Program Counter● Fetch instruction from Instruction memory

pointed to by the PC● Increment PC

Page 31: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Instruction Fetch – Elements

Page 32: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Instruction Fetch – Elements

Page 33: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Instruction Fetch

Page 34: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

ALU Instructions – Operations

ADD R1, R2, R3

Page 35: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

ALU Instructions – Operations

● Read R2 and R3 from Register file– Send 2 and 3 to RF

– RF reads contents of R2 and R3

ADD R1, R2, R3

Page 36: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

ALU Instructions – Operations

● Read R2 and R3 from Register file– Send 2 and 3 to RF

– RF reads contents of R2 and R3

● Add contents of R2 and R3 in the ALU

ADD R1, R2, R3

Page 37: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

ALU Instructions – Operations

● Read R2 and R3 from Register file– Send 2 and 3 to RF

– RF reads contents of R2 and R3

● Add contents of R2 and R3 in the ALU● Feed the sum output to the RF; Ask it to write

into R1

ADD R1, R2, R3

Page 38: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

ALU Operations – Elements

ADD R1, R2, R3

Page 39: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

ALU Operations – Elements

ADD R1, R2, R3

REGISTERFILE

REGISTERFILE

Addr

Data

Data

Write

Page 40: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

ALU Operations – Elements

ADD R1, R2, R3

Page 41: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

ALU Operations – Elements

ADD R1, R2, R3

Page 42: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

ALU Operations – Datapath

ADD R1, R2, R3

Page 43: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

ALU Operations – Datapath

ADDI R1, R2, -13

● How will the design change for ADDI?

Page 44: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

ALU Operations – Datapath

ADDI R1, R2, -13

Page 45: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Loads and Stores – Actions

LW R1, -8(R2)

Page 46: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Loads and Stores – Actions

● Calculate full address– Sum of -8 (offset) and contents of R2 (base)

– Size of offset? Size of contents of R2?

LW R1, -8(R2)

Page 47: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Loads and Stores – Actions

● Calculate full address– Sum of -8 (offset) and contents of R2 (base)

– Size of offset? Size of contents of R2?

● Send the address to Data memory

LW R1, -8(R2)

Page 48: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Loads and Stores – Actions

● Calculate full address– Sum of -8 (offset) and contents of R2 (base)

– Size of offset? Size of contents of R2?

● Send the address to Data memory● DM reads out the contents of Mem[R2+(-8)]

LW R1, -8(R2)

Page 49: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Loads and Stores – Actions

● Calculate full address– Sum of -8 (offset) and contents of R2 (base)

– Size of offset? Size of contents of R2?

● Send the address to Data memory● DM reads out the contents of Mem[R2+(-8)]● Feed the value from memory to the RF; Ask it

to write the value into R1

LW R1, -8(R2)

Page 50: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Loads and Stores – Elements

LW R1, -8(R2)

Page 51: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Memory and R-type Instructions

Page 52: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Memory Instruction – Load

LW R1, -8(R2)

Page 53: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Memory Instruction – Load

LW R1, -8(R2)

Page 54: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Memory Instruction – Load

LW R1, -8(R2)

Page 55: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Memory Instruction – Load

LW R1, -8(R2)

Page 56: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Memory Instruction – Load

LW R1, -8(R2)

ADD

Page 57: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Memory Instruction – Load

LW R1, -8(R2)

ADD

Page 58: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Memory Instruction – Load

LW R1, -8(R2)

ADD

Page 59: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Memory Instruction – Load

Control Signals: RegWrite=1; ALUSrc=1; ALUoperation=ADD;MemRead=1;MemWrite=0; MemToReg=1;

Control Signals: RegWrite=1; ALUSrc=1; ALUoperation=ADD;MemRead=1;MemWrite=0; MemToReg=1;

Page 60: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Memory Instruction – Store

SW R1, -8(R2)

Page 61: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Memory Instruction – Store

SW R1, -8(R2)

ADD

Page 62: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Memory Instruction – Store

Control Signals: Control Signals:

Page 63: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Memory Instruction – Store

Control Signals: RegWrite=0; ALUSrc=1; ALUoperation=ADD;MemRead=0;MemWrite=1; MemToReg=X;

Control Signals: RegWrite=0; ALUSrc=1; ALUoperation=ADD;MemRead=0;MemWrite=1; MemToReg=X;

Page 64: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

R Type Instruction – ADD

ADD R1, R2, R3

Page 65: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

R Type Instruction – ADD

ADD R1, R2, R3

Page 66: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

R Type Instruction – ADD

Control Signals: Control Signals:

Page 67: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

R Type Instruction – ADD

Control Signals: RegWrite=1; ALUSrc=0; ALUoperation=ADD;MemRead=X;MemWrite=X; MemToReg=0;

Control Signals: RegWrite=1; ALUSrc=0; ALUoperation=ADD;MemRead=X;MemWrite=X; MemToReg=0;

Page 68: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

I Type Instruction – ADDI

ADDI R1, R2, 13

Page 69: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

I Type Instruction – ADDI

ADDI R1, R2, 13

Page 70: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

I Type Instruction – ADDI

Control Signals: Control Signals:

Page 71: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

I Type Instruction – ADDI

Control Signals: RegWrite=1; ALUSrc=1; ALUoperation=ADD;MemRead=X;MemWrite=X; MemToReg=0;

Control Signals: RegWrite=1; ALUSrc=1; ALUoperation=ADD;MemRead=X;MemWrite=X; MemToReg=0;

Page 72: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

BEQ – Actions

BEQ R1, R2, -16

Page 73: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

BEQ – Actions

● Read R1 and R2 from Register file– Send 1 and 2 to RF

– RF reads contents of R1 and R2

BEQ R1, R2, -16

Page 74: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

BEQ – Actions

● Read R1 and R2 from Register file– Send 1 and 2 to RF

– RF reads contents of R1 and R2

● Send to ALU; Ask it to Subtract

BEQ R1, R2, -16

Page 75: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

BEQ – Actions

● Read R1 and R2 from Register file– Send 1 and 2 to RF

– RF reads contents of R1 and R2

● Send to ALU; Ask it to Subtract● Read out Zero flag from ALU

BEQ R1, R2, -16

Page 76: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

BEQ – Actions

● Read R1 and R2 from Register file– Send 1 and 2 to RF

– RF reads contents of R1 and R2

● Send to ALU; Ask it to Subtract● Read out Zero flag from ALU● If Z flag == 0; then PC = (PC + 4) – 16

BEQ R1, R2, -16

Page 77: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

BEQ – Actions

● Read R1 and R2 from Register file– Send 1 and 2 to RF

– RF reads contents of R1 and R2

● Send to ALU; Ask it to Subtract● Read out Zero flag from ALU● If Z flag == 0; then PC = (PC + 4) – 16 ● Else if Z flag == 1; then PC = PC + 4

BEQ R1, R2, -16

Page 78: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Branches – Elements

BEQ R1, R2, LABEL BEQ R1, R2, -16

Page 79: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Branches – Elements

BEQ R1, R2, LABEL BEQ R1, R2, -16

Page 80: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

The MIPS Datapath

Page 81: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

The MIPS Datapath – BEQ

BEQ R1, R2, -16

Page 82: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

The MIPS Datapath – BEQ

BEQ R1, R2, -16

Page 83: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

The MIPS Datapath – BEQ

BEQ R1, R2, -16

Page 84: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

The MIPS Datapath – BEQ

BEQ R1, R2, -16

Page 85: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

The MIPS Datapath – BEQ

BEQ R1, R2, -16

Page 86: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

The MIPS Datapath – BEQ

BEQ R1, R2, -16

Page 87: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

The MIPS Datapath – BEQ

BEQ R1, R2, -16

Page 88: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

The MIPS Datapath – BEQ

BEQ R1, R2, -16 Control Signals : Control Signals :

Page 89: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

The MIPS Datapath – BEQ

BEQ R1, R2, -16

Control Signals : RegWrite=0; ALUSrc=0; ALUoperation=SUB;MemRead=X;MemWrite=X; MemToReg=X;PCSrc=Condition

Control Signals : RegWrite=0; ALUSrc=0; ALUoperation=SUB;MemRead=X;MemWrite=X; MemToReg=X;PCSrc=Condition

Page 90: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

MIPS Datapath and Control Lines

Page 91: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Module Outline

● MIPS datapath implementation– Register File, Instruction memory, Data memory

● Instruction interpretation and execution. ● Combinational control● Assignment: Datapath design and Control Unit

design using SystemC.

Page 92: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

Backup

Page 93: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

ALU Instructions

● ALU instructions (R type), Memory Transfer (effective address calculation), Branches (BEQ)

● R-type

● I-type

6 bits 5 bits 5 bits 5 bits 6 bits5 bits

op rs rt rd shamt funct

6 bits 5 bits 5 bits 16 bits

op rs rt immediate

op: Opcode (class of instruction). Eg. ALUfunct: Which subunit of the ALU to activate?

OP rt, rs, IMM

OP rd, rs, rt

Page 94: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

ALU Instructions

● ALU instructions (R type), Memory Transfer (effective address calculation), Branches (BEQ)

● Identified by Opcode fields and Funct fields

Page 95: The MIPS Processor Datapath - Basavaraj Talawar · MIPS datapath implementation – Register File, Instruction memory, Data memory Instruction interpretation and execution. Combinational

ALU Instructions

● ALU instructions (R type), Memory Transfer (effective address calculation), Branches (BEQ)

● R-type

● I-type

6 bits 5 bits 5 bits 5 bits 6 bits5 bits

op rs rt rd shamt funct

6 bits 5 bits 5 bits 16 bits

op rs rt immediate

op: Opcode (class of instruction). Eg. ALUfunct: Which subunit of the ALU to activate?

OP rt, rs, IMM

OP rd, rs, rt