{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lecture_13 - ECE 190 Lecture 13 March 1 2011 LC—3 I/O...

Info icon This preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 4
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 6
Image of page 7

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 8
Image of page 9

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ECE 190 Lecture 13 March 1, 2011 LC—3 I/O system Lecture Topics Memory-mapped l/O Interrupt—driven l/O concepts Lecture materials Textbook Ch. 8 Homework Machine problem MP2 due March 2, 2011 at 5pm submitted electronically. MP3.1 due March 9, 2011 at 5pm submitted electronically. Announcements 1 V. Kind ratenko (Ht/u ,e , V V. m r, nm m Ke/zdgfwd gmztroplww, 2J0 V ~ 30:1 b 7V; mega/22222; 00f Lia 4:32“ qt 2/7 02mm; Ma (Operfileug Pwmgypzeg LIEU/e anal/£54] Q/m/[d/flfpfz-e/g _;_ We, WI'M [09K (2+ Keggpw’d (2140/ an/vlw/ //fl (La/(Lax (925 Mun/71w 2M4 dbl/flax. 9 WV!” CLO WeVV Khw/ 9.49 UL“ 4525mmZ [/Q 12 [[32 ;_ WT17MP xlé) RUM: Ojé-‘Ketdgoo/d 2’ ; «9 (0U TELL!) x :11) (4.519le (—— ROL720J _ «é 66ml M/K (CL coal” )[Y'ZL WWKS L V /2/ ,.4«.1me dew'ce . x - ¥ Ktsz—Kefloaréli . ; 7 4%”? W%zk+-er , KBQS’ Ke'jgoamol ' ' v V V $401M Peg/(£116? -—> We Meec/ «LWO hegqshwg fig QWEVL 9“,. (“/9va +NW' WV 7 K léebgoawcl , VVV. ~> KE‘BE — 3+0er flSfl/l VVMVZl/cé 03L M? /{23/ 9 KE£R ««V<Lo [eL MW [macessor KMM/ m; 61 MW [/81wa um; eMxLet/Leo/ 014 «ML? Ke3gQw/o/ , @QR9 (ilk/>7. . ' . 41a. 74a reg/$64239. séafieg i Mafia»: a V; amt/Mk : 3% a draw; 3-,~‘>:Wea~ ‘Mzéo/ lam nezgfivlf/VS lo ‘ 6L Vaduz qu/ Wilt/9&3 OMJWv/J I . -> 9953 R- SvLor—es iI/mlwe, 61c? g6 J/JSWMKQZ a 93.3 R — 40¢“; M (lug/m5 Know mvzfl , me x; a mow, M»? 6w (499ng ~> How % wasw MW KBCbR/‘BDR WW5? V viola Mg :{5 :La WW?— Sewmwlf), Jé¢f¢dv¢¢ l/Q ' c'MSw‘WN/‘Wé ('0‘ W 134 4v wag: _ Mega VWEbLeFS/i 64% #14 I's», M071 724?...de 4714/3 ¥ claw“ 1% “#5 evam‘fia4€*/ V 5 fiiaham- WW3 L'S lo use‘m,_ LLLJV’um/g/bé; ‘ 1% W , .M—SE E4 4,0 am; %%a MM‘WS,.. #340: do W2, ,jwmr, Kwre QMr-ugvkvéw .. mwsi apW;f as m2 o/dr’ww rial/MK. Erewr/MW_ _ $0gJ/R4NLV art‘s Mg _. I $.24__,1'a,34W-°4’?% cw. WWK MW” WWI .. Q N _ i may WM +mw ”we We m 1 f LiS/ST aflwmfgvifldL ?,'M9:4”V€VV¢”$ 74¢? 5. 4 §,.,1Zoadz..¢s; M42242; 14mm :K3$£.E.....<M<¥‘ Siék-Q [613 MW: $0 @993 _ M Li'thLMWM/ ; imam/lowly WK WM may: 3 ; 2 391444306]: Wail/weal: a? wag 490 Prggw+ K$2§l€//©9fl 9L} g mamarg/ [am 4139143. ‘rTng [,4 3 MW W J/ W VWEJMS ~> Kfi‘BR— Jo LoJJ PL WLJu! Obey/rm 7 MeagM/J ‘> EEK ., L2 LwLJ a WW 7%? W JEJo/ng _ , > K33}? dl/IJ QQSR Jo (MJ/édJe 4141 regal/neg: 1*) ”Mal Maggi Vagf’sJa‘; (UP map/sad EEJO a QJ QJ, (eJJVeEEeE JJLeJ we, QJJaneo/ JG f/fl Jew/mg V’QJ/JJ/V W 4—0; . Vne/WV‘j —> Jib/lg Joes woJ MeQM Haul (KBM JWBR _ ( (9,)(‘8 PJMosacgubl [.9wa M" We? Tim’s QM/j .E mews Mm? KBgR/KCBER page/EEK Vegdglwfl (9V6 WIWJLUA lCJeVIJtleeJ LIA W ngQ ng/ 1 . (95,: Wwwg/ Lamb-#0442 _ ; i V 5 “94441199 Lg/S/ Margy (Mu/KS (mstuéJ/vwfi ; JCQM I Work ' WIJJ 74(42ng PegfiJErS - » MAR; 4,3 44%) ‘ ‘ ”NARA MEgflfé/‘f! I235 , ‘> W7 ’WPMOL WW; (“My L35-~ Max:501 ? wa"_> KBSK Md; KESQIQ VWKWS; 15' 9% 0} >157 MMAXQKIL ’ i 5 [M- mm mm ? ’ 5 ' 7 ' {if} Maowxlkolg W W , gee/Wm J’Mt bygone/Vi we! Praugiflfi ’7 9 wit/QM 02 Keg £3. 59%ng KBSQHK] 4—1 5 >WWM KIéSBE :5 read KBSK EISJé-O: , §,.,‘_‘7 |:5+ KESREIS] =-_1,i ’Hal flSCII code S~/07°€ci (a, KB‘AK Am} I’m-5— 375,34 6191/! fecal CUM! W I (4457le 54mm (54w [(0%me 1‘9 d/Satglec/ [#9 RL RESR .\ , ‘ . ELM 1193599 L®RRO m, #0 R07RFBER) § MW wwawg W403? i .. L ~77 MW RWJ‘,“ I’d/“6"5 mwolx SW”, W W @9945)”ij ‘ < , E T muMIRWWW. , _ WOW"; 1 (WW 74/11“; Hz? $4M éwaduae/r who! 0/0qu < ‘_ VaJue LE Fecal “g2: WWV 0L4 Heft/- Wm Sfeeg/ _ Mu? wmdflw 0W ’9? m} I've 9544M WIRHA 6% who, WM 1 ‘ 0W >L¢SLAMOLIVOWSL3 7 how Clo » \xm/ JAx Hug?” ' , 7u&e K3;R} 3 mad agwj'm {a may lg! <2 W WW wwsgeflwé , . - ‘ {4450”(1 . , ‘ ' 30159 W R0 KESK gm: , * 3R} POLL LCM R0 KISCEFR Kym; ;.F-‘LL thOZ \(BSR 1.F1LL 7<F5190 '9 (QuIdguvL via W mpnnér . >QaMI/0MJIDWZ WVE mag/g S 7 7 I ' ' 7 ' MQKfi—SR MARF—AFQQR/mc) MEMEMfiRjé—M‘BR I §-> I/V VIM/oped, mmwg Leda/ZS STSRE ‘?1[ . mam—@916 11%: MM ; _ MFRFyFEaé , ' 1 ‘ ’ ' ©‘BKé—MCDR {MARé—XFEUH} MDRé—VQS‘Q . w m w : >WIIJM 19L mom/imam 1S wm/vf/JPW 1Z1) 799R, ‘ ®SR EMF—0 FWFQ 70F M cab/71M +0 d1§fl% +WILCM RUM Mull/(e 1; CIA: [31111364 014 M12 man/i217 I QSREKJH FFwdg Fa 1111ch4 Mum“ , , ;,‘7I\—I @913 51:: F0 1711 ASCII we 24mg V SQCDR M9 10$ 139—1 Keep; 099/2 [1121124 , : 553R BR2P W” .L .STI R0 SwR ”2'“ VFW" .HLL YFEUév POLLR L91 R0 KggR , é“: , 13R}? RoLL R Wml¢;¥%g&:L L‘BI R0 KFDCDR; ado/W ,POLLV/ WM R1 fissR ;)wwhwm ,9 ER“; P0LL,__\,1// _ STI R0 (BCBZ‘R) ' [DMRW _¢_mse, ‘ .mL‘ xzpwa (SEQMQ FILL ’xéFEvzi ,9R .FILL )(F‘EQLI ERMA ”LL xFEUé ECE 190 PUTS LOOP LPZ STR DONE Lecture 13 March 1, 2011 implementation LEA R1, STR ; Load address of string LDR R0, R1, #0 ; get next char to R0 BRz DONE ; string ends with 0 LDI R3, DSR ; Loop until MON is ready BRzp LP2 STI R0, DDR ; Write next character ADD R1, R1, #1 ; Set address to next char Banp LOOP .STRINGZ "Char String" Partial data path for LC-3 implementation of memory-mapped I / 0 Interrupt—driven I / O In memory-mapped l/O, interaction with the l/O devices is controlled by our program 0 Our program polls ready bits of l/O registers to see if the I/O devices are ready for interaction 0 This leads to inefficiencies since our program effectively stalls until an l/O operation is complete In case of interrupt-driven [/0, interaction with the I/O device is controlled by the l/O device iEeH 0 An l/O device generates an interrupt signal to indicate that l/O device is ready with new l/O operation (e.g., a new character has been entered on the keyboard) 0 In response to this interrupt, the currently executed program stops its execution and the control is passed to some subroutine designed to handle the interrupt 2 V. Kindratenko ECE 190 Lecture 13 March 1, 2011 0 Once the subroutine processes the interrupt, the control is passed back to the program that was previously executed - Several things must be true for an l/O device to actually interrupt the processor: 0 The l/O device must want to request service I This is indicated by ready bit (KBSR[15] and DSR[15]). if these bits are set, there is a new l/O request ready to be served 0 The device must have the right to request service I This is indicated by an interrupt enable bit (KBSR[14] and DSR[14]). If such bit is set by the processor, the processor wants to give the l/O device the right to request the interrupt service I ready bit and interrupt enable bit together are used to generate an interrupt DSR interrupt signal to the processor 0 This request must be more urgent than the processor’s current task I A program is executed with some specified priority level, LC-3 has 8 such priority levels PLO..PL7. I For an I/O device to stop the processor and start the interrupt service, its priority level has to be above the priority level of currently executed program I A special circuit is used to check if the priority of the I/O interrupt is higher than priority of the running program, and if so, an interrupt is generated I if an INT is present at the start of the instruction cycle, an extra step is inserted in theinstruction cycle just before FETC phase 0 The processor saves its state information so that it can later return to the current task. 0 The PC is loaded with the starting address of the lnterrupt Service Roufine 0 The FETCH phase of the cycle continues as normal 0 When the Interrupt Service Routine is done, it restores processor’s state to what it was before the interrupt New concepts from today’s lecture 0 Synchronous (running in lockstep) vs. asynchronous running not I lockstep) - Handshaking mechanism as a way of synchronization 0 Use flags to indicate that one device is ready to do its thing 0 Memory-mapped l/O 0 Using memory addresses to uniquely identify I/O device registers 0 Polling ' 3 V. Kindratenko ECE 190 Lecture 13 March 1, 2011 0 Process of periodically checking status of something (e.g., Ready Bit in DSR) to detect when it changes 0 Interrupt-driven 1/0 0 An I/O device can force program to stopphave thelprocessor to carry out the needs of 1/0 device, and resume the stopped program. 4 V. Kindratenko ...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern