SlideShare a Scribd company logo
Basics of Programming
Embedded Processors
陳正哲
聯發科技
2007.11.16
學經歷
 台灣大學電機系
 台灣大學電機所 計算機科學組
 工研院電通所 (4 years) 課長
 Java Chip HW/SW CoDesign
 Embedded Java Virtual Machine Optimization
 1 patent
 聯發科技 (4 years) 部門經理
 Audio Driver
 MPEG-4 SW Architecture, A/V Sync
 Platform Concurrent Analysis
 Embedded 3D Graphics
 Mobile TV
 JPEG
 11 patents
Agenda
 Challenges of Embedded Systems Programming
 Design Patterns for Embedded Systems
 Models of Programs
 Analysis of Execution Time
 Performance Optimizations
 Power Saving Techniques
 Reducing Data Size
 Reducing Code Size
 Testing
Challenges of Embedded Systems
Programming
 run at a required rate to meet system
deadline
 however, often with limited computing power
 limited memory
 power consumption
Design Patterns – State Machine (1/2)
State machines are suited for reactive systems.
Design Patterns – State Machine (2/2)
Design Pattern – Circular Buffer
Real-time data processing (e.g. FIR) with limited memory.
Models of Programs – Data Flow Graph
w = a + b;
x = a - c;
y = x+ d;
x = a + c;
z= y + e;
w = a + b;
x1 = a - c;
y = x1 + d;
x2 = a + c;
z = y + e;
Single Assignment Form
Use for determining feasible reorderings of the operations, which may help us
to reduce pipeline or cache conflicts.
Control/Data Flow Graphs (CDFG)
Two types of nodes:
(1) Decision nodes
(2) Data flow nodes
The CDFG is a sequential representation of the program.
Measuring Execution Time
 method
 simulator
 provides greater visibility, profiling
 not 100% accurate
 timer
 limited by the resolution of the timer
 logic analyzer
 condition
 average case, worst case, best case
Loop Optimizations – code motion
for (i = 0; i < N*M; i++) {
z[i] = a[i] + b[i];
}
Move unnecessary code out of a loop.
Loop Optimizations – Induction Variable
Elimination
for (i = 0; i < N; i++)
for (j = 0; j < M; j++)
z[i][j] = b[i][j];
for (i = 0; i < N; i++)
for (j = 0; j < M; j++) {
zbinduct = i*M + j;
*(zptr + zbinduct) = *(bptr + zbinduct);
}
for (i = 0; i < N; i++)
for (j = 0; j < M; j++)
*(zptr++) = *(bptr++);
eliminate induction variable
compiler
Loop Nest – Cache Optimizations
for (j = 0; j < M; j++)
for (i = 0; i < N; i++)
a[j][i] = b[j][i] * c;
Problem:
Access b will replace
a, and vice versa.
Solution:
(1) Data Realignment
(2) Array Padding
Power Saving Techniques
 replace the algorithms with those that
consume less power.
 optimize memory access
 memory accesses are a major component of
power consumption in many applications.
 turn off parts of the system when we don't
need them
 such as subsystems of the CPU, chips in the
system
Reducing Data Size
 identifying and eliminating duplications of
data
 determine the actual maximum amount of
data held in the buffer and allocate the array
accordingly
 data can sometimes be packed
 reuse values
 generate data on the fly
Reducing Code Size
 encapsulating functions in subroutines can reduce
program size when done carefully
 change sequence of instructions
 for example, a multiply-accumulate instruction may be both
smaller and faster than separate arithmetic operations.
 proper use of subroutines
 e.g. performs identical operations repeatedly
 use dense instruction sets
 e.g. ARM Thumb
 compress the code and decompress on the fly
Testing
 Black Box Test
 White Box Test
 Random Test
 Regression Test
 Coverage Test
 Boundary Test
 Performance Test
Reference
 The basics of programming embedded
processors, Wayne Wolf, Embedded.com.
 "
Computers as Components: Principles of Embedd
“, Wayne Wolf.

More Related Content

What's hot

