SlideShare une entreprise Scribd logo
1  sur  20
EMBEDDED C
KRUNAL SIDDHAPATHAK
HIGH LEVEL OPTIMIZATIONS IN CODE
1. Floating – point to Fixed – point conversion
2. Simple loop transformations
3. Loop tiling/blocking
4. Loop Splitting
5. Array Folding
CODE OPTIMIZATION
1) Floating –point to Fixed –
point Conversion:
• Reduction in cycle count by
75% and energy
consumption by 76% for an
MPEG – 2 video compression
algorithm.
• Trade – off between cost of
implementation and quality
of algorithm.
• Done using Fixed – C data
types.
• E.g. a=fixed(5,4,s,wt,*b)
fixed a,*b,c[8]
2) Array Folding:
• Options for reducing storage
requirements of large arrays
must be explored since
memory space is limited in
embedded systems.
• Inter – array folding method
employs sharing of memory
space among arrays which
are not needed at
overlapping time intervals.
• Limited sets of components
needed within an array can
also be taken as at a time
only a subset of array
elements is needed.
CODE OPTIMIZATION
3) Loop tiling/blocking:
• It is utmost essential to reuse
“small” memories including
caches and scratch – pad
memories.
• Blocked or tiled algorithms
improves locality of references.
• Innermost loop becomes
restricted as it accesses less
array elements.
• If a proper blocking factor is
selected, the elements are still
in the cache when next iteration
of the innermost loop starts.
• Improves performance for
matrix multiplications by
reducing no. of memory
references using reuse factor.
4) Loop Splitting:
• Efficiency of algorithm improves
if loops are splitted and one
loop body handles the regular
cases and a second one handles
the exceptions.
• Total number of cycles can be
saved by splitting of nested
loops for various applications
and target processors.
• Cycle count can be reduced by
75%.
CODE OPTIMIZATION
Simple Loop
Transformations
Loop
Permutation
Loop Fusion,
Loop Fission
Loop Unrolling
• Two loops can
either be merged
into a single loop –
Loop Fusion.
• Single loop is
splitted into two
loops – Loop Fission
• Helps in reuse of
array elements in
cache as next
iteration of the
loop body will
access an adjacent
location in
memory.
• Number of copies of the
loop is called unrolling
factor (>2).
• Reduces loop overhead
(less branches per
instruction) & improves
speed but increases code
size.
• Restricted to loops with
constant no. of
iterations.
EMBEDDED C FOR HIGH
PERFORMANCE DSP PROGRAMMING
• Performance is the key to digital signal
processing because it translates into
application – based end – user systems.
• Changes in technological and economic
requirements make it more and more
expensive to continue programming the DSP
processor in assembly languages.
• DSP architectures are not easy to program
optimally due to their non – orthogonality.
• Stronger error correction and encryption
algorithms must be added to match up to the
increased complexity in DSP.
• Communication protocols have become more
sophisticated and require much more code to
implement.
• Multiple protocol stacks have been
implemented to be compatible with multiple
service providers.
• In addition, backward compatibility with older
protocols is also needed to stay synchronized
with provider networks that are in a slow
process of upgrading.
ENTERING WITH EMBEDDED C
• Embedded C is designed to bridge the
performance mismatch between the signal
processing algorithms, standard C and the
architecture.
• It is an extension of C language with the
primitives that are needed by signal processing
applications and that are commonly provided by
DSP processors.
• Maintainability and portability of code are the
key winners in this process.
REQUIREMENTS FOR I/O HARDWARE
ADDRESSING INTERFACE
1. The device drive source code must be
portable.
2. The interface must not prevent
implementations to produce machine code
that is as efficient as other methods.
3. The design should permit encapsulation of
the system dependent access method.
MEMORY MANAGEMENT IN AN
AEROSPACE EMBEDDED CODE
• Dynamic Allocation eases development by
providing system memory to application
processes as needed at runtime and retrieving
the memory when it is no longer needed.
• C’s runtime library function malloc() can exhibit
wildly unpredictable performance and become a
bottleneck in multithread programs on multi core
systems.
• Hence, dynamic memory allocation is forbidden
in a safety – critical embedded avionics code.
WHY NOT DYNAMIC MEMORY
ALLOCATION IN AVIONICS?
• Dynamic memory is a poor – choice for a
mission – critical code as it is based on list
allocator algorithms that organize memory
pools into contiguous locations in a single
linked list.
• These list allocators allocates a memory using
malloc() and de – allocates the memory
location for reuse using free(). But it places a
burden on the programmer to balance each
call to malloc() with a corresponding call to
free().
THEN WHAT IS THE SOLUTION?
• Customized memory allocation functions that
more closely match specific allocation
scenarios are used such as:
1. Stack – based allocator
2. Thread – local allocator
3. In – Memory Database Systems (IMDS)
• The performance, stability and predictability
of the safety – critical code increases using
above custom allocators.
STACK – BASED ALLOCATOR
• In this algorithm, each allocation returns the
address of the current position of the stack
pointer and advances the pointer by the amount
of the request.
• When memory is no longer needed, the stack
pointer is rewound.
• Processing Overhead is reduced because there is
no chain of pointers to manage nor are there any
allocation sizes or contiguous locations to track.
• A memory leak can’t be accidentally introduced
through improper de – allocation because the
application does not have to track specific
allocations.
CUSTOM STACK – BASED ALLOCATOR
THREAD – LOCAL ALLOCATOR
• A custom thread – local allocator avoids conflicts
by assigning a specific memory pool to each
thread.
• The thread’s allocation is performed from this
block without interference with other thread’s
requests, thus enhancing performance and
predictability.
• It uses a Pending Request List or PRL for each
thread to coordinate the release of memory
blocks that are freed by a thread other than the
one that performed the original allocation.
• Memory that is allocated and de - allocated by
the same thread requires no coordination, and
therefore no lock conflicts occur.
IN – MEMORY DATABASE SYSTEMS
(IMDS)
• Benefits of Custom memory allocators can also
be harnessed by integrating third – party
software like IMDS.
• IMDS manages application objects in RAM.
• Memory allocation & de – allocation of
application objects is also done using malloc()
and free().
• With an IMDS, concurrency among multithreads
is maintained automatically via transactions.
APPLICATIONS IN MILITARY
• A sensor object could represent either optical
sensors for tracking missile targets or biosensors
for defense in chemical warfare or motion
sensors to aid in navigating an aircraft.
• This sensor object occupies memory from the
memory pool and free() returns memory back to
the heap & space is relinquished for reuse when
the code completes.
• malloc() is responsible for memory fragmentation
and for deciding the allocator type.
EMBEDDED C IN
FPGA SWITCHING
TECHNOLOGY
• C algorithms can be
applied to programmable
& flexible FPGAs using
ultra – low latency.
• Parallelism involves
unrolling a software
process into multiple
parallel hardware
processes.
• Recently applied in Wall
Street
• Possesses potential use
for military purposes.
THANK YOU

