1 / 11

Advanced Embedded Systems Design

Advanced Embedded Systems Design. Lecture 7 Rate Monotonic Analysis, Hybrid scheduling BAE 5030 - 003 Fall 2004 Instructor: Marvin Stone Biosystems and Agricultural Engineering Oklahoma State University. Goals for Class Today. Questions over reading (Chapter 17, Hybrid Scheduler)

bruno
Download Presentation

Advanced Embedded Systems Design

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. Advanced Embedded Systems Design Lecture 7 Rate Monotonic Analysis, Hybrid scheduling BAE 5030 - 003 Fall 2004 Instructor: Marvin Stone Biosystems and Agricultural Engineering Oklahoma State University

  2. Goals for Class Today • Questions over reading (Chapter 17, Hybrid Scheduler) • Rate Monotonic Analysis (Aswin Ramachandran) • Hybrid Scheduler • Set assignment

  3. Hybrid Scheduler - Pont • Objective • Provide centralized scheduling/dispatching • Provide a time triggered task scheduling function • Provide for a support for a single pre-emptive task • Determinancy • User may assure the configuration is determinant • Simple inter-task communications • Limitations • A priori static task scheduling by user • Single preemptive task with effect determined by user • Latency set by scheduler tick

  4. Hybrid Scheduler – State structure

  5. Hybrid Scheduler - Task data structure

  6. Homework program

  7. Timing issues • How often could the serial ISR be called? • Select a baud rate – 9600 baud • Character rate for back to back chars ~ 960 char/sec • ~1 ms per char • Serial ISR might be called at ~1ms period at max char rate • What time triggered period for line parser? • Set min line length – 3 char • Max line rate = 1/(4 chars * 1ms) = 250 chars/s • Period should be at least 4 ms • Can Line Parser execute along with Serial ISR and not miss characters? • 4*ISR time + Line Parser time for 4 chars including printing

  8. Ring Buffer - methods • Need • Initialize buffer • Read from • Write to • Issues • Must distinguish: • Empty • Full

  9. Ring Buffer Implementation (Untested) • Serial ISR char RXbuf[RXBUFSIZ]; // head is the index of the front element in the buffer int RXhead, RXtail; // tail is the index of the array element at which the next // element will be inserted void serial_ISR(void) interrupt SERIAL_INTERRUPT using 1 { if (RXhead != RXtail) // Check for buffer empty { if (++RXtail >= RXBUFSIZ) RXtail = 0; // Increment tail pointer, fix end of ring condition if (RXhead != RXtail) // Ring buffer filled { RXbuf[RXtail] = SBUF; // read UART char into ring buffer } else { RXtail--; // don't accept more characters // Set and error flag to allow this error to be found } } // clear serial interrupt ? }

  10. Ring Buffer Implementation (Untested) • Read Ring buffer char Get_from_Ring_buf( void ) // Read characters from the ring buffer { char temp_char; if (RXhead != RXtail) //Check for buffer empty { temp_char = RXbuf[RXhead]; // Get a character from the ring if (--RXhead <= 0) RXhead = RXBUFSIZ; // Decrement the head, fix the end of ring condition return(temp_char); } else return(0); // Buffer empty, this return condition is the same as a null character! }

  11. Assignment • Complete last weeks homework • Read Pont, Chapter 18 • Tutorial – 30 min • Review State machine shortcuts by Michael Kreiman , Embedded Systems Journal

More Related