# Wiki source code of Leveraging Ptolemy Semantics (KlePto)

Last modified by Richard Kreissig on 2023/09/14 10:55
Export
Office Formats
Export as PDF Export as ODT Export as RTF
Other Formats

Select the pages to export:

select all/ none

Legend:
  Created Page
  Modified Extension Page
  Clean Extension Page

Export as HTML

Show last authors

author | version | line-number | content
--- | --- | --- | ---
|  | 1 | == Deprecated since 0.12 ==
|  | 2 | This article is deprecated. The described features are no longer available in current releases.
|  | 3 |
|  | 4 | == Project Overview ==
|  | 5 | Responsible:
|  | 6 |
|  | 7 | * [[Christian Motika>>url:http://www.informatik.uni-kiel.de/rtsys/kontakt/cmot/||shape="rect"]]
|  | 8 |
|  | 9 | Related Theses:
|  | 10 |
|  | 11 | * Christian Motika, //Semantics and Execution of Domain Specific Models – KlePto and an Execution Framework//, December 2009 ([[pdf>>url:http://rtsys.informatik.uni-kiel.de/confluence/%7Ebiblio/downloads/theses/cmot-dt.pdf||shape="rect"]])
|  | 12 |
|  | 13 | = KlePto - KIELER leveraging Ptolemy semantics =
|  | 14 |
|  | 15 | [[image:attach:klepto-logo.jpg]]
|  | 16 |
|  | 17 | ==== Topics ====
|  | 18 |
|  | 19 |
|  | 20 |
|  | 21 | {{toc maxLevel="2" minLevel="2"/}}
|  | 22 |
|  | 23 | ----
|  | 24 |
|  | 25 | == Overview ==
|  | 26 |
|  | 27 | This subprojects tries to introduce notions of semantics and simulation into the Eclipse graphical modeling facilities [[(% class="icon" %) (%%)EMF>>url:http://www.eclipse.org/emf||shape="rect" class="ext-link"]], [[(% class="icon" %) (%%)GEF>>url:http://www.eclipse.org/gef||shape="rect" class="ext-link"]], [[(% class="icon" %) (%%)GMF>>url:http://www.eclipse.org/gmf||shape="rect" class="ext-link"]], etc.
|  | 28 |
|  | 29 | As a first step the precise models of computation of the great heterogeneous modeling and design Platform [[(% class="icon" %) (%%)Ptolemy>>url:http://ptolemy.eecs.berkeley.edu/||shape="rect" class="ext-link"]] of the University of California at Berkeley will be linked to KIELER to map between a domain specific modeling language (DSML) in Eclipse and a Ptolemy model.
|  | 30 |
|  | 31 | ----
|  | 32 |
|  | 33 | == Preparing KlePto SyncCharts Simulation ==
|  | 34 |
|  | 35 | In order to use the SyncCharts simulation based on the KlePto project please either
|  | 36 |
|  | 37 | 1. start the KIELER RCA or
|  | 38 | 1. ensure that the following plug-ins are loaded in your Eclipse run-configuration (in addition to the SyncChart editor related plug-ins):
|  | 39 | 1*. de.cau.cs.kieler.synccharts.sim.ptolemy
|  | 40 | 1*. de.cau.cs.kieler.synccharts.viewmanagement
|  | 41 | 1*. de.cau.cs.kieler.sim.ptolemy
|  | 42 | 1*. de.cau.cs.kieler.sim.table
|  | 43 | 1*. de.cau.cs.kieler.sim.syncsignalreset
|  | 44 | 1*. **be sure to click on the "Add Required Plug-ins" button**
|  | 45 |
|  | 46 | Then you should be able to start KIELER and select the KIEM view in the KIELER category (Window->Show View->Other...->KIELER->Execution Manager).
|  | 47 |
|  | 48 | ----
|  | 49 |
|  | 50 | == Simulating SyncCharts with KlePto ==
|  | 51 |
|  | 52 | To simulate a SyncChart, take care of the following facts:
|  | 53 |
|  | 54 | * No other DataComponents than the ones on the screen shot (s.b.) should be scheduled, i.e., appear in the KIEM DataComponent list (delete the others pressing <DEL>)
|  | 55 | *1. Synchronous Signal Resetter
|  | 56 | *1. DataTable (Procuder)
|  | 57 | *1. SyncCharts Ptolemy Simulator
|  | 58 | *1. Viewmanagement SyncCharts Visualizer
|  | 59 | *1. DataTable (Observer)
|  | 60 | * Make sure the DataComponents appear in this order, in particular the Synchronous Signal Resetter should be on the top of the list (use the yellow arrow buttons)
|  | 61 | * You may save this execution schedule configuration (while KIEM has the focus, click on File->Save and save the *.execution configuration)
|  | 62 | ** You can always load a configuration file by e.g., double click it in the Project Explorer (and wait just a second)
|  | 63 | * All warnings about the simulation should be fixed (otherwise the behavior might not be the one you expect)
|  | 64 | * All signals that are marked as **input** or **output**are displayed in the DataTable (local signals are not displayed)
|  | 65 | ** In the DataTable you can select [x] a signal to make it present, or deselect it [ ] to make it absent, use the 'permanent' option (double click) to emit it permanently
|  | 66 | * Be sure to **save** current model changes **before** starting to simulate them!
|  | 67 | * After changing the model: save it, stop any current simulation and (re)start it (again)!
|  | 68 | * Check the "Problems" View of Eclipse in order to see, whether there are any simulation related warnings left (see below)!
|  | 69 | ** For every simulation run, a Ptolemy model is generated out of the last saved SyncChart version of the currently opened SyncChart editor
|  | 70 | * IF THE VIEWMANAGEMENT HANGS OR NOT WORKS AT ALL, PLEASE RESTART THE SIMULATION - IT MIGHT STILL BE A LITTLE BUGGY
|  | 71 | ** The ViewManagement component is responsible for visualizing current states in a red color (s.b.)
|  | 72 |
|  | 73 | [[image:attach:klepto-screenshot.jpg]]
|  | 74 |
|  | 75 | ----
|  | 76 |
|  | 77 | == KlePto Error Messages ==
|  | 78 |
|  | 79 | Because the simulation computation is done within Ptolemy, this is where errors during the simulation might originate from. Some common problems are listed here for a better understanding of these error messages. Please use the "Error Log" View of Eclipse (see screen shot) to inspect any details of this error (double click it).
|  | 80 |
|  | 81 | It is **always** necessary to inspect the "Problems" View of Eclipse before simulating. Here you might find additional simulation problems not visually shown in the editor!
|  | 82 |
|  | 83 | [[image:attach:klepto-problems.jpg]]
|  | 84 |
|  | 85 |
|  | 86 | === unsaved changes ===
|  | 87 |
|  | 88 | [[image:attach:klepto-error1.jpg]]
|  | 89 |
|  | 90 | * If you have any unsaved changes, you must save your model in order to simulate it because the transformation only considers the model file. You cannot start a simulation for an editor with any unsaved changes (even only graphical/non-semantical ones).
|  | 91 |
|  | 92 |
|  | 93 | === model changes during simulation ===
|  | 94 |
|  | 95 | [[image:attach:klepto-error2.jpg]]
|  | 96 |
|  | 97 | * If you change the model during the simulation, you will be warned about this. The transformation took place on the last saved version of your model and the simulation cannot consider on-the-fly changes. If you ignore this warning, keep in mind that you do not simulate the (changed) model in your editor.
|  | 98 |
|  | 99 |
|  | 100 | === Ptolemy Model could not be generated ===
|  | 101 |
|  | 102 | [[image:attach:klepto-error3.jpg]]
|  | 103 |
|  | 104 | * If the transformation could not take place, there might be some unsolved problems left. Check the "Problems" View of Eclipse (s.a.).
|  | 105 | * This error message for example indicates that you have used an output signal in a trigger or an input signal in an output action. But this is fully brought to your attention when you inspect the "Problems" View as already described above.
|  | 106 |
|  | 107 |
|  | 108 | === Ptolemy Model could not make a step ===
|  | 109 |
|  | 110 | [[image:attach:klepto-error4.jpg]]
|  | 111 |
|  | 112 | * If Ptolemy cannot make a model step, then probably you have a non constructive SyncChart and causality problems.
|  | 113 | * Additionally you should check the Problems View of Eclipse if there are any uncleared simulation warnings.
|  | 114 | * In this case Ptolemy states, that it could not find a signal assignment for all (local) signals. This means that you should inspect your model for causality problems. Looking into the details of this error message might lead you to the signal being the causer of this.
|  | 115 |
|  | 116 | [[image:attach:klepto-error4b.jpg]]
|  | 117 |
|  | 118 | * If Ptolemy states about undeterministic transitions that you should inspect the priorities that must be destinct. This is also indicated as an error tag in the SyncChatrs editor.
|  | 119 |
|  | 120 | ----
|  | 121 |
|  | 122 | == Transformations ==
|  | 123 |
|  | 124 | Currently there are transformations into Ptolemy for two Domain Specific Languages (DSLs):
|  | 125 |
|  | 126 | 1. Simple Rail Controller Language
|  | 127 | 1. SyncCharts Language
|  | 128 |
|  | 129 | Both transformations use the Xtend model2model transformation language. Details are presented under the abowe links.
|  | 130 |
|  | 131 | ----
|  | 132 |
|  | 133 | == Links ==
|  | 134 |
|  | 135 | * [[(% class="icon" %) (%%)Ptolemy key Paper>>url:http://ptolemy.eecs.berkeley.edu/publications/papers/03/TamingHeterogeneity/TamingHeterogeneity.pdf||shape="rect" class="ext-link"]]
|  | 136 | * [[(% class="icon" %) (%%)Ptolemy website>>url:http://ptolemy.eecs.berkeley.edu/||shape="rect" class="ext-link"]]

# Quick Links

KIELER on GitHub
RTSYS Homepage

XWiki 14.4.7