Contenu connexe

Tendances

network ram parallel computing
network ram parallel computingnetwork ram parallel computing
network ram parallel computingNiranjana Ambadi
 
Parallel computing in india
Parallel computing in indiaParallel computing in india
Parallel computing in indiaPreeti Chauhan
 
Enabling Machine Learning on the Edge using SRAM Conserving Efficient Neural ...
Enabling Machine Learning on the Edge using SRAM Conserving Efficient Neural ...Enabling Machine Learning on the Edge using SRAM Conserving Efficient Neural ...
Enabling Machine Learning on the Edge using SRAM Conserving Efficient Neural ...Bharath Sudharsan
 
Lecture 3 parallel programming platforms
Lecture 3   parallel programming platformsLecture 3   parallel programming platforms
Lecture 3 parallel programming platformsVajira Thambawita
 
Parallel Processors (SIMD)
Parallel Processors (SIMD) Parallel Processors (SIMD)
Parallel Processors (SIMD) Ali Raza
 
Advanced computer architecture lesson 5 and 6
Advanced computer architecture lesson 5 and 6Advanced computer architecture lesson 5 and 6
Advanced computer architecture lesson 5 and 6Ismail Mukiibi
 
Parallel Algorithms Advantages and Disadvantages
Parallel Algorithms Advantages and DisadvantagesParallel Algorithms Advantages and Disadvantages
Parallel Algorithms Advantages and DisadvantagesMurtadha Alsabbagh
 
Parallel computing
Parallel computingParallel computing
Parallel computingvirend111
 
Limitations of memory system performance
Limitations of memory system performanceLimitations of memory system performance
Limitations of memory system performanceSyed Zaid Irshad
 
