Computer Science Education

Slides:



Advertisements
Similar presentations
Processor Data Path and Control Diana Palsetia UPenn
Advertisements

ARM Based microcontrollers Asst. Prof. Dr. Alper ŞİŞMAN.
SE 292 (3:0) High Performance Computing L2: Basic Computer Organization R. Govindarajan
Chapter 4 The Von Neumann Model
Chapter 4 The Von Neumann Model
CS/COE1541: Introduction to Computer Architecture Datapath and Control Review Sangyeun Cho Computer Science Department University of Pittsburgh.
ARM versions ARM architecture has been extended over several versions.
Lab 4 Design a processor to implement the Fibonacci sequence
Appendix D The ARM Processor
Overheads for Computers as Components 2nd ed.
THUMB Instructions: Branching and Data Processing
The Processor: Datapath & Control
1  1998 Morgan Kaufmann Publishers Chapter Five The Processor: Datapath and Control.
Levels in Processor Design
The Processor 2 Andreas Klappenecker CPSC321 Computer Architecture.
Chapter Five The Processor: Datapath and Control.
Processor I CPSC 321 Andreas Klappenecker. Midterm 1 Thursday, October 7, during the regular class time Covers all material up to that point History MIPS.
ARM Instructions I Prof. Taeweon Suh Computer Science Education Korea University.
Basic Operational Concepts of a Computer
ECM534 Advanced Computer Architecture Lecture 5. MIPS Processor Design
COSC 3430 L08 Basic MIPS Architecture.1 COSC 3430 Computer Architecture Lecture 08 Processors Single cycle Datapath PH 3: Sections
Lecture 9. MIPS Processor Design – Instruction Fetch Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System Education &
Computer Science Education
Gary MarsdenSlide 1University of Cape Town Chapter 5 - The Processor  Machine Performance factors –Instruction Count, Clock cycle time, Clock cycles per.
IT253: Computer Organization Lecture 9: Making a Processor: Single-Cycle Processor Design Tonga Institute of Higher Education.
1 A single-cycle MIPS processor  An instruction set architecture is an interface that defines the hardware operations which are available to software.
CS61C L20 Datapath © UC Regents 1 Microprocessor James Tan Adapted from D. Patterson’s CS61C Copyright 2000.
Elements of Datapath for the fetch and increment The first element we need: a memory unit to store the instructions of a program and supply instructions.
Datapath and Control AddressInstruction Memory Write Data Reg Addr Register File ALU Data Memory Address Write Data Read Data PC Read Data Read Data.
COM181 Computer Hardware Lecture 6: The MIPs CPU.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
MIPS Processor.
Lecture 9. MIPS Processor Design – Single-Cycle Processor Design Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System.
Lecture 5. MIPS Processor Design
Computer Architecture Lecture 6.  Our implementation of the MIPS is simplified memory-reference instructions: lw, sw arithmetic-logical instructions:
CS161 – Design and Architecture of Computer Systems
Single Cycle CPU.
CS 230: Computer Organization and Assembly Language
Computer Architecture
Edexcel GCSE Computer Science Topic 15 - The Processor (CPU)
Morgan Kaufmann Publishers The Processor
Morgan Kaufmann Publishers
Decode and Operand Read
Instruction Format MIPS Instruction Set.
Computer Architecture
MIPS Processor.
Processor (I).
CS/COE0447 Computer Organization & Assembly Language
CSCI206 - Computer Organization & Programming
CS/COE0447 Computer Organization & Assembly Language
Single-Cycle CPU DataPath.
CS/COE0447 Computer Organization & Assembly Language
Design of the Control Unit for One-cycle Instruction Execution
MIPS Processor.
Levels in Processor Design
Topic 5: Processor Architecture Implementation Methodology
Rocky K. C. Chang 6 November 2017
The Processor Lecture 3.2: Building a Datapath with Control
Topic 5: Processor Architecture
Lecture 9. MIPS Processor Design – Decoding and Execution
COMS 361 Computer Organization
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Instruction Format MIPS Instruction Set.
The Processor.
CS/COE0447 Computer Organization & Assembly Language
The Processor: Datapath & Control.
COMS 361 Computer Organization
MIPS Processor.
Processor: Datapath and Control
CS/COE0447 Computer Organization & Assembly Language
Presentation transcript:

Computer Science Education ARM CPU Internal I Prof. Taeweon Suh Computer Science Education Korea University

Overview For the sake of your understanding, we simplify the CPU and its system structure CPU North Bridge South Bridge Main Memory (DDR) FSB (Front-Side Bus) DMI (Direct Media I/F) Real-PC system Memory (Instruction, data) ARM CPU Address Bus Data Bus Simplified

Actual ARM Connection ARM CPU has separate connections to memory (caches) ARM920T Memory Instruction fetch Instruction Cache Address Bus Data Bus ARM CPU core Address Bus Address Bus Data Bus Data Cache Data Bus Instruction/ Data access Data access

Overview Microarchitecture is composed of datapath and control Datapath operates on words of data Datapath elements are used to operate on or hold data within a processor Datapath elements include the register file, ALU, muxes, and memory Control tells the datapath how to execute instructions Control unit receives the current instruction from the datapath and tells the datapath how to execute that instruction Specifically, the control unit produces mux select, register enable, ALU control, and memory write signals to control the operation of the datapath Essential ARM instructions Data processing instructions: add, sub, cmp, and, or Memory access instructions: ldr, str Branch instructions: b, bl

