ECE 1160/2160 Embedded Systems Design. Midterm Review. Wei Gao. ECE 1160/2160 Embedded Systems Design

Similar documents
Reminder. Course project team forming deadline. Course project ideas. Friday 9/8 11:59pm You will be randomly assigned to a team after the deadline

Reminder. Course project team forming deadline. Course project ideas. Next milestone

Raspberry Pi - I/O Interfaces

Recap from last class

Parallel Data Transfer. Suppose you need to transfer data from one HCS12 to another. How can you do this?

Embedded Systems. Octav Chipara. Thursday, September 13, 12

Introduction to Microcontrollers

Computer Organization

Embedded Systems: Hardware Components (part I) Todor Stefanov

Introduction. Definition. What is an embedded system? What are embedded systems? Challenges in embedded computing system design. Design methodologies.

Computer and Hardware Architecture I. Benny Thörnberg Associate Professor in Electronics

Lecture Objectives. Introduction to Computing Chapter 0. Topics. Numbering Systems 04/09/2017

Introduction the Serial Communications Parallel Communications Parallel Communications with Handshaking Serial Communications

The Embedded System Design Process. Wolf Text - Chapter 1.3

COMP2121: Microprocessors and Interfacing. Introduction to Microprocessors

ELCT708 MicroLab Session #1 Introduction to Embedded Systems and Microcontrollers. Eng. Salma Hesham

Interfacing Techniques in Embedded Systems

EE414 Embedded Systems Ch 5. Memory Part 2/2

Today s Agenda Background/Experience Course Information Altera DE2B Board do Overview Introduction to Embedded Systems Design Abstraction Microprocess

Components of a personal computer

Lecture 5: Computing Platforms. Asbjørn Djupdal ARM Norway, IDI NTNU 2013 TDT

FACTFILE: GCE DIGITAL TECHNOLOGY

TUTORIAL Describe the circumstances that would prompt you to use a microprocessorbased design solution instead of a hard-wired IC logic design.

Lecture 25 March 23, 2012 Introduction to Serial Communications

Overview of Computer Organization. Outline

MicroProcessor. MicroProcessor. MicroProcessor. MicroProcessor

Overview of Microcontroller and Embedded Systems

Serial Peripheral Interface. What is it? Basic SPI. Capabilities. Protocol. Pros and Cons. Uses

ECE Lab 8. Logic Design for a Direct-Mapped Cache. To understand the function and design of a direct-mapped memory cache.

Chapter 2 Lecture 1 Computer Systems Organization

Architecture of Computers and Parallel Systems Part 6: Microcomputers

Introduction to Microprocessor

CREATED BY M BILAL & Arslan Ahmad Shaad Visit:

Overview of Computer Organization. Chapter 1 S. Dandamudi

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

Overview. Memory Classification Read-Only Memory (ROM) Random Access Memory (RAM) Functional Behavior of RAM. Implementing Static RAM

Digital Design Laboratory Lecture 6 I/O

A First Look at Microprocessors

Logic and Computer Design Fundamentals. Chapter 8 Memory Basics

Computer Systems Organization

CENG4480 Lecture 09: Memory 1

Where We Are in This Course Right Now. ECE 152 Introduction to Computer Architecture Input/Output (I/O) Copyright 2012 Daniel J. Sorin Duke University

Embedded Systems: Architecture

Memory Expansion. Lecture Embedded Systems

ARM Processors for Embedded Applications

Universität Dortmund. ARM Architecture

The Embedded System Design Process. Wolf Text - Chapter 1.3

COA. Prepared By: Dhaval R. Patel Page 1. Q.1 Define MBR.

Embedded Systems Design: A Unified Hardware/Software Introduction. Outline. Chapter 5 Memory. Introduction. Memory: basic concepts

Embedded Systems Design: A Unified Hardware/Software Introduction. Chapter 5 Memory. Outline. Introduction

Von Neumann architecture. The first computers used a single fixed program (like a numeric calculator).

COMPUTER STRUCTURE AND ORGANIZATION

CprE 488 Embedded Systems Design. Lecture 4 Interfacing Technologies

Microcontroller basics

5 Computer Organization

Calendar Description

RISC (Reduced Instruction Set Computer)

! Memory Overview. ! ROM Memories. ! RAM Memory " SRAM " DRAM. ! This is done because we can build. " large, slow memories OR

EE 308: Microcontrollers