Lecture 1
Lecture 1Lecture 1
Lecture 1Mr SMAK
 
Introduction to parallel_computing
Introduction to parallel_computingIntroduction to parallel_computing
Introduction to parallel_computingMehul Patel
 
ECML PKDD 2021 ML meets IoT Tutorial Part II: Creating ML based Self learning...
ECML PKDD 2021 ML meets IoT Tutorial Part II: Creating ML based Self learning...ECML PKDD 2021 ML meets IoT Tutorial Part II: Creating ML based Self learning...
ECML PKDD 2021 ML meets IoT Tutorial Part II: Creating ML based Self learning...Bharath Sudharsan
 
Multithreading: Exploiting Thread-Level Parallelism to Improve Uniprocessor ...
Multithreading: Exploiting Thread-Level  Parallelism to Improve Uniprocessor ...Multithreading: Exploiting Thread-Level  Parallelism to Improve Uniprocessor ...
Multithreading: Exploiting Thread-Level Parallelism to Improve Uniprocessor ...Ahmed kasim
 
Multicore and shared multi processor
Multicore and shared multi processorMulticore and shared multi processor
Multicore and shared multi processorSou Jana
 
Unit IV Memory and I/O Organization
Unit IV Memory and I/O OrganizationUnit IV Memory and I/O Organization
Unit IV Memory and I/O OrganizationBalaji Vignesh
 
Parallel Programing Model
Parallel Programing ModelParallel Programing Model
Parallel Programing ModelAdlin Jeena
 

Tendances (20)

Parallel Processing Concepts
Parallel Processing Concepts Parallel Processing Concepts
Parallel Processing Concepts
 
network ram parallel computing
network ram parallel computingnetwork ram parallel computing
network ram parallel computing
 
Parallel computing in india
Parallel computing in indiaParallel computing in india
Parallel computing in india
 
Enabling Machine Learning on the Edge using SRAM Conserving Efficient Neural ...
Enabling Machine Learning on the Edge using SRAM Conserving Efficient Neural ...Enabling Machine Learning on the Edge using SRAM Conserving Efficient Neural ...
Enabling Machine Learning on the Edge using SRAM Conserving Efficient Neural ...
 
Lecture 3 parallel programming platforms
Lecture 3   parallel programming platformsLecture 3   parallel programming platforms
Lecture 3 parallel programming platforms
 
Parallel Processors (SIMD)
Parallel Processors (SIMD) Parallel Processors (SIMD)
Parallel Processors (SIMD)
 
Advanced computer architecture lesson 5 and 6
Advanced computer architecture lesson 5 and 6Advanced computer architecture lesson 5 and 6
Advanced computer architecture lesson 5 and 6
 
Parallel Algorithms Advantages and Disadvantages
Parallel Algorithms Advantages and DisadvantagesParallel Algorithms Advantages and Disadvantages
Parallel Algorithms Advantages and Disadvantages
 
Parallel computing
Parallel computingParallel computing
Parallel computing
 
Limitations of memory system performance
Limitations of memory system performanceLimitations of memory system performance
Limitations of memory system performance
 
Hpc 4 5
Hpc 4 5Hpc 4 5
Hpc 4 5
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
Introduction to parallel_computing
Introduction to parallel_computingIntroduction to parallel_computing
Introduction to parallel_computing
 
ECML PKDD 2021 ML meets IoT Tutorial Part II: Creating ML based Self learning...
ECML PKDD 2021 ML meets IoT Tutorial Part II: Creating ML based Self learning...ECML PKDD 2021 ML meets IoT Tutorial Part II: Creating ML based Self learning...
ECML PKDD 2021 ML meets IoT Tutorial Part II: Creating ML based Self learning...
 
Lecture02 types
Lecture02 typesLecture02 types
Lecture02 types
 
Multithreading: Exploiting Thread-Level Parallelism to Improve Uniprocessor ...
Multithreading: Exploiting Thread-Level  Parallelism to Improve Uniprocessor ...Multithreading: Exploiting Thread-Level  Parallelism to Improve Uniprocessor ...
Multithreading: Exploiting Thread-Level Parallelism to Improve Uniprocessor ...
 
Multicore and shared multi processor
Multicore and shared multi processorMulticore and shared multi processor
Multicore and shared multi processor
 
