You are on page 1of 33

EE382N-4

Advanced Microcontroller Systems

Course Overview

Mark McDermott

Spring 2018

EE382N-4 Class Notes


Goals of the Course
§ This course focuses on the HW/SW architectures of embedded
“System-on-a-Chip (SoC) implementations.
– The topics covered will be focused on the hardware and software design of
advanced microcontroller systems.
§ There will be a class project where these concepts will be put into
practice.
– Uses Xilinx Zynq-7020 based Zed Board
• Dual ARM Cortex A9
• 512 MB DDR3
• 256 MB Quad-SPI Flash
• 4 GB SD card
• On-board USB-JTAG Programming
• 10/100/1000 Ethernet
• USB OTG 2.0 and USB-UART
• PS & PL I/O expansion (FMC, Pmod, XADC)

1/18/18 EE382N-4 Class Notes 2


Course Syllabus

1/18/18 EE382N-4 Class Notes 3


Grading
§ Labs (3): 30%
§ Exam 1: 15%
§ Exam 2: 15%
§ Project: 40%

Penalty for late submission of Labs and Class Project:


25% per working day. (Maximum: 100%).

1/18/18 EE382N-4 Class Notes 4


Overview of the Lab Assignments
§ Lab #1
– Use Vivado to generate a dual-ported memory array using FPGA Block RAM’s.
– Implement an LFSR pseudo-random number generator in the FPGA.
– Write a memory test that tests both ports of the BRAM
§ Lab #2
– Use Vivado to setup a GPIO block that interrupts the processor.
– Develop an Interrupt handler to measure the latency of Linux running on the
ZEDBOARD platform using the I/O ports on the FPGA. Characterize the
latency over different work loads
§ Lab #3
– Use Vivado to setup a dual ported memory that can be accessed by the
processor and a HW accelerator.
– Write a C-routine which dynamically varies the processor clock without
disrupting normal operations. The processor will be performing a memory
tests on the BRAM that is in the FPGA while measuring latency of the
interrupts in the Linux kernel.

1/18/18 EE382N-4 Class Notes 5


Project Details
§ The class project focuses building a hardware accelerator that is
coupled to a dual ARM core system via the AXI bus using the
Zynq-7020 programmable SOC on the ZedBoard.
– Proposal due Feb 8th
§ Team size: 3
§ Project ideas:
• Graphics coprocessor/accelerator • Encryption for the Advanced Encryption
for rendering applications Standard (Rijndael algorithm)
• Channel Estimation for DRM in FPGA • Public key encryption using Montgomery
• Arithmetic coprocessor or Galois Field multiplier
implementing complex numerical • IP Packet Forwarding Engine (with
algorithms possibly with Encryption / Decryption)
• MPEG compression / decompression • NOC
accelerator • Dataflow Processor
• JPEG encoder / decoder accelerator

1/18/18 EE382N-4 Class Notes 6


So, what is an embedded system?
Simple answer -
Anything that uses a “processor” but isn't a general-purpose
computer.

The user “sees” a smart (special-purpose) system as opposed to the


computer inside the system
“how does it do that?”
“it has a computer inside it!”
“it does not or cannot run Windows or MacOS!”
But it might run Windows CE or Linux…
The end-user typically does not or cannot modify or upgrade the
internals

1/18/18 EE382N-4 Class Notes 7


Embedded System Abstractions

Hidden Aspect Applications Applications


Applications Hidden Aspect
Android
Hidden Aspect RTOS iOS Hidden Aspect
Firmware Firmware Firmware Firmware

Hardware Hardware Hardware Hardware


Basic Complex Standalone Standalone
Embedded Embedded System System
System System

Example: Example: Example: Example:


PID controller Set top Box iPhone Android Phone

1/18/18 EE382N-4 Class Notes 8


Disassembled iPhone-X

https://www.ifixit.com/Teardown/iPhone+X+Teardown/98975

1/18/18 EE382N-4 Class Notes 9


iPhone X CPU Board

https://www.ifixit.com/Teardown/iPhone+X+Teardown/98975

1/18/18 EE382N-4 Class Notes 10


3D view

https://www.ifixit.com/Teardown/iPhone+X+Teardown/98975

1/18/18 EE382N-4 Class Notes 11


