modeling heterogeneous systems
play

Modeling Heterogeneous Systems - Design f or Understanding - Design - PowerPoint PPT Presentation

Modeling Heterogeneous Systems - Design f or Understanding - Design f or Saf ety Workshop Edward Lee NASA Ames Research Center UC Berkeley Mountain View, CA 11 October, 2000 Components and Composition vehicle controller model vehicle


  1. Modeling Heterogeneous Systems - Design f or Understanding - Design f or Saf ety Workshop Edward Lee NASA Ames Research Center UC Berkeley Mountain View, CA 11 October, 2000

  2. Components and Composition vehicle controller model vehicle actuator sensor dynamics Br Acc modes Ba S Edward A. Lee, UC Berkeley

  3. Common Approaches � Threads or processes – Sun says in t he on-line J ava t ut orial: “The f ir st r ule of using t hr eads is t his: avoid t hem if you can. Threads can be dif f icult t o use, and t hey t end t o make pr ogr ams har der t o debug.” � Semaphores, monit ors, mut ex – Deadlock, livelock, liveness – hard t o underst and � Priorit ies, deadlines – Plug and pray Edward A. Lee, UC Berkeley

  4. Understanding Component I nteractions - Frameworks � What is a component (ont ology)? – St at es? Pr ocesses? Thr eads? Dif f er ent ial equat ions? Const r aint s? Obj ect s (dat a + met hods)? � What knowledge do component s share (epist emology)? – Time? Name spaces? Signals? St at e? � How do component s communicat e (prot ocols)? – Rendezvous? Message passing? Cont inuous-t ime signals? St r eams? Met hod calls? � What do component s communicat e (lexicon)? – Obj ect s? Tr ansf er of cont r ol? Dat a st r uct ur es? ASCI I t ext ? Edward A. Lee, UC Berkeley

  5. A Laboratory f or Exploring Component Frameworks Pt olemy I I – – J ava based, net wor k int egr at ed – Sever al f r amewor ks implement ed A realizat ion of a f ramework is – called a “domain.” Mult iple domains can be mixed hier ar chically in t he same model. ht t p:/ / pt olemy.eecs.ber keley.edu Edward A. Lee, UC Berkeley

  6. One Class of Component I nteraction Semantics: Producer / Consumer Are act ors act ive? passive? react ive? Flow of cont rol is mediat ed by a direct or. act ion { act ion { … … channel wr it e(); read(); port port … … } } receiver Are communicat ions t imed? synchronized? buf f ered? Communicat ions are mediat ed by receivers . Edward A. Lee, UC Berkeley

  7. Domain – A Realization of a Component Framework � CSP – concur r ent t hr eads wit h r endezvous � CT – cont inuous-t ime modeling � DE – discr et e-event syst ems Each is r ealized � DT – discr et e t ime (cycle dr iven) as a direct or and � P N – process net works a r eceiver class � P N’ – Pet ri net s in Pt olemy I I � SDF – synchr onous dat af low � SR – synchr onous/ r eact ive � PS – publish-and-subscr ibe Each of t hese def ines a component ont ology and an int er act ion semant ics bet ween component s. Ther e ar e many mor e possibilit ies! Edward A. Lee, UC Berkeley

  8. 1. Continuous Time (Coupled ODEs) Semant ics: – act ors def ine relat ions Examples: bet ween f unct ions of • Spice, t ime (ODEs or algebraic • HP ADS, equat ions) • Simulink, • Saber, • Mat rix X, – a behavior is a set of • … signals sat isf ying t hese relat ions Edward A. Lee, UC Berkeley

  9. 1. Continuous Time in Ptolemy I I The cont inuous t ime (CT) domain in Pt olemy I I models component s int eract ing by cont inuous-t ime signals. A variable- st ep size, Runge- Kut t a ODE solver is used, augment ed wit h discret e-event management (via modeling of Dirac delt a f unct ions). Edward A. Lee, UC Berkeley

  10. 1. CT: Strengths and Weaknesses St rengt hs: – Accur at e model f or many physical syst ems – Det er minat e under simple condit ions – Est ablished and mat ur e (appr oximat e) simulat ion t echniques Weaknesses: – Cover s a nar r ow applicat ion domain – Tight ly bound t o an implement at ion – Relat ively expensive t o simulat e – Dif f icult t o implement in sof t war e Edward A. Lee, UC Berkeley

  11. 2. Discrete Time z -1 z -1 z -1 z -1 Semant ics: – blocks are relat ions bet ween f unct ions of discret e t ime (dif f erence equat ions) Examples: • Syst em C – a behavior is a set of • HP Pt olemy, signals sat isf ying t hese • Syst emView, relat ions • ... Edward A. Lee, UC Berkeley

  12. 2. DT: Strengths and Weaknesses St rengt hs: – Usef ul model f or embedded DSP – Det er minat e under simple condit ions – Easy simulat ion (cycle-based) – Easy implement at ion (circuit s or sof t ware) Weaknesses: – Cover s a nar r ow applicat ion domain – Global synchrony may over specif y some syst ems Edward A. Lee, UC Berkeley

  13. 3. Discrete Events Examples: Semant ics: • SES Workbench, – Event s occur at discret e • Bones, point s on a t ime line t hat • VHDL is of t en a cont inuum. The • Verilog component s react t o • ... event s in chronological order. event s t ime Edward A. Lee, UC Berkeley

  14. 3. Discrete- Events in Ptolemy I I The discret e-event (DE) domain in Pt olemy I I models component s int eract ing by discret e event s placed in t ime. A calendar queue scheduler is used f or ef f icient event management , and simult aneous event s are handled syst emat ically and det erminist ically. Edward A. Lee, UC Berkeley

  15. 3. DE: Strengths and Weaknesses St rengt hs: – Nat ural f or asynchronous digit al hardware – Global synchronizat ion – Det erminat e under simple condit ions – Simulat able under simple condit ions Weaknesses: – Expensive t o implement in sof t ware – May over-specif y and/ or over-model syst ems Edward A. Lee, UC Berkeley

  16. Mixing Domains Example: MEMS Accelerometer V/F Digital T + - M. A. Lemkin, “Micro Acceleromet er Design wit h Digit al Feedback Cont rol”, Ph.D. dissert at ion, EECS, Universit y of Calif ornia, Berkeley, Fall 1997 Edward A. Lee, UC Berkeley

  17. Accelerometer Applet This model mixes t wo Pt olemy I I domains, DE (discret e event s) and CT (cont inuous t ime). Edward A. Lee, UC Berkeley

  18. Hierarchical Heterogeneous Models DE CT CTPlot + Sin 1/s 1/s K(z) Source Gain Integrator Integrator Sampler FIRFilter Quantizer text Gain Gain ZOH Gain ZeroOrderHold accumulator DEPlot Cont inuous-t ime model Discret e-event model Edward A. Lee, UC Berkeley

  19. Hierarchical Heterogeneity vs. Amorphous Heterogeneity Amorphous Hierarchical Color is a communicat ion prot ocol Color is a domain, which def ines only, which int eract s in bot h t he f low of cont rol and unpredict able ways wit h t he f low int eract ion prot ocols. of cont rol. Edward A. Lee, UC Berkeley

  20. 4. Synchronous/ Reactive Models � A discret e model of t ime progresses as a sequence of “t icks.” At a t ick, t he signals are def ined by a f ixed point equat ion: � L O L O x f ( ) 1 M P M P A t , Examples: M P M P y f ( ) z • Est erel, B t , M P M P N Q N Q • Lust re, z f ( , ) x y C t , x • Signal, A • Argos, C B y • ... z Edward A. Lee, UC Berkeley

  21. 4. SR: Strengths and Weaknesses St rengt hs: – Good mat ch f or cont r ol-int ensive syst ems – Tight ly synchr onized – Det er minat e in most cases – Maps well t o har dwar e and sof t war e Weaknesses: – Comput at ion-int ensive syst ems ar e overspecif ied – Modularit y is compromised – Causalit y loops ar e possible – Causalit y loops ar e har d t o det ect Edward A. Lee, UC Berkeley

  22. 5. Process Networks � Processes are pref ix- Examples: monot onic f unct ions mapping • SDL, sequences int o sequences. • Unix pipes, • ... � One implement at ion uses blocking reads, non-blocking process writ es, and unbounded FI FO A channels. C B � Dat af low special cases have st rong f ormal propert ies. channel st ream Edward A. Lee, UC Berkeley

  23. 5. Strengths and Weaknesses St rengt hs: – Loose synchr onizat ion (dist r ibut able) – Det er minat e under simple condit ions – I mplement able under simple condit ions – Maps easily t o t hr eads, but much easier t o use – Tur ing complet e (expr essive) Weaknesses: – Cont rol-int ensive syst ems ar e har d t o specif y – Bounded r esour ces ar e undecidable Edward A. Lee, UC Berkeley

  24. 6. Rendezvous Models � Event s represent rendezvous Examples: of a sender and a receiver. • CSP, Communicat ion is unbuf f ered • CCS, and inst ant aneous. • Occam, • Lot os, • ... � Of t en implicit ly assumed process wit h “process algebra” or a a , ,... A 1 2 even “concurrent .” C B b b , ,... event s 1 2 Edward A. Lee, UC Berkeley

  25. 6. Strengths and Weaknesses St rengt hs: – Models r esour ce shar ing well – Part ial-or der synchr onizat ion (dist r ibut able) – Suppor t s nat ur ally nondet er minat e int er act ions Weaknesses: – Over synchr onizes some syst ems – Dif f icult t o make det er minat e (and usef ul) Edward A. Lee, UC Berkeley

  26. Making Sense of the Options: Component I nterf aces classical r epr esent dat a t ypes f or messages type system exchanged on port s. act or act or system- level r epr esent int er act ion semant ics as types t ypes on t hese por t s. Edward A. Lee, UC Berkeley

  27. Approach – System- Level Types General St ring act or act or Scalar Boolean Long Complex represent int eract ion semant ics Double as t ypes on t hese port s. I nt A classical t ype syst em is based on f ixed-point s of monot onic f unct ions on a lat t ice where order represent s NaT subclassing. Our syst em-level t ypes are use t he simulat ion relat ion bet ween aut omat a t o provide an order relat ion. Edward A. Lee, UC Berkeley

Recommend


More recommend