Unit IV Memory and I/O Organization
Unit IV Memory and I/O OrganizationUnit IV Memory and I/O Organization
Unit IV Memory and I/O Organization
 
Parallel Programing Model
Parallel Programing ModelParallel Programing Model
Parallel Programing Model
 
Parallel processing
Parallel processingParallel processing
Parallel processing
 

En vedette

En vedette (20)

Embedded C workshop
Embedded C workshopEmbedded C workshop
Embedded C workshop
 
C Programming For Embedded Systems
C Programming For Embedded SystemsC Programming For Embedded Systems
C Programming For Embedded Systems
 
Embedded c programming22 for fdp
Embedded c programming22 for fdpEmbedded c programming22 for fdp
Embedded c programming22 for fdp
 
Embedded C - Lecture 1
Embedded C - Lecture 1Embedded C - Lecture 1
Embedded C - Lecture 1
 
Embedded c
Embedded cEmbedded c
Embedded c
 
Embedded C
Embedded CEmbedded C
Embedded C
 
Musketeers mind rover
Musketeers mind roverMusketeers mind rover
Musketeers mind rover
 
Grid computing
Grid computingGrid computing
Grid computing
 
Atumatic toll tax system
Atumatic toll tax systemAtumatic toll tax system
Atumatic toll tax system
 
MICROWAVE RADIO COVERAGE FOR VEHICLE TO-VEHICLE AND IN-VEHICLE COMMUNICATION
MICROWAVE RADIO COVERAGE FOR VEHICLE TO-VEHICLE AND IN-VEHICLE COMMUNICATION MICROWAVE RADIO COVERAGE FOR VEHICLE TO-VEHICLE AND IN-VEHICLE COMMUNICATION
MICROWAVE RADIO COVERAGE FOR VEHICLE TO-VEHICLE AND IN-VEHICLE COMMUNICATION
 
Features of modern intel microprocessors
Features of modern intel microprocessorsFeatures of modern intel microprocessors
Features of modern intel microprocessors
 
Embedded system - embedded system programming
Embedded system - embedded system programmingEmbedded system - embedded system programming
Embedded system - embedded system programming
 
States & Capitals 111
States & Capitals 111States & Capitals 111
States & Capitals 111
 
C++ for Embedded Programming
C++ for Embedded ProgrammingC++ for Embedded Programming
C++ for Embedded Programming
 
Embedded c programming
Embedded c programmingEmbedded c programming
Embedded c programming
 
C prog ppt
C prog pptC prog ppt
C prog ppt
 
Sic a new era in power electronics
Sic a new era in power electronicsSic a new era in power electronics
Sic a new era in power electronics
 
Embedded _c_
Embedded  _c_Embedded  _c_
Embedded _c_
 
Embedded C - Lecture 3
Embedded C - Lecture 3Embedded C - Lecture 3
Embedded C - Lecture 3
 
Embedded c program and programming structure for beginners
Embedded c program and programming structure for beginnersEmbedded c program and programming structure for beginners
Embedded c program and programming structure for beginners
 

Similaire à Embedded C

Memory and Performance Isolation for a Multi-tenant Function-based Data-plane
Memory and Performance Isolation for a Multi-tenant Function-based Data-planeMemory and Performance Isolation for a Multi-tenant Function-based Data-plane
Memory and Performance Isolation for a Multi-tenant Function-based Data-plane AJAY KHARAT
 
Advanced processor principles
Advanced processor principlesAdvanced processor principles
Advanced processor principlesDhaval Bagal
 
Accelerating Deep Learning Inference 
on Mobile Systems
Accelerating Deep Learning Inference 
on Mobile SystemsAccelerating Deep Learning Inference 
on Mobile Systems
Accelerating Deep Learning Inference 
on Mobile SystemsDarian Frajberg
 
Approximation techniques used for general purpose algorithms
Approximation techniques used for general purpose algorithmsApproximation techniques used for general purpose algorithms
Approximation techniques used for general purpose algorithmsSabidur Rahman
 
Basics of micro controllers for biginners
Basics of  micro controllers for biginnersBasics of  micro controllers for biginners
Basics of micro controllers for biginnersGerwin Makanyanga
 
