Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Lecture 21
Processor Cache
Memory - I/O Bus Main Memory I/O Controller I/O Controller Graphics I/O Controller
Disk
Disk
Network
Lecture 21
Bus Hierarchy
Lecture 21
Lecture 21
Systems lines
32 time multiplexed lines for address and data Interrupt & validate lines
Interface Control
Arbitration
Error lines
Lecture 21
Interrupt lines
Not shared
Additional 32 lines
Time multiplexed
2 lines to enable devices to agree to use 64-bit transfer
JTAG/Boundary Scan
Lecture 21
PCI Commands
Transaction between initiator (master) and target Master claims bus Determine type of transaction
Lecture 21
Lecture 21
Lecture 21
Multiple devices may need to use the bus at the same time so must have a way to arbitrate multiple requests
Bus arbitration schemes usually try to balance:
Bus priority the highest priority device should be serviced first Fairness even the lowest priority device should never be completely locked out from the bus
Distributed arbitration by collision detection device uses the bus when its not busy and if a collision happens (because some other device also decides to use the bus) then the device tries again later (Ethernet)
Comp. Arch. Fall 2006
Lecture 21
wired-OR
Data/Addr
Cannot assure fairness a low-priority device may be locked out indefinitely Slower the daisy chain grant signal limits the bus speed
Comp. Arch. Fall 2006
Lecture 21
Request1 Ack2
Request2
RequestN
AckN Data/Addr
Advantages: flexible, can assure fairness Disadvantages: more complicated arbiter hardware Used in essentially all processor-memory buses and in high-speed I/O buses
Comp. Arch. Fall 2006
Lecture 21
Lecture 21
Lecture 21
Lecture 21
Lecture 21
Whether its is synchronous or asynchronous and the timing characteristics of the protocol used The data bus width Whether the bus supports block transfers or only word at a time transfers Firewire USB 2.0
Type
Data lines Clocking Max length Peak bandwidth
Lecture 21
I/O
4 Asynchronous 4.5 meters 50 MB/s (400 Mbps)
I/O
2 Synchronous 127 5 meters
Max # devices 63
0.2 MB/s (low) 100 MB/s (800 Mbps) 1.5 MB/s (full) 60 MB/s (high)
Comp. Arch. Fall 2006
USB
Lecture 21
USB (contd)
Lecture 21
USB (contd)
Power distribution
- Simple devices can be bus-powered
Examples: mouse, keyboards, floppy disk drives, wireless LANs, coffee warmers, reading lights, MP3 players, Control peripherals
- Possible because USB allows data to flow in both directions
Lecture 21
USB (contd)
USB encoding
Lecture 21
USB (contd)
NRZI encoding
Still a problem
- Long strings of 1s do not causes signal change
Lecture 21
USB (contd)
Bit stuffing
Lecture 21
USB (contd)
Transfer
types
Interrupt transfer
- Uses polling
Isochronous transfer
- Used in real-time applications that require constant data transfer rate
Lecture 21
USB (contd)
Control transfer
- Used to configure and set up USB devices - Three phases
Setup stage Conveys type of request made to target device Data stage Optional stage Control transfers that require data use this stage Status stage Checks the status of the operation
- Allocates a guaranteed bandwidth of 10% - Error detection and recovery are used
Lecture 21
USB (contd)
Bulk transfer
- For devices with no specific data transfer rate requirements
Lecture 21
USB (contd)
USB architecture
Root hub
- Provides connection points
Defined by Intel
- Universal host controller (UHC)
Lecture 21
USB (contd)
UHC scheduling
Lecture 21
USB (contd)
Lecture 21
USB (contd)
OHC scheduling
Different from UHC scheduling Reserves space for non-periodic transfers first
- Non-periodic transfers: control and bulk - 10% bandwidth reserved
Lecture 21
USB (contd)
Low-power
- Less than 100 mA - Can be bus-powered
High-powered
- Between 100 mA and 500 mA
Configured (500 mA) Unconfigured (100 mA) Suspended ( about 2.5 mA)
Lecture 21
USB (contd)
USB hubs
Bus-powered
- No extra power supply required - Must be connected to an upstream port that can supply 500 mA - Downstream ports can only supply 100 mA
Self-powered
- Support 4 high-powered devices - Support 4 bus-powered USB hubs
Lecture 21
USB (contd)
Upstream port
Downstream ports
Lecture 21
USB (contd)
USB transactions
Except for isochronous transfers, others use error detection for guaranteed delivery Provides feedback on whether data has been received without error
Lecture 21
USB (contd)
USB IRP frame
Lecture 21
USB (contd)
USB (contd)
Lecture 21
USB (contd)
USB 2.0
Competitive with
- SCSI - IEEE 1394 (FireWire)
Current standard
Lecture 21
IEEE 1394
Lecture 21
Advantages
High speed
- Supports three speeds
100, 200, 400 Mbps Competes with USB 2.0 Plans to boost it to 3.2 Gbps Hot attachment
- Like USB - No need to shut down power to attach devices
Peer-to-peer support
- USB is processor-centric - Supports peer-to-peer communication without involving the processor
Lecture 21
Expandable bus
- Devices can be connected in daisy-chain fashion - Hubs can used to expand
Power distribution
- Like the USB, cables distribute power
Much higher power than USB Voltage between 8 and 33 V Current an be up to 1.5 Amps Error detection and recovery
- As in USB, uses CRC - Uses retransmission in case of error
Long cables
- Like the USB
Lecture 21
Buses in Transition
Companies are transitioning from synchronous, parallel, wide buses to asynchronous narrow buses
Reflection on wires and clock skew makes it difficult to use 16 to 64 parallel wires running at a high clock rate (e.g., ~400 MHz) so companies are transitioning to buses with a few oneway wires running at a very high clock rate (~2 GHz)
PCI Total # wires # data wires Clock (MHz) 120 32 64 (2-way) 33 133
Serial ATA cables (red) are much thinner than parallel ATA cables (green)
Lecture 21
Memory-mapped I/O
- Portions of the high-order memory address space are assigned to each I/O device
- Read and writes to those memory addresses are interpreted as commands to the I/O devices
- Load/stores to the I/O address space can only be done by the OS
Polling the processor periodically checks the status of an I/O device to determine its need for service
- Processor is totally in control but does all the work - Can waste a lot of processor time due to speed differences
Lecture 21
Interrupt-driven I/O the I/O device issues an interrupts to the processor to indicate that it needs attention
Comp. Arch. Fall 2006
Interrupt-Driven Input
Processor
1. input interrupt
user program
2.3 service interrupt lbu sb ... jr memory input interrupt service routine
Lecture 21
Interrupt-Driven Output
Processor
1.output interrupt
user program
2.3 service interrupt lbu sb ... jr memory output interrupt service routine
Lecture 21
Interrupt-Driven I/O
Is not associated with any instruction so doesnt prevent any instruction from completing
- You can pick your own convenient point to handle the interrupt
Lecture 21
For high-bandwidth devices (like disks) interrupt-driven I/O would consume a lot of processor cycles
DMA the I/O controller has the ability to transfer data directly to/from the memory without involving the processor
1.
The processor initiates the DMA transfer by supplying the I/O device address, the operation to be performed, the memory address destination/source, the number of bytes to transfer The I/O DMA controller manages the entire transfer (possibly thousand of bytes in length), arbitrating for the bus
2.
3.
When the DMA transfer is complete, the I/O controller interrupts the processor to let it know that the transfer is complete
Processor and I/O controllers contend for bus cycles and for memory
Comp. Arch. Fall 2006
Lecture 21
In systems with caches, there can be two copies of a data item, one in the cache and one in the main memory
For a DMA read (from disk to memory) the processor will be using stale data if that location is also in the cache For a DMA write (from memory to disk) and a write-back cache the I/O device will receive stale data if the data is in the cache and has not yet been written back to the memory Routing all I/O activity through the cache expensive and a large negative performance impact Having the OS selectively invalidate the cache for an I/O read or force write-backs for an I/O write (flushing) Providing hardware to selectively invalidate or flush the cache need a hardware snooper (details in Lecture 25)
Comp. Arch. Fall 2006
2.
3.
Lecture 21
The operating system acts as the interface between the I/O hardware and the program requesting I/O
To protect the shared I/O resources, the user program is not allowed to communicate directly with the I/O device
Thus OS must be able to give commands to I/O devices, handle interrupts generated by I/O devices, provide equitable access to the shared I/O resources, and schedule I/O requests to enhance system throughput
I/O interrupts result in a transfer of processor control to the supervisor (OS) process
Lecture 21