Escolar Documentos
Profissional Documentos
Cultura Documentos
198:211 ComputerArchitecture
Topics:
SystemI/O Buses
I/Oorinputandoutput
Inadditiontomemory,datatransferneedstooccur
betweenCPUandInputoutputdevices
Whenreadingfrommemory,abyteorseveralbytescanbe
transferredfrommemorytoregisterusing mov address, %eax or mov %eax, address
I/Oprogramming
TherearetwowaysofaddressingI/Odevices MemorymappedI/O
TheaddressspaceisdividedbetweenmemoryandI/Odevices Higherorderaddressescanrefertodevice Lowerorderaddressescanrefertomemory mov %eax,addresswillfetchdatafromI/Oormemorybasedonthe address
MemorymappedI/O
CPU
Main Memory
Disk
keyboard
Display
Network
Sendorreceivedatato/fromI/Odeviceisamemorytransferinstruction(mov)
withtherightaddress
MainmemorynotselectedwhenaddressisinI/Orange Adv
Uniformityofprogramming,samemov worksforI/Oandmemory Memoryaddressspaceisreduced
Dis adv
4
I/OmappedI/O
MemoryandI/Odevicesusedistinctaddressspaces
IsolatedI/O
TwoseparateinstructionstoaddressI/Odevices Aseparatecodeorcontrolsignalbasedontheopcodewill
selectmemoryorI/O
FFFF
0000
00FF 0000
InterfacingwithI/O
Manydevices,withvaryingspeeds,complexity CPU/bussharedamongallperipheralsandmemory CPUshouldbeabletoselectadeviceandtransferdatato
thedevice
Interpretationofdatalefttoeachdevice Unlikememory,deviceneedtobereadybeforeinitiating
transfer
AllofthishandedbyI/Omodule
I/Omodule
Data lines
To device
Address Control
To device
Datatransferschemes
Therearetwoschemes Programmeddatatransfers
CPUtransfersdatafromI/Odevicesontoregisters Usefulforsmalldatatransfers
DirectmemoryaccessorDMA
DeviceorI/Omoduledirectlytransfersdatatomemory Usefulorlargeblocktransfers
10
ProgrammedI/O
ProgrammedI/Ocanbefurtherclassifiedas Synchronoustransfer Asynchronoustransfer Interruptdriventransfer AlloftheabovecanbeusedtointerfacewithdifferentI/O devices
RequirespecialhardwarefeaturesintheCPU
11
Synchronoustransfer
Simplestamongthree CPUandI/Ospeedmatch Transferabyte,word,ordoubleword Memorymapped
mov %eax ,2 Addressofdeviceportis2 I/Omapped mov $2,%edx out%eax,%edx SimilarlyforInputdevice, Memorymapped:mov 3,%eax or I/Omappedmov $3,%edx in%edx,%eax
12
Asynchronoustransfer
I/Odevicesslower Instructdevicetobeready Waituntildeviceready Devicehasstatusflag/register Busywaiting WasteofCPUresources
READY No Request device to get ready
Yes
13
InterruptdrivenI/O
Processorneednotwaitforslow
device
Request device
Processorcontinueswithother
instructions
Deviceinterruptsprocessor
whenready
Execute instruction
InterruptServiceRoutine
CPUtransferswordfromdevice
toregister
INT High No Yes
CPUwriteswordfromregister
tomemory
Call Interrupt Service routine
14
DMAordirectmemory
Bulkdatatransfers Directdevicetomemory
transfer
Request DMA device
Memorybusiscontention
betweenCPUandDMAunit
Execute instruction
DuringDMA EitherCPUisinholdstate
INT High No
Or
Yes
15
Systembus
CPU
Main Memory
Disk
keyboard
Display
Network
16
Characteristicsofbus
Severaldevicescanbeconnected Singlebusforalldevices costsharing Added/removedwithoutaffectingothers I/Odevicescanbeconnectedtootherdevicesfollowingthe samebusstandard Disadvantages: Buscontention SpeedofI/Odevicesdeterminedbybusspeed Busspeeddeterminedbynumberofdevices Slowerdevicesimpactothers
17
Busarchitecture
Master issues command Bus Master Data can go either way Bus Slave
Anyinteractionconsistsoftwosteps
1.Issuecommand2.transferdata
MasterInitiates
Issuescommand,startingaddress,#bytes
SlaveResponds
Sendsorreceivesdataaspercommandfrommaster
18
Computerbuses
ModerncomputershaveseveralI/Odevices Varyingspeeds Asimplelinearbuswillnotsuffice Moderncomputershavehierarchicalbuses Busissplitintodifferentsegments CPUMemoryonebus CPUI/Odevicesanotherbus CPUcache anotherbus
19
Backplanebus
20
Twobussystems
Processor-Memory bus
21
hierarchicalbussystems
Backside cache bus L2 cache Processor-Memory bus
Bus Bridge
I/O bus
I/O bus
22
Examplesofbuses
ISAbus IndustryStandardbus
Oldtechnology 8Mhz,<1bytetransfer/cycle,busB/W5.3MB/sec
EISAbus ExtendedISA
Oldtechnology 8Mhz,4bytetransfer,busB/W32Mb/sec
PCIbus PeripheralComponentInterconnect
Speedsupto132MB/s Busspeedof33mhz,4Bytes/transfer PCIpopularizedPlugandPlay
23
Examplesofbuses
PCIXextendedPCI
133MHz,8bytes/transfer,1064MB/secor1GB/sec Usedtoconnectgigabitethernet,highspeeddisks
SCSI(SmallComputerSystemInterface)
Capableofhandlinginternal/externalperipherals Speedanywherefrom80 640Mb/s ManytypesofSCSI
FastSCSI UltraSCSI UltrawideSCSI
24
Parallelvs serial(pointtopoint)bus
Processor-Memory bus CPI/IO Bus Bridge I/O bus IO
IO
Parallelbus
Bussharedamongdevices Busarbitrationisslow Example:PCI,SCSI SerialI/O PointtopintlinksconnecteddirectlytoCPU Requireslotsofadditionalhighspeedhardware Examples:SATA,USB,firewire
25
USB
1.0
plugandplay FullspeedUSBdevicessignalat
12Mb/s
Lowspeeddevicesusea
1.5Mb/ssubchannel.
Upto127deviceschained
together
2.0
datarateof480megabitsper
second
26
Firewire (apple)
Highspeedserialport 400mbpstransferrate 30timesfasterthanUSB1.0 plugandplay
27
IntelBus
28
NorthbridgeandSouthbridgebus
29
http://www.testbench.in/pcie_sys_2.PNG
http://www.yourdictionary.com/images/computer/CHIPSET.GIF
30