VLSI design Dr B.jagadeesh UNIT-5.pptx
VLSI design Dr B.jagadeesh   UNIT-5.pptxVLSI design Dr B.jagadeesh   UNIT-5.pptx
VLSI design Dr B.jagadeesh UNIT-5.pptxjagadeesh276791
 
Computre_Engineering_Introduction_FPGA.ppt
Computre_Engineering_Introduction_FPGA.pptComputre_Engineering_Introduction_FPGA.ppt
Computre_Engineering_Introduction_FPGA.pptghadeer228987
 
OMI - The Missing Piece of a Modular, Flexible and Composable Computing World
OMI - The Missing Piece of a Modular, Flexible and Composable Computing WorldOMI - The Missing Piece of a Modular, Flexible and Composable Computing World
OMI - The Missing Piece of a Modular, Flexible and Composable Computing WorldAllan Cantle
 
Introduction to embedded System.pptx
Introduction to embedded System.pptxIntroduction to embedded System.pptx
Introduction to embedded System.pptxPratik Gohel
 
Chip Multithreading Systems Need a New Operating System Scheduler
Chip Multithreading Systems Need a New Operating System Scheduler Chip Multithreading Systems Need a New Operating System Scheduler
Chip Multithreading Systems Need a New Operating System Scheduler Sarwan ali
 
4.1 Introduction 145• In this section, we first take a gander at a.pdf
4.1 Introduction 145• In this section, we first take a gander at a.pdf4.1 Introduction 145• In this section, we first take a gander at a.pdf
4.1 Introduction 145• In this section, we first take a gander at a.pdfarpowersarps
 
Project Presentation Final
Project Presentation FinalProject Presentation Final
Project Presentation FinalDhritiman Halder
 
Evaluating UCIe based multi-die SoC to meet timing and power
Evaluating UCIe based multi-die SoC to meet timing and power Evaluating UCIe based multi-die SoC to meet timing and power
Evaluating UCIe based multi-die SoC to meet timing and power Deepak Shankar
 
embedded system-Memory_Organization_final.pdf
embedded system-Memory_Organization_final.pdfembedded system-Memory_Organization_final.pdf
embedded system-Memory_Organization_final.pdfSarveshPandey64
 
Trends and challenges in IP based SOC design
Trends and challenges in IP based SOC designTrends and challenges in IP based SOC design
Trends and challenges in IP based SOC designAishwaryaRavishankar8
 
Remote core locking-Andrea Lombardo
Remote core locking-Andrea LombardoRemote core locking-Andrea Lombardo
Remote core locking-Andrea LombardoAndrea Lombardo
 

Similaire à Embedded C (20)

Memory and Performance Isolation for a Multi-tenant Function-based Data-plane
Memory and Performance Isolation for a Multi-tenant Function-based Data-planeMemory and Performance Isolation for a Multi-tenant Function-based Data-plane
Memory and Performance Isolation for a Multi-tenant Function-based Data-plane
 
Node architecture
Node architectureNode architecture
Node architecture
 
Advanced processor principles
Advanced processor principlesAdvanced processor principles
Advanced processor principles
 
Accelerating Deep Learning Inference 
on Mobile Systems
Accelerating Deep Learning Inference 
on Mobile SystemsAccelerating Deep Learning Inference 
on Mobile Systems
Accelerating Deep Learning Inference 
on Mobile Systems
 
Lect_1.pptx
Lect_1.pptxLect_1.pptx
Lect_1.pptx
 
Approximation techniques used for general purpose algorithms
Approximation techniques used for general purpose algorithmsApproximation techniques used for general purpose algorithms
Approximation techniques used for general purpose algorithms
 
Basics of micro controllers for biginners
Basics of  micro controllers for biginnersBasics of  micro controllers for biginners
Basics of micro controllers for biginners
 
VLSI design Dr B.jagadeesh UNIT-5.pptx
VLSI design Dr B.jagadeesh   UNIT-5.pptxVLSI design Dr B.jagadeesh   UNIT-5.pptx
VLSI design Dr B.jagadeesh UNIT-5.pptx
 
Computre_Engineering_Introduction_FPGA.ppt
Computre_Engineering_Introduction_FPGA.pptComputre_Engineering_Introduction_FPGA.ppt
Computre_Engineering_Introduction_FPGA.ppt
 
