0% found this document useful (0 votes)
20 views77 pages

Unit 2

Uploaded by

jiya.ml21
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views77 pages

Unit 2

Uploaded by

jiya.ml21
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 77

MODULE 2 7Hrs

Embedded System Design Concepts: Characteristics and Quality


Attributes of Embedded Systems, Operational and non-operational
quality attributes, Embedded Systems-Application and Domain
specific, Fundamental issues in Hardware Software Co-Design,
Computational models in embedded design- Source file to object file
translation file systems

29-11-2023 1
Source file to object file translation

29-11-2023 2
Embedded software in a system
• Application specific software

• In the final stage, it is placed in the memory (ROM)

• The final stage software is also called ROM image. Why?

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

library - a collection of precompiled routines that a program can used


6
11/29/2023
Step1- assembling assembler translates assembly software into machine
codes.

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.

step3- reallocation of codes is done by placing it in physical memory by a


program called loader.
Loader finds out appropriate position in RAM that is ready to run.

Step4- locating phase ROM image is permanently placed in actually available


address of ROM.

11/29/2023 7
Process of Converting Assembly Program/ C program
to create ROM Image

library - a collection of precompiled routines that a program can used


8
11/29/2023
11/29/2023 9
11/29/2023 10
Linking
All of the object must be
linked together to produce a
single object file, called
the relocatable program.

The job of the linker is to


combine these object files
and to resolve all of the
unresolved symbols

11/29/2023 11
Locator- The tool that performs the conversion
from relocatable program to executable binary image

It then produces an output file that contains a binary


memory image that can be loaded into the target.

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:

• Allocates primary memory for the program's execution.

• Copies address space from secondary to primary memory.

• Copies the .text and .data sections from the executable into primary
memory.

• Copies program arguments (e.g., command line arguments) onto the


stack.

• Initializes registers

11/29/2023 14
Memory layout for a process

Local variables are allocated

Block Started by Symbol

Statically allocated and global data

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.
.

The RTOS can help the


programmer separate the
application’s functionality
into distinct tasks for better
organization of the
application software and a
more responsive system.

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

• located at the top level of the software hierarchy


• provides services directly to user application

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

• applications can access various


services provided by the OS.

• A GUI library for various GUI


programming interfaces, to interact
with users through application
windows, menus, dialog boxes, and
other graphic forms instead of a
command line.
11/29/2023 27
Important characteristics of an embedded system

1. Application and domain specific


2. Reactive and Real Time
3. Operates in harsh environments
4. Distributed
5. Small size and weight
6. Power concern

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.

• Specific design and Purpose- cannot replace the


embedded unit of one system from another, designed to
perform certain specific tasks.

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

• Controlling output variables to the desired level.

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.

• Throughput is generally measured in terms of ‘Benchmark’.


‘Benchmark’ is a reference point by which something can be
measured.
11/29/2023 38
Reliability
• % proper functioning of the system
• Mean Time Between Failures ( MTBF) and
Mean Time To Repair ( MTTR) are the terms
used in defining system reliability.
• For an embedded system with critical
application need, it should not be out of the
order

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.

Maintainability can be broadly classified as


1. Scheduled or Periodic Maintenance (preventive maintenance)
2. Maintenance to unexpected failures (corrective maintenance)
11/29/2023 40
Security
protection of data and application from unauthorised disclosure

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’

• if the product is capable of functioning in various environments


• The ease with which an embedded product can be ported on
to a new platform

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

• Prototyping is an informal kind of rapid product development in


which the important features of the product under consideration are
developed.
• If the prototype is developed faster, the actual estimated
development time can be brought down significantly.
11/29/2023 46
Per Unit Cost and Revenue Cost
• Proper market study and cost benefit analysis

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

• Selecting the programming model- It is hard to choose which


model should be followed in particular design. Most often, designers
switch between a varieties of model from requirement specification, as
objective varies with each phase
• Selecting the architecture-The architecture specifies how a system is
going to implement in terms of number of types of different
components and the interconnection between them.
• Common classification of architecture - ) Application Specific
Architecture Class (Controller Architecture) OR General purpose class
(CISC, RISC)

11/29/2023 49
Fundamental Issues in Hardware Software Co-Design

• The Data path Architecture- implements the data flow graph


model where the output is generated as a result of a set of
predefined computations on the input data. Data path may
contain registers, counters, register files, memories and ports
along with high speed arithmetic unit.
• The Finite State Machine architecture- combines the controller
architecture with data path architecture. The controller generates the
control inputs whereas the data path process the data. The data path
has two type of I/O ports, one acts as a control port for receiving/
sending the control inputs and second one interfaces the data path with
external world for data input and output.
11/29/2023 50
Fundamental Issues in Hardware Software Co-Design

Selecting the programming language –


• multiple programming languages like C, C++, C#, Java
etc. for software implementation
• languages like VHDL, System C, Verilog etc. for hardware
implementations.
• C++ is a good candidate for capturing an object oriented
model.

11/29/2023 51
COMPUTATIONAL MODELS IN EMBEDDED DESIGN
commonly used computational models in embedded system design

• Data Flow Graph (DFG) model


• Sequential Program model
• Concurrent Process model
• State Machine model
• Object Oriented model

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

• Example- DSP applications


11/29/2023 53
cyclic DFG Acyclic DFG (ADFG)
DFG Output is fed It may not have closed
back to Input path
Acyclic Cyclic
DFG DFG
• Helps in a simple code design.
• no control conditions and thus a single
path for the program flow.
• DFG model program translates and
executes as a single process sequential
model program

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

Develop a Sequential model for the 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

Develop a FSM model for the 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

We have five tasks here

we cannot execute them randomly


or sequentially.

We need to synchronize their


execution through some
mechanism.

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

The tea/coffee vending is initiated by user


inserting a 5 rupee coin. After inserting the
coin, the user can either select ‘Coffee’ or
‘Tea’ or press ‘Cancel’ to cancel the order
and take back the coin
Design a coin operated public telephone unit based on FSM
model for the following requirements.
1. The calling process is initiated by lifting the receiver (off-hook) of the telephone
unit
2. After lifting the phone the user needs to insert a 1 rupee coin to make the call.
3. If the line is busy, the coin is returned on placing the receiver back on the hook
(on-hook)
4. If the line is through, the user is allowed to talk till 60 seconds and at the end of
45th second, prompt for inserting another 1 rupee coin for continuing the call is
initiated
5. If the user doesn’t insert another 1 rupee coin, the call is terminated on
completing the 60 seconds time slot.
6. The system is ready to accept new call request when the receiver is placed back
on the hook (on-hook)
7. The system goes to the ‘Out of Order’ state when there is a line fault
11/29/2023 75
11/29/2023 76
11/29/2023 77
Unit 2 Complete

11/29/2023 78

You might also like