Pirouz Bazargan SabetDecember 2003 Effective Implementation of a 32-bit RISC Processor Pirouz Bazargan Sabet University of Paris 6 - LIP6 - ASIM

Slides:



Advertisements
Similar presentations
B261 Systems Architecture
Advertisements

Integer Arithmetic: Multiply, Divide, and Bitwise Operations
CS/COE0447 Computer Organization & Assembly Language
Chapter 3 Arithmetic for Computers. Exam 1 CSCE
Systems Architecture Lecture 5: MIPS Instruction Set
Chapter 2 Instructions: Language of the Computer
CPE 731 Advanced Computer Architecture Instruction Set Principles Dr. Gheith Abandah Adapted from the slides of Prof. David Patterson, University of California,
Computer Architecture CPSC 321 E. J. Kim. Overview Logical Instructions Shifts.
S. Barua – CPSC 440 CHAPTER 2 INSTRUCTIONS: LANGUAGE OF THE COMPUTER Goals – To get familiar with.
Lecture 5 Sept 14 Goals: Chapter 2 continued MIPS assembly language instruction formats translating c into MIPS - examples.
ECE 15B Computer Organization Spring 2010 Dmitri Strukov Lecture 6: Logic/Shift Instructions Partially adapted from Computer Organization and Design, 4.
IT253: Computer Organization Lecture 5: Assembly Language and an Introduction to MIPS Tonga Institute of Higher Education.
Computer Engineering AddSub page 1 Basic Building Blocks Multiplexer + Demultiplexer Adder.
CSE378 Instr. encoding.1 Instruction encoding The ISA defines –The format of an instruction (syntax) –The meaning of the instruction (semantics) Format.
CSCI 136 Lab 1: 135 Review.
Chapter 10 The Assembly Process. What Assemblers Do Translates assembly language into machine code. Assigns addresses to all symbolic labels (variables.
True Assembly Language Part I. The Assembly Process The process of translating a MAL code (an assembly language program) into machine code (a sequence.
Computer Organization CS224 Fall 2012 Lessons 7 and 8.
MIPS Instructions Instructions: Language of the Machine
EEL5708/Bölöni Lec 3.1 Fall 2006 Sept 1, 2006 Lotzi Bölöni EEL 5708 High Performance Computer Architecture Lecture 3 Review: Instruction Sets.
DR. SIMING LIU SPRING 2016 COMPUTER SCIENCE AND ENGINEERING UNIVERSITY OF NEVADA, RENO Session 9 Binary Representation and Logical Operations.
1 Signed Arithmetic Logical Operations Ellen Spertus MCS 111 October 1, 2002.
CMPUT Computer Organization and Architecture I1 CMPUT229 - Fall 2003 Topic6: Logic, Multiply and Divide Operations José Nelson Amaral.
COM181 Computer Hardware Lecture 6: The MIPs CPU.
Computer Organization and Design Instruction Sets - 1
MIPS Arithmetic and Logic Instructions
CS Computer Organization Numbers and Instructions Dr. Stephen P. Carl.
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Yaohang Li.
Instruction Set Architecture of MIPS Processor Presentation B
Instructor: Prof. Hany H Ammar, LCSEE, WVU
COMPUTER ARCHITECTURE & OPERATIONS I
Computer Organization and Design Instruction Sets - 2
Morgan Kaufmann Publishers
Computer Organization and Design Instruction Sets - 2
RISC Concepts, MIPS ISA Logic Design Tutorial 8.
Computer Organization and Design Instruction Sets - 1
ENGR 3410 – Computer Architecture Mark L. Chang Fall 2006
Computer Organization and Design Instruction Sets
Appendix A Classifying Instruction Set Architecture
Lecture 4: MIPS Instruction Set
MPIS Instructions Functionalities of instructions Instruction format
MISP Assembly.
CSCI206 - Computer Organization & Programming
Computer Organization and Design Instruction Sets - 1
Computer Architecture & Operations I
The University of Adelaide, School of Computer Science
ECE232: Hardware Organization and Design
The University of Adelaide, School of Computer Science
MIPS History MIPS is a computer family
Part II Instruction-Set Architecture
MIPS History MIPS is a computer family
MIPS Assembly.
Computer Instructions
Computer Architecture
Flow of Control -- Conditional branch instructions
Basic Building Blocks Multiplexer Demultiplexer Adder +
UCSD ECE 111 Prof. Farinaz Koushanfar Fall 2018
Logical instructions And rd rs rt Nor rd rs rt Or rd rs rt
Basic Building Blocks Multiplexer Demultiplexer Adder +
Computer Organization and Design Instruction Sets - 1
MIPS Assembly.
Flow of Control -- Conditional branch instructions
MIPS History MIPS is a computer family
CS352H Computer Systems Architecture
Reduced Instruction Set Computer (RISC)
Logical Instructions And rd rs rt Nor rd rs rt Or rd rs rt
Instruction Sets, Episode 1
MIPS Arithmetic and Logic Instructions
MIPS Assembly.
MIPS Arithmetic and Logic Instructions
Presentation transcript:

Pirouz Bazargan SabetDecember 2003 Effective Implementation of a 32-bit RISC Processor Pirouz Bazargan Sabet University of Paris 6 - LIP6 - ASIM

Pirouz Bazargan SabetDecember 2003 Outline Architecture of a RISC Processor Implementation

Pirouz Bazargan SabetDecember 2003 Introduction Architecture ? All aspects visible from the USER’s (programmer) point of view External view Specifications of the processor What the processor is supposed to do

Pirouz Bazargan SabetDecember 2003 Introduction Implementation ? All aspects visible from the DESIGNER’s point of view Internal view How much time does it take to perform some operation ? Which hardware may be used and how it should be organized to make the specifications feasable

Pirouz Bazargan SabetDecember 2003 Software visible registers The instruction set Architecture Memory Addressing The exception / reset mechanism

Pirouz Bazargan SabetDecember 2003 Architecture Architecture of the MIPS processor Mips ? A 32-bit processor One of the two first RISC architectures Defined in 1981 by the Architecture Research Group at the Stanford University (John Hennessy)

Pirouz Bazargan SabetDecember 2003 Architecture Simplified Mips-R3000 architecture No floating point operations No virtual memory management

Pirouz Bazargan SabetDecember 2003 Software visible registers The instruction set Architecture Memory Addressing The exception / reset mechanism

Pirouz Bazargan SabetDecember 2003 Architecture Software visible registers Registers that can be manipulated (written and read) in the assembly language

Pirouz Bazargan SabetDecember 2003 Software Visible Registers 32 common 32-bit registers Integer Registers R 0 …. R 31 Addressed from their number

Pirouz Bazargan SabetDecember 2003 Software Visible Registers R 0 : The Trash Register R 0 contains always 0 A value written into R 0 is lost R 31 : The Link Register When a subroutine is called, the return address is saved into R 31

Pirouz Bazargan SabetDecember 2003 Software Visible Registers Two 32-bit registers : HI and LO Used by multiply and divide instructions Multiply 32 most significant bits 32 least significant bits HI LO Divide Result Remainder HI LO

Pirouz Bazargan SabetDecember 2003 Software Visible Registers Four 32-bit special registers : Coprocessor Registers Needed to implement an operating system SRStatus Register CAUSECause Register (cause of exceptions) EPCException Program Counter (return address in case of exception) BAR Bad Address Register (illegal memory address)

Pirouz Bazargan SabetDecember 2003 Software visible registers The instruction set Architecture Memory Addressing The exception / reset mechanism

Pirouz Bazargan SabetDecember 2003 Memory Addressing 32-bit address  4 Gbytes of memory space Read / Write operations 3 types of data : Half-word (2 bytes) Word (4 bytes) Byte

Pirouz Bazargan SabetDecember 2003 Memory Addressing The processor can operate under 2 modes User / Kernel 1 1 : user 0 : kernel The current mode is defined by the Status Register Status Register

Pirouz Bazargan SabetDecember 2003 Memory Addressing The memory space is divided into 2 parts In User mode the processor can only access the addresses ranged from to 7FFF FFF FFF FFFF FFFF USER

Pirouz Bazargan SabetDecember 2003 Memory Addressing FFF FFFF FFFF The OS protects the hardware against an error in a User program USER O S The frontier protects the OS

Pirouz Bazargan SabetDecember 2003 Memory Addressing lsbMsb memory register Data alignment rule

Pirouz Bazargan SabetDecember 2003 Memory Addressing lsbMsb memory register Bytes’ order : Little Endian 0000 FFFF

Pirouz Bazargan SabetDecember 2003 Memory Addressing Address alignment rule The address of an object of N bytes must be multiple of N Address of a Word  multiple of 4 Address of a Half-Word  multiple of 2 Address of a Byte  multiple of 1

Pirouz Bazargan SabetDecember 2003 Software visible registers The instruction set Architecture Memory Addressing The exception / reset mechanism

Pirouz Bazargan SabetDecember 2003 Instruction Set RISC Architecture Only simple instructions All instructions have the same size (32 bits) 3-operand instructions (2 read, 1 write) No operation involving operands in memory - Only load and store operations

Pirouz Bazargan SabetDecember 2003 Instruction Set 3 instruction formats Register-register instructionsR Immediate instructionsI Jump instructionsJ

Pirouz Bazargan SabetDecember 2003 Instruction Set R format opcodOperation code funcFunction (opcod extension) rs# of source register rt# of source register rd# of destination register shamShift amount (# of bit the opr. is shifted) 6 opcod 5 rs 5 rt 5 rd 5 sham 6 func

Pirouz Bazargan SabetDecember 2003 Instruction Set I format opcodOperation code rs# of source register rt / rd# of source or destination register imdImmediate value 6 opcod 5 rs 5 rt/rd 16 imd

Pirouz Bazargan SabetDecember 2003 Instruction Set J format opcodOperation code imdImmediate value 6 opcod 26 imd

Pirouz Bazargan SabetDecember 2003 Instruction Set Arithmetic and logic instructions Control instructions Memory access instructions System instructions

Pirouz Bazargan SabetDecember 2003 Arithmetic and logic Assembly language Action Format Add Rd, Rs, RtRs+Rt  Rd Overflow  exc. add opcodrsrtrdfunc R format

Pirouz Bazargan SabetDecember 2003 Arithmetic and logic Assembly language Action Format opcodrsrdimd I format Addi Rd, Rs, ImdRs+Imd  Rd add immediate Overflow  exc. Imd is sign extended Rs Rd Imd

Pirouz Bazargan SabetDecember 2003 Arithmetic and logic Assembly language Action Format opcodrsrtrdfunc Addu Rd, Rs, RtRs+Rt  Rd No overflow add unsigned R format

Pirouz Bazargan SabetDecember 2003 Arithmetic and logic Assembly language Action Format opcodrsrdimd I format Addiu Rd, Rs, ImdRs+Imd  Rd add immediate unsigned No overflow Imd is sign extended Rs Rd Imd

Pirouz Bazargan SabetDecember 2003 Arithmetic and logic Assembly language Action Format opcodrsrtrdfunc R format Sub Rd, Rs, Rt Rs – Rt  Rd Overflow  exc. subtract

Pirouz Bazargan SabetDecember 2003 Arithmetic and logic Assembly language Action Format opcodrsrtrdfunc R format Subu Rd, Rs, Rt Rs – Rt  Rd No overflow Subtract unsigned

Pirouz Bazargan SabetDecember 2003 Arithmetic and logic Assembly language Action Format opcodrsrtrdfunc R format Or Rd, Rs, RtRs or Rt  Rd bitwise logic OR

Pirouz Bazargan SabetDecember 2003 Arithmetic and logic Assembly language Action Format opcodrsrdimd I format Ori Rd, Rs, ImdRs or Imd  Rd bitwise logic OR immediate Imd is zero extended Rs Rd 0 0 Imd

Pirouz Bazargan SabetDecember 2003 Arithmetic and logic Assembly language Action Format opcodrsrtrdfunc R format And Rd, Rs, RtRs and Rt  Rd bitwise logic AND

Pirouz Bazargan SabetDecember 2003 Arithmetic and logic Assembly language Action Format opcodrsrdimd I format Andi Rd, Rs, ImdRs and Imd  Rd bitwise logic AND immediate Imd is zero extended Rs Rd Imd 0 0

Pirouz Bazargan SabetDecember 2003 Arithmetic and logic Assembly language Action Format opcodrsrtrdfunc R format Xor Rd, Rs, RtRs xor Rt  Rd bitwise logic XOR

Pirouz Bazargan SabetDecember 2003 Arithmetic and logic Assembly language Action Format opcodrsrdimd I format Xori Rd, Rs, ImdRs xor Imd  Rd bitwise logic XOR immediate Imd is zero extended Rs Rd Imd 0 0

Pirouz Bazargan SabetDecember 2003 Arithmetic and logic Assembly language Action Format opcodrsrtrdfunc R format Nor Rd, Rs, RtRs nor Rt  Rd bitwise logic NOR

Pirouz Bazargan SabetDecember 2003 Arithmetic and logic Assembly language Action Format opcodshamrtrdfunc R format Sll Rd, Rt, ShamRt << Sham  Rd Shift left logic 0 Sham Rt Rd

Pirouz Bazargan SabetDecember 2003 Arithmetic and logic Assembly language Action Format opcodrsrtrdfunc R format Sllv Rd, Rt, RsRt << Rs  Rd Shift left logic variable 0 Rt Rd Rs Only the 5 lsb of Rs are meaningful

Pirouz Bazargan SabetDecember 2003 Arithmetic and logic Assembly language Action Format opcodshamrtrdfunc R format Srl Rd, Rt, ShamRt >> Sham  Rd Shift right logic 0 Sham Rt Rd

Pirouz Bazargan SabetDecember 2003 Arithmetic and logic Assembly language Action Format opcodrsrtrdfunc R format Srlv Rd, Rt, RsRt >> Rs  Rd Shift right logic variable Rs Only the 5 lsb of Rs are meaningful 0 Rt Rd

Pirouz Bazargan SabetDecember 2003 Arithmetic and logic Assembly language Action Format opcodshamrtrdfunc R format Sra Rd, Rt, ShamRt >> Sham  Rd Shift right arithmetic Sham Rt Rd

Pirouz Bazargan SabetDecember 2003 Arithmetic and logic Assembly language Action Format opcodrsrtrdfunc R format Srav Rd, Rt, RsRt >> Rs  Rd Shift right arithmetic variable Rs Only the 5 lsb of Rs are meaningful Rt Rd

Pirouz Bazargan SabetDecember 2003 Arithmetic and logic Assembly language Action Format opcodrsrtrdfunc R format Slt Rd, Rs, RtRs < Rt ? Set if less than 0  Rd 1  Rd Yes : No : Operands are signed

Pirouz Bazargan SabetDecember 2003 Arithmetic and logic Assembly language Action Format Slti Rd, Rs, ImdRs < Imd ? Set if less than immediate 0  Rd 1  Rd Yes : No : Operands are signed Imd is sign extended opcodrsrdimd I format

Pirouz Bazargan SabetDecember 2003 Arithmetic and logic Assembly language Action Format opcodrsrtrdfunc R format Sltu Rd, Rs, RtRs < Rt ? Set if less than unsigned 0  Rd 1  Rd Yes : No : Operands are unsigned

Pirouz Bazargan SabetDecember 2003 Arithmetic and logic Assembly language Action Format Sltiu Rd, Rs, ImdRs < Imd ? Set if less than immediate, unsigned 0  Rd 1  Rd Yes : No : Operands are unsigned Imd is zero extended opcodrsrdimd I format

Pirouz Bazargan SabetDecember 2003 Arithmetic and logic Assembly language Action Format opcodrdimd I format Lui Rd, ImdImd << 16  Rd load upper immediate 0 0 Rd