Bài giảng Kiến trúc máy tính: Bộ nhớ và các thiết bị lưu trữ - Nguyễn Ngọc Hoá

Nội dung

 Khái niệm

 Bộ nhớ chính

 Bộ nhớ cache

 Bộ nhớ ngoài (các thiết bị lưu trữ)

1. Khái niệm

 Bộ nhớ: thiết bị có thể bảo quản và khôi phục một thông tin

 Từ nhớ: tập bits có thể được đọc hay ghi đồng thời

pdf86 trang | Chia sẻ: phuongt97 | Lượt xem: 399 | Lượt tải: 1download
Bạn đang xem trước 20 trang nội dung tài liệu Bài giảng Kiến trúc máy tính: Bộ nhớ và các thiết bị lưu trữ - Nguyễn Ngọc Hoá, để xem tài liệu hoàn chỉnh bạn click vào nút DOWNLOAD ở trên
nh tranh cache (cache contention) trong chu trình tải/giải mã lệnh và chu trình thi hành (nâng cao hiệu năng pipeline) Computer Architecture –Department of Information Systems @ Hoá NGUYEN 63 Hiệu năng  Thời gian truy cập trung bình = Thời gian truy cập thành công + tỷ lệ thất bại x penality thất bại  Thời gian truy cập = Thời gian truy cập một dữ liệu trong cache  Tỷ lệ thất bại = số lần dữ liệu cần đọc không chứa trong cache /số lần truy cập cache Computer Architecture –Department of Information Systems @ Hoá NGUYEN 64 Pentium Cache  80386 – no on chip cache  80486 – 8k using 16 byte lines and four way set associative organization  Pentium (all versions) – two on chip L1 caches  Data & instructions  Pentium III – L3 cache added off chip  Pentium 4  L1 caches  8k bytes  64 byte lines  four way set associative  L2 cache  Feeding both L1 caches  256k  128 byte lines  8 way set associative  L3 cache on chip Computer Architecture –Department of Information Systems @ Hoá NGUYEN 65 Problem Solution Processor on which feature first appears External memory slower than the system bus. Add external cache using faster memory technology. 386 Increased processor speed results in external bus becoming a bottleneck for cache access. Move external cache on-chip, operating at the same speed as the processor. 486 Internal cache is rather small, due to limited space on chip Add external L2 cache using faster technology than main memory 486 Contention occurs when both the Instruction Prefetcher and the Execution Unit simultane- ously require access to the cache. In that case, the Prefetcher is stalled while the Execution Unit’s data access takes place. Create separate data and instruction caches. Pentium Increased processor speed results in external bus becoming a bottleneck for L2 cache access. Create separate back-side bus that runs at higher speed than the main (front-side) external bus. The BSB is dedicated to the L2 cache. Pentium Pro Move L2 cache on to the processor chip. Pentium II Some applications deal with massive databases and must have rapid access to large amounts of data. The on-chip caches are too small. Add external L3 cache. Pentium III Move L3 cache on-chip. Pentium 4 Pentium Cache Computer Architecture –Department of Information Systems @ Hoá NGUYEN 66 Pentium 4 Block Diagram Computer Architecture –Department of Information Systems @ Hoá NGUYEN 67 PowerPC Cache  601 – single 32kb 8 way set associative  603 – 16kb (2 x 8kb) two way set associative  604 – 32kb  620 – 64kb  G3 & G4  64kb L1 cache  8 way set associative  256k, 512k or 1M L2 cache  two way set associative  G5  32kB instruction cache  64kB data cache Computer Architecture –Department of Information Systems @ Hoá NGUYEN 68 PowerPC G5 Block Diagram Computer Architecture –Department of Information Systems @ Hoá NGUYEN 69 ARM Cache Core Cache Type Cache Size (kB) Cache Line Size (words) Associativity Location Write Buffer Size (words) ARM720T Unified 8 4 4-way Logical 8 ARM920T Split 16/16 D/I 8 64-way Logical 16 ARM926EJ-S Split 4-128/4-128 D/I 8 4-way Logical 16 ARM1022E Split 16/16 D/I 8 64-way Logical 16 ARM1026EJ-S Split 4-128/4-128 D/I 8 4-way Logical 8 Intel StrongARM Split 16/16 D/I 4 32-way Logical 32 Intel Xscale Split 32/32 D/I 8 32-way Logical 32 ARM1136-JF-S Split 4-64/4-64 D/I 8 4-way Physical 32 Computer Architecture –Department of Information Systems @ Hoá NGUYEN 70 Tổ chức ARM Cache  Small FIFO write buffer  Enhances memory write performance  Between cache and main memory  Small c.f. cache  Data put in write buffer at processor clock speed  Processor continues execution  External write in parallel until empty  If buffer full, processor stalls  Data in write buffer not available until written  So keep buffer small Computer Architecture –Department of Information Systems @ Hoá NGUYEN 71 Tổ chức ARM Cache Computer Architecture –Department of Information Systems @ Hoá NGUYEN 72 4. Bộ nhớ ngoài  RAM for storage  Flash  Đĩa từ - Magnetic Disk  HDD  RAID  Removable  Đĩa quang - Optical  CD-ROM  CD-Recordable (CD-R)  CD-R/W  DVD  Băng từ - Magnetic Tape Computer Architecture –Department of Information Systems @ Hoá NGUYEN 73 Magnetic Disks Computer Architecture –Department of Information Systems @ Hoá NGUYEN 74 Magnetic Disks  Ưu điểm: rẻ($/MB), độ tin cậy chấp nhận được  Primary storage, memory swapping  Nhược: chỉ có thể đọc/ghi toàn bộ một sector   không thể truy cập trực tiếp như bộ nhớ chính  Thời gian truy cập đĩa  Queuing delay  Wait until disk gets to do this operation  Seek time  Head moves to correct track  Rotational latency  Correct sector must get under the head  Data transfer time and controller time Computer Architecture –Department of Information Systems @ Hoá NGUYEN 75 Khuynh hướng của đĩa từ  Dung lượng: ~gấp đôi sau mỗi năm  Thời gian truy cập trung bình  5-12ms (việc cải thiện tốc độ tương đối chậm)  Latency quay trung bình (1/2 full rotation)  5,000 RPM to 10,000 RPM to 15,000 RPM  Cải thiện chậm, phức tạp (reliability, noise)  Tốc độ truyền dữ liệu  Phục thuộc vào bề mặt đĩa, dữ liệu trên một track Computer Architecture –Department of Information Systems @ Hoá NGUYEN 76 Đĩa quang  Giới hạn bởi các chuẩn  CD and DVD capacity fixed over years  Technology actually improves, but it takes time for it to make it into new standards  Kích thước bé, dễ thay thế  Good for backups and carrying around Computer Architecture –Department of Information Systems @ Hoá NGUYEN 77 Băng từ  Thời gian truy cập rất chậm  Must rewind tape to correct place for read/write  Chi phí thấp ($/MB)  It’s just miles of tape!  But disks have caught up anyway  Được sử dụng để sao lưu dữ liệu (secondary storage)  Large capacity & Replaceable Computer Architecture –Department of Information Systems @ Hoá NGUYEN 78 RAM for Storage  Disks are about 100 times cheaper ($/MB)  DRAM is about 100,000 faster (latency)  Solid-State Disks  Actually, a DRAM and a battery  Much faster than disk, more reliable  Expensive (not very good for archives and such)  Flash memory  Much faster than disks, but slower than DRAM  Very low power consumption  Can be sold in small sizes (few GB, but tiny) Computer Architecture –Department of Information Systems @ Hoá NGUYEN 79 Một số vấn đề lỗi  Phân loại theo nguyên nhân  Hardware Faults  Hardware devices fail to perform as designed  Design Faults  Faults in software and some faults in HW  E.g. the Pentium FDIV bug was a design fault  Operation Faults  Operator and user mistakes  Environmental Faults  Fire, power failure, sabotage, etc. Computer Architecture –Department of Information Systems @ Hoá NGUYEN 80 Khắc phục: cải thiện độ tin cậy  Fault Avoidance  Prevent occurrence of faults by construction  Fault Tolerance  Prevent faults from becoming failures  Typically done through redundancy  Error Removal  Removing latent errors by verification  Error Forecasting  Estimate presence, creation, and consequences of errors Computer Architecture –Department of Information Systems @ Hoá NGUYEN 81 Disk Fault Tolerance with RAID  Redundant Array of Independent/Inexpensive Disks  Several smaller disks play a role of one big disk  Can improve performance  Data spread among multiple disks  Accesses to different disks go in parallel  Can improve reliability  Data can be kept with some redundancy Computer Architecture –Department of Information Systems @ Hoá NGUYEN 82 RAID Tập các đĩa vật lý thành một đĩa logic nhìn bởi hệ điều hành  RAID 0: không dư thừa dữ liệu  Truy cập song song các đĩa  Dữ liệu có thể phân tán trên nhiều đĩa  RAID 1:  Mirrored disks  2 copies được lưu trên 2 đĩa khác nhau  Đọc từ 1 trong 2, ghi đồng thời lên 2  Đắt  RAID 2:  Các đĩa được đồng bộ hoá  Dư thừa nhiều, giá thành cao Computer Architecture –Department of Information Systems @ Hoá NGUYEN 83 RAID  RAID 3  Như RAID 2  Chỉ sử dụng 1 đĩa dư thừa  RAID 4  Mỗi đĩa hoạt động một cách độc lập  Parity được lưu trong một đĩa parity riêng  RAID 5  Như RAID 4  Parity được phân ra trên tất cả các đĩa  RAID 6  Hai lần tính parity  Lưu các block khác nhau trên các đĩa khác nhau Computer Architecture –Department of Information Systems @ Hoá NGUYEN 84 RAID 0, 1, 2 Computer Architecture –Department of Information Systems @ Hoá NGUYEN 85 RAID 3 & 4 Computer Architecture –Department of Information Systems @ Hoá NGUYEN 86 RAID 5 & 6

Các file đính kèm theo tài liệu này:

  • pdfbai_giang_kien_truc_may_tinh_bo_nho_va_cac_thiet_bi_luu_tru.pdf