General Purpose Processors: Software. This Week In DIG II  Introduction  Basic Architecture  Memory  Programmer’s view (that would be you !)  Development.

Slides:



Advertisements
Similar presentations
CPU Structure and Function
Advertisements

Computer Architecture
Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
3-Software Design Basics in Embedded Systems
Chapter 3 General-Purpose Processors: Software
Parul Polytechnic Institute
Control path Recall that the control path is the physical entity in a processor which: fetches instructions, fetches operands, decodes instructions, schedules.
Computer Organization and Architecture
8051 Core Specification.
Processor System Architecture
MICRO PROCESSER The micro processer is a multipurpose programmable, clock driven, register based, electronic integrated device that has computing and decision.
Khaled A. Al-Utaibi  Computers are Every Where  What is Computer Engineering?  Design Levels  Computer Engineering Fields  What.
Chapter 12 CPU Structure and Function. CPU Sequence Fetch instructions Interpret instructions Fetch data Process data Write data.
Computer Organization and Architecture
Computer Organization and Architecture
Interfacing. This Week In DIG II  Basic communications terminology  Communications protocols  Microprocessor interfacing: I/O addressing  Port and.
Chapter 5: Computer Systems Organization Invitation to Computer Science, Java Version, Third Edition.
6-1 I/O Methods I/O – Transfer of data between memory of the system and the I/O device Most devices operate asynchronously from the CPU Most methods involve.
Computer Organization and Architecture The CPU Structure.
Data Manipulation Computer System consists of the following parts:
Chapter 3 General-Purpose Processors: Software
General Purpose Processors: Software This Week In DIG II  Introduction  Basic Architecture  Operation  Programmer’s view (that would be you !) 
Chapter 4 Processor Technology and Architecture. Chapter goals Describe CPU instruction and execution cycles Explain how primitive CPU instructions are.
Recap – Our First Computer WR System Bus 8 ALU Carry output A B S C OUT F 8 8 To registers’ input/output and clock inputs Sequence of control signal combinations.
Embedded Systems Design: A Unified Hardware/Software Introduction 1 Chapter 3 General-Purpose Processors: Software ECE 4330 Embedded System Design.
Pyxis Aaron Martin April Lewis Steve Sherk. September 5, 2005 Pyxis16002 General-purpose 16-bit RISC microprocessor bit registers 24-bit address.
Henry Hexmoor1 Chapter 10- Control units We introduced the basic structure of a control unit, and translated assembly instructions into a binary representation.
Embedded Systems Design: A Unified Hardware/Software Introduction 1 Chapter 3 General-Purpose Processors: Software.
Group 5 Alain J. Percial Paula A. Ortiz Francis X. Ruiz.
CH12 CPU Structure and Function
Micro controllers A self-contained system in which a processor, support, memory, and input/output (I/O) are all contained in a single package.
Embedded Systems Design: A Unified Hardware/Software Introduction 1 Microprocessors.
Chapter 5 Basic Processing Unit
CS 1308 Computer Literacy and the Internet Computer Systems Organization.
1 3-Software Design Basics in Embedded Systems. 2 Two Memory Architectures Processor Program memory Data memory Processor Memory (program and data) HarvardPrinceton.
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
MICROPROCESSOR INPUT/OUTPUT
Chapter 5: Computer Systems Organization Invitation to Computer Science, Java Version, Third Edition.
Lecture 15 VHDL Modeling of Microprocessors.
George Mason University ECE 448 – FPGA and ASIC Design with VHDL Experiment 7 VHDL Modeling of Embedded Microprocessors and Microcontrollers.
1 3-Software Design Basics in Embedded Systems Optimizing the design of General Purpose processors.
Embedded Systems Design: A Unified Hardware/Software Introduction, (c) 2000 Vahid/Givargis 1 Basic Architecture Control unit and datapath –Note similarity.
Embedded Systems Design: A Unified Hardware/Software Introduction 1 Chapter 3 General-Purpose Processors: Software.
General Concepts of Computer Organization Overview of Microcomputer.
ALU (Continued) Computer Architecture (Fall 2006).
Processor Structure and Function Chapter8:. CPU Structure  CPU must:  Fetch instructions –Read instruction from memory  Interpret instructions –Instruction.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
بسم الله الرحمن الرحيم MEMORY AND I/O.
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
Chapter Microcontroller
1 3-Software Design Basics in Embedded Systems. 2 Two Memory Architectures Processor Program memory Data memory Processor Memory (program and data) HarvardPrinceton.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
Chapter 11 System Performance Enhancement. Basic Operation of a Computer l Program is loaded into memory l Instruction is fetched from memory l Operands.
BASIC COMPUTER ARCHITECTURE HOW COMPUTER SYSTEMS WORK.
Recap – Our First Computer WR System Bus 8 ALU Carry output A B S C OUT F 8 8 To registers’ read/write and clock inputs Sequence of control signal combinations.
3-Software Design Basics in Embedded Systems
Chapter 3 General-Purpose Processors: Software
Computing Systems Organization
UNIT – Microcontroller.
Microcomputer Programming
Microcomputer Architecture
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
General Purpose Processor : Software
Computer Operation 6/22/2019.
Chapter 4 The Von Neumann Model
Presentation transcript:

