Introduction to embedded systems and realtime systems B. Ramamurthy CSE321 This course is partially...

21
Introduction to Introduction to embedded systems and embedded systems and realtime systems realtime systems B. Ramamurthy CSE321 This course is partially supported National Science Foundation NSF DUE Grant: 0737243 10/29/22 1

Transcript of Introduction to embedded systems and realtime systems B. Ramamurthy CSE321 This course is partially...

Page 1: Introduction to embedded systems and realtime systems B. Ramamurthy CSE321 This course is partially supported National Science Foundation NSF DUE Grant:

Introduction to embedded Introduction to embedded systems and realtime systems and realtime systemssystemsB. RamamurthyCSE321This course is partially supported National Science Foundation NSF DUE Grant: 0737243

04/18/23 1

Page 2: Introduction to embedded systems and realtime systems B. Ramamurthy CSE321 This course is partially supported National Science Foundation NSF DUE Grant:

Introduction to Realtime Introduction to Realtime Systems & Embedded Systems & Embedded SystemsSystemsB. RamamurthyCSE321This course is partially supported National Science Foundation NSF DUE Grant: 0737243

04/18/23 2

Page 3: Introduction to embedded systems and realtime systems B. Ramamurthy CSE321 This course is partially supported National Science Foundation NSF DUE Grant:

The course will enable you The course will enable you to:to:Understand and design embedded

systems and real-time systemsFor real-time systems:

◦Identify the unique characteristics of real-time systems

◦Explain the general structure of a real-time system

◦Define the unique design problems and challenges of real-time systems

◦Apply real-time systems design techniques to various software programs.

04/18/23 3

Page 4: Introduction to embedded systems and realtime systems B. Ramamurthy CSE321 This course is partially supported National Science Foundation NSF DUE Grant:

Course overviewCourse overview

For embedded systems it will enable you to :◦Understand the basics of an

embedded system◦Program an embedded system◦Design, implement and test an

embedded system.◦Ex: realtime + embedded : games on

a Gameboy or arcade games◦Ex: realtime: Spore on a laptop

04/18/23 4

Page 5: Introduction to embedded systems and realtime systems B. Ramamurthy CSE321 This course is partially supported National Science Foundation NSF DUE Grant:

Example real-time and embedded Example real-time and embedded systemssystems

Domain Application

Avionics Navigation; displays

Multimedia Games; simulators

Medicine Robot surgery; remote surgery; medical imaging

Industrial systems Robot assembly lines; automated inspection

Civilian Elevator control

Automotive system; Global positioning system (GPS)

04/18/23 5

Page 6: Introduction to embedded systems and realtime systems B. Ramamurthy CSE321 This course is partially supported National Science Foundation NSF DUE Grant:

Lets discuss some realtime Lets discuss some realtime system (RTS) characteristicssystem (RTS) characteristics

04/18/23 6

Page 7: Introduction to embedded systems and realtime systems B. Ramamurthy CSE321 This course is partially supported National Science Foundation NSF DUE Grant:

Realtime CharacteristicsRealtime CharacteristicsRTS have to respond to events in a

certain pre-detemined amount of time.◦The time constraints have to be considered

during planning, design, implementation and testing phases.

Internal failures due to software and hardware fault have be handled satisfactorily.◦You cannot simply pop-up a dialog error

box that says “send report” or “don’t send report”.

◦Also external failures due to outside sources need to be handled.

04/18/23 7

Page 8: Introduction to embedded systems and realtime systems B. Ramamurthy CSE321 This course is partially supported National Science Foundation NSF DUE Grant:

Realtime Characteristics Realtime Characteristics (contd.)(contd.)Typical interaction in an RTS is

asynchronous. Thus an RTS should have features to handle asynchronous events such as interrupt handlers and dispatcher and associated resources.

Potential for race condition: when state of resources are timing dependent race condition may occur.

Periodic tasks are common.

04/18/23 8

Page 9: Introduction to embedded systems and realtime systems B. Ramamurthy CSE321 This course is partially supported National Science Foundation NSF DUE Grant:

Embedded SystemEmbedded SystemIs a special purpose system designed to

perform a few dedicated functions.Small foot prints (in memory)Highly optimized codeCell phones, mp3 players are examples.The components in an mp3 player are

highly optimized for storage operations. (For example, no need to have a floating point operation on an mp3 player!)

04/18/23 9

Page 10: Introduction to embedded systems and realtime systems B. Ramamurthy CSE321 This course is partially supported National Science Foundation NSF DUE Grant:

Real-time system Real-time system conceptsconceptsA system is a mapping of a set of input into a

set of outputs.A digital camera is an example of a realtime

system: set of input including sensors and imaging devices producing control signals and display information.

Realtime system can be viewed as a sequence of job to be scheduled.

Time between presentation of a set of inputs to a system and the realization of the required behavior, including availability of all associated outputs, is called the response time of the system.

04/18/23 10

Page 11: Introduction to embedded systems and realtime systems B. Ramamurthy CSE321 This course is partially supported National Science Foundation NSF DUE Grant:

Real-time system concepts Real-time system concepts (contd.)(contd.)

