Presentation laddar. Vänta.

Presentation laddar. Vänta.

Datorsystem 1 & Datorarkitektur 1 – föreläsning 7 onsdag 7 november 2007.

Liknande presentationer


En presentation över ämnet: "Datorsystem 1 & Datorarkitektur 1 – föreläsning 7 onsdag 7 november 2007."— Presentationens avskrift:

1 Datorsystem 1 & Datorarkitektur 1 – föreläsning 7 onsdag 7 november 2007

2 I/O devices are incredibly diverse with respect to –Behavior – input, output or storage –Partner – human or machine –Data rate – the peak rate at which data can be transferred between the I/O device and the main memory or processor DeviceBehaviorPartnerData rate (Mb/s) Keyboardinputhuman0.0001 Mouseinputhuman0.0038 Laser printeroutputhuman3.2000 Graphics displayoutputhuman800.0000-8000.0000 Network/LANinput or output machine100.0000-1000.0000 Magnetic diskstoragemachine240.0000-2560.0000

3 Synkron Bus Bussen styrs av en klock-signal (en speciell control-line). Enkel att implementera Protokollet förutbestämt Det går att köra bussen mycket snabbt Alla enheter måste använda samma klock- frekvens Det går inte att göra en snabb och samtidigt allt för lång buss pga sk clock-skew. processor-memory buses

4 Ingen klocka! Lättare stödja olika typer av enheter eftersom vi inte behöver komma överens om en gemensam klockfrekvens. Längden på bussen inget problem. Ingen klocka! Inte lika enkelt att implementera (handskakning). Långsammare än Synkron buss USB 2.0 och Firewire Asynkron Bus – en Buss utan klocka Ett handskaknings-protokoll används Sändare och mottagare fortsätter till nästa steg i protokollet först när de är överens om att det föregående steget är utfört...

5 Asynchronous Bus Handshaking Protocol 7.I/O device sees DataRdy go low and drops Ack Output (read) data from memory to an I/O device I/O device signals a request by raising ReadReq and putting the addr on the data lines 1 2 3 ReadReq Data Ack DataRdy addrdata 4 56 7 1.Memory sees ReadReq, reads addr from data lines, and raises Ack 2.I/O device sees Ack and releases the ReadReq and data lines 3.Memory sees ReadReq go low and drops Ack 4.When memory has data ready, it places it on data lines and raises DataRdy 5.I/O device sees DataRdy, reads the data from data lines, and raises Ack 6.Memory sees Ack, releases the data lines, and drops DataRdy

6 Control lines –Signal requests and acknowledgments –Indicate what type of information is on the data lines Data lines –Data, addresses, and complex commands Bus transaction consists of –Master issuing the command (and address) – request –Slave receiving (or sending) the data – action –Defined by what the transaction does to memory Input – inputs data from the I/O device to the memory Output – outputs data from the memory to the I/O device Bus Master Bus Slave Control lines: Master initiates requests Data lines: Data can go either way

7 Processor Cache Memory - I/O Bus Main Memory I/O Controller Disk I/O Controller I/O Controller Graphics Interrupts Disk Network Jag vill ha bussen! Jag vill oxå ha bussen! Nu får ni ge er - Jag vill ha bussen!

8 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

9 Bus Arbiter Device 1 Highest Priority Device N Lowest Priority Device 2 Ack Request wired-OR Data/Addr Om någon eller några gör request, skicka Ack Vill jag ha bussen så tar jag den och skickar inte vidare Ack.

10 Enkel att implementera Enhet med låg prioritet riskar att ”svälta”, dvs aldrig få tillgång till bussen. Ack måste propagera  slöar ner bussen. Daisy Chaining Bus Arbiter Device 1 Highest Priority Device N Lowest Priority Device 2 Ack Request wired-OR Data/Addr

11 Bus Arbiter Device 1 Device NDevice 2 Ack1 Data/Addr Ack2 AckN Request1Request2RequestN Logik i hårdvara som ser till att ingen ”svälter”, dvs fairness Fairness Mer komplicerad hårdvara Centralized Parallel Arbitration

12 2 serial ATAs: 150 MB/s 8 USBs: 60 MB/s 2 parallel ATA: 100 MB/s Hub Bus: 8b x 266 MHz Gbit ethernet: 0.266 GB/s Main Memory Memory Controller Hub “Northbridge” I/O Controller Hub “Southbridge” Det som tidigare var separata I/O-kort ryms nu på dessa chip. Trend att gå från parallella delade bussar till seriella höghastighets interconnects

13 A bus is a shared communication link (a single set of wires used to connect multiple subsystems) that needs to support a range of devices with widely varying latencies and data transfer rates –Advantages Versatile – new devices can be added easily and can be moved between computer systems that use the same bus standard Low cost – a single set of wires is shared in multiple ways –Disadvantages Creates a communication bottleneck – bus bandwidth limits the maximum I/O throughput The maximum bus speed is largely limited by –The length of the bus –The number of devices on the bus Sammanfattning

14 After n yearsCPU time (s)I/O time (s)Elapsed time (s) % I/O time 0901010010 190/1.5 = 60107014 260/1.5 = 40105020 340/1.5 = 27103727 427/1.5 = 18102836 518/1.5 = 12102245 Förbättring i CPU tid: 90/12 = 7.5 Förbättring i total-tid: 100/22 = 4.5 Att bortse från I/O är ett vanligt misstag Antag att CPU blir 50% snabbare varje år

15 Kommunikation? I/O enhet Processor Program som vi skriver...

16 I SPIM finns det stöd för en enkel minnes-mappad I/O-enhet. För att skriva ut tecken används följande minnes- mappade transmitter-register: För att läsa tecken används följande minnes-mappade register

17 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 –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 –When the DMA transfer is complete, the I/O controller interrupts the processor to let it know that the transfer is complete There may be multiple DMA devices in one system –Processor and I/O controllers contend for bus cycles and for memory Direct Memory Access Vill avlasta processorn... Interrupt endast för att säga till när hela rasket är klart.


Ladda ner ppt "Datorsystem 1 & Datorarkitektur 1 – föreläsning 7 onsdag 7 november 2007."

Liknande presentationer


Google-annonser