Backside

https://www.ifixit.com/Teardown/iPhone+X+Teardown/98975

1/18/18 EE382N-4 Class Notes 12


Outside logic board

1/18/18 EE382N-4 Class Notes 13


Inside the iPhone: Hardware
§ Processor Functions
– Execute Mac iPhone OS with integrated security and validation
– Interacts with baseband processor over secured channels
– Controls various IC’s like Power management IC, Audio codec, camera
sensors, display module, touch modules, etc.
§ Baseband Processor – Functions
– Controls all communication system on the phone
– Controls WIFI, Bluetooth and GSM system
– Runs its own nucleus encrypted firmware on it thus ensuring the security
over communications
– Effectively communicates with Application processor directly over secured
channels
§ Hardware Acceleration
– Image sensing
– Security

1/18/18 EE382N-4 Class Notes 14


Inside the iPhone : Software
§ iPhone OS architecture is largely OS X
(Unix variant)
– Kernel is XNU
– Basically XNU code compiled for ARM
– Kernel cannot be modified or re-ported
– Encrypted using IMG3 container
§ Spring Board
– This is the shell
– User can interact with iPhone through
springboard
– Controlled by core libraries
§ Lockdownd service
– Handles communication with the computer
– Services like syncing and AFC
– Activates iPhone through iTunes
– SSL tunnel between sockets on the computer
and the iPhone
– Lockdownd is more of a daemon

1/18/18 EE382N-4 Class Notes 15


Four General Categories of Embedded Systems
§ General Computing
– Applications similar to desktop computing, but in an embedded package
– Video games, set top boxes, wearable computers, automatic tellers
§ Control Systems
– Closed loop feedback control of real time system
– Vehicle engines, chemical processes, nuclear power, flight control
§ Signal Processing
– Computations involving large data stream
– Radar, Sonar, video compression
§ Communication & Networking
– Switching and information transmission
– Telephone system, Internet

Courtesy Intel
1/18/18 EE382N-4 Class Notes 16
Types of Embedded System Functions
§ Control Laws
– PID control
– Fuzzy logic, ...
§ Sequencing logic
– Finite state machines
– Switching modes between control laws
§ Signal processing
– Multimedia data compression
– Digital filtering
§ Application specific interfacing
– Buttons, bells, lights,...
– High speed I/O
§ Fault response
– Detection & reconfiguration
– Diagnosis

Courtesy Intel
1/18/18 EE382N-4 Class Notes 17
Distinctive Embedded System Attributes
§ Reactive: computations occur in response to external events
– Periodic events (e.g., rotating machinery and control loops)
– Aperiodic events (e.g., button closures)

§ Real-Time: timing correctness is part of system correctness


– Hard real-time
• Absolute deadline, beyond which answer is useless
• May include minimum time as well as maximum time
– Soft real-time
• Missing a deadline is not catastrophic
• Utility of answer degrades with time difference from deadline
– Example:
• a train is entering an urban area...
• the railway gate in the city allows automotive traffic to go over the tracks
• when should the railway gate close?
In general,
Real Time does not equal “Real Fast”
Courtesy Intel
1/18/18 EE382N-4 Class Notes 18
Typical Embedded System Constraints
§ Small Size, Low Weight
– Handheld electronics
– Transportation applications weight costs money
§ Low Power
– Battery power for 24+ hours
– Limited cooling may limit power even if AC power available
§ Harsh environment
– Heat, vibration, shock
– Power fluctuations, RF interference, lightning
– Water, corrosion, physical abuse
§ Safety critical operation
– Must function correctly
– Must not function incorrectly
§ Extreme cost sensitivity
– $.05 adds up over 1,000,000 units

Courtesy Intel
1/18/18 EE382N-4 Class Notes 19
A Taxonomy of Embedded System Design

Level Name Modules Primitives Descriptive Media

H Transistors, Resistors,
1 Electronics Gates, FF’s Circuit Diagrams
A etc.
R
D
W
2 Logic Registers, ALU’s Gates, FF’s Logic Diagrams
A
R Processors, Busses, Register Transfer
E 3 Organization Registers, ALU’s ...
Memories Notation
Assembly
FIRMWARE 4 Microprogramming Microinstructions Microprogram
Language

