Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3....

37
Embedded System Design Stephen A. Edwards Columbia University Spring 2020

Transcript of Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3....

Page 1: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.

Embedded System Design

Stephen A. Edwards

Columbia University

Spring 2020

Page 2: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.

Spot the Computer

Page 3: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.

Cars These Days...

Page 4: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.

Embedded Systems: Ubiquitous Computers

iPhone Laser Keyboard Nikon D300 Video Watch

GPS Playstation 3 PC Keyboard SD Card

Page 5: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.

Inside a Digital Camera

Page 6: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.

Want an Optimal Device that Meets Constraints On

Price Functionality

Performance Size

Power Time-to-market

Maintainability Safety

Page 7: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.

Embedded System Technologies

Integrated Circuits

Processing elements

Design tools

Page 8: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.

IC Technology

1947: First transistor (Shockley, Bell Labs)

1958: First integrated circuit (Kilby, TI)

1971: First microprocessor (4004: Intel)

2015: 14 nm features, 13 layers (Intel, Broadwell)

Page 9: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.

Moore’s Law: Transistors per chip

1970 1980 1990 2000 2010

1k

10k

100k

1M

10M

100M

1G

10G

≈ 1.5× /

year

“The complexity for minimum component costshas increased at a rate of roughly a factor oftwo per year. Certainly over the short termthis rate can be expected to continue,if not to increase.”

— Gordon Moore, 1965

Source: Intel/Wikipedia

Page 10: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.

$1000 Buys You This Many Cycles per Second

ElectromechanicalRelays

TubesTransistors

Integrated Circuits

1900 1920 1940 1960 1980 2000

10−4

10−2

100

102

104

106

108

Source: Ray Kurzweil, The Age of Spiritual Machines

Page 11: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.

1918 Sears Roebuck Catalog

About $100 in today’s dollars.From Donald Norman, The Invisible Computer, 1998.

Page 12: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.

What Percentage of Time Do You Spend...

Developing Specifications

Conceptual Design

Detailed Design

Simulation

Testing/Debugging

Prototyping

Sending to production

Documentation/meetings

0% 5% 10% 15% 20% 25%

Source: 2009 Embedded Market Study

Page 13: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.

What Percentage of Time Do You Spend...

Developing Specifications

Conceptual Design

Detailed Design

Simulation

Testing/Debugging

Prototyping

Sending to production

Documentation/meetings

0% 5% 10% 15% 20% 25%

Source: 2009 Embedded Market Study

Page 14: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.

Does Your Current Project Contain FPGAs?

45% Yes

55% No

Source: 2009 Embedded Market Study

Page 15: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.

Does Your Current Project Contain FPGAs?

45% Yes

55% No

Source: 2009 Embedded Market Study

Page 16: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.

Why Won’t Your Next Project Use FPGAs?

Don’t need them

Too expensive

Too power-hungry

Hard to use

Too slow

Too small

Unreliable

Don’t Know

0% 15% 30% 45% 60% 75%

Source: 2009 Embedded Market Study

Page 17: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.

Why Won’t Your Next Project Use FPGAs?

Don’t need them

Too expensive

Too power-hungry

Hard to use

Too slow

Too small

Unreliable

Don’t Know

0% 15% 30% 45% 60% 75%

Source: 2009 Embedded Market Study

Page 18: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.

Your Nemesis: The DE1-SoC Board

Page 19: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.
Page 20: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.
Page 21: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.

Inside the Cyclone V: Dual ARM processors + FPGA

FPGA

Hard Processor System (HPS)

ARM® Cortex™-A9NEON™/FPUL1 Cache

HPS I/O

HPS

L2 Cache

USB OTG(x2) (1)

64KbyteRAM

DMA

Shared Multiport DDRSDRAM Controller (2)

JTAGDebug/Trace (1)

QSPI FlashControllerNANDFlash

(1) (2)SD/SDIO/MMC (1)

I2C(x2)

CAN(x2)

GPIO

SPI(x2)

Timers(x11)

HPS toFPGA

FPGA toHPS

FPGAConfiguration

UART(x2)

Ethernet(x2) (1)

ARM Cortex-A9NEON/FPUL1 Cache

Single- or Dual-Core Processor

Hard PCIe* *Optional Configuration (1) Integrated DMA (2) Integrated ECC

Hard MemoryController*Transceivers*

Page 22: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.

An Example System

Page 23: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.

Linux + Custom Hardware

+

Page 24: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.

Class Structure

Three Introductory Labs: 2 weeks each

Work in pairs

1. Hardware: Access, modify, and display memory

2. Software: A simple Internet chat client

3. HW + SW: A video bouncing ball

The project: Design-your-own

Work in groups of four

Broadly: C + SystemVerilog + peripheral(s)

Page 25: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.

Broad Project Idea: Video Game

Implement graphics in custom hardware

Put game logic in software

Interface with USB HID (Joystick, etc.)

E.g., Pac-man, 2.5D maze game, tank, worms

Page 26: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.

Broad Project Idea: Computational Accelerator

Pick a computationally intensive algorithm

Implement its core in custom hardware

Write software and device drivers that passdata to and from the accelerator

E.g., Smoke simulator, inverse kinematics forrobotics, Bitcoin miner

Page 27: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.

More Ideas

Digital tone control

Spectrum analyzer

Internet radio

Speech Synthesizer

MIDI synthesizer

Accelerated JPEG

Game of Life

Pool game

Real-time ray tracer

Page 28: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.

The Three Main Challenges of Embedded Systems

Coping with Real-World Sensor Data

Algorithm Design

Implementation Details

Page 29: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.

What Happens When You Press the Switch?

GND

100K

Vcc

Vout

Page 30: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.

What Happens When You Press the Switch?

GND

100K

Vcc

Vout

Page 31: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.

Inside a Pushbutton Switch

A – View of moveablecontact mounted onback side of actuator

ThermoplasticActuator Button Thermoplastic

Case and Cover

StainlessSteel Spring

Terminals

Mounting Posts

Shorting Bar

Source: Cherry CS series data sheet

Page 32: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.

Raw Data from a CCD (zoomed in)

Page 33: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.

Corrected Image (zoomed in)

Page 34: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.

Correcting Data from CCDs

Raw

Dark Frame

Flat Field

Bias

=

Color−→ Temp.−→ Exposure−→

Page 35: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.

Correcting Data from CCDs

Raw

Dark Frame

Flat Field

Bias

=

Color−→ Temp.−→ Exposure−→

Page 36: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.

Where Does This Noise Come From?

Nikon D300: 23.6 mm × 15.8 mm12.3 megapixel CMOS sensor

Pixels are 5.5 µm on a side

A/D sampling of 12 bits per pixel measures

ISO: LO 200 400 800 1600 3200G 7.1 5.5 2.7 1.3 0.65 0.33B 5.8 4.6 2.3 1.1 0.55 0.27R 4.7 4.5 2.2 1.1 0.54 0.26

The units: electrons per ADU (digital unit).

Emil Martinec, A comparison of the Nikon D300 and Canon 40D sensors,2007.

Page 37: Embedded System Design - Columbia Universitysedwards/classes/2020/4840-spring/... · 2020. 3. 24. · 3.HW + SW: A video bouncing ball The project: Design-your-own ... Bitcoin miner.

The Two Big Challenges

I Design the algorithm

1. Acquire representative input (sensor) data2. Conceive of an algorithm3. Prototype the algorithm using your favorite language

I Implement the algorithm

1. Choose a hardware/software partition based onperformance and resource constraints

2. Develop software and hardware architectures3. Define interface between software and hardware4. Implement the hardware and software5. Test, test, test...