Accessing I/O Devices: Generic Model of IO Module
Accessing I/O Devices: Generic Model of IO Module
Accessing I/O Devices: Generic Model of IO Module
Lecture plan
http://csetube.co.nr/
ht
tp
://
cs
et
ub
e.c
o.
nr
Code & name of subject: 141403 computer organization and architecture Unit no: 5
Lecture plan
CPU has direct control over I/O Sensing status Read/write commands Transferring data CPU waits for I/O module to complete operation Wastes CPU time 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 Under programmed I/O data transfer is very like memory access (CPU viewpoint) Each device given unique identifier
http://csetube.co.nr/
ht
Programmed I/O
tp
://
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 CPU
cs
et
ub
e.c
o.
nr
Code & name of subject: 141403 computer organization and architecture Unit no: 5 By the use of standard ICs known as IO interfacing circuits. -->the simplest interface circuits is a one-word, addressable register that Serves as an I/o port. most basic IO interface circuits are programmable circuits intended to Act as serial or parallel ports .serial ports accommodate many types of slow peripheral Devices ranging from secondary memory units to network connections.
Lecture plan
I/O Mapping
Memory mapped I/O Devices and memory share an address space I/O looks just like memory read/write No special commands for I/O Large selection of memory access commands available Isolated I/O Separate address spaces Need I/O or memory select lines Special commands for I/O
http://csetube.co.nr/
ht
tp
://
cs
et
Interrupt driven and programmed I/O require active CPU intervention (All data must pass through CPU) Transfer rate is limited by processor's ability to service the device CPU is tied up managing I/O transfer Additional Module (hardware) on bus DMA controller takes over bus from CPU for I/O Waiting for a time when the processor doesn't need bus Cycle stealing seizing bus from CPU
ub
e.c
o.
nr
Code & name of subject: 141403 computer organization and architecture Unit no: 5
Lecture plan
When there is an interrupt, continuation of the execution of the current program is meaningless. Execution of the Current program needs to be stopped In a computer system, there are many sources of interrupts Needs to prepare interrupt processing routines for each source of interrupts Source of interrupt needs to be identified Needs to initiate execution of the interrupt processing routine associated with the identified interrupt
When the interrupt is resolved, the interrupted program needs to be continued for the efficiency reason Needs to resume execution of the interrupted program.
http://csetube.co.nr/
ht
tp
://
Interrupts are a commonly used technique for computer multitasking, especially in real-time computing. Such a system is said to be interrupt-driven.
cs
et
ub
A hardware interrupt causes the processor to save its state of execution and begin execution of an interrupt handler. Software interrupts are usually implemented as instructions in the instruction set, which cause a context switch to an interrupt handler similar to a hardware interrupt.
e.c
o.
nr
An interrupt is an asynchronous signal indicating the need for attention or a synchronous event in software indicating the need for a change in execution.
Code & name of subject: 141403 computer organization and architecture Unit no: 5 Vectored interrupts In a computer, a vectored interrupt is an I/O interrupt that tells the part of the computer that handles I/O interrupts at the hardware level that a request for attention from an I/O device has been received and and also identifies the device that sent the request. A vectored interrupt is an alternative to a polled interrupt , which requires that the interrupt handler poll or send a signal to each device in turn in order to find out which one sent the interrupt request. PCI interrupts Devices are required to follow a protocol so that the interrupt lines can be shared. The PCI bus includes four interrupt lines, all of which are available to each device. However, they are not wired in parallel as are the other PCI bus lines. PCI bridges (between two PCI buses) map the four interrupt traces on each of their sides in varying ways.The result is that it can be impossible to determine how a PCI device's interrupts will appear to software. PCI interrupt lines are level-triggered. This was chosen over edge-triggering in order to gain an advantage when servicing a shared interrupt line, and for robustness: edge triggered interrupts are easy to miss. PCI Express does not have physical interrupt lines at all. It uses message-signaled interrupts exclusively. pipeline interrupt Interrupt: Hardware signal to switch processor to new instruction stream.
Lecture plan
When interrupt occurs, state of interrupted process is saved, including PC, registers, and memory
Interrupt is precise if the following three conditions hold: All instructions preceding u have been executed, and have modified the state correctly
All instructions following u are unexecuted, and have not modified the state If the interrupt was caused by an instruction, it was caused by instruction u, which is either completely executed (e.g.: overflow) or completely unexecuted (e.g: VM page fault).
http://csetube.co.nr/
ht
tp
://
cs
et
ub
e.c
o.
nr
Code & name of subject: 141403 computer organization and architecture Unit no: 5 Precise interrupts are desirable if software is to fix up error that caused interrupt and execution has to be resumed Easy for external interrupts, could be complex and costly for internal Imperative for some interrupts (VM page faults, IEEE FP standard)
Lecture plan
Special control circuit required in the I/O device interface, called a DMA controller DMA controller keeps track of memory locations, transfers directly to memory (via the bus) independent of the processor Single Bus, Detached DMA controller Each transfer uses bus twice I/O to DMA then DMA to memory CPU is suspended twice
Single Bus, DMA controller integrated into I/O module Controller may support one or more devices Each transfer uses bus once DMA to memory CPU is suspended once
http://csetube.co.nr/
ht
Transfer large amounts of data at high speed without continuous intervention by the processor
tp
://
cs
et
ub
e.c
o.
nr
Code & name of subject: 141403 computer organization and architecture Unit no: 5
Lecture plan
A bus is a subsystem that transfers data between components inside a computer, or between computers. Multiple devices communicating over a single set of wires Only one device can talk at a time or the message is garbled Each line or wire of a bus can at any one time contain a single binary digit. Over time, however, a sequence of binary digits may be transferred These lines may and often do send information in parallel A computer system may contain a number of different buses
Buses:
http://csetube.co.nr/
ht
Part of the I/O device interface DMA Channels Performs functions that would normally be carried out by the processor Provides memory address Bus signals that control transfer Keeps track of number of transfers
tp
://
cs
et
ub
e.c
DMA Controller
o.
nr
Code & name of subject: 141403 computer organization and architecture Unit no: 5
Lecture plan
Bus Interconnection A bus is a communication pathway connecting two or more device. A key characteristic of a bus is that it is a shared transmission medium. A bus consists of multiple pathways or lines. Each line is capable of transmitting signal representing binary digit (1 or 0 A sequence of bits can be transmit across a single line. Several lines can be used to transmit bits simultaneously (in parallel). A bus that connects major components (CPU,Memory,I/O) is called System Bus. The most common computer interconnection structures are based on the use of one or more system buses.
Asynchronous occurrence of one event follows and depends on the previous event
Bus arbitration Centralized bus controller (Arbiter), hardware device,is responsible for allocating time on the bus (daisy chain)
http://csetube.co.nr/
ht
tp
://
Bus interfacing Synchronous occurrence of events on the bus is determined by a clock (Clock Cycle or Bus Cycle) which includes line upon
cs
et
ub
e.c
o.
nr
Code & name of subject: 141403 computer organization and architecture Unit no: 5
Lecture plan
Distributed access control logic in each module act together to share bus
Provides a storage buffer for at least one word of data. Contains status flag that can be accessed by the processor. Contains address-decoding circuitry Generates the appropriate timing signals required by the bus control scheme. Performs format conversions Ports Serial port Parallel port
http://csetube.co.nr/
ht
tp
://
cs
et
INTERFACE CIRCUITS
ub
e.c
o.
nr
Code & name of subject: 141403 computer organization and architecture Unit no: 5
Lecture plan
http://csetube.co.nr/
ht
tp
://
cs
et
ub
e.c
o.
nr
Code & name of subject: 141403 computer organization and architecture Unit no: 5
Lecture plan
PCI stands for Peripheral Component Interconnect Introduced in 1992 It is a Low-cost bus It is Processor independent It has Plug-and-play capability
http://csetube.co.nr/
ht
Arbitration Address phase Address phase timing Data phases Ending transactions
tp
://
cs
et
ub
e.c
o.
nr
Code & name of subject: 141403 computer organization and architecture Unit no: 5
Lecture plan
http://csetube.co.nr/
ht
tp
://
cs
50, 68 or 80 pins
et
ub
e.c
o.
nr
SCSI Bus
Code & name of subject: 141403 computer organization and architecture Unit no: 5
Lecture plan
Speed
http://csetube.co.nr/
ht
High-speed(480 Mb/s)
tp
://
Full-speed(12 Mb/s)
cs
et
Low-speed(1.5 Mb/s)
ub
e.c
o.
nr
Code & name of subject: 141403 computer organization and architecture Unit no: 5
Lecture plan
USB (Universal Serial Bus) is a specification to establish communication between devices and a host controller (usually personal computers). USB is intended to replace many varieties of serial and parallel ports. USB can connect computer peripherals such as mice, keyboards, digital cameras, printers, personal media players, flash drives, and external hard drives. For many of those devices, USB has become the standard connection method. USB was designed for personal computers[citation needed], but it has become commonplace on other devices such as smartphones, PDAs and video game consoles, and as a power cord between a device and an AC adapter plugged into a wall plug for charging. As of 2008, there are about 2 billion USB devices sold per year, and approximately 6 billion total sold to date.
http://csetube.co.nr/
ht
tp
://
cs
et
ub
Structure
e.c
o.
nr