Microprocessors And Microcontroller

Digital Circuits Part 2 - Communication

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

The Central Processing Unit

Chapter Seven Morgan Kaufmann Publishers

ECE 471 Embedded Systems Lecture 2

Cycle Time for Non-pipelined & Pipelined processors

COMPUTER ORGANISATION CHAPTER 1 BASIC STRUCTURE OF COMPUTERS

CPE300: Digital System Architecture and Design

Summer 2003 Lecture 18 07/09/03

Concept of Memory. The memory of computer is broadly categories into two categories:

Introduction to I2C & SPI. Chapter 22

EE251: Thursday November 15

Three-box Model: These three boxes need interconnecting (usually done by wiring known as a bus. 1. Processor CPU e.g. Pentium 4 2.

Computer Hardware Requirements for ERTSs: Microprocessors & Microcontrollers

Computer Organization and Assembly Language (CS-506)

Chapter 5 Memory Hierarchy Design. In-Cheol Park Dept. of EE, KAIST

Chapter 4 Main Memory

EECS 373 Design of Microprocessor-Based Systems

PC I/O. May 7, Howard Huang 1

ELCT 912: Advanced Embedded Systems

Design and development of embedded systems for the Internet of Things (IoT) Fabio Angeletti Fabrizio Gattuso

Embedded Computing Platform. Architecture and Instruction Set

Interfacing. Introduction. Introduction Addressing Interrupt DMA Arbitration Advanced communication architectures. Vahid, Givargis

Digital Storage Oscilloscope

Computer Organization and Microprocessors SYLLABUS CHAPTER - 1 : BASIC STRUCTURE OF COMPUTERS CHAPTER - 3 : THE MEMORY SYSTEM

Latches. IT 3123 Hardware and Software Concepts. Registers. The Little Man has Registers. Data Registers. Program Counter

CS 101, Mock Computer Architecture

Growing Together Globally Serial Communication Design In Embedded System

Introduction to the Personal Computer

or between microcontrollers)

MICROCONTROLLERS 8051

CSC 553 Operating Systems

LECTURE 10: Improving Memory Access: Direct and Spatial caches

Chapter 1 Computer System Overview

EECS 373 Design of Microprocessor-Based Systems

Computer Architecture Dr. Charles Kim Howard University

McMaster University Embedded Systems. Computer Engineering 4DS4 Lecture 6 Serial Peripherals Amin Vali Feb. 2016

Organization. 5.1 Semiconductor Main Memory. William Stallings Computer Organization and Architecture 6th Edition

Network Embedded Systems Sensor Networks Fall Hardware. Marcus Chang,

QUIZ Ch.6. The EAT for a two-level memory is given by:

Transcription:

ECE 1160/2160 Embedded Systems Design Midterm Review Wei Gao ECE 1160/2160 Embedded Systems Design 1

Midterm Exam When: next Monday (10/16) 4:30-5:45pm Where: Benedum G26 15% of your final grade What about: Everything until Cache and Memory Closed-book, closed-notes, no laptop, no discussion All included in class slides May have 1 or 2 programming questions Make your answers short to include only key points Sample questions will be posted on course website Graduate students need to answer 1 more question ECE 1160/2160 Embedded Systems Design 2

Definition Embedded system: any device that includes a computer but is not itself a general-purpose computer. Application specific The design is specialized and optimized for specific application Don t need all the general-purpose bells and whistles ECE 1160/2160 Embedded Systems Design 3

System Characteristics Non-functional requirements Real-time Low power Small memory footprint Low cost Short development cycles Small teams ECE 1160/2160 Embedded Systems Design 4

Real-Time Hard real time: violating timing constraints causes failure Anti-lock Brake System CD burner Software modem Soft real time: missing deadline results in degraded performance Online video GPS map Audio (MP3 player)? ECE 1160/2160 Embedded Systems Design 5

Alternative Technology Application-Specific Integrated Circuits (ASICs) Microprocessors Field-Programmable Gate Arrays (FPGAs) Why should we use microprocessors? ECE 1160/2160 Embedded Systems Design 6

ASIC Ex: Digital baseband processing for cell phones Pros Performance: Fast! Power: Fewer logic elements lead to low power Cons Development cost: Very high 2 million $ for starting production of a new ASIC Needs a long time and a large team Reprogrammability: None! Single-purpose devices Difficult to upgrade systems ECE 1160/2160 Embedded Systems Design 7

