DMA, Introduction to Caches
Tom Kelliher, CS26
Nov. 12, 1996
- We'll skip 4.5.2--4.7.
DMA.
How does a disk perform a transfer?
CPU driven method:
- Prepare memory buffer, pointer into buffer, and count.
- Send disk a command through I/O registers:
- Cylinder, head, sector.
- Read or write.
- Go.
- Do other things.
- Repeat:
- Receive interrupt.
- Transfer byte between disk and memory.
- Update pointer, count.
One possible speed-up: block transfers.
How efficient is this? Assume:
- Disk:
- 3600 RPM.
- 512 bytes/sector.
- 56 sectors/track.
- How many bytes/sec.?
- CPU:
- 100 MHz.
- 200 instructions/interrupt.
- The problem here?
- DMA removes the burden.
- DMA controller is a bus master --- arbitration required.
DMA architecture (2 channels)
DMA channel interface:
Is it memory mapped?
- Write starting address, count registers.
- Write control register.
- Interrupt will be received upon completion.
Is the order important?
Schematic operation:
- CPU reserves an area of memory as a buffer for the I/O (assume a read
is performed).
- CPU loads the starting address of the buffer into the DMA controller
- CPU loads the transfer count into the DMA controller (assume that
it's same as the buffer size).
- Concurrently:
- CPU goes on to another task (block requesting process).
- I/O device starts transfer, writes data directly to memory.
Memory arbitration problems here.
- I/O device interrupts CPU upon completion.
- CPU receives interrupt, checks status, schedules formerly blocked
process.
- Only one device --- bus master --- can control bus.
- CPU and DMA controller are bus masters.
- How is control passed back and forth?
Centralized arbitration:
Operation. Assume CPU is bus master at start:
- DMA n asserts bus request.
- CPU accepts request, asserts BG.
- BG daisy chains until reaching requesting controller.
- Controller releases bus request, waits for bus busy to go away.
- Controller asserts bus busy and begins using bus.
- Controller releases bus busy when done.
De-centralized arbitration?
- Addressing conventions for 32-bit memory:
- CPU/memory behavior on word/byte accesses. Consider writing a single
byte.
- Memory organization:
- Memory access is a bottleneck to CPU operation. Speed-ups:
- Caches.
- Interleaving. Pipelined access to multiple memory banks.
Example:
- 200 ns. RAM.
- 50 ns. CPU cycle.
- No interleaving vs. 4-way interleaved.
organization:
- No address bit sharing.
- Memory cell organization:
How many transistors?
- Reading, Writing?
A static RAM:
- Row, Column share address lines --- must strobe and latch.
- Memory cell organization:
How many transistors?
- Reading, Writing?
- Refresh. Stalls.
A dynamic RAM:
- Fast page mode DRAMS.
- EDO DRAMS.
- Faster?
- Denser?
Why?
Caches use static.
Main memory uses dynamic.
Design techniques:
- Modular.
- Scalable.
- Reducing number of drawn transistors.
Uses DRAMS in chip array.
- Registers --- flip-flops.
- L1 cache --- on-chip SRAM.
- L2 cache --- off-chip SRAM.
- Main memory --- DRAM.
- Secondary storage --- magnetic disk.
Size, speed, cost? Management?
Thomas P. Kelliher
Mon Nov 11 15:28:37 EST 1996
Tom Kelliher