ADAPTIVE FUZZY KERNEL CLUSTERING ALGORITHM
ADAPTIVE FUZZY KERNEL CLUSTERING ALGORITHMADAPTIVE FUZZY KERNEL CLUSTERING ALGORITHM
ADAPTIVE FUZZY KERNEL CLUSTERING ALGORITHM
ijfls
 
Effective machine learning_with_tpu
Effective machine learning_with_tpuEffective machine learning_with_tpu
Effective machine learning_with_tpu
Athul Suresh
 
Concurrent Root Cut Loops to Exploit Random Performance Variability
Concurrent Root Cut Loops to Exploit Random Performance VariabilityConcurrent Root Cut Loops to Exploit Random Performance Variability
Concurrent Root Cut Loops to Exploit Random Performance Variability
IBM Decision Optimization
 
Innovations in CPLEX performance and solver capabilities
Innovations in CPLEX performance and solver capabilitiesInnovations in CPLEX performance and solver capabilities
Innovations in CPLEX performance and solver capabilities
IBM Decision Optimization
 
An35225228
An35225228An35225228
An35225228
IJERA Editor
 
Run length encoding
Run length encodingRun length encoding
Run length encoding
praseethasnair123
 
Recent MIP Performance Improvements in IBM ILOG CPLEX Optimization Studio
Recent MIP Performance Improvements in IBM ILOG CPLEX Optimization StudioRecent MIP Performance Improvements in IBM ILOG CPLEX Optimization Studio
Recent MIP Performance Improvements in IBM ILOG CPLEX Optimization Studio
IBM Decision Optimization
 
Getting started with image processing using Matlab
Getting started with image processing using MatlabGetting started with image processing using Matlab
Getting started with image processing using Matlab
Pantech ProLabs India Pvt Ltd
 
GPU Parallel Computing of Support Vector Machines as applied to Intrusion Det...
GPU Parallel Computing of Support Vector Machines as applied to Intrusion Det...GPU Parallel Computing of Support Vector Machines as applied to Intrusion Det...
GPU Parallel Computing of Support Vector Machines as applied to Intrusion Det...
IJCSIS Research Publications
 
Interesting Use Cases for the CPLEX Remote Object
Interesting Use Cases for the CPLEX Remote ObjectInteresting Use Cases for the CPLEX Remote Object
Interesting Use Cases for the CPLEX Remote Object
IBM Decision Optimization
 
Implementation of PD controller in attitude of quadcopter
Implementation of PD controller in attitude of quadcopterImplementation of PD controller in attitude of quadcopter
Implementation of PD controller in attitude of quadcopter
Tack-geun You
 
Lift-and-Project Cuts in CPLEX 12.5.1
Lift-and-Project Cuts  in CPLEX 12.5.1Lift-and-Project Cuts  in CPLEX 12.5.1
Lift-and-Project Cuts in CPLEX 12.5.1
IBM Decision Optimization
 
Impact of Auto-tuning of Kernel Loop Transformation by using ppOpen-AT
Impact of Auto-tuning of Kernel Loop Transformation by using ppOpen-ATImpact of Auto-tuning of Kernel Loop Transformation by using ppOpen-AT
Impact of Auto-tuning of Kernel Loop Transformation by using ppOpen-AT
Takahiro Katagiri
 
IRJET-ASIC Implementation for SOBEL Accelerator
IRJET-ASIC Implementation for SOBEL AcceleratorIRJET-ASIC Implementation for SOBEL Accelerator
IRJET-ASIC Implementation for SOBEL Accelerator
IRJET Journal
 
Compression: Images (JPEG)
Compression: Images (JPEG)Compression: Images (JPEG)
Compression: Images (JPEG)
danishrafiq
 
Paper id 37201520
Paper id 37201520Paper id 37201520
Paper id 37201520
IJRAT
 
IRJET - Distributed Arithmetic Method for Complex Multiplication
IRJET -  	  Distributed Arithmetic Method for Complex MultiplicationIRJET -  	  Distributed Arithmetic Method for Complex Multiplication
IRJET - Distributed Arithmetic Method for Complex Multiplication
IRJET Journal
 
Simulation of Signal Reflection in Digital Design
Simulation of Signal Reflection in Digital DesignSimulation of Signal Reflection in Digital Design
Simulation of Signal Reflection in Digital Design
Kaushik Patra
 

What's hot (18)

ADAPTIVE FUZZY KERNEL CLUSTERING ALGORITHM
ADAPTIVE FUZZY KERNEL CLUSTERING ALGORITHMADAPTIVE FUZZY KERNEL CLUSTERING ALGORITHM
ADAPTIVE FUZZY KERNEL CLUSTERING ALGORITHM
 
Effective machine learning_with_tpu
Effective machine learning_with_tpuEffective machine learning_with_tpu
Effective machine learning_with_tpu
 
Concurrent Root Cut Loops to Exploit Random Performance Variability
Concurrent Root Cut Loops to Exploit Random Performance VariabilityConcurrent Root Cut Loops to Exploit Random Performance Variability
Concurrent Root Cut Loops to Exploit Random Performance Variability
 
Innovations in CPLEX performance and solver capabilities
Innovations in CPLEX performance and solver capabilitiesInnovations in CPLEX performance and solver capabilities
Innovations in CPLEX performance and solver capabilities
 
An35225228
An35225228An35225228
An35225228
 
Run length encoding
Run length encodingRun length encoding
Run length encoding
 
Recent MIP Performance Improvements in IBM ILOG CPLEX Optimization Studio
Recent MIP Performance Improvements in IBM ILOG CPLEX Optimization StudioRecent MIP Performance Improvements in IBM ILOG CPLEX Optimization Studio
Recent MIP Performance Improvements in IBM ILOG CPLEX Optimization Studio
 
Getting started with image processing using Matlab
Getting started with image processing using MatlabGetting started with image processing using Matlab
Getting started with image processing using Matlab
 
GPU Parallel Computing of Support Vector Machines as applied to Intrusion Det...
GPU Parallel Computing of Support Vector Machines as applied to Intrusion Det...GPU Parallel Computing of Support Vector Machines as applied to Intrusion Det...
GPU Parallel Computing of Support Vector Machines as applied to Intrusion Det...
 
Interesting Use Cases for the CPLEX Remote Object
Interesting Use Cases for the CPLEX Remote ObjectInteresting Use Cases for the CPLEX Remote Object
Interesting Use Cases for the CPLEX Remote Object
 
Implementation of PD controller in attitude of quadcopter
Implementation of PD controller in attitude of quadcopterImplementation of PD controller in attitude of quadcopter
Implementation of PD controller in attitude of quadcopter
 
Lift-and-Project Cuts in CPLEX 12.5.1
Lift-and-Project Cuts  in CPLEX 12.5.1Lift-and-Project Cuts  in CPLEX 12.5.1
Lift-and-Project Cuts in CPLEX 12.5.1
 
Impact of Auto-tuning of Kernel Loop Transformation by using ppOpen-AT
Impact of Auto-tuning of Kernel Loop Transformation by using ppOpen-ATImpact of Auto-tuning of Kernel Loop Transformation by using ppOpen-AT
Impact of Auto-tuning of Kernel Loop Transformation by using ppOpen-AT
 
IRJET-ASIC Implementation for SOBEL Accelerator
IRJET-ASIC Implementation for SOBEL AcceleratorIRJET-ASIC Implementation for SOBEL Accelerator
IRJET-ASIC Implementation for SOBEL Accelerator
 
Compression: Images (JPEG)
Compression: Images (JPEG)Compression: Images (JPEG)
Compression: Images (JPEG)
 
Paper id 37201520
Paper id 37201520Paper id 37201520
Paper id 37201520
 
IRJET - Distributed Arithmetic Method for Complex Multiplication
IRJET -  	  Distributed Arithmetic Method for Complex MultiplicationIRJET -  	  Distributed Arithmetic Method for Complex Multiplication
IRJET - Distributed Arithmetic Method for Complex Multiplication
 
Simulation of Signal Reflection in Digital Design
Simulation of Signal Reflection in Digital DesignSimulation of Signal Reflection in Digital Design
Simulation of Signal Reflection in Digital Design
 

Similar to Basics of programming embedded processors

What&rsquo;s new in Visual C++
What&rsquo;s new in Visual C++What&rsquo;s new in Visual C++
What&rsquo;s new in Visual C++
Microsoft
 
