1. Trang chủ
  2. » Công Nghệ Thông Tin

CPU (Bài giảng Kiến trúc máy tính)

61 52 0

Đ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

Kiến trúc máy tính CPU NGUYỄN Ngọc Hố Bộ mơn Hệ thống thông tin, Khoa CNTT Trường Đại học Công nghệ, Đại học Quốc gia Hà Nội December 2015 Hoa.Nguyen@vnu.edu.vn Tổ chức chức CPU  Cấu trúc CPU  Pipeline  CISC & RISC  Superscalar, VLIW Tham khảo chương 12, 13 [1] Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá Cấu trúc CPU  CPU đảm nhiệm      Tải lệnh Dịch lệnh Tải liệu Xử lý liệu Lưu liệu  Đơn vị tính tốn (ALU, FPU)  Đơn vị điều khiển  Registers (data, address, instruction, control)  Internal bus Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá Registers  Bộ nhớ CPU   registers sử dụng chương trình (user visible regs) registers điều khiển thể trạng thái    sử dụng CPU sử dụng OS Chú ý      Ít ghi  tham chiếu MM nhiều Quá nhiều registers không làm giảm nhiều tham chiếu MM, giảm hiệu CPU Đủ rộng để chứa trường địa Đủ rộng để chứa từ nhớ Có thể ghép nhiều registers tạo word lớn Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá User Visible Registers    Đa dụng - General Purpose Dữ liệu - Data Địa - Address: thường sử dụng mode đánh địa     Segment based address (e.g., pentium) index pointer to memory stack Cờ nhớ - Condition codes (flags) :   dãy bits độc lập với chương trình khơng thể thay đổi giá trị, đọc Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá Control & Status Registers Trao đổi liệu với nhớ      Program Counter (PC) : địa lệnh thi hành Instruction Decoding Register (IR) : lệnh thi hành Memory Address Register (MAR) : địa nhớ, kết nối trực tiếp tới bus địa Memory Buffer Register (MBR) : từ liệu, kết nối trực tiếp đến bus liệu Những registers trung gian Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá Program Status Word  Tập bits thể trạng thái phép tính vừa thực CPU - Condition Codes         Sign of last result Zero Carry Equal Overflow Interrupt enable/disable Supervisor Supervisor/Kernel mode   Cho phép thi hành lệnh đặc quyền (system calls) Được sử dụng hệ điều hành người sử dụng/programers không cấp phép sử dụng chế độ Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hố Ví dụ tổ chức ghi Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá Thi hành chương trình Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá Luồng liệu – data flow  Tải lệnh: (phụ thuộc vào thiết kế CPU)      Copy nội dung PC vào MAR  xác lập địa MM bus địa CU gửi yêu cầu đọc MM Kết có bus liệu  copy vào MBR  copy đến IR PC tăng thêm (von Neuman) Data fetch: IR phân tích, tuỳ thuộc vào kiểu đánh địa để tiến hành tải toán hạng   Địa trực tiếp: tải giống tải lệnh (chu trình trực tiếp) Địa gián tiếp: (chu trình gián tiếp)    N bits phải MBR chuyển đến MAR CU yêu cầu đọc MM Kết chuyển đến MBR Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá 10 Tác động phụ thuộc liệu Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá 47 Hướng thiết kế  Song song hoá mức lệnh     Chuỗi lệnh xem độc lập Q trình thi hành bị xếp chồng Được quản trị thông qua kỹ thuật kiểm soát phụ thuộc liệu hàm (procedural dependency) Song song hố mức máy   Có khả mang lại lợi điểm so với mức lệnh Được quản trị tập pipelines song song Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá 48 Thi hành kiểu superscalar Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá 49 Cài đặt superscalar   Tải nhiều lệnh đồng thời Sử dụng cổng logic để xác định phụ thuộc giá trị ghi  Cần chế để trao đổi (communicate) giá trị  Cần chế để khởi tạo đa lệnh song song  Cần tài nguyên cho thi hành song song nhiều lệnh  Cần chế xác định trạng thái tiến trình (process state) thứ tự Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hố NGUYỄN NGUYEN Ngọc Hố 50 Ví dụ với Pentium   80486 - CISC Pentium – some superscalar components    Two separate integer execution units Pentium Pro – Full blown superscalar Subsequent models refine & enhance superscalar design Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá 51 Pentium Block Diagram Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá 52 Pentium Operation    Fetch instructions form memory in order of static program Translate instruction into one or more fixed length RISC instructions (micro-operations) Execute micro-ops on superscalar pipeline     micro-ops may be executed out of order Commit results of micro-ops to register set in original program flow order Outer CISC shell with inner RISC core Inner RISC core pipeline at least 20 stages  Some micro-ops require multiple execution stages   Longer pipeline c.f five stage pipeline on x86 up to Pentium Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá 53 Pentium Pipeline Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá 54 Pentium Pipeline Operation (1) Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá 55 Pentium Pipeline Operation (2) Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá 56 Pentium Pipeline Operation (3) Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá 57 Pentium Pipeline Operation (4) Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá 58 Pentium Pipeline Operation (5) Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá 59 Pentium Pipeline Operation (6) Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá 60 Tổng kết  Cần nắm rõ cấu trúc chức CPU  Kỹ thuật thực lệnh gối đầu pipeline  Phân biệt kiến trúc kiểu CISC & RISC Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá 61 ...Tổ chức chức CPU  Cấu trúc CPU  Pipeline  CISC & RISC  Superscalar, VLIW Tham khảo chương 12, 13 [1] Computer Architecture... Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá Cấu trúc CPU  CPU đảm nhiệm      Tải lệnh Dịch lệnh Tải liệu Xử lý liệu Lưu liệu  Đơn vị tính tốn... đại trà Đa phần CPU thương mại sử dụng hai Computer Architecture – –Department Department of ofInformation Information Systems Systems @ @Hoá NGUYỄN NGUYEN Ngọc Hoá 39 So sánh kiến trúc Computer

Ngày đăng: 26/10/2021, 08:51

Xem thêm:

TỪ KHÓA LIÊN QUAN

w