Microprocessors Performance Con: Programmable architecture is fundamentally slow! Fetch, decode instructions Pro: Highly optimized architecture and manufacturing Power Pipelines; cache; clock frequency; circuit density; manufacturing technology Processors perform poorly in terms of performance/watt! Power management can alleviate the power problem. Flexibility, development cost and time Let software do the work! ECE 1160/2160 Embedded Systems Design 8

FPGA Programmable hardware In the middle of ASIC and microprocessor Power Hardware implementation: better performance/watt than microprocessor Many overhead transistors: waste more power than ASIC Reprogrammability Reprogammable: lower development cost than ASIC More difficult to program than microprocessor More commonly used for prototyping ECE 1160/2160 Embedded Systems Design 9

State of the Practice Microprocessor is the dominant player Reprogrammability and low development cost >> low performance/watt Optimization and power management have significantly improved microprocessors performance Microprocessor + ASIC is common Ex: cell phone FPGA is expected to improve ECE 1160/2160 Embedded Systems Design 10

Design Challenges Non-functional constraints How do we meet deadlines? Faster hardware or better software? How do we minimize power? Turn off unnecessary logic? Reduce memory accesses? Slow down CPU? Cost considerations Trade-offs among constraints Optimization & analysis are important! ECE 1160/2160 Embedded Systems Design 11

Design Methodologies requirements specification Top-down design architecture component design system integration Bottom-up design ECE 1160/2160 Embedded Systems Design 12

GPS Map Requirement Form name GPS moving map purpose consumer-grade moving map for driving inputs power button, two control buttons outputs back-lit LCD 400 X 600 functions performance manufacturing cost power 5-receiver GPS; three resolutions; displays current lat/lon updates screen within 0.25 sec of movement $100 cost-of-goodssold 100 mw physical size/weight no more than 2: X 6:, 12 oz. ECE 1160/2160 Embedded Systems Design 13

Microprocessors von Neumann Same memory holds data, instructions. A single set of address/data buses between CPU and memory Harvard Separate memories for data and instructions. Two sets of address/data buses between CPU and memory ECE 1160/2160 Embedded Systems Design 14

von Neumann vs. Harvard Harvard allows two simultaneous memory fetches. Harvard architectures are widely used because Most DSPs use Harvard for streaming data The separation of program and data memories Greater memory bandwidth Higher performance for digital signal processing Speed is gained at the expense of more complex electrical circuitry. Other examples: On chip cache of CPUs is divided into an instruction cache and a data cache ECE 1160/2160 Embedded Systems Design 15

RISC vs. CISC Reduced Instruction Set Computer (RISC) Compact, uniform instructions: facilitate pipelining More lines of code: poor memory footprint Allow effective compiler optimization Complex Instruction Set Computer (CISC) Many addressing modes and instructions; High code density. Often require manual optimization of assembly code for embedded systems. ECE 1160/2160 Embedded Systems Design 16

Busy-Wait I/O Programming Simplest way to program I/O devices. Devices are usually slower than CPU and require more cycles CPU has to wait for device to finish before starting next one Use peek instruction to test when device is finished //send a string to device using Busy-Wait handshaking current_char = mystring; while (*current_char!= \0 ) { //send character to device (data register) poke(out_char,*current_char); //wait for device to finish by checking its status while (peek(out_status)!= 0); //advance character pointer to next one current_char++; } ECE 1160/2160 Embedded Systems Design 17

Interrupt-based I/O Busy-wait is very inefficient. CPU can t do other work while testing device. Hard to do simultaneous I/O. Interrupts allow to change the flow of control in the CPU. Call interrupt handler (i.e. device driver) to handle device. IR CPU PC interrupt request interrupt ack status register Device mechanism data/address data register ECE 1160/2160 Embedded Systems Design 18

Generic Interrupt Mechanism continue executing next instruction N interrupt? Y ignore N interrupt priority > current priority? ack Y bus error Y timeout? N Y vector? Y call table[vector] ECE 1160/2160 Embedded Systems Design 19

Microprocessor Bus Bus is a set of wires and a protocol for the CPU to communicate with memory and devices Five major components to support reads and writes Device 1 Device 2 CPU a n Clock R/W Address Data ready Data Memory ECE 1160/2160 Embedded Systems Design 20