Optimizing Commercial Software for Intel Xeon Coprocessors: Lessons Learned
Optimizing Commercial Software for Intel Xeon Coprocessors: Lessons LearnedOptimizing Commercial Software for Intel Xeon Coprocessors: Lessons Learned
Optimizing Commercial Software for Intel Xeon Coprocessors: Lessons Learned
Intel IT Center
 
“Programming Vision Pipelines on AMD’s AI Engines,” a Presentation from AMD
“Programming Vision Pipelines on AMD’s AI Engines,” a Presentation from AMD“Programming Vision Pipelines on AMD’s AI Engines,” a Presentation from AMD
“Programming Vision Pipelines on AMD’s AI Engines,” a Presentation from AMD
Edge AI and Vision Alliance
 
Workshop "Can my .NET application use less CPU / RAM?", Yevhen Tatarynov
Workshop "Can my .NET application use less CPU / RAM?", Yevhen TatarynovWorkshop "Can my .NET application use less CPU / RAM?", Yevhen Tatarynov
Workshop "Can my .NET application use less CPU / RAM?", Yevhen Tatarynov
Fwdays
 
Accelerated Training of Transformer Models
Accelerated Training of Transformer ModelsAccelerated Training of Transformer Models
Accelerated Training of Transformer Models
Databricks
 
Java 5 6 Generics, Concurrency, Garbage Collection, Tuning
Java 5 6 Generics, Concurrency, Garbage Collection, TuningJava 5 6 Generics, Concurrency, Garbage Collection, Tuning
Java 5 6 Generics, Concurrency, Garbage Collection, Tuning
Carol McDonald
 
Федор Поляков (Looksery) “Face Tracking на мобильных устройствах в режиме реа...
Федор Поляков (Looksery) “Face Tracking на мобильных устройствах в режиме реа...Федор Поляков (Looksery) “Face Tracking на мобильных устройствах в режиме реа...
Федор Поляков (Looksery) “Face Tracking на мобильных устройствах в режиме реа...
Provectus
 
Designing Architecture-aware Library using Boost.Proto
Designing Architecture-aware Library using Boost.ProtoDesigning Architecture-aware Library using Boost.Proto
Designing Architecture-aware Library using Boost.Proto
Joel Falcou
 
Intro to Machine Learning for GPUs
Intro to Machine Learning for GPUsIntro to Machine Learning for GPUs
Intro to Machine Learning for GPUs
Sri Ambati
 
Model-based GUI testing using UPPAAL
Model-based GUI testing using UPPAALModel-based GUI testing using UPPAAL
Model-based GUI testing using UPPAAL
Ulrik Hørlyk Hjort
 
Resume digital
Resume digitalResume digital
Resume digital
tarora1
 
Resume digital
Resume digitalResume digital
Resume digital
tarora1
 
pgconfasia2016 plcuda en
pgconfasia2016 plcuda enpgconfasia2016 plcuda en
pgconfasia2016 plcuda en
Kohei KaiGai
 
Resume mixed signal
Resume mixed signalResume mixed signal
Resume mixed signal
tarora1
 
Resume mixed signal
Resume mixed signalResume mixed signal
Resume mixed signal
tarora1
 
Accelerating Real Time Video Analytics on a Heterogenous CPU + FPGA Platform
Accelerating Real Time Video Analytics on a Heterogenous CPU + FPGA PlatformAccelerating Real Time Video Analytics on a Heterogenous CPU + FPGA Platform
Accelerating Real Time Video Analytics on a Heterogenous CPU + FPGA Platform
Databricks
 
09 accelerators
09 accelerators09 accelerators
09 accelerators
Murali M
 
Deep Learning, Microsoft Cognitive Toolkit (CNTK) and Azure Machine Learning ...
Deep Learning, Microsoft Cognitive Toolkit (CNTK) and Azure Machine Learning ...Deep Learning, Microsoft Cognitive Toolkit (CNTK) and Azure Machine Learning ...
Deep Learning, Microsoft Cognitive Toolkit (CNTK) and Azure Machine Learning ...
Naoki (Neo) SATO
 