General Purpose Processors: Software

This Week In DIG II  Introduction  Basic Architecture  Memory  Programmer’s view (that would be you !)  Development environment  Application specific instruction-Set Processors (ASIPs)  Selecting a microprocessor  Z-World  General – purpose processor design Chapter 3 General-Purpose Processors: Software

Basic Architecture  Control unit and datapath  Note similarity to single- purpose processor  Key differences  Datapath is general  Control unit doesn’t store the algorithm – the algorithm is “programmed” into the memory Processor (CPU) Control unit Datapath ALU Registers IRPC Controller Memory I/O Control /Status

Architectural Considerations  Clock frequency  Inverse of clock period  Must be longer than longest register-to- register delay in entire processor  Memory access is often the longest  The path that takes the longest time is called critical path. Clock period must be longer than the critical path. Processor Control unitDatapath ALU Registers IRPC Controller Memory I/O Control /Status

Memory: Two Memory Architectures Processor Program memory Data memory Processor Memory (program and data) HarvardPrinceton  Registers serve as short time storage space, the memory serves as the long time storage space  Memory:  Data  Program  Princeton  Data and program stored together  Fewer memory wires  Harvard  Data and program have separate memory locations  Simultaneous program and data memory access RAM:ROM,

Cache Memory  Memory access may be slow  On-chip memory (faster)  Off-chip memory (slower)  Cache is small but fast memory close to processor  Holds copy of part of memory that is most likely to be needed often  Underlying principle: If processor access a specific part of the memory, chances are it will need to access that immediate neighborhood of memory block again sometime soon  Hits and misses Processor Memory Cache Fast/expensive technology, usually on the same chip Slower/cheaper technology, usually on a different chip

Pipelining: Increasing Instruction Throughput Fetch-instr. Decode Fetch ops. Execute Store res Wash Dry Time Non-pipelinedPipelined Time Pipelined pipelined instruction execution non-pipelined dish cleaningpipelined dish cleaning Instruction 1

Programmer’s View  Programmer doesn’t need detailed understanding of architecture  Instead, needs to know what instructions can be executed  Two levels of instructions:  Assembly level (processor specific)  Structured languages (C, C++, Java, etc., processor independent) »How about machine language?  Most development today done using structured languages  But, some assembly level programming may still be necessary  Drivers: portion of program that communicates with and/or controls (drives) another device Often have detailed timing considerations, extensive bit manipulation Assembly level may be best for these

Assembly-Level Instructions opcodeoperand1operand2 opcodeoperand1operand2 opcodeoperand1operand2 opcodeoperand1operand2... Instruction 1 Instruction 2 Instruction 3 Instruction 4  Instruction Set  Defines the legal set of instructions for that processor. If programming in assembly, you need to know these…!  An instruction typically has two parts: opcode field and operand field. Three types of instructions: Data transfer: memory/register, register/register, I/O, etc. Arithmetic/logical: implement a function, move register through ALU and back Branches: determine next PC value when not just PC+1 –Unconditional jumps  determine the address of next instruction –Conditional jumps  ditto, if a condition is satisfied The operation to take place during the instruction Locations of actual data that takes place in an operation (source / destination operand)

Addressing Modes Data Immediate Register-direct Register indirect Direct (regular variables) Indirect (pointer variables) Data Operand field Register address Memory address Data Memory address Data Addressing mode Register-file contents Memory contents The operand field may indicate the data’s location through one of several addressing modes:

