comparison of risc.pdf

Upload: koteswara-rao-l

Post on 06-Jul-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/18/2019 COMPARISON OF RISC.pdf

    1/31

    Insightful comparison between three of the mosand widely used RISC processors: MIPS, ARM a

    Apurv

    Rishabh SRishikes

    Shivakumar Sop

  • 8/18/2019 COMPARISON OF RISC.pdf

    2/31

    Index

    1. Introduction2. History3. Applications and market4. Architectural difference5. Register conventions6. Operating modes

    7. Addressing modes8. Conditional execution9. Exception handling10 Stack implementation11.Conclusion

  • 8/18/2019 COMPARISON OF RISC.pdf

    3/31

    Introduction

    1. Why do we need to study the differences?

    ● Every application is different, and hence each application requires different cfactors that decide the architecture to use.

    ● Some may be performance dependent, some crucial with respect to reliabilitymight require to reduce the cost.

    2. We will discuss about how to select a specific processor for p

    application along with few use cases.

    3. The presentation will help you scale your application and adarchitecture which is a best fit.

  • 8/18/2019 COMPARISON OF RISC.pdf

    4/31

    History

    Reduced instruction set computing ( RISC ).

    ● MIPS : Microprocessor without Interlocked Pipeline Stages. - Developed since 1MIPS-32 and MIPS-64 with versions MIPS 1 to MIPS 5Ex: Embedded systems, Connectivity.

    ● ARM : Advanced RISC Machines. - Developed since 1985.Developed because of the emerging trend of low cost machines.

    Ex: Mobile devices, Automotive.

    ● SPARC : Scalable Processor Architecture. - Developed since 1987.Developed because of the concept of making it compatible for various dlanguages to code on and deploy softwares which can provide high perfo

    Ex: Network Servers, Mobile Devices.

  • 8/18/2019 COMPARISON OF RISC.pdf

    5/31

    Applications and market

    1. MIPS● Unlike other architectures MIPS has many market applications.● Open source implementations available.

    ● Simple coding syntax, easier to use.● Benefits help them to be used for educational purpose.● The cost for devices using MIPS is less.● Support for Graphics, and long term support.

    Ex: Few Applications● MM : Memory Management application .

    ● MMU : Memory Management Unit.● Mobile Devices, Networking devices, Audio devices.

    Overall : Low cost, huge functionality and high performance gives it a bigger marthe rest.

  • 8/18/2019 COMPARISON OF RISC.pdf

    6/31

    Applications and market (contd..)

    2. ARM● Support for 64 bit architecture. Continuous updation.● Development over architecture depending upon the market.

    Ex. ARM v8-A for high performance market like mobile devices.  ARM v8-R for embedded devices like automotive, industrial control.

    ● Variety of units as per demand. Some include virtual platforms, code generatidebug solution tools.

    ● Every device configured with respect to consume low power.● Extension approach like java acceleration, SIMD, advanced SIMD, security (Tru● Support for Graphics, long term support.

    Overall : Low cost, adaptability, variety of low power-high performance devices gbigger market than the rest.

  • 8/18/2019 COMPARISON OF RISC.pdf

    7/31

    Applications and market (cont..)

    3. SPARC

    ● Used majorly by programmers and Architects. Low level programing.● Multi core functionality introduced by this architecture.● Use cases include softwares and devices where need for performance with res

    throughput is required.● A bit higher on cost than others● Highest support of Integration with other architectures.● Multiple servers can be written with the help of Solaris OS which is the best fi

    Overall : Adaptability, Extreme high performance architecture makes it ideal for which are highly concerned about throughput and extreme server processing.

  • 8/18/2019 COMPARISON OF RISC.pdf

    8/31

    Architectural difference

    1.MIPS● Low overhead - less time wasted● Power Efficient- less number of instructions

    2.ARM with Thumb● Reduced total amount of Memory● Extra Thumb ISA

    ● Switching between states

    3.SPARC● Register file model unlike others its not flat

     

  • 8/18/2019 COMPARISON OF RISC.pdf

    9/31

    Register conventions

    Registers referred using:

    ● MIPS $ ex: $R0● ARM

    ex: R0

    ● SPARC %ex: %R0

    MIPS

  • 8/18/2019 COMPARISON OF RISC.pdf

    10/31

    MIPS

    32 bit wide 32 registers

    Two special registers:Hi/Lo -> Multiply and DivideUnitsmfhi $r1mflo $r0

    ARM

  • 8/18/2019 COMPARISON OF RISC.pdf

    11/31

    ARM

    For ARM Cortex- M3

    ● 32 bit wide 16 registers● 12 general purpose registers

    Status registers:● CPSR

  • 8/18/2019 COMPARISON OF RISC.pdf

    12/31

    SPARC● 32 bit wide 32 Registers

    ● Registers are divided into four groups.1. global registers2. output registers3. local registers4. input registers

    ● Register file model not flat.● Overlapping register windows.

    Procedure Callin

  • 8/18/2019 COMPARISON OF RISC.pdf

    13/31

    ARM

    Operating modes

    User Mode Privileg

    System Mode Except

    SVC - Supervisor Mode

    UND- Undefined Mode

     ABT - Abort Mode

    IRQ- Interrupt Mode

    FIQ- Fast Interrupt Mode

    MIPS

    Kernel Mode User Mode

    SPARC

    Supervisor Mode User Mode

  • 8/18/2019 COMPARISON OF RISC.pdf

    14/31

    MI

    PS

    Operating Modes - MIPS and SPARC

    kernel mode, (Status Bit - 0)● Can access and change all registers.● This mode has the privilege over other modes and gets switched to in case o

    error, interruption, exception or at power upUser mode, (Status Bit - 1)

    ● Accessed by users and has a lower privilege than that of the kernel mode.● It also prevents different users from interfering with one another 

    kernel mode, (Status Bit - 0)● Used to access the processor state registers, such as the Window Invalid Ma

    input/output devices.● Full access to the memory and its system tables making it privileged in almos

    User mode, (Status Bit - 1)● Used to write to and read from the processor state register and has a limited

    since a load or a store instruction cannot be executed in it.● Additionally, to know whether the processor is in the user mode or in the supe

    processor status word is used to determine the current state of the processor

    SPAR

    C

  • 8/18/2019 COMPARISON OF RISC.pdf

    15/31

    Operating Modes - ARM

     ARM has seven basic operating modes, starting with the processor mode which has twmodes under it, the user mode and the privileged mode.1. User mode

    The user mode is where most applications’ contents or operating systems’ tasks 2. Privileged mode

    The privileged mode has under it two operating modes, system mode and the exc

    ❖ System mode is the privileged mode which uses the same registers as used by ❖ Exception mode has 5 operating modes

    1. Supervisor mode (SVC) which is entered under two conditions, when on restore o

    Interrupt Instruction (SWI) is executed2.  Abort (ABT) mode which is used to handle memory access violations3. Undefined (UND) mode which is used to handle undefined instructions4. Interrupt (IRQ) mode which is entered when a high priority interrupt is raised.5. Fast Interrupt (FIQ) mode which is entered when a high priority interrupt is raised

  • 8/18/2019 COMPARISON OF RISC.pdf

    16/31

    Operating Modes - ARM - Register Organization

  • 8/18/2019 COMPARISON OF RISC.pdf

    17/31

  • 8/18/2019 COMPARISON OF RISC.pdf

    18/31

     Addressing modes - MIPS

    MIPS support five addressing modes:

    1. Register Addressing: This mode is mainly used in calculating the effective address of the j

    instruction. Ex: Jump $R3; ADD $R5, $R6, $R7

    2. Immediate Addressing: This mode does not access memory and thus is relatively faster thaThe immediate is of size equal to 16-bits. Ex: ADD $R1, $R1, 10; i.e R1= R1+100

    3. PC-Relative Addressing: This mode is used to determine when the branch instruction occuoffset value with the PC. EX: BEQZ $R5, Loop;

    4. Pseudo-direct Addressing: This mode is used in the jump instruction where the value of th

    and the target of the instruction jumped to is 26-bits. The upper four bits of the PC and thesignificant bits, which are 00, are all concatenated with the 26-bit immediate resulting in ainstruction. EX: MOVE $R1, $R2 means move value of $R2 into $R1, this is translated into ac$R1, $R1, $ZERO

    5. Base Addressing: This mode is used in store word and load word instructions. It is known aaddressing since the register acts as a pointer to some memory location whose address couregister. EX: LW $R1, 24($R1); Address is the sum of the register and constant 24

  • 8/18/2019 COMPARISON OF RISC.pdf

    19/31

    Addressing Mode - ARM

    ARM supports multiple addressing modes, including modes that allow direct bit shifting. There aaddressing modes to calculate the effective address:

    1. Pre-indexed Addressing: In this mode, the source/destination address is stored in a regi

    another value. Figure 1 (a), shows how the load operation is used to calculate the pre-indeffective address. EX: LDR R3, [R5, R6]

    2. Pre-indexed Addressing with Write Back: In this mode, it is sometimes useful to save thin a register. To indicate that this effective address is being written back, add an exclamat the end of the load instruction. Figure 1 (b) describes the operation of the write back.[R5, R6]!

    3. Post-Indexed Addressing: This mode is similar to Pre-Indexed Addressing with Write bacthe address is modified and saved only after the load/store operation. Figure 1 (c) illustreffective address calculation in the post-indexed addressing mode. EX: LDR R3, [R5], R6

    4. Program Counter Relative Addressing: This mode allows the ARM architecture developememory relative to the Program Counter (R15). LDR R0, [R15, #24]

  • 8/18/2019 COMPARISON OF RISC.pdf

    20/31

  • 8/18/2019 COMPARISON OF RISC.pdf

    21/31

    Addressing mode -SPARC

    SPARC supports two addressing modes to compute the effective address:

    1. The Register indirect with index: This mode computes the effective address by addinbase register to those of the index register. The effective address cannot be equal to only thethe index register could be made equal to zero and by that the effective address will be equalE.g: Add %i3, %i1, %i2Typically used to access array where one register holds the base value and other holds the (selement

    2. The Register indirect with immediate: This mode computes the effective address by

    13-bit immediate to 64 bits and then adds the contents of the base register to it. The effectivemade equal to the base register by making the constant equal to zero.E.g: Add %o1, 4, %o2

  • 8/18/2019 COMPARISON OF RISC.pdf

    22/31

     Stack implementation

    A stack is a data structure that is used for the storage of data.

    MIPS ARM

    Direction ofStack growth

    Stack growdownwards

    Stack growdownwards andupwards

    Sdo

    Push and Popinstruction

    Does not supportpush/popinstructions.Instead, itmanipulates thestack pointer(register 29)

    No explicitpush/popinstructions but itcan manipulate thestack pointer to doso

    Nopobuimthe(sp

  • 8/18/2019 COMPARISON OF RISC.pdf

    23/31

     Stack implementation - Stack Popping

    Stack popping. The stack pointer (SP) copies the data, in the address given, in a regiand then moves the stack pointer.

    Initial StackAf

    adju

    S

     Empty

    Data

    Stack

    SP SP

    SP

     Empty

    Data

    Stack

     Em

    Da

    St

    000FFFFC

    00100000

    000FFFFC

    00100000

    AfterCopying 

  • 8/18/2019 COMPARISON OF RISC.pdf

    24/31

     Stack implementation - Stack Pushing

    Stack pushing. The stack pointer (SP) is moved in order to place the contents of reg[3]) into the address that the stack pointer is pointing to.

    Initial StackAf

    Cop

     Empty

    Stack

    SP

    SP SPEmpty

    Stack

     Em

    R

    St

    000FFFFC

    0010000000100000

    AfterAdjusting

    SP

  • 8/18/2019 COMPARISON OF RISC.pdf

    25/31

    Conditional ExecutionAdvantage of conditional statements is that, we can make certain statements toconditionally.

    MIPSNo Conditional bitsdepends on branch instructionsExample:beq $5, $13, label1

  • 8/18/2019 COMPARISON OF RISC.pdf

    26/31

    ARMFour Conditional Flags:

    ● Zero (Z), Overflow(V), Carry (C), Negative (N)Data processing instructions do not affect the conditional flags

    postfix the instruction with letter “s”Example:ADDS r0, r1, r2Data processing Instructions: Arithmetic operations, comparisons, logical operations, data movement between

    SPARCFour Conditional flags:

    ● Zero (Z), Overflow(V), Carry (C), Negative (N)Suffix “cc” to operationsExample:ADDc Rs1, Rs2, RdADDccc Rs1, Rs2, Rd

  • 8/18/2019 COMPARISON OF RISC.pdf

    27/31

    Exception handling

    Normal execution of instructions may be interrupted when an exception occurs.Are 2 types:

    ● Synchronous exceptions: occurs at the same place every time a program is executed● Asynchronous exceptions: happen with no temporal relation to the program being execute

    Register Number Register Name Usage

    8 BadVAddr This holds Memory address where exception

    12 Status Masks the Interrupts, enable bits, and changesexception occurred

    13 Cause Type of exception occurred and pending inte

    14 EPC Holds Address of instruction that caused ex

    MIPS

    Cause Register  Pending Interrupt Exception Code

    Bits 15-10 Bits 5-2

  • 8/18/2019 COMPARISON OF RISC.pdf

    28/31

    Exception handling

    ARM● Exception happens only in ARM mode.● Core copies CPSR and is saved in SPSR.● CPSR is updated with ARM state, CPU to exception mode, interrupts are disab● PC is set to interrupt vector address.

    SPARC● When Exception occurs Trap Enable gets cleared● Execution state changes to supervisor mode

    ● Current window pointer is decremented● Program counter, processor state register, NPC are saved to local registers %l0● trap handling code is saved to %l3 to %l7

  • 8/18/2019 COMPARISON OF RISC.pdf

    29/31

    Conclusion

    We conclude that once the detail analysis of your product is donethe tables and flowcharts from this presentation is followed, it ca

    us decide which architecture to choose before even starting theprototyping of product.

    This will help making the product competitive and help them keeupdated in the market with high assured performance.

  • 8/18/2019 COMPARISON OF RISC.pdf

    30/31

    References

    [1] A. I. Center., ARM Information Center. N.p., n.d.

    [2] B. J. Catanzaro, Ed., The SPARC Technical Papers. New York, NY, USA: SpringeNew York, Inc., 1991.

    [3] C. Corporation, Best Practices For Improving Application Performance and Lowby Managing MIPS., 2012.

    [4] R. Teodorescu, Instruction Set Architecture of MIPS Processor Presentation B. TState University, 2008.

    [5] C. Lin, Understanding the Stack. Department of Computer Science, University 2003.

  • 8/18/2019 COMPARISON OF RISC.pdf

    31/31

    Thank you