© 2009, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction  Purpose:  This course provides an overview of the SH-2 32-bit RISC.

Slides:



Advertisements
Similar presentations
Lecture 4: CPU Performance
Advertisements

PIPELINE AND VECTOR PROCESSING
Computer Organization and Architecture
CSCI 4717/5717 Computer Architecture
May 12 th, 2002 Microprocessors. Introduction Motorola controls roughly 40% of the 32-bit embedded processor market ColdFire is the next generation 68K.
Mehmet Can Vuran, Instructor University of Nebraska-Lincoln Acknowledgement: Overheads adapted from those provided by the authors of the textbook.
Lecture Objectives: 1)Define pipelining 2)Calculate the speedup achieved by pipelining for a given number of instructions. 3)Define how pipelining improves.
ELEN 468 Advanced Logic Design
Chapter 8. Pipelining.
CS252/Patterson Lec 1.1 1/17/01 Pipelining: Its Natural! Laundry Example Ann, Brian, Cathy, Dave each have one load of clothes to wash, dry, and fold Washer.
Chapter 8. Pipelining. Instruction Hazards Overview Whenever the stream of instructions supplied by the instruction fetch unit is interrupted, the pipeline.
Pipelining II Andreas Klappenecker CPSC321 Computer Architecture.
Chapter XI Reduced Instruction Set Computing (RISC) CS 147 Li-Chuan Fang.
Computer Organization and Architecture The CPU Structure.
1  2004 Morgan Kaufmann Publishers Chapter Six. 2  2004 Morgan Kaufmann Publishers Pipelining The laundry analogy.
Pipelined Processor II CPSC 321 Andreas Klappenecker.
DLX Instruction Format
7/2/ _23 1 Pipelining ECE-445 Computer Organization Dr. Ron Hayne Electrical and Computer Engineering.
Appendix A Pipelining: Basic and Intermediate Concepts
Group 5 Alain J. Percial Paula A. Ortiz Francis X. Ruiz.
CSE378 Pipelining1 Pipelining Basic concept of assembly line –Split a job A into n sequential subjobs (A 1,A 2,…,A n ) with each A i taking approximately.
Instruction Sets and Pipelining Cover basics of instruction set types and fundamental ideas of pipelining Later in the course we will go into more depth.
Computer Organization and Architecture Instruction-Level Parallelism and Superscalar Processors.
© 2009, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction  Purpose:  This course provides an overview of the SH-2 32-bit RISC.
Pipeline Hazard CT101 – Computing Systems. Content Introduction to pipeline hazard Structural Hazard Data Hazard Control Hazard.
Presented by: Sergio Ospina Qing Gao. Contents ♦ 12.1 Processor Organization ♦ 12.2 Register Organization ♦ 12.3 Instruction Cycle ♦ 12.4 Instruction.
1 Pipelining Reconsider the data path we just did Each instruction takes from 3 to 5 clock cycles However, there are parts of hardware that are idle many.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction Purpose  This training course provides an overview of the CPU architecture.
University of Texas at Austin CS352H - Computer Systems Architecture Fall 2009 Don Fussell CS352H: Computer Systems Architecture Topic 8: MIPS Pipelined.
Computer Organization CS224 Fall 2012 Lesson 28. Pipelining Analogy  Pipelined laundry: overlapping execution l Parallelism improves performance §4.5.
Pipeline Hazards. CS5513 Fall Pipeline Hazards Situations that prevent the next instructions in the instruction stream from executing during its.
CMPE 421 Parallel Computer Architecture
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction  Purpose:  This course provides an overview of the Direct Memory.
Oct. 18, 2000Machine Organization1 Machine Organization (CS 570) Lecture 4: Pipelining * Jeremy R. Johnson Wed. Oct. 18, 2000 *This lecture was derived.
Pipelining Example Laundry Example: Three Stages
LECTURE 7 Pipelining. DATAPATH AND CONTROL We started with the single-cycle implementation, in which a single instruction is executed over a single cycle.
CBP 2005Comp 3070 Computer Architecture1 Last Time … All instructions the same length We learned to program MIPS And a bit about Intel’s x86 Instructions.
3/12/2013Computer Engg, IIT(BHU)1 CONCEPTS-1. Pipelining Pipelining is used to increase the speed of processing It uses temporal parallelism In pipelining,
1. Convert the RISCEE 1 Architecture into a pipeline Architecture (like Figure 6.30) (showing the number data and control bits). 2. Build the control line.
11 Pipelining Kosarev Nikolay MIPT Oct, Pipelining Implementation technique whereby multiple instructions are overlapped in execution Each pipeline.
Introduction to Computer Organization Pipelining.
Lecture 9. MIPS Processor Design – Pipelined Processor Design #1 Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System.
RISC / CISC Architecture by Derek Ng. Overview CISC Architecture RISC Architecture  Pipelining RISC vs CISC.
PipeliningPipelining Computer Architecture (Fall 2006)
Immediate Addressing Mode
ARM Organization and Implementation
A Closer Look at Instruction Set Architectures
William Stallings Computer Organization and Architecture 8th Edition
CSCI206 - Computer Organization & Programming
ELEN 468 Advanced Logic Design
Chapter 14 Instruction Level Parallelism and Superscalar Processors
Single Clock Datapath With Control
Pipeline Implementation (4.6)
\course\cpeg323-08F\Topic6b-323
Pipelining: Advanced ILP
Morgan Kaufmann Publishers The Processor
Instruction Level Parallelism and Superscalar Processors
Instruction Level Parallelism and Superscalar Processors
CSCI206 - Computer Organization & Programming
\course\cpeg323-05F\Topic6b-323
Pipelining Basic concept of assembly line
* From AMD 1996 Publication #18522 Revision E
Control Hazards Branches (conditional, unconditional, call-return)
Pipelining Basic concept of assembly line
Created by Vivi Sahfitri
Pipelining Basic concept of assembly line
Interrupts and exceptions
Presentation transcript:

© 2009, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction  Purpose:  This course provides an overview of the SH-2 32-bit RISC CPU core used in the popular SH-2 series microcontrollers  Objectives:  Learn about error detection and address errors  Explore the pipeline in the SH-2 CPU  Understand branching  Obtain some helpful coding tips  Content:  16 pages  3 questions  Learning Time:  15 minutes

© 2009, Renesas Technology America, Inc., All Rights Reserved 2 CPU Error Detection  SH-2 CPU can detect and react to various error conditions:  Address errors  Illegal instructions (invalid op codes) –Undefined instruction executed  Slot illegal instructions –Certain instructions, such as one that changes the PC, cannot be located in a delay slot (i.e., a slot after a delayed branch)

© 2009, Renesas Technology America, Inc., All Rights Reserved Address Errors  Instruction fetch from odd address  Instruction fetch from on-chip peripheral module space  Instruction fetch from external memory space in single-chip mode  Word data accessed from odd address  Longword data accessed from other than a longword boundary  Longword accessed in 8-bit on-chip peripheral module space  External memory space accessed when in single-chip mode  Stack access to address that is not multiple of four (longword alignment required)  Access using vector base register when VBR is not a multiple of four (longword alignment required)

© 2009, Renesas Technology America, Inc., All Rights Reserved IFIDALUMAWBIFIDALUMAWBIF IDALUMAWB Instruction Why Use a Pipeline?  CISC CPUs perform all operations sequentially, then execute instructions in series, one at a time; instruction execution can take several cycles  RISC CPUs use a pipeline to try to overlap “independent parts" of instructions, so that one instruction may be able to execute every cycle Instruction CISC Ideal pipeline speedup: T pipeline = T unpipelined / # of Pipeline stages RISC Time saved Instruction Fetch Inst. Dec./ Reg. Acc. ALU Mem Access/ Data Cycle Write Back Register Content of a typical instruction CISC: Variable length SH-2: 16 bits long

© 2009, Renesas Technology America, Inc., All Rights Reserved Ideal SH-2 Pipeline Flow  IF (Instruction Fetch): Fetches an instruction from the memory in which the program is stored  ID (Instruction Decode): Decodes instruction fetched  EX (Instruction Execution): Performs data operations and address calculations according to the results of decoding  MA(Memory Access): Accesses data in memory; generated by instructions that involve memory access (with some exceptions)  WB(Write Back): Returns results of memory access (data to a register) - Generated by instructions that involve memory loads, with some exceptions Instruction 1IFIDEXMAWB Instruction 2IFIDEXMAWB Instruction 3IFIDEXMAWB Instruction 4IFIDEXMAWB Instruction 5IFIDEXMAWB Instruction 6IFIDEXMAWB Time Slots Instruction stream Ideal execution – One instruction every slot (1 cycle per slot)

© 2009, Renesas Technology America, Inc., All Rights Reserved Hazards Prevent Ideal Flow Pipeline can be “stalled” by:  Structural hazards  Arise from resource conflicts that occur when the hardware cannot support all possible combinations of instructions in simultaneous, overlapped execution  Data hazards  Arise when an instruction depends on the result of a previous instruction in a way that is exposed by the overlapping of instructions in the pipeline  Control hazards  Arise from the pipelining of branches and other instructions that change the PC

© 2009, Renesas Technology America, Inc., All Rights Reserved 9 Slots Requiring Multiple Cycles MA stage takes three cycles IF stage takes two cycles Execution time of Instruction 1: 4 cycles

© 2009, Renesas Technology America, Inc., All Rights Reserved Pipeline and Flow Control  Due to the pipeline, instructions are fetched before previous instructions are totally completed  Program timing is affected when fetched instructions are not used; this situation can occur for:  Conditional branching  Unconditional branching Understand the difference between  “Virtual time” for instruction execution (ideal case)  Total time for an instruction to execute (actual case) SuperH ® compilers organize code to minimize pipeline stalls

© 2009, Renesas Technology America, Inc., All Rights Reserved Conditional Branch Taken When branch is taken...  Conditional branch instructions:  BF  BT Destination address is known at this point

© 2009, Renesas Technology America, Inc., All Rights Reserved Conditional Branch Not Taken When branch is NOT taken...  Conditional branch instructions:  BF  BT IFIDEX IFIDEXMAWB MAWB IFIDEXMAWB IFIDEXMAWB BR Inst Next Inst Execution continues normally

© 2009, Renesas Technology America, Inc., All Rights Reserved Conditional Delayed Branch When branch is taken...  Instructions:  BF/S  BT/S Delayed Branch / Instruction Re-order Traditional CPU –ADD.W R1,R0 –BGT target_address SuperH CPU –BF/S target_address –ADD.W R1,R0 Delay Delay Introduced

© 2009, Renesas Technology America, Inc., All Rights Reserved Programming Tips  Use local variables wherever possible to improve execution (locals use less ROM and RAM)  Use modular programming to reduce far branches  Be careful with constants; use 8-bit wherever possible  Avoid operations on the MAC that will stall the pipeline  Place functions that call each other close together  Try to align instructions on 32-bit boundaries, especially load/store instructions  Convert byte and word values to signed long integers, the most efficient data type for the SH-2 architecture  Make sure that instructions that immediately follow an instruction that loads from memory, do not use the same destination register as the load instruction

© 2009, Renesas Technology America, Inc., All Rights Reserved 16 Course Summary  Error detection  Address errors  Pipeline  Branching  Recommendations for coding