Real-time system is the one in which logical correctness is based on both the correctness of the output as well as their timeliness.

A soft real-time system is one in which performance is degraded by failure to meet response-time constraints.

A hard real-time system is one in which failure to meet a single deadline may lead to complete and catastrophic failure.

More examples:◦ Automatic teller: soft◦ Robot vacuum cleaner: firm◦ Missile delivery system: hard

04/18/23 11

Page 12: Introduction to embedded systems and realtime systems B. Ramamurthy CSE321 This course is partially supported National Science Foundation NSF DUE Grant:

Regular Computer SystemRegular Computer System

04/18/23 12

“From Minimalist”: STIR-FRIED CHICKEN WITH CREAMED CORN Time: 20 minutes

1 pound boneless chicken (breasts or thighs), in 1/2-inch chunks 2 tablespoons soy sauce 1 teaspoon sesame oil 1 tablespoon sherry, rice wine, sake or white wine 2 tablespoons peanut oil or another neutral oil, like corn or grape seed 1 tablespoon minced garlic 1 tablespoon minced ginger 1 small chili, seeds and stems removed, minced (or dried red chili flakes to taste) 1 15-ounce can creamed corn 1 cup corn kernels (fresh, frozen or canned) Chopped cilantro leaves for garnish.

1. In a small bowl, mix the chicken with the soy sauce, the sesame oil and the wine. Put the peanut oil into a deep skillet or wok, preferably nonstick, and turn heat to high. Drain chicken. When oil is hot, add chicken to skillet, and cook, undisturbed, until bottom browns, about 2 minutes. Stir once or twice, and cook 2 minutes longer. Turn the heat down to medium-low. 2. Add the garlic, the ginger and the chili to the skillet, and stir; 15 seconds later, add the creamed corn and the corn kernels. Cook, stirring occasionally, until heated through, 3 or 4 minutes. Garnish, and serve over white rice.

Data

Algorithm

Program

Hardware

Page 13: Introduction to embedded systems and realtime systems B. Ramamurthy CSE321 This course is partially supported National Science Foundation NSF DUE Grant:

Embedded SystemsEmbedded Systems

04/18/23 13

Page 14: Introduction to embedded systems and realtime systems B. Ramamurthy CSE321 This course is partially supported National Science Foundation NSF DUE Grant:

The Number Game (1)The Number Game (1)

04/18/23 14

1 3 5 7

9 11 13 15

17 19 21 23

25 27 29 31

Page 15: Introduction to embedded systems and realtime systems B. Ramamurthy CSE321 This course is partially supported National Science Foundation NSF DUE Grant:

The Number Game (2)The Number Game (2)

04/18/23 15

2 3 6 7

10 11 14 15

18 19 22 23

26 27 30 31

Page 16: Introduction to embedded systems and realtime systems B. Ramamurthy CSE321 This course is partially supported National Science Foundation NSF DUE Grant:

The Number Game (4)The Number Game (4)

04/18/23 16

4 5 6 7

12 13 14 15

20 21 22 23

28 29 30 31

Page 17: Introduction to embedded systems and realtime systems B. Ramamurthy CSE321 This course is partially supported National Science Foundation NSF DUE Grant:

The Number Game (8)The Number Game (8)

04/18/23 17

8 9 10 11

12 13 14 15

24 25 26 27

28 29 30 31

Page 18: Introduction to embedded systems and realtime systems B. Ramamurthy CSE321 This course is partially supported National Science Foundation NSF DUE Grant:

The Number Game (16)The Number Game (16)

04/18/23 18

16 17 18 19

20 21 22 23

24 25 26 27

28 29 30 31

Page 19: Introduction to embedded systems and realtime systems B. Ramamurthy CSE321 This course is partially supported National Science Foundation NSF DUE Grant:

Analysis Analysis What is theory /concept behind this game?How did I arrive at the number you guessed?How can I automate this process?What is the data and what is the algorithm?How can we convey these to a computing machine?While a computer talks binary, we humans write

programs in languages such as Java, C#, C++, Basic etc.

Binary numbers (1’s and 0’s) is the number system used by the computer systems.

We humans use decimal number system that has 10 distinct symbols (0,1,2,3,4,5,6,7,8,9)

Your task: Write a C program to computerize this game.

04/18/23 19

Page 20: Introduction to embedded systems and realtime systems B. Ramamurthy CSE321 This course is partially supported National Science Foundation NSF DUE Grant:

04/18/23 20

1 3 5 7

9 11 13 15

17 19 21 23

25 27 29 31

2 3 6 7

10 11 14 15

18 19 22 23

26 27 30 31

16 17 18 19

20 21 22 23

24 25 26 27

28 29 30 31

4 5 6 7

12 13 14 15

20 21 22 23

28 29 30 31

8 9 10 11

12 13 14 15

24 25 26 27

28 29 30 31

Page 21: Introduction to embedded systems and realtime systems B. Ramamurthy CSE321 This course is partially supported National Science Foundation NSF DUE Grant:

SummarySummaryWe examined the course

objectives for embedded and realtime systems

We looked at sample systemsHomework:

◦Write a program that automates the number game

◦Logo for NEXOS

04/18/23 21