Unit 2
Unit 2
29-11-2023 1
Source file to object file translation
29-11-2023 2
Embedded software in a system
• Application specific software
11/29/2023 3
ROM IMAGE
Embedded software is a
unique placement and
arrangement of bytes for
instructions and data.
11/29/2023 4
Software in processor specific assembly language
• Coding in assembly language is easy to learn for a designer who
has knowledge about machine specific instruction set
• Assembly Coding is extremely useful for configuring physical
devices like ports, a line-display interface, ADC and DAC and
reading into or transmitting from a buffer
• They are useful to run the device specific features and provide an
optimal coding solution.
• To do all the coding in assembly language may be very time
consuming.
• Full coding in assembly may be done only for a few simple, small-
scale systems
11/29/2023 5
Process of Converting Assembly Program to create ROM Image
step2- linking phase linker links no of codes with other assembled codes.
Linking produces the final binary file by linking all these. The linked file in a
computer is commonly known as .exe file.
11/29/2023 7
Process of Converting Assembly Program/ C program
to create ROM Image
11/29/2023 11
Locator- The tool that performs the conversion
from relocatable program to executable binary image
11/29/2023 12
• Loader: A program which loads the executable file to
the primary memory of the machine.
• It is a part of OS
• After reading .exe file loader places the code in memory.
This is necessary as memory addresses may not start from
0000H
• Loader finds appropriate start address and reallocates the
codes
• In computer after loader loads, section of program is
ready to run
11/29/2023 13
The loader does the following things:
• Copies the .text and .data sections from the executable into primary
memory.
• Initializes registers
11/29/2023 14
Memory layout for a process
11/29/2023 15
Difference in Linker and Loader
11/29/2023 16
Embedded System Software
11/29/2023 17
The software for the embedded system varies
depending on the functionality needed.
.
11/29/2023 18
Different program layers in the embedded software in C
11/29/2023 19
Hardware Abstraction Layer- a software abstraction layer
between the embedded system hardware and OS
11/29/2023 20
Application Layer
11/29/2023 21
Bootloader -similar to BIOS
• a program that runs before the OS kernel executes.
• It completes the initialization of the hardware
• enables the hardware and software environment to
reach an appropriate state for the final scheduling of
the system kernel.
• From the perspective of end users, the bootloader is
used to load the OS.
11/29/2023 22
BSP- Board support packages
• provides a standardized interface between hardware
and the operating system
• is used to start up and run the embedded target
processor
• does not directly access hardware.
• A BSP Contains hardware-specific drivers and other
routines that allow a particular operating system to
function in a particular hardware environment
11/29/2023 23
OS layer
• Scheduling, files synchronization,
and networking
• Example- Windows Embedded
Compact, embedded Linux,
VxWorks, MeeGo, Tizen, Android,
Ubuntu,
• outstanding real-time and reliable
features widely used in
communications, military,
aerospace, aviation
11/29/2023 24
Kernel- software collection in OS
• core component of an operating system.
• responsible for translating the command which computer
understands
• It handles the hardware, timing, peripherals, memory, disks, user
access
• Using interprocess communication and system calls, it acts as a
bridge between applications and the data processing performed at
the hardware level.
• When an operating system is loaded into memory, the kernel
loads first and remains in memory until the operating system is
shut down again.
11/29/2023 25
Functions of Kernel
• Memory allocation
• task scheduling
• inter-process communication
• effective management of shared memory
11/29/2023 26
System service layer
• a link between the OS and applications
11/29/2023 28
Application and Domain Specific
• Fixed functions- each embedded system is designed to
perform a set of defined functions
They cannot be used for any other purpose. It is the major
criterion which distinguishes an embedded system from a
general purpose computing system.
11/29/2023 29
Embedded Systems are Reactive
produce changes in output in response to the changes in the
input.
• constant interaction with the Real world through
sensors and user-defined input devices
11/29/2023 30
Real Time
• All embedded systems are not Real Time.
• Real Time System operation- the timing behaviour of the system
should be deterministic; the system should respond to requests or
tasks in a known amount of time.
• A Real Time system should not miss any deadlines for tasks or
operations.
• Embedded applications or systems which are mission critical, like
flight control systems, Antilock Brake Systems (ABS), etc. are
examples of Real Time systems.
11/29/2023 31
Operates in Harsh Environment
• Adverse operating conditions- It is not necessary that all
embedded systems should be deployed in controlled
environments.
• Embedded system should withstand in all operating conditions.
• The design should take care of the operating conditions of the
area where the system is going to implement.
• Power supply fluctuations, corrosion and component aging are
the other factors that need to be taken into consideration for
embedded systems to work in harsh environments.
11/29/2023 32
Distributed System- may be a part of larger systems
• Example- Automatic Teller Machine (ATM)
card reader- for reading and validating the user’s ATM card
transaction unit -for performing transactions
currency counter- for dispatching/vending currency to the
authorised person
printer unit- for printing the transaction details.
11/29/2023 33
Small Size and Weight
• Product aesthetics is an important factor in choosing a product
• the product aesthetics- (size, weight, shape, style, will be one
of the deciding factors to choose a product.
11/29/2023 34
Power Concerns
• Power management is important factor to be considered
• to minimise the heat dissipation by the system.
• The production of high amount of heat demands cooling
requirements like cooling fans which in turn occupies additional
space and make the system bulky.
• design according to the low power components, controllers
• processors with power saving modes.
• Also power management is a critical constraint in battery operated
application.
11/29/2023 35
Operational Quality Attributes
1. Response
2. Throughput
3. Reliability
4. Maintainability
5. Security
6. Safety
11/29/2023 36
Response
• how fast your system is tracking the changes in input variables.
• Most of the embedded systems demand fast response which
should be almost Real Time.
• It is not necessary that all embedded systems should be Real
Time in response.
• For example, the response time requirement for an electronic toy
is not at all time-critical .There is no specific deadline that this
system should respond within this particular timeline.
11/29/2023 37
Throughput
• Throughput deals with the efficiency of a system.
• rate of production or operation of a defined process over a
stated period of time.
• Example- For Card Reader, throughput means how many
transactions the Reader can perform in a minute or in an
hour or in a day.
11/29/2023 39
Maintainability
• deals with support and maintenance to the end user in case of technical
issues and product failures or on the basis of a routine system check-up.
• A more reliable system means a system with less corrective
maintainability requirements and vice versa.
• As the reliability of the system increases, the chances of failure and non-
functioning also reduces, thereby the need for maintainability is also
reduced.
Confidentiality
Availability –
Integrity- Some data may be visible to all users but there may
be no permissions to alter the data by the users.
Read Only access is allocated to all users
11/29/2023 41
Non-Operational Quality Attributes
1. Testability & Debug-ability
2. Evolvability
3. Portability
4. Time to prototype and market
5. Per unit and total cost.
11/29/2023 42
Testability & Debug-ability
• Testability- how easily one can test the designed system
(either hardware or firmware)
• Debug-ability - debugging the product, to figure out the
probable sources that create unexpected behaviour in the
total system.
Hardware debugging - the issues created by hardware
firmware debugging- figure out the probable errors in the
firmware.
11/29/2023 43
Evolvability
• Reconfigurable to take advantage of new firmware or
hardware technologies
• Scalable
11/29/2023 44
Portability - measure of ‘system independence’
11/29/2023 45
Time-to-Prototype and Market
• Time-to-market- conceptualisation of a product and the time at which
the product is ready for selling
• critical factor in the success of a commercial embedded product.
• multiple players in the embedded industry who develop products of
the same category
11/29/2023 47
Fundamental issues in Hardware Software Co-Design
In Traditional Co-design, both hardware and software are designed by
independent groups of experts. But in concurrent design, both hardware and
software are designed by same group of experts with cooperation.
Hardware
functional system level development
requirement- processing
product requirements Product
----
requirements transferred into Testing
captured from the functions for -----
customer simulation
Use of programming
models for software
development
11/29/2023 48
Fundamental Issues in Hardware Software Co-Design
11/29/2023 49
Fundamental Issues in Hardware Software Co-Design
11/29/2023 51
COMPUTATIONAL MODELS IN EMBEDDED DESIGN
commonly used computational models in embedded system design
11/29/2023 52
Data Flow Graph/Diagram (DFG) Model
• a data driven model in which
the program execution is
determined by data
• Programmer predetermines
the data inputs and designs
the programming steps to
generate the data output
11/29/2023 54
Control DFG
• DFG model that may have
statements to controls input
and outputs
• It may have loops or conditional
statements for various designs
in the process
• CDFG is a graphically represents
the conditions and the program
flow along condition dependent
path
Sequential Program model
• Use of multiple function calls sequentially
11/29/2023 57
Seat Belt Warning System
When the ignition is turned on and the seat beat is not fastened
within 10 seconds of ignition ON, the system generates an alarm
signal for 5 seconds
The Alarm is turned off when the alarm time expires after 5
seconds or if the driver fastens the belt or if the ignition switch is
turned off, whichever happens first.
11/29/2023 58
Seat Belt Warning System
11/29/2023 59
Seat Belt Warning System
11/29/2023 60
State Machine model
• used for modelling reactive or event-driven embedded
systems whose processing behavior are dependent on
state transitions.
• Embedded systems used in the control and industrial
applications
• This model describes the system behaviour with
‘States’, ‘Events’, ‘Actions’ and ‘Transitions’.
Seat Belt Warning System
11/29/2023 62
Finite state Machine Model
states
1. Alarm Off
2. Waiting
3. Alarm On
events
Finite-state processes (FSP) is an abstract language 1. ignition key ON
that’s used to develop concurrent systems of 2. ignition key OFF
processes with the modeling approach 3. Timer Expire
4. Alarm Time Expire
details of the threads of execution are not visible
to the consumer. Labelled Transition
5. Seat Belt ON
System(LTS)Tools
11/29/2023
used for software development. 63
concurrent or communicating process mode
• Sequential execution leads to a single sequential execution of task
• leads to poor processor utilization, when the task involves I/O
waiting, sleeping for specified duration etc
• split the task into multiple subtasks
• tackle the CPU usage effectively, when the subtask under execution
goes to a wait or sleep mode, by switching the task execution.
• requires additional overheads in task scheduling, task synchronisation
and communication.
• commonly used for the modeling of ‘Real Time’ systems, concurrently
executing tasks/processes
11/29/2023 64
concurrent processing model
1. an individual Process
2. a Concurrent Program (collection of processes executing
concurrently),
3. the interactions between a collection of processes
4. the dynamic behavior & properties of a process & concurrent
system
11/29/2023 65
Seat Belt Warning’ system in concurrent processing model
Develop a concurrent processing model for the Seat Belt Warning System
1. Timer task for waiting 10 seconds (wait timer task)
2. Task for checking the ignition key status (ignition key status
monitoring task)
3. Task for checking the seat belt status (seat belt status
monitoring task)
4. Task for starting and stopping the alarm (alarm control task)
5. Alarm timer task for waiting 5 seconds (alarm timer task)
11/29/2023 66
Seat Belt Warning’ system in concurrent processing model
Tasks for ‘Seat Belt Warning System
11/29/2023 67
Concurrent processing Program model for ‘Seat Belt Warning System’
11/29/2023 68
Advantages and Disadvantages of Concurrent model
• Adv- If the task is split into multiple subtasks, it is possible to
tackle the CPU usage effectively.
• Disadv-Concurrent processing model requires additional
overheads in task scheduling, task synchronization and
communication.
11/29/2023 69
Design an automatic tea/coffee vending machine based on
FSM model for the following requirement
11/29/2023 78