Computer Architecture Lecture Notes Input - Output
Computer Architecture Lecture Notes Input - Output
Input / Output
Input/Output Problems
• There is a wide variety of peripherals
- Delivering different types of data
- At different speeds
- In different formats
• All input and output devices are slower than CPU and RAM
• The Input/output devices need I/O modules to
- Interface to CPU and Memory
- Interface to one or more peripherals
External Devices
• Human readable
- Screen, printer, keyboard
• Machine readable
- Monitoring and control
• Communication
- Modem
- Network Interface Card (NIC)
External Device Block Diagram
Prepared and Compiled by Mr. Edwin Omondi Page 1
Computer Architecture Lecture Notes – Input/ Output
iii.Device Communication
iv.Data Buffering
v. Error Detection
I/O Steps
• CPU checks I/O module device status
• I/O module returns status
• If ready, CPU requests data transfer
• I/O module gets data from device
• I/O module transfers data to/from CPU
• Variations for transfer mechanisms
• Programmed
• Interrupt driven
• Direct Memory Access (DMA)
Programmed I/O
• CPU has direct control over I/O
- Sensing status (polling)
- Read/write commands
- Transferring data
• CPU waits for I/O module to complete operation
• Wastes CPU time
I/O Commands
• CPU issues address which identifies module (& device if >1 per module)
• CPU issues command which performs the following:-
- Control - telling module what to do e.g. to spin up disk
- Test - check status e.g. power? Error?
- Read/Write - Module transfers data via buffer from/to device
CPU Viewpoint
• Issue read command
• Do other work
• Check for interrupt at end of each instruction cycle
• If interrupted:-
- Save context (registers)
- Process interrupt i.e. Fetch data & store
- Resume interrupted process
-
Design Issues
• How do you identify the module issuing the interrupt?
• How do you deal with multiple interrupts i.e. an interrupt handler being interrupted
Multiple Interrupts
• Each interrupt line has a priority
• Higher priority lines can interrupt lower priority lines
• If bus mastering only current master can interrupt
• Interrupt masking
DMA Function
• Additional Module (hardware) on bus
• DMA controller takes over I/O data transfer from CPU
DMA Operation
• CPU tells DMA controller:-
- Read/Write
- Device address
- Starting address of memory block for data
- Amount of data to be transferred
• CPU carries on with other work
• DMA controller deals with transfer
• DMA controller sends interrupt when finished
I/O Channels
• I/O devices getting more sophisticated e.g. 3D graphics cards
• CPU instructs I/O controller to do transfer
• I/O controller does entire transfer
• Improves speed because:-
- It takes load off CPU
- A dedicated processor is faster
Interfacing
• Connecting devices to I/O modules
• Tailored to peripheral
• Interface types
- Serial interface
- Parallel interface e.g. FireWire, InfiniBand
FireWire Configuration
• Daisy chain where up to 63 devices on single port
• Really 64 of which one is the interface itself
• Up to 1022 buses can be connected with bridges
• Automatic configuration
• No bus terminators
• May be tree structure
• Transaction
- Request-response protocol
FireWire Sub-actions
InfiniBand
• I/O specification aimed at high end servers
- Merger of Future I/O (Cisco, HP, Compaq, IBM) and Next Generation I/O (Intel)
• Version 1 released early 2001
• Architecture and spec. for data flow between processor and intelligent I/O devices
• Intended to replace PCI in servers
• Increased capacity, expandability, flexibility
InfiniBand Architecture
• Remote storage, networking and connection between servers
• Attach servers, remote storage, network devices to central fabric of switches and links
• Greater server density
• Scalable data centre
• Independent nodes added as required
Prepared and Compiled by Mr. Edwin Omondi Page 18
Computer Architecture Lecture Notes – Input/ Output
InfiniBand Operation
• 16 logical channels (virtual lanes) per physical link
• One lane for management, rest for data
• Data in stream of packets
• Virtual lane dedicated temporarily to end to end transfer
• Switch maps traffic from incoming to outgoing lane