Machine-learning based performance heuristics for Runtime CPU/GPU Selection i...
Machine-learning based performance heuristics for Runtime CPU/GPU Selection i...Machine-learning based performance heuristics for Runtime CPU/GPU Selection i...
Machine-learning based performance heuristics for Runtime CPU/GPU Selection i...
Akihiro Hayashi
 
20160407_GTC2016_PgSQL_In_Place
20160407_GTC2016_PgSQL_In_Place20160407_GTC2016_PgSQL_In_Place
20160407_GTC2016_PgSQL_In_Place
Kohei KaiGai
 

Similar to Basics of programming embedded processors (20)

What&rsquo;s new in Visual C++
What&rsquo;s new in Visual C++What&rsquo;s new in Visual C++
What&rsquo;s new in Visual C++
 
Optimizing Commercial Software for Intel Xeon Coprocessors: Lessons Learned
Optimizing Commercial Software for Intel Xeon Coprocessors: Lessons LearnedOptimizing Commercial Software for Intel Xeon Coprocessors: Lessons Learned
Optimizing Commercial Software for Intel Xeon Coprocessors: Lessons Learned
 
“Programming Vision Pipelines on AMD’s AI Engines,” a Presentation from AMD
“Programming Vision Pipelines on AMD’s AI Engines,” a Presentation from AMD“Programming Vision Pipelines on AMD’s AI Engines,” a Presentation from AMD
“Programming Vision Pipelines on AMD’s AI Engines,” a Presentation from AMD
 
Workshop "Can my .NET application use less CPU / RAM?", Yevhen Tatarynov
Workshop "Can my .NET application use less CPU / RAM?", Yevhen TatarynovWorkshop "Can my .NET application use less CPU / RAM?", Yevhen Tatarynov
Workshop "Can my .NET application use less CPU / RAM?", Yevhen Tatarynov
 
Accelerated Training of Transformer Models
Accelerated Training of Transformer ModelsAccelerated Training of Transformer Models
Accelerated Training of Transformer Models
 
Java 5 6 Generics, Concurrency, Garbage Collection, Tuning
Java 5 6 Generics, Concurrency, Garbage Collection, TuningJava 5 6 Generics, Concurrency, Garbage Collection, Tuning
Java 5 6 Generics, Concurrency, Garbage Collection, Tuning
 
Федор Поляков (Looksery) “Face Tracking на мобильных устройствах в режиме реа...
Федор Поляков (Looksery) “Face Tracking на мобильных устройствах в режиме реа...Федор Поляков (Looksery) “Face Tracking на мобильных устройствах в режиме реа...
Федор Поляков (Looksery) “Face Tracking на мобильных устройствах в режиме реа...
 
Designing Architecture-aware Library using Boost.Proto
Designing Architecture-aware Library using Boost.ProtoDesigning Architecture-aware Library using Boost.Proto
Designing Architecture-aware Library using Boost.Proto
 
Intro to Machine Learning for GPUs
Intro to Machine Learning for GPUsIntro to Machine Learning for GPUs
Intro to Machine Learning for GPUs
 
Model-based GUI testing using UPPAAL
Model-based GUI testing using UPPAALModel-based GUI testing using UPPAAL
Model-based GUI testing using UPPAAL
 
Resume digital
Resume digitalResume digital
Resume digital
 
Resume digital
Resume digitalResume digital
Resume digital
 
pgconfasia2016 plcuda en
pgconfasia2016 plcuda enpgconfasia2016 plcuda en
pgconfasia2016 plcuda en
 
Resume mixed signal
Resume mixed signalResume mixed signal
Resume mixed signal
 
Resume mixed signal
Resume mixed signalResume mixed signal
Resume mixed signal
 
Accelerating Real Time Video Analytics on a Heterogenous CPU + FPGA Platform
Accelerating Real Time Video Analytics on a Heterogenous CPU + FPGA PlatformAccelerating Real Time Video Analytics on a Heterogenous CPU + FPGA Platform
Accelerating Real Time Video Analytics on a Heterogenous CPU + FPGA Platform
 
09 accelerators
09 accelerators09 accelerators
09 accelerators
 