Instruction Execution in CPU Generic steps of the instruction execution in CPU Fetch uses the program counter (PC) to supply the instruction address and fetch instruction from memory Decoding decodes instruction and reads operands Extract opcode: determine what operation should be done Extract operands: register numbers or immediate from fetched instruction Execution Use ALU to calculate (depending on instruction class) Arithmetic or logical result Memory address for load/store Branch target address Access memory for load/store Next Fetch PC  target address or PC + 4 Address Bus Instruction/ Data Memory ARM CPU core Fetch with PC Data Bus PC = PC +4 Decode Address Bus Execute Data Bus

Increment by 4 for the next instruction 32-bit register (flip-flops) Instruction Fetch ARM CPU core Increment by 4 for the next instruction 4 Add Memory Address Out 32 PC reset clock instruction 32-bit register (flip-flops) What is PC on reset in ARM? PC = 0x0000_0000

Memory Memory is classified into RAM (Random Access Memory) and ROM (Read-Only Memory) RAM is classified into DRAM (Dynamic RAM) and SRAM (Static RAM) DDR is a kind of DRAM DDR is a short form of DDR (Double Data Rate) SDRAM (Synchronous DRAM) DDR is used as main memory in modern computers

Simple ARM Test Code assemble

Instruction Decoding Instruction decoding separates the fetched instruction into the fields Opcode determines which operation the instruction wants to do Control logic should be designed to supply control signals to datapath elements (such as ALU and register file) Operands Register numbers in the instruction are sent to the register file Immediate field is either sign-extended or zero-extended depending on instructions* *It seems immediate is zero-extended in ARM case. If you write “add r1, r2, #-12”, assembler generates “sub r1, r2, 12”. The shifter operand could be “logical (or arithmetic) shift right a register by immediate. In this case, the register is zero-filled or signed-filled in the shifted vacant bits

Schematic with Instruction Decoding ARM CPU Control Unit Opcode RegWrite Register File Inst[15:12] (=Rd) Inst[19:16] (=Rn) Inst [3:0] (=Rm) Rn 32 Rm wd RegWrite R0 R1 R2 R3 R14 R15 (PC) … instruction PC Add 4 reset clock Memory Address Out 8 32 zero-extended imm 32

Instruction Execution #1 Arithmetic and logical instructions Examples: add, adc, sub, sbc, cmp, mov, and, or … Two source operands One is always a register The other has two basic forms: Immediate or register (optionally shifted) add r1, r2, r3 # r1 = r2 + r3 add opcode: 0100 sub r1, r2, r3 # r1 = r2 – r3 sub opcode: 0010

Data Processing Instruction Formats Source: ARM Architecture Reference Manual

Schematic with Instruction Execution #1 ARM CPU Control Unit opcode ALUSrc RegWrite Register File Inst[15:12] (=Rd) Inst[19:16] (=Rn) Inst [3:0] (=Rm) Rn 32 Rm wd RegWrite R0 R1 R2 R3 R14 R15 (PC) … ALU ALUSrc instruction mux PC Add 4 reset clock Memory Address Out 8 32 zero-extended imm 32

Instruction Execution #2 Memory access instructions ldr, str instructions ldr R1, [R2, #4] // R1 <= [R2 + 4] str R1, [R2,R3] // [R2 + R3] <= R1

Memory Access Instruction Formats Load and Store Word or Unsigned Byte instructions * 12-bit immediate is for load and store word or unsigned byte. * 8-bit immediate is used for halfword and signed byte instructions Source: ARM Architecture Reference Manual

Schematic with Instruction Execution #2 ARM CPU Control Unit opcode MemWrite MemtoReg 8-or-12 Memory Address ReadData WriteData MemWrite ALUSrc RegWrite Register File Inst[15:12] (=Rd) Inst[19:16] (=Rn) Inst [3:0] (=Rm) Rn 32 Rm wd R0 R1 R2 R3 R30 R31 … Rd ALU ALUSrc instruction mux MemtoReg Prof. Suh’ note: For store to work, register file has to have another port (read port). The read port input should be multiplexed with Rs and Rd. mux 8-or-12 PC Add 4 reset clock Memory Address Out 8 32 zero-extended imm 32 12 ldr R1, [R2, #4] // R1 <= [R2 + 4] str R1, [R2, R3] // [R2 + R3] <= R1

Instruction Execution #3 Execution of the branch and jump instructions b, bl instructions b target (offset) Destination = (PC + 8) + sign-extend (imm << 2)

Schematic with Instruction Execution #3 (B) ARM CPU Control Unit opcode branch Memory Address ReadData WriteData MemWrite Register File Inst[15:12] (=Rd) Inst[19:16] (=Rn) Inst [3:0] (=Rm) Rn 32 Rm wd R0 R1 R2 R3 R14 R15 (PC) … Rd ALU ALUSrc mux MemtoReg instruction mux 8-or-12 branch 12 32 zero-extended imm mux Add Memory Address Out 4 Add 24 imm Sign extension <<2 32 PC 32 reset clock Note that Branch Destination = (PC+8) + (sign-extend) (imm << 2)}