OMI - The Missing Piece of a Modular, Flexible and Composable Computing World
OMI - The Missing Piece of a Modular, Flexible and Composable Computing WorldOMI - The Missing Piece of a Modular, Flexible and Composable Computing World
OMI - The Missing Piece of a Modular, Flexible and Composable Computing World
 
Introduction to embedded System.pptx
Introduction to embedded System.pptxIntroduction to embedded System.pptx
Introduction to embedded System.pptx
 
Doc32002
Doc32002Doc32002
Doc32002
 
Chip Multithreading Systems Need a New Operating System Scheduler
Chip Multithreading Systems Need a New Operating System Scheduler Chip Multithreading Systems Need a New Operating System Scheduler
Chip Multithreading Systems Need a New Operating System Scheduler
 
4.1 Introduction 145• In this section, we first take a gander at a.pdf
4.1 Introduction 145• In this section, we first take a gander at a.pdf4.1 Introduction 145• In this section, we first take a gander at a.pdf
4.1 Introduction 145• In this section, we first take a gander at a.pdf
 
Project Presentation Final
Project Presentation FinalProject Presentation Final
Project Presentation Final
 
Evaluating UCIe based multi-die SoC to meet timing and power
Evaluating UCIe based multi-die SoC to meet timing and power Evaluating UCIe based multi-die SoC to meet timing and power
Evaluating UCIe based multi-die SoC to meet timing and power
 
embedded system-Memory_Organization_final.pdf
embedded system-Memory_Organization_final.pdfembedded system-Memory_Organization_final.pdf
embedded system-Memory_Organization_final.pdf
 
Vcs standard ccna 2 ch-1.1
Vcs standard ccna 2 ch-1.1Vcs standard ccna 2 ch-1.1
Vcs standard ccna 2 ch-1.1
 
Trends and challenges in IP based SOC design
Trends and challenges in IP based SOC designTrends and challenges in IP based SOC design
Trends and challenges in IP based SOC design
 
Remote core locking-Andrea Lombardo
Remote core locking-Andrea LombardoRemote core locking-Andrea Lombardo
Remote core locking-Andrea Lombardo
 

Dernier

Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesShubhangi Sonawane
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 

Dernier (20)

Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 

