1. Trang chủ
  2. » Luận Văn - Báo Cáo

báo cáo nhóm KIẾN TRÚC MÁY TÍNH MULTICYCLE MIPS

20 582 1

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 20
Dung lượng 563,17 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Recall: Simple Datapath Instruction memory +4 rt rs rd Registers ALU Data memory imm Data Data Address Controller Opcode, funct Address Instruction... Recall: R-format Dat

Trang 1

04/2012

KIẾN TRÚC MÁY TÍNH

MULTICYCLE MIPS

GV : Nguyễn Đức Minh

SV : Đào Đăng Toàn

Nguyễn Quốc Đạt Nguyễn Đăng Hoàng Vũ

Phạm Hồng Đức Nguyễn Đức Hiếu

Trang 2

Review

• Sự xây dựng Datapath

– Xác định loại lệnh

• R-format

• Rẽ nhánh có điều kiện

• Rẽ nhánh không điều kiện

• Load/store

– Tiến hành xây dựng modul Datapath (RF, ALU,

Memory, SignExt)

– Kết nối các modul

• Datapath đơn xung nhịp

– Tất cả các lệnh thực hiện trong một xung (CPI = 1) – Thời gian một chu kỳ được xác định bằng độ dài đường

dữ liệu dài nhất

– Chu kỳ đồng hồ được đặt theo lệnh chậm nhất (load)

Trang 3

Overview – Multicycle Datapath

• Mỗi lệnh có nhiều stage (tầng)

• Mỗi stage mất nhiều chu kỳ

1 IF

2 ID / RF

3 EXE

4 MEM

5 WB

Mỗi stage có thể sử dụng lại hardware từ stage

trước

Sử dụng hiệu quả hơn của phần cứng và thời

gian

Tất cả các lệnh sử dụng cái này

Trang 4

Recall: Simple Datapath

Instruction

memory

+4

rt

rs

rd

Registers ALU

Data memory

imm

Data

Data

Address

Controller

Opcode, funct

Address

Instruction

Trang 5

Recall: R-format Datapath

• Format: opcode r3, r1, r2

Result

Zero

ALU

Read Data 1

Read Data 2

Read Reg 1 Read Reg 2 Write

Register Write Data

Register Write

ALU op

Register File 3

Instruction

Trang 6

Recall: Load/Store Datapath

Trang 7

Recall: Branch Datapath

Trang 8

Multicycle DP

Instr Fetch Instr Decode/Data Fetch Execute

Trang 9

Multicycle DP

Làm thế nào để xây dựng multicycle datapath (DP)

1 Thay 3 ALUs từ single-cycle DP bằng một ALU

2 Thêm 1 multiplexer chọn đầu vào cho ALU

3 Thêm 1 control line cho đầu vào chọn kênh của ALU

• Đầu vào mới: Constant = 4 [PC + 4]

• Sign-ext., shifted offset [BTA calc.]

4 Thêm các thanh ghi trung gian (buffer)

• MDR: Memory Data Register

• IR: Instruction Register

• A,B: ALU operand registers

• ALUout: ALU output register

Trang 10

Multicycle DP

Trang 11

Multicycle DP: 1-bit Ctl Signals

Trang 12

Multicycle DP: 2-bit Ctl Signals

Trang 13

Making Sense of Multicycle DP

Step 1: Decompose the MC/DP execution sequence into cycles Step 2: Examine which cycles apply to which instructions

One-Cycle Steps R-fmt lw sw beq j

1 Instruction Fetch

2 Instruction Decode / Data Fetch

3 ALU ops / R-format Execution

4 R-format Completion

5 Memory Access Completion

Trang 14

Multicycle DP: R-format

Step 1: Fetch instr // Store in IR // Compute PC + 4

Step 2: Decode instruction: opcode, rd, rs, rt, funct fields

Data fetch: Apply rs, rt to Register File

Data Read into A,B buffer registers (ALUin)

Step 3: ALU operation (ALUsrcA, ALUsrcB, ALUop)

ALU output goes into ALUout register

Step 4: ALUout register contents written to Register File write input

Register number in rd written (Assert: RegWrite,RegDst) CPI for R-format = 4 cycles

Trang 15

Multicycle DP: Store Word (sw)

Step 1: Fetch instr // Store in IR // Compute PC + 4

Step 2: Decode instruction: opcode, rs, rt, offset fields

Data fetch: Apply rt to Register File => Base address

Data Read into A buffer register (Base) SignExt,Shift offset field into B buffer register

Step 3: ALU operation (ALUsrcB, ALUop) => Base + Offset

ALU output goes into ALUout register

Step 4: ALUout register contents applied as Memory Address

Assert: MemWrite [ALUout => RegFile]

CPI for Store = 4 cycles

Trang 16

Multicycle DP: Load Word (lw)

Step 1: Fetch instr // Store in IR // Compute PC + 4

Step 2: Decode instruction: opcode, rd, rt, offset fields

Data fetch: Apply rt to Register File => Base address

Data Read into A buffer register (Base) SignExt,Shift offset field into B buffer register

Step 3: ALU operation (ALUsrcB, ALUop) => Base + Offset

ALU output goes into ALUout register

Step 4: ALUout register contents applied as Memory Address

Assert: MemRead

Step 5: Memory Data Out routed to Register File write input

Register number from rd written to (Assert:

CPI for Load = 5 cycles

Trang 17

Multicycle DP: Cond Branch

Step 1: Fetch instr // Store in IR // Compute PC + 4

Step 2: Decode instruction: opcode, rs, rt, offset fields

Data fetch: Apply rs, rt to Register File

BTA calc: SignExt,Shift offset field into B buffer register

ALU compose PC, offset => BTA

Step 3: ALU operation (ALUsrcA, ALUsrcB, ALUop) = compare

ALU output present at Zero register causes Control

to select BTA or PC+4

CPI for Conditional Branch = 3 cycles

Trang 18

Multicycle DP: Jump

Step 1: Fetch instr // Store in IR // Compute PC + 4

Step 2: Decode instruction: opcode, address fields

JTA calc: SignExt,Shift offset field [Bits 27-0]

Concatenate with PC [Bits 31-28] => JTA

Step 3: PC replaced by the Jump Target Address (JTA)

CPI for Jump = 3 cycles

Trang 19

Conclusions

• MIPS ISA: Three instruction formats (R,I,J)

• One cycle per stage, Different stages per format

• One-Cycle Steps R-fmt lw sw beq j

1 Instruction Fetch

2 Instruction Decode / Data Fetch

3 ALU ops / R-format Execution

4 R-format Completion

5 Memory Access Completion

Challenge: More involved control design

Ngày đăng: 12/04/2015, 14:12

TỪ KHÓA LIÊN QUAN

🧩 Sản phẩm bạn có thể quan tâm

w