S Assembly Language Assembly Language Assembly Language


5 OS Routines
O Programming Instructions Programs
F
T Procedural Applications, OS Routines
W
6 HLL Programs
Programming Drivers, etc. High Level Languages
A
R Embedded Embedded Problem Oriented
E 7 Procedural Constructs
Applications Systems Programs

Focus of this class


1/18/18 EE382N-4 Class Notes 20
HW & SW Components of a typical Embedded System

Applications

Libraries Operating System (Kernel)


Software
Architecture

Complier
Assembler & Linker Boot Loader

ISA ISA
HW HW
Accelerator Accelerator
Processor Processor
Hardware Interconnect Fabric
Architecture
SOC Peripherals:
MTD, UART, I2C, PCMCIA, NIC, USB, ADC, DAC, GPIO, Audio, Video

Sensors & Actuators Connectors

1/18/18 EE382N-4 Class Notes 21


Linux Kernel Architecture

App_1 App_2 App_xx User Space


Applications

C library

System call interface


Kernel Modules

Process Memory File system Device Networking


management management support control

Kernel
space File system
types

CPU support CPU / MMU Storage Character Network


code support code drivers device drivers device drivers

CPU RAM Storage

1/18/18 EE382N-4 Class Notes 22


Android Kernel Architecture

1/18/18 EE382N-4 Class Notes 23


Computing Element Choices

General Purpose
Selection Factors:
Processors - Type and complexity of computational algorithms
(GPPs): - Desired level of flexibility - Performance
Programmability /Flexibility

- Development cost - System cost


- Power requirements - Real-time constrains
Application-Specific
Processors (ASPs)

Configurable Hardware

Co-Processors &
Accelerators
Application Specific
Integrated Circuits
(ASICs)

Specialization , Development cost/time


Performance/Chip Area/Watt
Performance
(Computational Efficiency)
Courtesy Intel
1/18/18 EE382N-4 Class Notes 24
Why ARM for the GPP?

1/18/18 EE382N-4 Class Notes 25


Because it is the optimal GPP for embedded systems

1/18/18 EE382N-4 Class Notes 26


Zed Board Overview

EE382N-4 Class Notes


Key Features of the Zed Board
§ Processor § Clocking
– Zynq™-7000 AP SoC XC7Z020- – 33.33333 MHz clock source for PS
CLG484-1 – 100 MHz oscillator for PL
§ Memory § Display
– 512 MB DDR3 – HDMI output supporting 1080p60 with
– 256 Mb Quad-SPI Flash 16-bit, YCbCr, 4:2:2 mode color
– 4 GB SD card – VGA output (12-bit resolution color)
§ Communication – 128x32 OLED display
– Onboard USB-JTAG Programming § Configuration and Debug
§ 10/100/1000 Ethernet – Onboard USB-JTAG interface
– USB OTG 2.0 and USB-UART – Xilinx Platform Cable JTAG connector
§ Expansion connectors § General Purpose I/O
– FMC-LPC connector (68 single-ended – 8 user LEDs
or 34 differential I/Os) – 7 push buttons
– 5 Pmod™ compatible headers (2x6) – 8 DIP switches
– Agile Mixed Signaling (AMS) header

1/18/18 EE382N-4 Class Notes Page 28


28
Zed Board Block Diagram

1/18/18 EE382N-4 Class Notes 29


Zed Board Component Placement

VGA
Power Audio I/O GbE HDMI

JTAG
XADC

FMC (LPC)
DDR Zynq

PMODs

OLED

PMODs Slide Switches Push Switches

1/18/18 EE382N-4 Class Notes 30


Zed Board Jumper Placement

1/18/18 EE382N-4 Class Notes 31


Available PMODS

http://store.digilentinc.com/pmod-expansion-modules/pmod-boards/

1/18/18 EE382N-4 Class Notes 32


ZedBoard Web Site Resources
§ Overview and Features of ZedBoard
– www.zedboard.org/product/zedboard
§ ZedBoard – Hardware User Guide
– www.zedboard.org/documentation/1521
§ Zynq-7000 AP SoC Product Information
– www.xilinx.com/zynq

1/18/18 EE382N-4 Class Notes 33

You might also like