1 / 16

Engineering Open House

Engineering Open House. Need students to demo their players on Friday 3-4 Saturday 10-2. Embedded Software Architectures. No Operating System Round robin: sequential polling for events Round robin w/ interrupts Function Queue Scheduling Real Time Operating System.

jill
Download Presentation

Engineering Open House

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. Engineering Open House • Need students to demo their players on • Friday 3-4 • Saturday 10-2.

  2. Embedded Software Architectures • No Operating System • Round robin: sequential polling for events • Round robin w/ interrupts • Function Queue Scheduling • Real Time Operating System

  3. What are the time critical functions?Flipping channels, change tones at end of timeslice What are the housekeeping functions? TNE count down and stream processing (TNE, Tones) Do these have hard time constraints too? Yes, one time slice (18ms)…good enough? Not necessarily…serial is undefined! Maestro in RR+INT volatile bit fEndOfSlice, fSerial; void isr(void) interrupt … { process_tones(); if (!--sliceCount) { changeTones(); sliceCount = SliceSize fEndOfSlice = TRUE; } } void serial(void) interrupt …{ timeCritical(); fSerial = TRUE; } main () { if (fSerial) {process_serial_data(); fSerial = FALSE;} if (fEndOfSlice) { if (--TNE==0) process_next_event(); fEndOfSlice = FALSE; } }

  4. Task Diagram Worst case analysis: character comes one cycle before TF0 Worst case latency: Sum of max of all task functions. Advantage over RR: Critical Stuff happens in ISR time slice start time slice end serial_isr isr serial housekeeping main deadline timer0 overflow occurs (TF0) char arrives Can we do better?

  5. What isthe advantage of this? Programmer can set priority for task functions. Worst case latency for priority n task function? Sum of max execution time for all task functions of priority > n + max current task With only two tasks, it is the same as RR+INT. And it does not allow any non-deterministic tasks. Function Queue void isr(void) interrupt … { process_tones(); if (!--sliceCount) { changeTones(); sliceCount = SliceSize; enq(process_time_slice); } } void serial(void) interrupt …{ timeCritical(); enq(process_serial_data); } void main(void) { while (1) if (f = deq()) { *f()); } You get a scheduling opportunity every time a task completes.

  6. Task Diagram Worst case analysis: Its actually different…serial has to get started Worst case latency: Sum of max of all task functionsAdvantage: Can support priorities, but still at mercy of slowest task. time slice start time slice end serial_isr isr serial housekeeping main not worst case deadline timer0 overflow occurs (TF0) char arrives Can we do better?

  7. Comparison Non OS Architectures • See Chapter 5, table 5.1 Simon

  8. Real Time Operating Systems • What is the basic thing we want the OS to do to help us improve worst case latency? Enable multithreading • How? Define an OS time-slice (tick) at which highest priority ‘runnable’ task is continued. Priority function determines response behavior. • Simplest Scheduling algorithm: each task gets at most 1 tick at a time to run. Round Robin Scheduling. Worst case task latency = #tasks*tick. Worst case run time = ticks/task * #tasks • Some properties of such system: liveness, safety, fairness, latency, overhead. • Other niceties: Device Drivers, Synchronization, Data Sharing (messages, queues, etc.), Memory Management

  9. Programmers View • Advantages: • Deterministic response time even w/ non deterministic tasks lengths. • Incremental development • Resources: • Task switching overhead • Memory overhead • Use of system timer • Degrades best case response time. void tone_isr(void) interrupt … { process_tones(); if (!--sliceCount) { changeTones(); sliceCount = SliceSize isr_send_signal(MUSIC); } } void serial_isr(void) interrupt …{ timeCritical(); os_send_signal(SERIAL); } void play(void) _task_ MUSIC { os_create(SERIAL); while (1) {os_wait(); process_next_event();} } void serial(void) _task_ SERIAL { while (1) {os_wait(); process_serial_data();} // os_create(MUSIC)? } Tasks are threads

  10. Task Diagram os time slice os time slice os time slice os time slice music time slice start music time slice end serial_isr music_isr serial music OS Music task is never more than one OS time slice away Char arrives

  11. Another Solution • Multiprocessor: Dedicate one processor to each (or a few) tasks. • Still need synchronization and communication. • Our Orchestra network could be an example of a multiprocessor system

  12. Design Meeting • What’s next? • Streaming

  13. Orchestra Functions • Time of day • Get data from net, send to player or to pilot • Send music to net • Get music from net • Play music • Task to play music from net • Task to create/delete other tasks (master)

  14. Basic Architecture of an RT OS • Task Table • Process state, signal flag, time_out counter, context • System Interrupt Service Routine (timer) • System Calls (Code, time)

  15. Benefits

  16. Embedded Software • Software States v. Finite State Machines • Hierarchical State • Thread/Process Communication • Critical Sections • Synchronization • Messaging and Signaling

More Related