A Simple (Trivial) Instruction Set opcode operands MOV Rn, direct Rm ADD Rn, Rm 0000Rndirect 0010Rn 0100RmRn Rn = M(direct) Rn = Rn + Rm SUB Rn, Rm 0101Rm Rn = Rn - Rm MOV Rn, #immed. 0011Rnimmediate Rn = immediate Assembly instruct.First byteSecond byteOperation JZ Rn, relative 0110Rnrelative PC = PC+ relative (only if Rn is 0) Rn MOV direct, Rn 0001Rndirect M(direct) = Rn Rm M(Rn) = Rm

Sample Programs int total = 0; for (int i=10; i!=0; i--) total += i; // next instructions... C program MOV R0, #0; // total = 0 MOV R1, #10; // i = 10 JZ R1, Next; // Done if i=0 ADD R0, R1; // total += i MOV R2, #1; // constant 1 JZ R3, Loop; // Jump always Loop: Next:// next instructions... SUB R1, R2; // i-- Equivalent assembly program MOV R3, #0; // constant  Try some others (exercise)  Handshake: Wait until the value of M[256] is not 0, set M[257] to 1, wait until M[256] is 0, set M[257] to 0 (assume those locations are ports).  (Harder) Count the occurrences of zero in an array stored in memory locations 100 through 199.

Programmer Considerations  Program and data memory space  Embedded processors often very limited e.g., 64 Kbytes program, 256 bytes of RAM (expandable) Find out the program and memory space in BL-1800  Registers: How many are there?  Only a direct concern for assembly-level programmers  However, all programmers need to know “special-function” registers (used for configuring built-in timers, counters, serial communication devices or read/write external pins). Find the number of registers in BL-1800  I/O  How communicate with external signals?  Serial / parallel ports, system bus Find the I/O capabilities and features of BL-1800  Interrupts  Causes the processor to suspend execution of the main program and jump to an interrupt service routine (ISR) to execute a special, short-term need program. Controlled by the PC. Examples…?

Example: parallel port driver  Using assembly language programming we can configure a PC parallel port to perform digital I/O  write and read to three special registers to accomplish parallel communications. Table provides list of parallel port connector pins and corresponding register location for the PC  Example : parallel port monitors the input switch (pin 13) and turns the LED (Pin 2) on/off accordingly LPT Connection PinI/O DirectionRegister Address 1Output0 th bit of register #2 2-9Output0 th ~7 th bit of register #0 14,16,17Output1,2,3 rd bit of register #2 10,11,12,13,15Input6,7,5,4,3 rd bit of register #1

Parallel Port Example ; This program consists of a sub-routine that reads ; the state of the input pin, determining the on/off state ; of our switch and asserts the output pin, turning the LED ; on/off accordingly.x86 CheckPortproc pushax; save the content pushdx; save the content movdx, 3BCh + 1; base + 1 for register #1 inal, dx; read register #1 and al, 10h; mask out all but bit # 4 cmpal, 0; is it 0? jneSwitchOn; if not, we need to turn the LED on SwitchOff: movdx, 3BCh + 0; base + 0 for register #0 inal, dx; read the current state of the port andal, feh; clear first bit (masking) outdx, al; write it out to the port jmpDone ; we are done SwitchOn: movdx, 3BCh + 0; base + 0 for register #0 inal, dx; read the current state of the port oral, 01h; set first bit (masking) outdx, al; write it out to the port Done: popdx; restore the content popax; restore the content CheckPortendp extern “C” CheckPort(void);// defined in // assembly void main(void) { while( 1 ) { CheckPort(); } LPT Connection PinI/O DirectionRegister Address 1Output0 th bit of register #2 2-9Output0 th bit of register #2 14,16,17Output1,2,3 th bit of register #2 10,11,12,13,15Input6,7,5,4,3 th bit of register #1 3BCh: Base address of LPT port (most PCs)

Operating System  Optional software layer providing low-level services to a program (application).  File management, disk access  Keyboard/display interfacing  Scheduling multiple programs for execution Or even just multiple threads from one program  Program makes system calls to the OS  OS responds to these “service calls” based on this priority order.  OS determines which program use the system resources (CPU, memory, etc.) when and how long.

Chapter Summary  General-purpose processors  Good performance, low NRE, flexible  Controller, datapath, and memory  Structured languages prevail  But some assembly level programming still necessary  Many tools available  Including instruction-set simulators, and in-circuit emulators  ASIPs  Microcontrollers, DSPs, network processors, more customized ASIPs  Choosing among processors is an important step  Designing a general-purpose processor is conceptually the same as designing a single-purpose processor