计组实验-MIPS异常和中断处理

计组实验-MIPS异常和中断处理

ID:39323594

大小:471.91 KB

页数:18页

时间:2019-06-30

计组实验-MIPS异常和中断处理_第1页
计组实验-MIPS异常和中断处理_第2页
计组实验-MIPS异常和中断处理_第3页
计组实验-MIPS异常和中断处理_第4页
计组实验-MIPS异常和中断处理_第5页
资源描述:

《计组实验-MIPS异常和中断处理》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库

1、计算机学院课程计算机组成原理MIPS异常/中断处理高小鹏北京航空航天大学计算机学院系统结构研究所提纲MIPS中断/异常支持中断/异常的数据通路软硬件配合的中断响应机制CP0设计北京航空航天大学计算机学院ExceptionsandInterrupts•“Unexpected”eventsrequiringchangeinflowofcontrol–DifferentISAsusethetermsdifferently•Exception–AriseswithintheCPU(e.g.undefinedopcode,overflow,syscall,TLBMiss)•Interrupt–Fr

2、omanexternalI/Ocontroller•Dealingwiththesewithoutsacrificingperformanceisdifficult!7/31/2012Summer2012--Lecture#253HandlingExceptions(1/2)•InMIPS,exceptionsmanagedbyaSystemControlCoprocessor(CP0)•SavePCofoffending(orinterrupted)instruction–InMIPS:saveinspecialregistercalledExceptionProgramCounter

3、(EPC)异常返回地址寄存器•Saveindicationoftheproblem–InMIPS:savedinspecialregistercalledCauseregister原因寄存器–Insimpleimplementation,mightonlyneed1‐bit(0forundefinedopcode,1foroverflow)•Jumptoexceptionhandlercodeataddress0x80000180(或者0xBFC000380,不同模式地址不同)7/31/2012Summer2012--Lecture#254HandlingExceptions(2/2)•

4、Operatingsystemisalsonotified–Cankillprogram(e.g.segfault)–ForI/Odevicerequestorsyscall,oftenswitchtoanotherprocessinmeantime•ThisiswhathappensonaTLBmissesandpagefaults7/31/2012Summer2012--Lecture#255ExceptionProperties•Re‐startableexceptions–Pipelinecanflushtheinstruction–Handlerexecutes,thenret

5、urnstotheinstruction•Re‐fetchedandexecutedfromscratch•PC+4savedinEPCregister–Identifiescausinginstruction–PC+4becauseitistheavailablesignalinapipelinedimplementation•Handlermustadjustthisvaluetogetrightaddress7/31/2012Summer2012--Lecture#256HandlerActions•ReadCauseregister,andtransfertorelevantha

6、ndler•OSdeterminesactionrequired:–Ifrestartableexception,takecorrectiveactionandthenuseEPCtoreturntoprogram–Otherwise,terminateprogramandreporterrorusingEPC,Causeregister,etc.(e.g.ourbestfriendthesegfault)7/31/2012Summer2012--Lecture#257I/OInterrupt•AnI/Ointerruptislikeanexceptionexcept:–AnI/Oint

7、erruptis“asynchronous”–Moreinformationneedstobeconveyed•“Asynchronous”withrespecttoinstructionexecution:–I/Ointerruptisnotassociatedwithanyinstruction,butitcanhappeninthemiddleofanygiveninstruction–I/Ointerruptdoesnotp

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。