Beruflich Dokumente
Kultur Dokumente
cs 152 buses.1
cs 152 buses.2
cs 152 buses.3
Network
Processor
Processor
Input
Input
Control
Control
Memory
Memory
Datapath
cs 152 buses.4
Output
Output
Datapath
Output
cs 152 buses.5
Advantages of Buses
Processor
I/O
Device
I/O
Device
I/O
Device
Memory
Versatility:
New devices can be added easily
Peripherals can be moved between computer
systems that use the same bus standard
Low Cost:
A single set of wires is shared in multiple ways
cs 152 buses.6
Disadvantages of Buses
Processor
I/O
Device
I/O
Device
I/O
Device
Memory
cs 152 buses.7
Control lines:
Signal requests and acknowledgments
Indicate what type of information is on the data lines
Data lines carry information between the source and the destination:
Data and Addresses
Complex commands
A bus transaction includes two parts:
Sending the address
Receiving or sending the data
cs 152 buses.8
Bus
Slave
cs 152 buses.9
Output
Operation
Output is defined as the Processor sending data to the I/O device:
Step 1: Request Memory
Processor
Memory
Control
Processor
Data
Memory
Memory
Input
Operation
Input is defined as the Processor receiving data from the I/O device:
Step 1: Request Memory
Processor
Memory
Processor
I/O Device (Disk)
cs 152 buses.11
Data
(I/O Device Address
and then Data)
Memory
Types of Buses
Processor-Memory Bus (design specific)
Short and high speed
Only need to match the memory system
- Maximize memory-to-processor bandwidth
Connects directly to the processor
I/O Bus (industry standard)
Usually is lengthy and slower
Need to match a wide range of I/O devices
Connects to the processor-memory bus or backplane bus
Backplane Bus (industry standard)
Backplane: an interconnection structure within the chassis
Allow processors, memory, and I/O devices to coexist
Cost advantage: one single bus for all components
cs 152 buses.12
Memory
I/O Devices
cs 152 buses.13
A Two-Bus System
Processor Memory Bus
Processor
Memory
Bus
Adaptor
I/O
Bus
Bus
Adaptor
Bus
Adaptor
I/O
Bus
I/O
Bus
I/O buses tap into the processor-memory bus via bus adaptors:
Processor-memory bus: mainly for processor-memory traffic
I/O buses: provide expansion slots for I/O devices
Apple Macintosh-II
NuBus: Processor, memory, and a few selected I/O devices
SCCI Bus: the rest of the I/O devices
cs 152 buses.14
A Three-Bus System
Processor Memory Bus
Processor
Memory
Bus
Adaptor
Backplane Bus
Bus
Adaptor
Bus
Adaptor
I/O Bus
I/O Bus
Example Architecture:
The SPARCstation 20
SPARCstation 20
Memory SIMMs
Memory
Controller
Memory Bus
MBus
MBu
s
MBu
s
Disk
Slot 1
Slot 0
SBus
Slot 1
SBus
Slot 3
SBus
Slot 0
SBus
Slot 2
SBus
MSBI
cs 152 buses.16
SEC
MACIO
Keyboard
Floppy
& Mouse
Disk
Tape
SCSI
Bus
External Bus
SPARCstation 20
Memory Bus
Memory
Controller
Processor Bus:
MBus
SEC
MACIO
cs 152 buses.17
USB
Universal Serial Bus
Originally developed in 1995 by a consortium including
-
cs 152 buses.18
USB (contd)
Upstream port
Downstream ports
cs 152 buses.19
Asynchronous Bus:
It is not clocked
It can accommodate a wide range of devices
It can be lengthened without worrying about clock skew
It requires a handshaking protocol
cs 152 buses.20
A Handshaking Protocol
ReadReq
Data
Address
2
Data
4
6
5
Ack
DataRdy
cs 152 buses.21
Bus
Slave
cs 152 buses.23
Device N
Lowest
Priority
Device 2
Grant
Grant
Release
Request
Advantage: simple
Disadvantages:
Cannot assure fairness:
A low-priority device may be locked out indefinitely
The use of the daisy chain grant signal also limits the bus speed
cs 152 buses.25
GrantA
Arbiter
Highest priority: ReqA
Lowest Priority: ReqB
GrantB
GrantC
Clk
Clk
ReqA
ReqB
GrA
GrB
cs 152 buses.26
ReqB
ReqC
3-bit D Register
ReqA
G0
P0
cs 152 buses.27
ReqA
Priority
P1
G1
P2
EN
Clk
SetGrA
Clk
SetGrB
ReqB
Clk
G2
SetGrC
ReqC
Clk
J
Q
K
GrantA
J
Q
K
GrantB
J
Q
K
GrantC
Priority
Logic
P0
G0
P1
G1
P2
G2
EN
cs 152 buses.28
JK Flip
Flop
JK Flip Flop can be implemented with a D-Flip Flop
J
J
0
0
0
1
1
1
cs 152 buses.29
K
0
0
1
0
1
1
Q(t-1)
0
1
x
x
0
1
Q(t)
0
1
0
1
1
0
D
K
ReqB
ReqC
3-bit D Register
ReqA
G0
P0
cs 152 buses.30
ReqA
Priority
P1
G1
P2
EN
Clk
SetGrA
Clk
SetGrB
ReqB
Clk
G2
SetGrC
ReqC
Clk
J
Q
K
GrantA
J
Q
K
GrantB
J
Q
K
GrantC
cs 152 buses.31
cs 152 buses.32
cs 152 buses.33
Memory-mapped I/O:
Portions of the address space are assigned to I/O device
Read and writes to those addresses are interpreted
as commands to the I/O devices
User programs are prevented from issuing I/O operations directly:
cs 152 buses.34
I/O Interrupt:
- Whenever an I/O device needs attention from the processor,
it interrupts the processor from what it is currently doing.
cs 152 buses.35
Polling: Programmed
I/O
CPU
Is the
data
ready?
Memory
IOC
no
yes
read
data
device
store
data
done?
no
yes
Advantage:
Simple: the processor is totally in control and does all the work
Disadvantage:
Polling overhead can consume a lot of CPU time
cs 152 buses.36
CPU
(1) I/O
interrupt
user
program
(2) save PC
Memory
IOC
(3) interrupt
service addr
device
(4)
read
store
... :
rti
interrupt
service
routine
memory
Advantage:
User program progress is only halted during actual transfer
Disadvantage, special hardware is needed to:
Cause an interrupt (I/O device)
Detect an interrupt (processor)
Save the proper states to resume after the interrupt (processor)
cs 152 buses.37
I/O
Interrupt
An I/O interrupt is just like the exceptions except:
An I/O interrupt is asynchronous
Further information needs to be conveyed
An I/O interrupt is asynchronous with respect to instruction execution:
I/O interrupt is not associated with any instruction
I/O interrupt does not prevent any instruction from completion
- You can pick your own convenient point to take an interrupt
I/O interrupt is more complicated than exception:
Needs to convey the identity of the device generating the interrupt
Interrupt requests can have different urgencies:
- Interrupt request needs to be prioritized
cs 152 buses.38
Interrupt
Logic
Detect and synchronize interrupt requests
Ignore interrupts that are disabled (masked off)
Rank the pending interrupt requests
Create interrupt microsequence address
Provide select signals for interrupt microsequence
uSeq.
addr &
select
logic
Interrupt
Priority
Network
Synchronizer
Circuits
Async
interrupt
requests
Clk
cs 152 buses.39
Async.
D Inputs
Clk
DAP & SIK 1995
Program Interrupt/Exception
Hardware
Hardware interrupt services:
Save the PC (or PCs in a pipelined machine)
Inhibit the interrupt that is being handled
Branch to interrupt service routine
Options:
- Save status, save registers, save interrupt information
-
cs 152 buses.40
Programmers View
main
program
Add
Div
Sub
(1)
(3) get PC
CPU
Memory
DMAC
IOC
device
DMAC provides handshake
signals for Peripheral
Controller, and Memory
Addresses and handshake
signals for Memory.
cs 152 buses.42
D1
IOP
D2
main memory
bus
Mem
. . .
Dn
I/O
bus
(1) Issues
instruction
to IOP
CPU
IOP
(3)
OP Device Address
IOP looks in memory for commands
OP Addr Cnt Other
memory
target device
where cmnds are
what
to do
special
requests
where
to put
data
how
much
DAP & SIK 1995
Summary:
Three types of buses:
Processor-memory buses
I/O buses
Backplane buses
Bus arbitration schemes:
Daisy chain arbitration: it cannot assure fairness
Centralized parallel arbitration: requires a central arbiter
I/O device notifying the operating system:
Polling: it can waste a lot of processor time
I/O interrupt: similar to exception except it is asynchronous
Delegating I/O responsibility from the CPU
Direct memory access (DMA)
I/O processor (IOP)
cs 152 buses.44
shing.kong@eng.sun.com
cs 152 buses.45