Deep Learning, Microsoft Cognitive Toolkit (CNTK) and Azure Machine Learning ...
Deep Learning, Microsoft Cognitive Toolkit (CNTK) and Azure Machine Learning ...Deep Learning, Microsoft Cognitive Toolkit (CNTK) and Azure Machine Learning ...
Deep Learning, Microsoft Cognitive Toolkit (CNTK) and Azure Machine Learning ...
 
Machine-learning based performance heuristics for Runtime CPU/GPU Selection i...
Machine-learning based performance heuristics for Runtime CPU/GPU Selection i...Machine-learning based performance heuristics for Runtime CPU/GPU Selection i...
Machine-learning based performance heuristics for Runtime CPU/GPU Selection i...
 
20160407_GTC2016_PgSQL_In_Place
20160407_GTC2016_PgSQL_In_Place20160407_GTC2016_PgSQL_In_Place
20160407_GTC2016_PgSQL_In_Place
 

More from Murphy Chen

提升心靈的方法:佛陀教導的四念住
提升心靈的方法:佛陀教導的四念住提升心靈的方法:佛陀教導的四念住
提升心靈的方法:佛陀教導的四念住
Murphy Chen
 
資工人的職涯發展之道
資工人的職涯發展之道資工人的職涯發展之道
資工人的職涯發展之道
Murphy Chen
 
EKernel Thesis: an object-oriented micro-kernel
EKernel Thesis: an object-oriented micro-kernelEKernel Thesis: an object-oriented micro-kernel
EKernel Thesis: an object-oriented micro-kernel
Murphy Chen
 
EKernel: an object-oriented micro-kernel
EKernel: an object-oriented micro-kernelEKernel: an object-oriented micro-kernel
EKernel: an object-oriented micro-kernel
Murphy Chen
 
心靈環保
心靈環保心靈環保
心靈環保
Murphy Chen
 
資工人的學習成長之路
資工人的學習成長之路資工人的學習成長之路
資工人的學習成長之路
Murphy Chen
 
南北傳禪修經驗分享
南北傳禪修經驗分享南北傳禪修經驗分享
南北傳禪修經驗分享
Murphy Chen
 
資工人為什麼需要學習數位電路?
資工人為什麼需要學習數位電路?資工人為什麼需要學習數位電路?
資工人為什麼需要學習數位電路?
Murphy Chen
 
佛陀的啟示 (What the Buddha Taught)
佛陀的啟示 (What the Buddha Taught)佛陀的啟示 (What the Buddha Taught)
佛陀的啟示 (What the Buddha Taught)
Murphy Chen
 
禪修的效用與方法
禪修的效用與方法禪修的效用與方法
禪修的效用與方法
Murphy Chen
 

More from Murphy Chen (10)

提升心靈的方法:佛陀教導的四念住
提升心靈的方法:佛陀教導的四念住提升心靈的方法:佛陀教導的四念住
提升心靈的方法:佛陀教導的四念住
 
資工人的職涯發展之道
資工人的職涯發展之道資工人的職涯發展之道
資工人的職涯發展之道
 
EKernel Thesis: an object-oriented micro-kernel
EKernel Thesis: an object-oriented micro-kernelEKernel Thesis: an object-oriented micro-kernel
EKernel Thesis: an object-oriented micro-kernel
 
EKernel: an object-oriented micro-kernel
EKernel: an object-oriented micro-kernelEKernel: an object-oriented micro-kernel
EKernel: an object-oriented micro-kernel
 
心靈環保
心靈環保心靈環保
心靈環保
 
資工人的學習成長之路
資工人的學習成長之路資工人的學習成長之路
資工人的學習成長之路
 
南北傳禪修經驗分享
南北傳禪修經驗分享南北傳禪修經驗分享
南北傳禪修經驗分享
 
資工人為什麼需要學習數位電路?
資工人為什麼需要學習數位電路?資工人為什麼需要學習數位電路?
資工人為什麼需要學習數位電路?
 
佛陀的啟示 (What the Buddha Taught)
佛陀的啟示 (What the Buddha Taught)佛陀的啟示 (What the Buddha Taught)
佛陀的啟示 (What the Buddha Taught)
 
