Lecture 3. RAS Issues in Lucida Prof. Taeweon Suh Computer Science Education Korea University COM609 Topics in Embedded Systems.

Slides:



Advertisements
Similar presentations
Computer Structure 2014 – Out-Of-Order Execution 1 Computer Structure Out-Of-Order Execution Lihu Rappoport and Adi Yoaz.
Advertisements

Federation: Repurposing Scalar Cores for Out- of-Order Instruction Issue David Tarjan*, Michael Boyer, and Kevin Skadron* University of Virginia Department.
1 Lecture: Out-of-order Processors Topics: out-of-order implementations with issue queue, register renaming, and reorder buffer, timing, LSQ.
Pipeline Hazards Pipeline hazards These are situations that inhibit that the next instruction can be processed in the next stage of the pipeline. This.
Lecture 8. MIPS Instructions #4 – Branch Instructions #2
Interrupts Chapter 8 – pp Chapter 10 – pp Appendix A – pp 537 &
Chapter 6 Limited Direct Execution
Computer Architecture 2011 – Out-Of-Order Execution 1 Computer Architecture Out-Of-Order Execution Lihu Rappoport and Adi Yoaz.
Pipeline Hazards CS365 Lecture 10. D. Barbara Pipeline Hazards CS465 2 Review  Pipelined CPU  Overlapped execution of multiple instructions  Each on.
ENEE350 Ankur Srivastava University of Maryland, College Park Based on Slides from Mary Jane Irwin ( )
1 COMP 206: Computer Architecture and Implementation Montek Singh Wed., Oct. 8, 2003 Topic: Instruction-Level Parallelism (Dynamic Branch Prediction)
1 COMP 206: Computer Architecture and Implementation Montek Singh Mon., Oct. 7, 2002 Topic: Instruction-Level Parallelism (Dynamic Branch Prediction)
EECS 470 Pipeline Control Hazards Lecture 5 Coverage: Chapter 3 & Appendix A.
1 Lecture 8: Branch Prediction, Dynamic ILP Topics: branch prediction, out-of-order processors (Sections )
1 Chapter Six - 2nd Half Pipelined Processor Forwarding, Hazards, Branching EE3055 Web:
Trace Caches J. Nelson Amaral. Difficulties to Instruction Fetching Where to fetch the next instruction from? – Use branch prediction Sometimes there.
Pipeline Exceptions & ControlCSCE430/830 Pipeline: Exceptions & Control CSCE430/830 Computer Architecture Lecturer: Prof. Hong Jiang Courtesy of Yifeng.
1 Lecture 18: Pipelining Today’s topics:  Hazards and instruction scheduling  Branch prediction  Out-of-order execution Reminder:  Assignment 7 will.
Team 2 Week 6 Presentation The Attack of the Slow Moving Computers! AlexDaveKevinMike.
1 Lecture 8: Branch Prediction, Dynamic ILP Topics: static speculation and branch prediction (Sections )
Exception and Interrupt Handling
Ch2. Instruction-Level Parallelism & Its Exploitation 2. Dynamic Scheduling ECE562/468 Advanced Computer Architecture Prof. Honggang Wang ECE Department.
Computer Organization CS345 David Monismith Based upon notes by Dr. Bill Siever and notes from the Patterson and Hennessy Text.
Lecture 4. ARM Instructions #1 Prof. Taeweon Suh Computer Science Education Korea University ECM586 Special Topics in Embedded Systems.
TAC O » ACM Transactions on Architecture and Code Optimization (TACO) ˃Volume 5 Issue 3, Nov 2008 » Author: ˃Hans Vandierendonck Ghent University, Gent,
1 Appendix A Pipeline implementation Pipeline hazards, detection and forwarding Multiple-cycle operations MIPS R4000 CDA5155 Spring, 2007, Peir / University.
Richard P. Paul, SPARC Architecture, Assembly Language Programming, and C Chapter 7 – Subroutines These are lecture notes to accompany the book SPARC Architecture,
Fall EE 333 Lillevik 333f06-l21 University of Portland School of Engineering Computer Organization Lecture 21 Subroutines, stack Interrupts, service.
Lecture 0. Course Introduction Prof. Taeweon Suh Computer Science Education Korea University COM609 Topics in Embedded Systems.
by Richard P. Paul, 2nd edition, 2000.
CS 6290 Branch Prediction. Control Dependencies Branches are very frequent –Approx. 20% of all instructions Can not wait until we know where it goes –Long.
Correct Alignment of a RAS after Call and Return Mispredictions Ghent University Veerle Desmet Yiannakis Sazeides Constantinos Kourouyiannis Koen De Bosschere.
EE/CS-352: Embedded Microcontroller Systems Part V The 8051 Assembly Language Interrupts.
Adapted from Computer Organization and Design, Patterson & Hennessy, UCB ECE232: Hardware Organization and Design Part 13: Branch prediction (Chapter 4/6)
MIPS Subroutines Subroutine Call – jal subname Saves RA in $31 and jumps to subroutine entry label subname Subroutine Return – jr $31 Loads PC with return.
Pushing the Return Address To return to the caller a subroutine must have the correct return address in $ra when the jr instruction is performed. But this.
Constructive Computer Architecture Tutorial 6: Five Details of SMIPS Implementations Andy Wright 6.S195 TA October 7, 2013http://csg.csail.mit.edu/6.s195T05-1.
Introduction to the DE0 Board Prof. Taeweon Suh Computer Science & Engineering Korea University COSE221, COMP211 Computer Logic Design.
1 Lecture: Out-of-order Processors Topics: a basic out-of-order processor with issue queue, register renaming, and reorder buffer.
ECE/CS 552: Pipeline Hazards © Prof. Mikko Lipasti Lecture notes based in part on slides created by Mark Hill, David Wood, Guri Sohi, John Shen and Jim.
EECS 370 Discussion 1 xkcd.com. EECS 370 Discussion Topics Today: – Control Hazards – Branch Prediction – Project 3 – stackoverflow Example 2.
Lecture: Out-of-order Processors
Computer Science 210 Computer Organization
Handling Exceptions In MIPS, exceptions managed by a System Control Coprocessor (CP0) Save PC of offending (or interrupted) instruction In MIPS: Exception.
CS/COE 1541 (term 2174) Jarrett Billingsley
Day 08 Processes.
Day 09 Processes.
CS252 Graduate Computer Architecture Spring 2014 Lecture 8: Advanced Out-of-Order Superscalar Designs Part-II Krste Asanovic
Pipelining - Branch Prediction
Test 2 review Lectures 5-10.
Pipelining review.
The processor: Pipelining and Branching
Lecture 19: Branches, OOO Today’s topics: Instruction scheduling
Lecture 9. MIPS Processor Design – Pipelined Processor Design #2
MIPS Instructions.
Lecture 8: Dynamic ILP Topics: out-of-order processors
Lecture 5. MIPS Processor Design
The Processor Lecture 3.6: Control Hazards
by Richard P. Paul, 2nd edition, 2000.
Branch Prediction: Direction Predictors
Control unit extension for data hazards
Branch Prediction: Direction Predictors
Additional ILP Topics Prof. Eric Rotenberg
Control Hazards Branches (conditional, unconditional, call-return)
Control unit extension for data hazards
Control unit extension for data hazards
Interrupts and exceptions
Lecture 9: Dynamic ILP Topics: out-of-order processors
MIPS R3000 Subroutine Calls and Stack
Handling Stores and Loads
Presentation transcript:

Lecture 3. RAS Issues in Lucida Prof. Taeweon Suh Computer Science Education Korea University COM609 Topics in Embedded Systems

Korea Univ Return Address Stack Issues in Lucida Push and Pop timing  Push the return address in ID stage? What if the conditional branch turns out to be predicted wrong? Corrupt RAS  Pop from RAS in IF stage? Need to decode the return instruction in IF stage: JPLR (Jump to Link Register), POP PC, JR ? Unmatched call/return sequences  What if the conditional branch turns out to be predicted wrong? Corrupt RAS  Exception or Interrupt What is the instruction for returning from interrupt? (SR restore)  Context Switch Timer interrupt  Clear RAS at the reception of interrupt or exception?  longjmp() / setjump() ? Misprediction detection and correction logic 2

Korea Univ Basic Operation in Lucida 8-entry RAS? RAS reset conditions,  Overflow/Underflow  Unmatched sequence Or use circular buffer and let it overflow or underflow? If the RAS return is wrong, then reset the RAS.. 3

Korea Univ RAS Corruption due to Conditional Branch Misprediction No corruption because the conditional branch is resolved in ID stage  If the speculated instruction is jlr -kind instruction, it will be squashed immediately because it is in IF stage, assuming that jlr -kind inst. pushes the return address in ID stage 4

Korea Univ RAS Corruption due to RAS Misprediction It could come from unmatched sequence (jal, jalr) – (jplr, jr?) pair  We don’t consider jr  jplr is resolved in ID stage. No problem in case of the misprediction. The same reason as the conditional branch misprediction pop pc is resolved in MEM stage. Then, what if the prediction was wrong? There are 3 instructions in the pipe after POP PC  We almost decided to use the normal stack-like structure (not the one in Patt’s paper)  Checkpoint TOS and NEXT (Patt’s paper) at each prediction with RAS? Need at most 2-3 buffers RAS reset conditions? 5

Korea Univ Misc We don’t take the following cases into account in RTL design since it would occur extremely rarely (Make common cases faster!)  JAL, JPLR : immediately return from subroutine It could corrupt the instruction queue since RAS push from JAL occurs in ID stage? Then IQ could be filled with instructions from wrong path? I am not quite sure… 6

Korea Univ Nelahem Case Study 16-entry Return Stack Buffer 7

Korea Univ General Lucida Questions What happens in IF stage when the conditional branch is turned out to be mis-predicted? When executing jal, jalr instructions, the return address is saved in ID stage? 8