1 / 34

Embedded Real time systems – an Introduction

Embedded Real time systems – an Introduction. What’s a ”Real time system”? The concept of control . Embedded real time control – some examples Some terminology ”Scheduling” – determination of actions ”Execution time analysis” – a prerequisite for scheduling. Embedded systems.

rodericki
Télécharger la présentation

Embedded Real time systems – an Introduction

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Embedded Real time systems – an Introduction • What’s a ”Real time system”? The concept of control. • Embedded real time control – some examples • Some terminology • ”Scheduling” – determination of actions • ”Execution time analysis” – a prerequisite for scheduling Embedded Real time systems - an Introduction

  2. Embedded systems Wikipedia... ” An embedded system is a special-purpose computer system designed to perform one or a few dedicated functions, often with real-time computing constraints. It is usually embedded as part of a complete device including hardware and mechanical parts.” More distinct... ” An embedded system is a special-purpose digital system designed to perform dedicated functions with real-time computing constraints. The digital system hardware is embedded as part of a complete device which might include other hardware such as mechanical, pneumatic or hydraulical parts.” Embedded Real time systems - an Introduction

  3. Digital systems Server applications Embedded systems Personal computing Real-Time Control systems Secure/RobustR-T control Safety-critical R-T control Embedded Real time systems - an Introduction

  4. Swedish fighter JAS 39 GRIPEN In Control ? Embedded Real time systems - an Introduction

  5. but there is control ... In Control ? Embedded Real time systems - an Introduction

  6. In Control ? Control requires feedback A control system is a feedback system Time properties (temporal aspects) is fundamental for a well designed control system. A computer designed for control has to handle REAL-TIME as desired by the controlled object. Embedded Real time systems - an Introduction

  7. Real time control applications Embedded Real time systems - an Introduction

  8. steer ”by-wire” electronic information carrier hydraulic information carrier The “F-8 Digital Fly-By-Wire (DFBW)” validated fundamental concepts still used today. The first “by-wire” flight was in the 25’th of May in 1972. The project lasted for 13 years. Embedded Real time systems - an Introduction

  9. Computers in space… Embedded Real time systems - an Introduction

  10. ..and within marine applications. Embedded Real time systems - an Introduction

  11. ..development of Automotive electronics Embedded Real time systems - an Introduction

  12. control characteristics in a car • simple reactive (ON/OFF) … climate, windows … • reactive, autonomous … engine- and gear- control, anti-brake-lock, anti-spin, etc. • safety critical airbag ... • others.. navigation, audio-video ... Embedded Real time systems - an Introduction

  13. A real time clock, basic terminology ”Correct time” is an convention ”perfect clock” computer time ”computer clock” correct time Embedded Real time systems - an Introduction

  14. A real time clock, basic terminology Cs(t)>t computer time Ideal : C(t)=t Cs(t) Cs(t)<t t correct time Embedded Real time systems - an Introduction

  15. Definitions Correctness Deviation Monotoni Embedded Real time systems - an Introduction

  16. ct rt Δt rt1 rt0 Clock adjustment   Embedded Real time systems - an Introduction

  17. 1 oscillator 1 2 2 timer Mechanisms Embedded Real time systems - an Introduction

  18. interval t 0 IRQ IRQ IRQ Y = X / interval Timer interrupt Embedded Real time systems - an Introduction

  19. Real time clock timer interrupt ”TICK” ”TIMESLICE” ”TIMESLICE” ”Timer interrupt routine” – invoked approx each ms, requires low overhead ”TIMESLICE” – systemcheck, task switch, more overhead 100 000 ”TIMESLICE” – clock adjustment Embedded Real time systems - an Introduction

  20. init_timer start_timer stop_timer timer_interrupt SetRealTime SetTime GetTime SetTimeout SetPeriod ... ... Application task GetRealTime ”software” clock hardware clock Clock services Embedded Real time systems - an Introduction

  21. A control system rk Computations control laws r(t) A/D uk D/A yk A/D y(t) u(t) sensor object actuator Embedded Real time systems - an Introduction

  22. Time triggered implementations initiate • Pros Easy to understand, easy to implement. • Cons Time synchronization is tied to underlying hardware. Difficult to anticipate and handle unordered events. Software complexity depends on object . object input calculate output Embedded Real time systems - an Introduction

  23. Event triggered implementations • Pros Easy to understand. Short response times (good feedback performance) • Cons Exteremely complex software when object becomes complex. initiate object wait... activity.. Embedded Real time systems - an Introduction

  24. A software task task 1 task 2 task 3 sensor actuator sample input from sensor compute new values (control laws) update actuators actuator micro computer t Embedded Real time systems - an Introduction

  25. Scheduling strategies Non-preemptive (serial) task switch task 1 task 2 task 3 t Preemptive (parallel) task switch task 3 task 2 task 1 t Embedded Real time systems - an Introduction

  26. Task Execution time analysis Measurements, program under test is executed a number of times. A Worst Case Execution Time is estimated. Code analysis, determine the most time consuming path through the program and determine execution time for this path. Embedded Real time systems - an Introduction

  27. Execution time measure // Example t_start = C(t); P(); t_finish = C(t); t_exec = t_finish – t_start; Embedded Real time systems - an Introduction

  28. Execution time analysis, basic blocks start label: ..instr 1 ..instr 2 ..instr 3 ... ..instr n bra ... BB 1 BB2 BB3 stop Embedded Real time systems - an Introduction

  29. start BB 1 BB 2 start BB 3 ΣBB stop stop Execution time analysis, Control Flow Graphs A Control Flow Graph represents all possible execution paths in a program. Contributions from all basic blocks are summed. Embedded Real time systems - an Introduction

  30. Basic blocks, assignments int a,b; long int la,lb; a = b; la = lb; Each instruction takes 6 processor cycles (from Datasheet). So, for the block: 6+6+6=18 cycles Execution time: 18 * 1/fClock * MC68HCS12 BB: movw _b,_a movw _lb,_la movw 2+_lb,2+_la Embedded Real time systems - an Introduction

  31. Basic blocks, test evaluation BB= [min,max] At the end of the block the ackumulator D should hold 1 (if the expression is true) and 0 otherwise. (Compiler convention) Embedded Real time systems - an Introduction

  32. Combining basic blocks, if/else A program flow graph for: if( c == a ) b = 1; else b = d+e+f+g; test Code for ’test’ is always executed. Exactly one of statements ’S1’ or ’S2’ is always executed. S1 S2 Embedded Real time systems - an Introduction

  33. Combining basic blocks, if/else Inspect the code, identify and annotate the basic blocks: BB0: if( c == a ) BB1: b = 1; else BB2: b = d+e+f+g; From the program flow graph we conclude that: BB(min) = BB0(min) + min ( BB1(min) , BB2(min) ) and BB(max) = BB0(max) + max ( BB1(max) , BB2(max) ) Embedded Real time systems - an Introduction

  34. Summary we have got a brief introduction to • The concept of control. • Embedded real time control • Real Time Systems terminology • Task Scheduling • Execution time analysis Embedded Real time systems - an Introduction

More Related