Computer Architecture –Department of Information Systems @ Hoá NGUYEN 4Computer Architecture – Department of Information Systems @ NGUYỄN Ngọc Hoá 4... Computer Architecture –Department
Trang 2Computer Architecture –Department of Information Systems @ Hoá NGUYEN 2
Computer Architecture – Department of Information Systems @ NGUYỄN Ngọc Hoá 2
Interrupt driven I/O
Direct Memory Access – DMA
Kênh vào/ra & CPU
4 Interfacing
Trang 31 Quản lý vào/ra (I/O)
Khối lượng khác nhau
Tốc độ khác nhau
Định dạng khác nhau
nhiều so với CPU và MM
Trang 4Computer Architecture –Department of Information Systems @ Hoá NGUYEN 4
Computer Architecture – Department of Information Systems @ NGUYỄN Ngọc Hoá 4
Trang 52 Chức năng của I/O Module
Trang 6Computer Architecture –Department of Information Systems @ Hoá NGUYEN 6
Computer Architecture – Department of Information Systems @ NGUYỄN Ngọc Hoá 6
Quy trình hoạt động mô đun I/O
đun I/O
4 Mô đun I/O lấy dữ liệu từ thiết bị
như DMA, etc.
Trang 7Sơ đố khối I/O
Trang 8Computer Architecture –Department of Information Systems @ Hoá NGUYEN 8
Computer Architecture – Department of Information Systems @ NGUYỄN Ngọc Hoá 8
3 Kỹ thuật kiểm soát vào/ra
Trang 9i Programmed I/O
tiếp các thiết bị ngoại vi
Phát hiện thay đổi (sensing
status)
Gửi các lệnh read/write
Truyền dữ liệu
tác lãng phí tài nguyên
Các bước thực hiện
CPU requests I/O operation
I/O module performs operation
I/O module sets status bits
CPU checks status bits periodically
I/O module does not inform CPU directly
I/O module does not interrupt CPU
CPU may wait or come back later
Trang 10Computer Architecture –Department of Information Systems @ Hoá NGUYEN 10
Computer Architecture – Department of Information Systems @ NGUYỄN Ngọc Hoá 10
I/O Commands
Xác định bộ vào/ra (& thiết bị nếu >1 mỗi bộ)
Control : yêu cầu module thực hiện thao tác
Ví dụ: quay đĩa, di chuyển đầu từ, …
Test – kiểm tra trạng thái thiết bị
Ví dụ: đã được cung cấp nguồn? Có lỗi hay không?
Read/Write
Module truyền dữ liệu sử dụng buffer từ/đến thiết bị
Trang 11Đánh địa chỉ với các thiết bị I/O
việc truy cập bộ nhớ chính (CPU viewpoint)
I/O được ánh xạ vào MM: các thiết bị có địa chỉ nằm trong không
gian địa chỉ của MM
Các thao tác với I/O tương tự như đọc/ghi bộ nhớ,
Không cần lệnh đặc biệt
I/O độc lập so với MM: các thiết bị có địa chỉ độc lập so với không
gian địa chỉ MM
Cần cơ chế liên kết riêng cho I/O
Cần có lệnh riêng thao tác với I/O
Trang 12Computer Architecture –Department of Information Systems @ Hoá NGUYEN 12
Computer Architecture – Department of Information Systems @ NGUYỄN Ngọc Hoá 12
Minh hoạ
Trang 13ii Interrupt Driven I/O
Các bước thực hiện
whilst CPU does other work
Trang 14Computer Architecture –Department of Information Systems @ Hoá NGUYEN 14
Computer Architecture – Department of Information Systems @ NGUYỄN Ngọc Hoá 14
Sơ đồ xử lý ngắt
Trang 15Thay đổi trong MM và Registers khi
xử lý ngắt
Trang 16Computer Architecture –Department of Information Systems @ Hoá NGUYEN 16
Computer Architecture – Department of Information Systems @ NGUYỄN Ngọc Hoá 16
Vấn đề cần quan tâm
Trang 17Xác định module ngắt
ngắt mỗi khi CPU nhận được yêu cầu ngắt
được truyền lần lượt các thiết bị cho đến khi đến được thiết bị yêu cầu
Trang 18Computer Architecture –Department of Information Systems @ Hoá NGUYEN 18
Computer Architecture – Department of Information Systems @ NGUYỄN Ngọc Hoá 18
Đa ngắt
(priority), đường ngắt có độ ưu tiên cao hơn có thể ngắt
Trang 19iii Direct Memory Access
thiệp” của CPU
Tốc độ truyền giữa các thiết bị sẽ bị giới hạn
CPU có thể bị quá tải
điểm nêu trên khi truyền khối lượng dữ liệu lớn
Sử dụng thêm module (hardware) DMA Controller
DMA controller giữ vai trò điều phối vào/ra
Trang 20Computer Architecture –Department of Information Systems @ Hoá NGUYEN 20
Computer Architecture – Department of Information Systems @ NGUYỄN Ngọc Hoá 20
Sơ đồ bộ DMA điển hình
Trang 21Quy trình hoạt động
Read/Write
Device address
Starting address of memory block for data
Amount of data to be transferred
Trang 22Computer Architecture –Department of Information Systems @ Hoá NGUYEN 22
Computer Architecture – Department of Information Systems @ NGUYỄN Ngọc Hoá 22
DMA truyền với kỹ thuật Cycle Stealing
data bus để truyền dữ liệu (one word/cycle)
Trang 23Cấu hình DMA
Trang 24Computer Architecture –Department of Information Systems @ Hoá NGUYEN 24
Computer Architecture – Department of Information Systems @ NGUYỄN Ngọc Hoá 24
Ví dụ: Intel 8237A DMA Controller
Trang 25iv I/O Channels
VD: Card đồ hoạ (GPU), …
truyền dữ liệu
Trang 26Computer Architecture –Department of Information Systems @ Hoá NGUYEN 26
Computer Architecture – Department of Information Systems @ NGUYỄN Ngọc Hoá 26
Kiến trúc kênh vào/ra
Trang 28Computer Architecture –Department of Information Systems @ Hoá NGUYEN 28
Computer Architecture – Department of Information Systems @ NGUYỄN Ngọc Hoá 28
Trang 29FireWire Configuration
Really 64 of which one is the interface itself
Trang 30Computer Architecture –Department of Information Systems @ Hoá NGUYEN 30
Computer Architecture – Department of Information Systems @ NGUYỄN Ngọc Hoá 30
Simple FireWire Configuration
Trang 31FireWire 3 Layer Stack
Trang 32Computer Architecture –Department of Information Systems @ Hoá NGUYEN 32
Computer Architecture – Department of Information Systems @ NGUYỄN Ngọc Hoá 32
FireWire Subactions
Trang 33Kết luận
giới bên ngoài
I/O và DMA
chuẩn: Firewire 1394, USB, …