Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 3

BÀI TẬP KIẾN TRÚC MÁY TÍNH

Họ tên: Nguyễn Đức Anh Tiệp

Lớp : ĐT8-K52

SHSV : 20072908

Ex. 47. Pipelining and Bypass. In this question we will explore how bypassing affects
program execution performance. To begin consider the standard MIPS 5 stage pipeline.
For your reference, refer to the figure below. For this question, we will use the following
code to evaluate the pipeline’s performance:

1 add $t2, $s1, $sp

2 lw $t1, $t1, 0

3 addi $t2, $t1, 7

4 add $t1, $s2, $sp

5 lw $t1, $t1, 0

6 addi $t1, $t1, 9

7 sub $t1, $t1, $t2

e) Identify whether the value for each register operand is coming from the bypass or
from the register file for the modified pipeline. For clarity, please write REG or BYPASS
in each box.

f) How long does the program take to execute on the modified pipeline?

Bài làm
1
Ta có minh họa cấu trúc pipeline MIPS 5 giai đoạn

Theo phần d , giả sử dây nối từ MEM quay ngược lại EX bị bỏ đi nên số chu kì dừng lại
sau khi thực hiện lệnh load phải là 2 chu kì thì mới không xảy ra xung đột dữ liệu

Hoạt động của pipeline:

Minh họa các lệnh từ 1 -> 4

Minh họa các lệnh từ 4 -> 7

2
e. Xác định giá trị mỗi toán hạng thanh ghi được lấy từ sự chuyển tiếp dữ liệu hay từ
thanh ghi để pipeline thay đổi

f. Thời gian thực hiện chương trình

 Giả sử mỗi giai đoạn thực hiện trong 1 chu kì

 Lệnh 1 cần 5 chu kì, các lệnh sau mỗi lệnh cần thêm 1 chu kì để thực hiện

 Sau khi thực hiện lệnh Load cần phải dừng 2 chu kì để tránh xảy ra xung đột

 Tổng thời gian thực hiện chương trình

5+1+2+1+1+1+2+1+1 = 15 (chu kì)

You might also like