1 / 19

Efficient Embedded Runtime Systems through Optimization of Port Communication

Efficient Embedded Runtime Systems through Optimization of Port Communication. Software Engineering Institute Carnegie Mellon University Pittsburgh, PA 15213 Peter H Feiler April 2, 2008. Outline. The problem Buffer lifespan model Buffer optimization considerations

bruno-munoz
Download Presentation

Efficient Embedded Runtime Systems through Optimization of Port Communication

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. Efficient Embedded Runtime Systems through Optimization of Port Communication Software Engineering Institute Carnegie Mellon University Pittsburgh, PA 15213 Peter H Feiler April 2, 2008

  2. Outline The problem Buffer lifespan model Buffer optimization considerations Property preserving transformation

  3. Shared Variable Communication Pr 1 20Hz Periodic I/O 20Hz Pr 2 To other Partitions Navigation Sensor Processing From other Partitions Shared data area Pr 3 10Hz Integrated Navigation 20Hz Pr 4 Guidance Processing Data flow determined by execution order of write & read 5Hz Pr 6 Flight Plan Processing 2Hz Pr 9 Aircraft Performance Calculation Preemption and concurrency affect read/write order

  4. Non-Deterministic Sampling of Data Stream Example: Downsampling • Desired sampling pattern 2X: n, n+2, n+4 (2,2,2,…) • Worst-case sampling pattern: n, n+1, n+4 (1,3,…) 20Hz 10Hz NavSensor Processing Integrated Navigation Thread IntegratedNavigation Read Write Thread NavSensorProcessing Timeline

  5. Port-based AADL Model 20Hz Periodic I/O 20Hz To Partitions Navigation Sensor Processing Nav signal data Nav sensor data From Partitions 10Hz Integrated Navigation 20Hz Guidance Processing Nav data Nav sensor data Guidance Input-compute-output AADL thread semantics 5Hz FP data Flight Plan Processing FP data Immediate and delayed data port connections for deterministic sampling 2Hz Aircraft Performance Calculation Performance data Nav data Fuel Flow

  6. Outline The problem Buffer lifespan model Buffer optimization considerations Property preserving transformation

  7. General Unqueued Port Buffer Model Consumer Producer Consumer/Producer MPj MCj MCk MPk Send Receive Send Receive Xfer Xfer MRj MSj MSk MRk • Send/receive with or without copy • Transfer with or without copy • Processing with or without copy MP: producer copy MS: send copy MR: receive copy MC: consumer copy

  8. Message Streaming Lifespan Model TP, Mi+1 DP, Mi+1 B E Producer task MPi MPi+1 SMi Send Send buffer MSi MSi+1 XMi Xfer MRi MRi+1 Receive buffer RMi Receive MCi MCi+1 Consumer task TC, Mi DC, Mi TX

  9. Message Lifespan Properties • Message operation ordering condition • SMi < XMi < RMi • MP bounded by producer dispatches • TP, Mi BMPi  EMPi = SMi  TP, Mi+1 • MC bounded by consumer dispatches • TC, Mi RMi = BMCi  EMCi  TC, Mi+1 • MS bounded by sends and transfer • SMi = BMSi  X*Mi EMSi < SMi+1 • MR bounded by transfers and receive • X**Mi  BMRi  EMRi = R***Mi < XMi+1 * Completion of transfer ** Start of transfer *** Latest of multiple receivers

  10. Outline The problem Buffer lifespan model Buffer optimization considerations Property preserving transformation

  11. Sequential Task Execution TP ;TC Collapse to single buffer MPi MPi+1 MS MS MR MR MCi MCi-1

  12. MPi MPi+1 MS MS MR MR MCi MCi-1 Overlapping Message Instances Overlapping message instance lifespan Send, transfer, or receive as copy operation Copy message between 2 buffersbefore BMPi+1 after EMCi-1

  13. Application-based Send and Receive (ASR) ASR TP P  SP DP TC C  RCDC MP P P S&X • : actual execution start time  : actual completion time MR C C R MC • ASR/IMT • P - P  C - C    non-deterministic S/R

  14. Buffer Optimization Considerations Periodic & aperiodic task dispatch • Send and receive execution • As part of application (ASR) • As part of task dispatch/completion (DSR) • Task execution order • Concurrent: C | P • Atomic non-deterministic: C ≠ P • Ordered: C ; P or P ; C • Message transfer • Immediate to consumer (IMT) • Direct to delayed consumer (DMT) • Period-delayed to consumer (PMT)

  15. Consumer Before Producer • C ; P consumer before producer: C,j P,j • Non-preemption: P,j - P,j  C,j - C,j =  • Deterministic S/R for ASR & DSR • ASR • Sj-1 < Tj < Rj < Sj < Tj+1 : Sj = SMi  Rj = RMi-1 • IMT: Sj-1 = Xj-1 < Tj < Rj < Sj = Xj • PMT: Sj-1 < Tj = Xj < Rj < Sj < Tj+1 = Xj+1 • DSR • Sj-1 = DP,j-1 < Tj = Rj < Sj < Tj+1 : Sj = SMi  Rj = RMi-1 • IMT: Sj-1 = DP,j-1 = Xj-1 < Tj = Rj < Sj = Xj • PMT: Sj-1 < Tj = Xj = Rj < Sj < Tj+1 = Xj+1 Period delayed communication Single buffer

  16. Periodic Task Communication Summary S, X, R: data copy S/X: IMT combined send/xfer S/X/R: DMT combined S, X, R X/R: DSR/PMT combined X, R o1o2: One operation copy MF: Mid-Frame PD: Period Delay ND: Non-Deterministic NDI: No Data Integrity 1B: Single buffer 2B: Two buffers 3B: Three buffers 4B: Four buffers

  17. Outline The problem Buffer lifespan model Buffer optimization considerations Property preserving transformation

  18. AADL Communication Semantics • Input frozen at dispatch time • Copy to input buffer at dispatch if required • Data ports & periodic threads • Immediate connection (DMT) • Data driven execution or offset start time • Delayed connection (DSR/PMT) • Transfer by dispatch in runtime system • Sampling ports • Double buffer for concurrency or down-sampling to ensure data consistency during compute

  19. Peter H Feiler phf@sei.cmu.edu

More Related