Download presentation
Presentation is loading. Please wait.
Published byImogen Fleming Modified over 9 years ago
1
© 2006 Carnegie Mellon University 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
2 Port Communication Optimization Feiler, April 2008 © 2008 Carnegie Mellon University Outline The problem Buffer lifespan model Buffer optimization considerations Property preserving transformation
3
3 Port Communication Optimization Feiler, April 2008 © 2008 Carnegie Mellon University Shared Variable Communication Navigation Sensor Processing Integrated Navigation Guidance Processing Flight Plan Processing Aircraft Performance Calculation 20Hz 10Hz 20Hz 5Hz 2Hz From other Partitions Periodic I/O 20Hz To other Partitions Shared data area Pr 1 Pr 2 Pr 3 Pr 4 Pr 6 Pr 9 Data flow determined by execution order of write & read Preemption and concurrency affect read/write order
4
4 Port Communication Optimization Feiler, April 2008 © 2008 Carnegie Mellon University 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,…) Timeline Thread NavSensorProcessing Thread IntegratedNavigation NavSensor Processing Integrated Navigation 20Hz 10Hz Write Read
5
5 Port Communication Optimization Feiler, April 2008 © 2008 Carnegie Mellon University Port-based AADL Model Navigation Sensor Processing Integrated Navigation Guidance Processing Flight Plan Processing Aircraft Performance Calculation 20Hz 10Hz 20Hz 5Hz 2Hz From Partitions To Partitions Fuel Flow Guidance Nav sensor data Nav signal data FP data Performance data Nav data Nav sensor data Nav data FP data Periodic I/O 20Hz Immediate and delayed data port connections for deterministic sampling Input-compute-output AADL thread semantics
6
6 Port Communication Optimization Feiler, April 2008 © 2008 Carnegie Mellon University Outline The problem Buffer lifespan model Buffer optimization considerations Property preserving transformation
7
7 Port Communication Optimization Feiler, April 2008 © 2008 Carnegie Mellon University General Unqueued Port Buffer Model MS j MP j Producer Send MR j Xfer MP k Consumer/Producer MC j Receive MS k Send Consumer MC k MR k Xfer Receive MP: producer copy MS: send copy MR: receive copy MC: consumer copy Send/receive with or without copy Transfer with or without copy Processing with or without copy
8
8 Port Communication Optimization Feiler, April 2008 © 2008 Carnegie Mellon University Message Streaming Lifespan Model MS i MP i Producer task Send MR i Xfer MP i+1 Send buffer MC i Receive MS i+1 Consumer task MC i+1 MR i+1 Receive buffer T P, M i+1 D P, M i+1 T C, M i D C, M i S Mi R Mi X Mi BE TXTX
9
9 Port Communication Optimization Feiler, April 2008 © 2008 Carnegie Mellon University Message Lifespan Properties Message operation ordering condition S M i < X M i < R M i MP bounded by producer dispatches T P, M i B MP i E MP i = S M i T P, M i+1 MC bounded by consumer dispatches T C, M i R M i = B MC i E MC i T C, M i+1 MS bounded by sends and transfer S M i = B MS i X * M i E MS i < S M i+1 MR bounded by transfers and receive X ** M i B MR i E MR i = R *** M i < X M i+1 * Completion of transfer ** Start of transfer *** Latest of multiple receivers
10
10 Port Communication Optimization Feiler, April 2008 © 2008 Carnegie Mellon University Outline The problem Buffer lifespan model Buffer optimization considerations Property preserving transformation
11
11 Port Communication Optimization Feiler, April 2008 © 2008 Carnegie Mellon University Sequential Task Execution T P ; T C Collapse to single buffer MS MP i MR MC i MP i+1 MS MR MC i-1
12
12 Port Communication Optimization Feiler, April 2008 © 2008 Carnegie Mellon University Overlapping Message Instances Overlapping message instance lifespan Send, transfer, or receive as copy operation Copy message between 2 buffers before B MP i+1 after E MC i-1 MS MP i MR MC i MP i+1 MS MR MC i-1
13
13 Port Communication Optimization Feiler, April 2008 © 2008 Carnegie Mellon University Application-based Send and Receive (ASR) MP MR MC PP PP CC CC S&X R ASR/IMT P - P C - C non-deterministic S/R T P P S P D P T C C R C D C : actual execution start time : actual completion time ASR
14
14 Port Communication Optimization Feiler, April 2008 © 2008 Carnegie Mellon University Buffer Optimization Considerations 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 Periodic & aperiodic task dispatch Message transfer Immediate to consumer (IMT) Direct to delayed consumer (DMT) Period-delayed to consumer (PMT)
15
15 Port Communication Optimization Feiler, April 2008 © 2008 Carnegie Mellon University 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 S j-1 < T j < R j < S j < T j+1 : S j = S M i R j = R M i-1 IMT: S j-1 = X j-1 < T j < R j < S j = X j PMT: S j-1 < T j = X j < R j < S j < T j+1 = X j+1 DSR S j-1 = D P,j-1 < T j = R j < S j < T j+1 : S j = S M i R j = R M i-1 IMT: S j-1 = D P,j-1 = X j-1 < T j = R j < S j = X j PMT: S j-1 < T j = X j = R j < S j < T j+1 = X j+1 Period delayed communication Single buffer
16
16 Port Communication Optimization Feiler, April 2008 © 2008 Carnegie Mellon University Periodic Task Communication Summary Periodic Same period ASR IMT | PMT DSR IMT | PMT DMT P ; C MF:1BPD:2B S X R PD:2B R PD:2B S X/R MF:1B C ; P PD:1B P CP C ND:1BPD:2B X PD:2B R PD:2B X/R ND:1B P | C ND:3B S/X C R C PD:2B X PD:2B R PD:2B X/R NDI:2B S/X/R C 1B: Single buffer 2B: Two buffers 3B: Three buffers 4B: Four buffers 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
17
17 Port Communication Optimization Feiler, April 2008 © 2008 Carnegie Mellon University Outline The problem Buffer lifespan model Buffer optimization considerations Property preserving transformation
18
18 Port Communication Optimization Feiler, April 2008 © 2008 Carnegie Mellon University 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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.