Embedded C

  • 2. HIGH LEVEL OPTIMIZATIONS IN CODE 1. Floating – point to Fixed – point conversion 2. Simple loop transformations 3. Loop tiling/blocking 4. Loop Splitting 5. Array Folding
  • 3. CODE OPTIMIZATION 1) Floating –point to Fixed – point Conversion: • Reduction in cycle count by 75% and energy consumption by 76% for an MPEG – 2 video compression algorithm. • Trade – off between cost of implementation and quality of algorithm. • Done using Fixed – C data types. • E.g. a=fixed(5,4,s,wt,*b) fixed a,*b,c[8] 2) Array Folding: • Options for reducing storage requirements of large arrays must be explored since memory space is limited in embedded systems. • Inter – array folding method employs sharing of memory space among arrays which are not needed at overlapping time intervals. • Limited sets of components needed within an array can also be taken as at a time only a subset of array elements is needed.
  • 4.
  • 5. CODE OPTIMIZATION 3) Loop tiling/blocking: • It is utmost essential to reuse “small” memories including caches and scratch – pad memories. • Blocked or tiled algorithms improves locality of references. • Innermost loop becomes restricted as it accesses less array elements. • If a proper blocking factor is selected, the elements are still in the cache when next iteration of the innermost loop starts. • Improves performance for matrix multiplications by reducing no. of memory references using reuse factor. 4) Loop Splitting: • Efficiency of algorithm improves if loops are splitted and one loop body handles the regular cases and a second one handles the exceptions. • Total number of cycles can be saved by splitting of nested loops for various applications and target processors. • Cycle count can be reduced by 75%.
  • 6. CODE OPTIMIZATION Simple Loop Transformations Loop Permutation Loop Fusion, Loop Fission Loop Unrolling • Two loops can either be merged into a single loop – Loop Fusion. • Single loop is splitted into two loops – Loop Fission • Helps in reuse of array elements in cache as next iteration of the loop body will access an adjacent location in memory. • Number of copies of the loop is called unrolling factor (>2). • Reduces loop overhead (less branches per instruction) & improves speed but increases code size. • Restricted to loops with constant no. of iterations.
  • 7. EMBEDDED C FOR HIGH PERFORMANCE DSP PROGRAMMING • Performance is the key to digital signal processing because it translates into application – based end – user systems. • Changes in technological and economic requirements make it more and more expensive to continue programming the DSP processor in assembly languages. • DSP architectures are not easy to program optimally due to their non – orthogonality.
  • 8. • Stronger error correction and encryption algorithms must be added to match up to the increased complexity in DSP. • Communication protocols have become more sophisticated and require much more code to implement. • Multiple protocol stacks have been implemented to be compatible with multiple service providers. • In addition, backward compatibility with older protocols is also needed to stay synchronized with provider networks that are in a slow process of upgrading.
  • 9. ENTERING WITH EMBEDDED C • Embedded C is designed to bridge the performance mismatch between the signal processing algorithms, standard C and the architecture. • It is an extension of C language with the primitives that are needed by signal processing applications and that are commonly provided by DSP processors. • Maintainability and portability of code are the key winners in this process.
  • 10. REQUIREMENTS FOR I/O HARDWARE ADDRESSING INTERFACE 1. The device drive source code must be portable. 2. The interface must not prevent implementations to produce machine code that is as efficient as other methods. 3. The design should permit encapsulation of the system dependent access method.
  • 11. MEMORY MANAGEMENT IN AN AEROSPACE EMBEDDED CODE • Dynamic Allocation eases development by providing system memory to application processes as needed at runtime and retrieving the memory when it is no longer needed. • C’s runtime library function malloc() can exhibit wildly unpredictable performance and become a bottleneck in multithread programs on multi core systems. • Hence, dynamic memory allocation is forbidden in a safety – critical embedded avionics code.
  • 12. WHY NOT DYNAMIC MEMORY ALLOCATION IN AVIONICS? • Dynamic memory is a poor – choice for a mission – critical code as it is based on list allocator algorithms that organize memory pools into contiguous locations in a single linked list. • These list allocators allocates a memory using malloc() and de – allocates the memory location for reuse using free(). But it places a burden on the programmer to balance each call to malloc() with a corresponding call to free().
  • 13. THEN WHAT IS THE SOLUTION? • Customized memory allocation functions that more closely match specific allocation scenarios are used such as: 1. Stack – based allocator 2. Thread – local allocator 3. In – Memory Database Systems (IMDS) • The performance, stability and predictability of the safety – critical code increases using above custom allocators.
  • 14. STACK – BASED ALLOCATOR • In this algorithm, each allocation returns the address of the current position of the stack pointer and advances the pointer by the amount of the request. • When memory is no longer needed, the stack pointer is rewound. • Processing Overhead is reduced because there is no chain of pointers to manage nor are there any allocation sizes or contiguous locations to track. • A memory leak can’t be accidentally introduced through improper de – allocation because the application does not have to track specific allocations.
  • 15. CUSTOM STACK – BASED ALLOCATOR
  • 16. THREAD – LOCAL ALLOCATOR • A custom thread – local allocator avoids conflicts by assigning a specific memory pool to each thread. • The thread’s allocation is performed from this block without interference with other thread’s requests, thus enhancing performance and predictability. • It uses a Pending Request List or PRL for each thread to coordinate the release of memory blocks that are freed by a thread other than the one that performed the original allocation. • Memory that is allocated and de - allocated by the same thread requires no coordination, and therefore no lock conflicts occur.
  • 17. IN – MEMORY DATABASE SYSTEMS (IMDS) • Benefits of Custom memory allocators can also be harnessed by integrating third – party software like IMDS. • IMDS manages application objects in RAM. • Memory allocation & de – allocation of application objects is also done using malloc() and free(). • With an IMDS, concurrency among multithreads is maintained automatically via transactions.
  • 18. APPLICATIONS IN MILITARY • A sensor object could represent either optical sensors for tracking missile targets or biosensors for defense in chemical warfare or motion sensors to aid in navigating an aircraft. • This sensor object occupies memory from the memory pool and free() returns memory back to the heap & space is relinquished for reuse when the code completes. • malloc() is responsible for memory fragmentation and for deciding the allocator type.
  • 19. EMBEDDED C IN FPGA SWITCHING TECHNOLOGY • C algorithms can be applied to programmable & flexible FPGAs using ultra – low latency. • Parallelism involves unrolling a software process into multiple parallel hardware processes. • Recently applied in Wall Street • Possesses potential use for military purposes.