Typical Bus Access Timing diagram syntax: Constant value (0/1), stable, changing, unknown. Clock R/W Address enable Address Data Ready data read write time ECE 1160/2160 Embedded Systems Design 21

Memory System and Caches Memory is slower than CPU CPU clock rates increase faster than memory Caches are used to speed up memory Cache is a small but fast memory that holds copies of the contents of main memory More expensive than main memory, but faster Memory Management Units (MMU) Memory size is not large enough for all application? Provide a larger virtual memory than physical memory ECE 1160/2160 Embedded Systems Design 22

Cache Organizations How should we map memory to cache? Fully-associative: any memory location can be stored anywhere in the cache. Ideal, best cache hit rate but implementation is complex and slow Almost never implemented Direct-mapped: each memory location maps onto exactly one cache entry. Simplest, fastest but least flexible Easy to have conflicts N-way set-associative: each memory location can go into one of n sets. Compromised solution ECE 1160/2160 Embedded Systems Design 23

Memory Management Unit Memory size is not large enough for all applications? Memory management unit (MMU) Provides a larger virtual memory than physical memory Translates logical addresses to physical addresses CPU logical address memory management unit physical address main memory ECE 1160/2160 Embedded Systems Design 24

Memory Devices Types of memory devices RAM (Random-Access Memory) Address can be read in any order, unlike magnetic disk/tape Usually used for data storage DRAM vs. SRAM. ROM (Read-Only Memory) Usually used or program storage Mask-programmed vs. field-programmable. ECE 1160/2160 Embedded Systems Design 25

RAM (Random-Access Memory) SRAM (Static RAM) Faster, usually used for caches Easier to integrate with logic. Higher power consumption. DRAM (Dynamic RAM) Structurally simpler Only 1 transistor and 1 capacitor are required per bit, compared with 6 transistors used in SRAM Can reach very high density Must be periodically refreshed ECE 1160/2160 Embedded Systems Design 26

I/O Interfaces Parallel I/O and Serial I/O Parallel I/O: multiple input/output simultaneously Data Bus, Address Bus, Intel 8255, printer Serial I/O: transferring data between CPU and peripherals one bit at a time, sequentially Ethernet, USB, Inter-integrated Circuit, Serial Peripheral Interface ECE 1160/2160 Embedded Systems Design 27

I/O Interfaces Parallel v.s. Serial Parallel Wider bandwidth More wires indicate more overhead Simple I/O operation Serial 1-bit transfer per time unit Less wires indicate less overhead Complex I/O protocol ECE 1160/2160 Embedded Systems Design 28

I/O Interfaces Serial over Parallel Parallel interfaces have less reliability Interference and noise corrupt data Capacitance and mutual inductance affects bandwidth Serial Less mutual interference between wires Higher clock frequency increases transmission rate ECE 1160/2160 Embedded Systems Design 29

Inter-integrated Circuit (I2C) I 2 C connection example ECE 1160/2160 Embedded Systems Design 30

Inter-integrated Circuit (I2C) Start and Stop condition Both initiated by master SCL has to be high in both case SDA High to low: START Low to high: STOP ECE 1160/2160 Embedded Systems Design 31

Inter-integrated Circuit (I2C) Communication with 7-bit I2C Address Initiating communication Addressing slave device Transferring data Ending communication ECE 1160/2160 Embedded Systems Design 32

Serial Peripheral Interface (SPI) Basic Model Serial Click (SCLK or SCK): clock pulse that synchronizes data transmission generated by master Master In Slave Out (MISO): slave line for sending data to master Master Out Slave In (MOSI): master line for sending data to peripherals. Slave Select(SS): pin on which device the master could use to enable/disable specific devices ECE 1160/2160 Embedded Systems Design 33

Serial Peripheral Interface Write/Read Transaction Write Transaction lower SS# to select slave device sending instruction bytes and data bytes via MOSI ECE 1160/2160 Embedded Systems Design 34

Serial Peripheral Interface Write/Read Transaction Read Transaction lower SS# to select slave device sending instruction byte via MOSI and receiving data byte by MISO ECE 1160/2160 Embedded Systems Design 35

SPI v.s. I2C Which one? I2C require two wires while SPI may need more SPI support full-duplex communication while I2C is slower I2C is more power-consuming than SPI I2C has ACK to verify data transfer while SPI is not I2C may have multiple master but SPI only has one master ECE 1160/2160 Embedded Systems Design 36