禪修的效用與方法
禪修的效用與方法禪修的效用與方法
禪修的效用與方法
 

Recently uploaded

E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
Quickdice ERP
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Undress Baby
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
lorraineandreiamcidl
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
Yara Milbes
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 

Recently uploaded (20)

E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 

Basics of programming embedded processors

  • 1. Basics of Programming Embedded Processors 陳正哲 聯發科技 2007.11.16
  • 2. 學經歷  台灣大學電機系  台灣大學電機所 計算機科學組  工研院電通所 (4 years) 課長  Java Chip HW/SW CoDesign  Embedded Java Virtual Machine Optimization  1 patent  聯發科技 (4 years) 部門經理  Audio Driver  MPEG-4 SW Architecture, A/V Sync  Platform Concurrent Analysis  Embedded 3D Graphics  Mobile TV  JPEG  11 patents
  • 3. Agenda  Challenges of Embedded Systems Programming  Design Patterns for Embedded Systems  Models of Programs  Analysis of Execution Time  Performance Optimizations  Power Saving Techniques  Reducing Data Size  Reducing Code Size  Testing
  • 4. Challenges of Embedded Systems Programming  run at a required rate to meet system deadline  however, often with limited computing power  limited memory  power consumption
  • 5. Design Patterns – State Machine (1/2) State machines are suited for reactive systems.
  • 6. Design Patterns – State Machine (2/2)
  • 7. Design Pattern – Circular Buffer Real-time data processing (e.g. FIR) with limited memory.
  • 8. Models of Programs – Data Flow Graph w = a + b; x = a - c; y = x+ d; x = a + c; z= y + e; w = a + b; x1 = a - c; y = x1 + d; x2 = a + c; z = y + e; Single Assignment Form Use for determining feasible reorderings of the operations, which may help us to reduce pipeline or cache conflicts.
  • 9. Control/Data Flow Graphs (CDFG) Two types of nodes: (1) Decision nodes (2) Data flow nodes The CDFG is a sequential representation of the program.
  • 10. Measuring Execution Time  method  simulator  provides greater visibility, profiling  not 100% accurate  timer  limited by the resolution of the timer  logic analyzer  condition  average case, worst case, best case
  • 11. Loop Optimizations – code motion for (i = 0; i < N*M; i++) { z[i] = a[i] + b[i]; } Move unnecessary code out of a loop.
  • 12. Loop Optimizations – Induction Variable Elimination for (i = 0; i < N; i++) for (j = 0; j < M; j++) z[i][j] = b[i][j]; for (i = 0; i < N; i++) for (j = 0; j < M; j++) { zbinduct = i*M + j; *(zptr + zbinduct) = *(bptr + zbinduct); } for (i = 0; i < N; i++) for (j = 0; j < M; j++) *(zptr++) = *(bptr++); eliminate induction variable compiler
  • 13. Loop Nest – Cache Optimizations for (j = 0; j < M; j++) for (i = 0; i < N; i++) a[j][i] = b[j][i] * c; Problem: Access b will replace a, and vice versa. Solution: (1) Data Realignment (2) Array Padding
  • 14. Power Saving Techniques  replace the algorithms with those that consume less power.  optimize memory access  memory accesses are a major component of power consumption in many applications.  turn off parts of the system when we don't need them  such as subsystems of the CPU, chips in the system
  • 15. Reducing Data Size  identifying and eliminating duplications of data  determine the actual maximum amount of data held in the buffer and allocate the array accordingly  data can sometimes be packed  reuse values  generate data on the fly
  • 16. Reducing Code Size  encapsulating functions in subroutines can reduce program size when done carefully  change sequence of instructions  for example, a multiply-accumulate instruction may be both smaller and faster than separate arithmetic operations.  proper use of subroutines  e.g. performs identical operations repeatedly  use dense instruction sets  e.g. ARM Thumb  compress the code and decompress on the fly
  • 17. Testing  Black Box Test  White Box Test  Random Test  Regression Test  Coverage Test  Boundary Test  Performance Test
  • 18. Reference  The basics of programming embedded processors, Wayne Wolf, Embedded.com.  " Computers as Components: Principles of Embedd “, Wayne Wolf.