updated workingSets.psf file + removed unused installer plugin
diff --git a/eclipse-tools/model-transformation/build/dev_utils/workingSets.psf b/eclipse-tools/model-transformation/build/dev_utils/workingSets.psf
index fafd4c9..06bf9e1 100644
--- a/eclipse-tools/model-transformation/build/dev_utils/workingSets.psf
+++ b/eclipse-tools/model-transformation/build/dev_utils/workingSets.psf
@@ -38,5 +38,6 @@
<item elementID="=org.eclipse.app4mc.transformation.3rdparty.libs" factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory"/>
<item elementID="=org.eclipse.app4mc.inchron.transformation.installer" factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory"/>
<item elementID="=org.eclipse.app4mc.transform.to.inchron.product" factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory"/>
+<item elementID="=com.inchron.realtime.root" factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory"/>
</workingSets>
</psf>
\ No newline at end of file
diff --git a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/.classpath b/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/.classpath
deleted file mode 100644
index 428337e..0000000
--- a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="xtend-gen"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/.gitignore b/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/.gitignore
deleted file mode 100644
index d3fb94c..0000000
--- a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-/bin/
-/target/
-/xtend-gen/
\ No newline at end of file
diff --git a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/.project b/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/.project
deleted file mode 100644
index db6d67b..0000000
--- a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/.project
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.app4mc.transform.to.inchron.m2m</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
-
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
- </natures>
-</projectDescription>
diff --git a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/.settings/org.eclipse.jdt.core.prefs b/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 0c68a61..0000000
--- a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
-org.eclipse.jdt.core.compiler.compliance=1.8
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.8
diff --git a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/META-INF/MANIFEST.MF b/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/META-INF/MANIFEST.MF
deleted file mode 100644
index 180f732..0000000
--- a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,13 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: APP4MC Transformation to Inchron M2M
-Bundle-SymbolicName: org.eclipse.app4mc.transform.to.inchron.m2m;singleton:=true
-Bundle-Version: 0.3.0.qualifier
-Bundle-Vendor: Eclipse APP4MC
-Bundle-RequiredExecutionEnvironment: JavaSE-1.8
-Require-Bundle: com.google.inject;bundle-version="3.0.0",
- org.apache.log4j;bundle-version="1.2.15",
- org.eclipse.emf;bundle-version="2.6.0",
- org.eclipse.app4mc.transformation.extensions,
- org.eclipse.app4mc.amalthea.model;visibility:=reexport,
- com.inchron.realtime.root;bundle-version="2.98.2"
diff --git a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/about.html b/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/about.html
deleted file mode 100644
index 164f781..0000000
--- a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/about.html
+++ /dev/null
@@ -1,36 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
-<title>About</title>
-</head>
-<body lang="EN-US">
- <h2>About This Content</h2>
-
- <p>November 30, 2017</p>
- <h3>License</h3>
-
- <p>
- The Eclipse Foundation makes available all content in this plug-in
- ("Content"). Unless otherwise indicated below, the Content
- is provided to you under the terms and conditions of the Eclipse
- Public License Version 2.0 ("EPL"). A copy of the EPL is
- available at <a href="http://www.eclipse.org/legal/epl-2.0">http://www.eclipse.org/legal/epl-2.0</a>.
- For purposes of the EPL, "Program" will mean the Content.
- </p>
-
- <p>
- If you did not receive this Content directly from the Eclipse
- Foundation, the Content is being redistributed by another party
- ("Redistributor") and different terms and conditions may
- apply to your use of any object code in the Content. Check the
- Redistributor's license that was provided with the Content. If no such
- license exists, contact the Redistributor. Unless otherwise indicated
- below, the terms and conditions of the EPL still apply to any source
- code in the Content and such source code may be obtained at <a
- href="http://www.eclipse.org/">http://www.eclipse.org</a>.
- </p>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/build.properties b/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/build.properties
deleted file mode 100644
index bac7dc9..0000000
--- a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/build.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-# *******************************************************************************
-# Copyright (c) 2018 Robert Bosch GmbH and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License 2.0
-# which accompanies this distribution, and is available at
-# https://www.eclipse.org/legal/epl-2.0/
-#
-# Contributors:
-# Robert Bosch GmbH - initial API and implementation
-#
-# *******************************************************************************
-source.. = src/,\
- xtend-gen/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml,\
- epl-2.0.html,\
- about.html
-src.includes = about.html,\
- epl-2.0.html
diff --git a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/epl-2.0.html b/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/epl-2.0.html
deleted file mode 100644
index 637a181..0000000
--- a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/epl-2.0.html
+++ /dev/null
@@ -1,300 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Eclipse Public License - Version 2.0</title>
- <style type="text/css">
- body {
- margin: 1.5em 3em;
- }
- h1{
- font-size:1.5em;
- }
- h2{
- font-size:1em;
- margin-bottom:0.5em;
- margin-top:1em;
- }
- p {
- margin-top: 0.5em;
- margin-bottom: 0.5em;
- }
- ul, ol{
- list-style-type:none;
- }
- </style>
- </head>
- <body>
- <h1>Eclipse Public License - v 2.0</h1>
- <p>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
- PUBLIC LICENSE (“AGREEMENT”). ANY USE, REPRODUCTION OR DISTRIBUTION
- OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
- </p>
- <h2 id="definitions">1. DEFINITIONS</h2>
- <p>“Contribution” means:</p>
- <ul>
- <li>a) in the case of the initial Contributor, the initial content
- Distributed under this Agreement, and
- </li>
- <li>
- b) in the case of each subsequent Contributor:
- <ul>
- <li>i) changes to the Program, and</li>
- <li>ii) additions to the Program;</li>
- </ul>
- where such changes and/or additions to the Program originate from
- and are Distributed by that particular Contributor. A Contribution
- “originates” from a Contributor if it was added to the Program by such
- Contributor itself or anyone acting on such Contributor's behalf.
- Contributions do not include changes or additions to the Program that
- are not Modified Works.
- </li>
- </ul>
- <p>“Contributor” means any person or entity that Distributes the Program.</p>
- <p>“Licensed Patents” mean patent claims licensable by a Contributor which
- are necessarily infringed by the use or sale of its Contribution alone
- or when combined with the Program.
- </p>
- <p>“Program” means the Contributions Distributed in accordance with this
- Agreement.
- </p>
- <p>“Recipient” means anyone who receives the Program under this Agreement
- or any Secondary License (as applicable), including Contributors.
- </p>
- <p>“Derivative Works” shall mean any work, whether in Source Code or other
- form, that is based on (or derived from) the Program and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship.
- </p>
- <p>“Modified Works” shall mean any work in Source Code or other form that
- results from an addition to, deletion from, or modification of the
- contents of the Program, including, for purposes of clarity any new file
- in Source Code form that contains any contents of the Program. Modified
- Works shall not include works that contain only declarations, interfaces,
- types, classes, structures, or files of the Program solely in each case
- in order to link to, bind by name, or subclass the Program or Modified
- Works thereof.
- </p>
- <p>“Distribute” means the acts of a) distributing or b) making available
- in any manner that enables the transfer of a copy.
- </p>
- <p>“Source Code” means the form of a Program preferred for making
- modifications, including but not limited to software source code,
- documentation source, and configuration files.
- </p>
- <p>“Secondary License” means either the GNU General Public License,
- Version 2.0, or any later versions of that license, including any
- exceptions or additional permissions as identified by the initial
- Contributor.
- </p>
- <h2 id="grant-of-rights">2. GRANT OF RIGHTS</h2>
- <ul>
- <li>a) Subject to the terms of this Agreement, each Contributor hereby
- grants Recipient a non-exclusive, worldwide, royalty-free copyright
- license to reproduce, prepare Derivative Works of, publicly display,
- publicly perform, Distribute and sublicense the Contribution of such
- Contributor, if any, and such Derivative Works.
- </li>
- <li>b) Subject to the terms of this Agreement, each Contributor hereby
- grants Recipient a non-exclusive, worldwide, royalty-free patent
- license under Licensed Patents to make, use, sell, offer to sell,
- import and otherwise transfer the Contribution of such Contributor,
- if any, in Source Code or other form. This patent license shall
- apply to the combination of the Contribution and the Program if,
- at the time the Contribution is added by the Contributor, such
- addition of the Contribution causes such combination to be covered
- by the Licensed Patents. The patent license shall not apply to any
- other combinations which include the Contribution. No hardware per
- se is licensed hereunder.
- </li>
- <li>c) Recipient understands that although each Contributor grants the
- licenses to its Contributions set forth herein, no assurances are
- provided by any Contributor that the Program does not infringe the
- patent or other intellectual property rights of any other entity.
- Each Contributor disclaims any liability to Recipient for claims
- brought by any other entity based on infringement of intellectual
- property rights or otherwise. As a condition to exercising the rights
- and licenses granted hereunder, each Recipient hereby assumes sole
- responsibility to secure any other intellectual property rights needed,
- if any. For example, if a third party patent license is required to
- allow Recipient to Distribute the Program, it is Recipient's
- responsibility to acquire that license before distributing the Program.
- </li>
- <li>d) Each Contributor represents that to its knowledge it has sufficient
- copyright rights in its Contribution, if any, to grant the copyright
- license set forth in this Agreement.
- </li>
- <li>e) Notwithstanding the terms of any Secondary License, no Contributor
- makes additional grants to any Recipient (other than those set forth
- in this Agreement) as a result of such Recipient's receipt of the
- Program under the terms of a Secondary License (if permitted under
- the terms of Section 3).
- </li>
- </ul>
- <h2 id="requirements">3. REQUIREMENTS</h2>
- <p>3.1 If a Contributor Distributes the Program in any form, then:</p>
- <ul>
- <li>a) the Program must also be made available as Source Code, in
- accordance with section 3.2, and the Contributor must accompany
- the Program with a statement that the Source Code for the Program
- is available under this Agreement, and informs Recipients how to
- obtain it in a reasonable manner on or through a medium customarily
- used for software exchange; and
- </li>
- <li>
- b) the Contributor may Distribute the Program under a license
- different than this Agreement, provided that such license:
- <ul>
- <li>i) effectively disclaims on behalf of all other Contributors all
- warranties and conditions, express and implied, including warranties
- or conditions of title and non-infringement, and implied warranties
- or conditions of merchantability and fitness for a particular purpose;
- </li>
- <li>ii) effectively excludes on behalf of all other Contributors all
- liability for damages, including direct, indirect, special, incidental
- and consequential damages, such as lost profits;
- </li>
- <li>iii) does not attempt to limit or alter the recipients' rights in the
- Source Code under section 3.2; and
- </li>
- <li>iv) requires any subsequent distribution of the Program by any party
- to be under a license that satisfies the requirements of this section 3.
- </li>
- </ul>
- </li>
- </ul>
- <p>3.2 When the Program is Distributed as Source Code:</p>
- <ul>
- <li>a) it must be made available under this Agreement, or if the Program (i)
- is combined with other material in a separate file or files made available
- under a Secondary License, and (ii) the initial Contributor attached to
- the Source Code the notice described in Exhibit A of this Agreement,
- then the Program may be made available under the terms of such
- Secondary Licenses, and
- </li>
- <li>b) a copy of this Agreement must be included with each copy of the Program.</li>
- </ul>
- <p>3.3 Contributors may not remove or alter any copyright, patent, trademark,
- attribution notices, disclaimers of warranty, or limitations of liability
- (‘notices’) contained within the Program from any copy of the Program which
- they Distribute, provided that Contributors may add their own appropriate
- notices.
- </p>
- <h2 id="commercial-distribution">4. COMMERCIAL DISTRIBUTION</h2>
- <p>Commercial distributors of software may accept certain responsibilities
- with respect to end users, business partners and the like. While this
- license is intended to facilitate the commercial use of the Program, the
- Contributor who includes the Program in a commercial product offering should
- do so in a manner which does not create potential liability for other
- Contributors. Therefore, if a Contributor includes the Program in a
- commercial product offering, such Contributor (“Commercial Contributor”)
- hereby agrees to defend and indemnify every other Contributor
- (“Indemnified Contributor”) against any losses, damages and costs
- (collectively “Losses”) arising from claims, lawsuits and other legal actions
- brought by a third party against the Indemnified Contributor to the extent
- caused by the acts or omissions of such Commercial Contributor in connection
- with its distribution of the Program in a commercial product offering.
- The obligations in this section do not apply to any claims or Losses relating
- to any actual or alleged intellectual property infringement. In order to
- qualify, an Indemnified Contributor must: a) promptly notify the
- Commercial Contributor in writing of such claim, and b) allow the Commercial
- Contributor to control, and cooperate with the Commercial Contributor in,
- the defense and any related settlement negotiations. The Indemnified
- Contributor may participate in any such claim at its own expense.
- </p>
- <p>For example, a Contributor might include the Program
- in a commercial product offering, Product X. That Contributor is then a
- Commercial Contributor. If that Commercial Contributor then makes performance
- claims, or offers warranties related to Product X, those performance claims
- and warranties are such Commercial Contributor's responsibility alone.
- Under this section, the Commercial Contributor would have to defend claims
- against the other Contributors related to those performance claims and
- warranties, and if a court requires any other Contributor to pay any damages
- as a result, the Commercial Contributor must pay those damages.
- </p>
- <h2 id="warranty">5. NO WARRANTY</h2>
- <p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED
- BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN “AS IS” BASIS, WITHOUT
- WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
- WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
- solely responsible for determining the appropriateness of using and
- distributing the Program and assumes all risks associated with its
- exercise of rights under this Agreement, including but not limited to the
- risks and costs of program errors, compliance with applicable laws, damage
- to or loss of data, programs or equipment, and unavailability or
- interruption of operations.
- </p>
- <h2 id="disclaimer">6. DISCLAIMER OF LIABILITY</h2>
- <p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED
- BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY
- LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS),
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS
- GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- </p>
- <h2 id="general">7. GENERAL</h2>
- <p>If any provision of this Agreement is invalid or unenforceable under
- applicable law, it shall not affect the validity or enforceability of the
- remainder of the terms of this Agreement, and without further action by the
- parties hereto, such provision shall be reformed to the minimum extent
- necessary to make such provision valid and enforceable.
- </p>
- <p>If Recipient institutes patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Program itself
- (excluding combinations of the Program with other software or hardware)
- infringes such Recipient's patent(s), then such Recipient's rights granted
- under Section 2(b) shall terminate as of the date such litigation is filed.
- </p>
- <p>All Recipient's rights under this Agreement shall terminate if it fails to
- comply with any of the material terms or conditions of this Agreement and
- does not cure such failure in a reasonable period of time after becoming
- aware of such noncompliance. If all Recipient's rights under this Agreement
- terminate, Recipient agrees to cease use and distribution of the Program
- as soon as reasonably practicable. However, Recipient's obligations under
- this Agreement and any licenses granted by Recipient relating to the
- Program shall continue and survive.
- </p>
- <p>Everyone is permitted to copy and distribute copies of this Agreement,
- but in order to avoid inconsistency the Agreement is copyrighted and may
- only be modified in the following manner. The Agreement Steward reserves
- the right to publish new versions (including revisions) of this Agreement
- from time to time. No one other than the Agreement Steward has the right
- to modify this Agreement. The Eclipse Foundation is the initial Agreement
- Steward. The Eclipse Foundation may assign the responsibility to serve as
- the Agreement Steward to a suitable separate entity. Each new version of
- the Agreement will be given a distinguishing version number. The Program
- (including Contributions) may always be Distributed subject to the version
- of the Agreement under which it was received. In addition, after a new
- version of the Agreement is published, Contributor may elect to Distribute
- the Program (including its Contributions) under the new version.
- </p>
- <p>Except as expressly stated in Sections 2(a) and 2(b) above, Recipient
- receives no rights or licenses to the intellectual property of any
- Contributor under this Agreement, whether expressly, by implication,
- estoppel or otherwise. All rights in the Program not expressly granted
- under this Agreement are reserved. Nothing in this Agreement is intended
- to be enforceable by any entity that is not a Contributor or Recipient.
- No third-party beneficiary rights are created under this Agreement.
- </p>
- <h2 id="exhibit-a">Exhibit A – Form of Secondary Licenses Notice</h2>
- <p>“This Source Code may also be made available under the following
- Secondary Licenses when the conditions for such availability set forth
- in the Eclipse Public License, v. 2.0 are satisfied: {name license(s),
- version(s), and exceptions or additional permissions here}.”
- </p>
- <blockquote>
- <p>Simply including a copy of this Agreement, including this Exhibit A
- is not sufficient to license the Source Code under Secondary Licenses.
- </p>
- <p>If it is not possible or desirable to put the notice in a particular file,
- then You may include the notice in a location (such as a LICENSE file in a
- relevant directory) where a recipient would be likely to look for
- such a notice.
- </p>
- <p>You may add additional accurate notices of copyright ownership.</p>
- </blockquote>
- </body>
-</html>
\ No newline at end of file
diff --git a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/plugin.xml b/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/plugin.xml
deleted file mode 100644
index 11e05ec..0000000
--- a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/plugin.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<!--
- * Copyright (c) 2018 Robert Bosch GmbH.
- *
- * This program and the accompanying materials are made
- * available under the terms of the Eclipse Public License 2.0
- * which is available at https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * Robert Bosch GmbH - initial API and implementation
- -->
-
-<plugin>
- <extension
- point="org.eclipse.app4mc.transformation.configuration">
- <config
- enabled="true"
- id="org.eclipse.app4mc.transform.to.inchron.m2m.config"
- m2m_class="configuration.M2MTransformation"
- module_class="module.DefaultM2MInjectorModule">
- </config>
- </extension>
-
-</plugin>
diff --git a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/src/configuration/M2MTransformation.java b/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/src/configuration/M2MTransformation.java
deleted file mode 100644
index b641726..0000000
--- a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/src/configuration/M2MTransformation.java
+++ /dev/null
@@ -1,100 +0,0 @@
- /**
- ********************************************************************************
- * Copyright (c) 2018 Robert Bosch GmbH.
- *
- * This program and the accompanying materials are made
- * available under the terms of the Eclipse Public License 2.0
- * which is available at https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * Robert Bosch GmbH - initial API and implementation
- ********************************************************************************
- */
-package configuration;
-
-import java.util.Properties;
-
-import org.apache.log4j.ConsoleAppender;
-import org.apache.log4j.LogManager;
-import org.apache.log4j.Logger;
-import org.apache.log4j.PatternLayout;
-import org.eclipse.app4mc.amalthea.model.AmaltheaFactory;
-import org.eclipse.app4mc.transformation.extensions.executiontype.IModelToModelConfig;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
-
-import com.inchron.realtime.root.RootPackage;
-
-import model.loader.AmaltheaMultiFileLoader;
-
-public class M2MTransformation implements IModelToModelConfig {
-
- private Properties parameters;
-
- private Logger logger=LogManager.getLogger(IModelToModelConfig.class);
-
- public M2MTransformation() {
- logger.addAppender(new ConsoleAppender(new PatternLayout()));
- }
-
- @Override
- public ResourceSet getInputResourceSet() {
-
- if(parameters !=null){
-
- String folderPath = parameters.getProperty("input_models_folder");
-
- if(folderPath !=null){
-
- logger.info("Loading AMALTHEA model files from folder : "+folderPath);
-
- ResourceSet resourceSet = new AmaltheaMultiFileLoader().loadMultipleFiles(folderPath);
-
- if(resourceSet.getResources().size()==0) {
- logger.error("no Amalthea model files are loaded. Verify if the model version is : " + AmaltheaFactory.eINSTANCE.createAmalthea().getVersion());
- }
-
- return resourceSet;
- }else{
- logger.error("amalthea_models_folder parameter not set", new NullPointerException("amalthea_models_folder property not set"));
- }
-
- }else{
- logger.error("Parameters object not set ", new NullPointerException("Parameter object is null"));
- }
- return null;
- }
-
- @Override
- public ResourceSet getOuputResourceSet() {
-
- ResourceSet outputRurceSet=new ResourceSetImpl();
-
- outputRurceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put
- (Resource.Factory.Registry.DEFAULT_EXTENSION,
- new XMIResourceFactoryImpl());
-
- outputRurceSet.getPackageRegistry().put
- (RootPackage.eNS_URI,
- RootPackage.eINSTANCE);
-
- return outputRurceSet;
- }
-
- @Override
- public void setProperties(Properties parameters) {
-
- this.parameters=parameters;
- }
-
- @Override
- public void setLogger(Logger logger) {
- this.logger=logger;
-
- }
-
-}
diff --git a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/src/model/loader/AmaltheaMultiFileLoader.java b/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/src/model/loader/AmaltheaMultiFileLoader.java
deleted file mode 100644
index 70f33c1..0000000
--- a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/src/model/loader/AmaltheaMultiFileLoader.java
+++ /dev/null
@@ -1,94 +0,0 @@
- /**
- ********************************************************************************
- * Copyright (c) 2018 Robert Bosch GmbH.
- *
- * This program and the accompanying materials are made
- * available under the terms of the Eclipse Public License 2.0
- * which is available at https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * Robert Bosch GmbH - initial API and implementation
- ********************************************************************************
- */
-package model.loader;
-
-import java.io.File;
-import java.io.FilenameFilter;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.app4mc.amalthea.model.Amalthea;
-import org.eclipse.app4mc.amalthea.model.AmaltheaPackage;
-import org.eclipse.app4mc.amalthea.sphinx.AmaltheaResourceFactory;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.sphinx.emf.resource.ExtendedResourceSet;
-import org.eclipse.sphinx.emf.resource.ExtendedResourceSetImpl;
-
-public class AmaltheaMultiFileLoader {
-
- public ResourceSet loadMultipleFiles(String directoryPath){
-
- File folder = new File(directoryPath);
-
- if(folder.isDirectory()){
- File[] listFiles = folder.listFiles( new FilenameFilter() {
-
- @Override
- public boolean accept(File file, String name) {
-
- if(name.endsWith(".amxmi")){
- return true;
- }
-
- return false;
- }
- });
-
- ResourceSet resourceSet = initializeResourceSet();
-
- loadMultipleFiles(resourceSet, listFiles);
-
- return resourceSet;
- }
-
- return new ResourceSetImpl();
-
- }
-
- private List<Amalthea> loadMultipleFiles(ResourceSet resourceSet, File[] listFiles) {
-
- List<Amalthea> models =new ArrayList<Amalthea>();
-
- for (File amxmiFile : listFiles) {
-
- final Resource res = resourceSet.createResource(URI.createURI("file:////"+amxmiFile.getAbsolutePath()));
- try {
- res.load(null);
- for (final EObject content : res.getContents()) {
- if (content instanceof Amalthea) {
- models.add((Amalthea) content);
- }
- }
- } catch (IOException e) {
- // ignore
- }
- }
- return models;
- }
-
- private static ResourceSet initializeResourceSet() {
- final ExtendedResourceSet resSet = new ExtendedResourceSetImpl();
- resSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("amxmi", new AmaltheaResourceFactory());
- AmaltheaPackage.eINSTANCE.eClass(); // register the package
-
- return resSet;
- }
-
-}
diff --git a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/src/module/DefaultM2MInjectorModule.java b/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/src/module/DefaultM2MInjectorModule.java
deleted file mode 100644
index 3571d76..0000000
--- a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/src/module/DefaultM2MInjectorModule.java
+++ /dev/null
@@ -1,43 +0,0 @@
- /**
- ********************************************************************************
- * Copyright (c) 2018 Robert Bosch GmbH.
- *
- * This program and the accompanying materials are made
- * available under the terms of the Eclipse Public License 2.0
- * which is available at https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * Robert Bosch GmbH - initial API and implementation
- ********************************************************************************
- */
-package module;
-
-import org.eclipse.app4mc.transformation.extensions.AbstractTransformationInjectorModule;
-import org.eclipse.app4mc.transformation.extensions.base.templates.Model2ModelRootTransformer;
-
-import templates.AmaltheaTransformer;
-import templates.CustomHWTransformer;
-import templates.HWTransformer;
-
-public class DefaultM2MInjectorModule extends AbstractTransformationInjectorModule {
-
- public DefaultM2MInjectorModule() {
- }
-
- @Override
- protected void configure() {
-
- initializeBaseConfiguration();
-
- }
-
- @Override
- protected void initializeBaseConfiguration() {
- super.initializeBaseConfiguration();
- bind(Model2ModelRootTransformer.class).to(AmaltheaTransformer.class);
-
- }
-
-}
diff --git a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/src/templates/AbstractAmaltheaInchronTransformer.xtend b/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/src/templates/AbstractAmaltheaInchronTransformer.xtend
deleted file mode 100644
index 1740ae4..0000000
--- a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/src/templates/AbstractAmaltheaInchronTransformer.xtend
+++ /dev/null
@@ -1,64 +0,0 @@
-package templates
-
-import com.inchron.realtime.root.RootFactory
-import com.inchron.realtime.root.model.Model
-import com.inchron.realtime.root.model.ModelFactory
-import com.inchron.realtime.root.model.memory.MemoryFactory
-import com.inchron.realtime.root.model.stimulation.StimulationFactory
-import org.eclipse.app4mc.amalthea.model.Amalthea
-import org.eclipse.app4mc.amalthea.model.AmaltheaFactory
-import org.eclipse.app4mc.transformation.extensions.base.templates.AbstractTransformer
-import org.eclipse.emf.ecore.EObject
-
-class AbstractAmaltheaInchronTransformer extends AbstractTransformer{
-
- public var Model inchronModel;
-
- public var Amalthea amaltheaModel
-
- /*- Factory initiaization */
- public val inchronRootFactory = RootFactory.eINSTANCE
-
- public val inchronModelFactory = ModelFactory.eINSTANCE
-
- public val inchronmemoryFactory = MemoryFactory.eINSTANCE
-
- public val inchronStimulationFactory = StimulationFactory.eINSTANCE
-
-
- public val amaltheaFactory = AmaltheaFactory.eINSTANCE
-
- public def OSTransformer getOSTransformerInstance(){
- return customObjsStore.getInstance(OSTransformer)
- }
-
- public def HWTransformer getHWTransformerInstance(){
- return customObjsStore.getInstance(HWTransformer)
- }
-
- public def SWTransformer getSWTransformerInstance(){
- return customObjsStore.getInstance(SWTransformer)
- }
-
-
- public def StimuliTransformer getStimuliTransformerInstance(){
- return customObjsStore.getInstance(StimuliTransformer)
- }
-
- public def static <T> T getParentContainer(EObject eObject, Class<T> cl)
- {
- var EObject result = null;
- if (eObject != null)
- {
- for (var EObject parent = eObject.eContainer(); parent != null; parent = parent.eContainer())
- {
-
- if(cl.isAssignableFrom(parent.getClass())){
- return parent as T;
- }
-
- }
- }
- return result as T;
- }
-}
\ No newline at end of file
diff --git a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/src/templates/AmaltheaTransformer.xtend b/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/src/templates/AmaltheaTransformer.xtend
deleted file mode 100644
index 6b0b791..0000000
--- a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/src/templates/AmaltheaTransformer.xtend
+++ /dev/null
@@ -1,181 +0,0 @@
-package templates
-
-import com.google.inject.Inject
-import com.inchron.realtime.root.RootFactory
-import com.inchron.realtime.root.model.Model
-import com.inchron.realtime.root.model.ModelFactory
-import java.io.File
-import java.lang.String
-import java.text.DateFormat;
-import java.text.SimpleDateFormat
-import java.util.Date
-import java.util.Locale
-import org.apache.log4j.ConsoleAppender
-import org.apache.log4j.PatternLayout
-import org.eclipse.app4mc.amalthea.model.Amalthea
-import org.eclipse.app4mc.amalthea.model.Value
-import org.eclipse.app4mc.amalthea.model.StringObject
-import org.eclipse.app4mc.transformation.extensions.base.templates.Model2ModelRootTransformer
-import org.eclipse.emf.common.util.URI
-import org.eclipse.emf.ecore.EObject
-import org.eclipse.emf.ecore.resource.ResourceSet
-import templates.utils.AmltCacheModel
-
-class AmaltheaTransformer extends Model2ModelRootTransformer{
-
- /*- Factory initiaization */
- val inchronRootFactory = RootFactory.eINSTANCE
-
- val inchronModelFactory = ModelFactory.eINSTANCE
-
- /*- Transformer classes initiaization */
- @Inject extension SWTransformer swTransformer
-
- @Inject extension HWTransformer hwTransformer
-
- @Inject extension OSTransformer osTransformer
-
- @Inject extension StimuliTransformer stimuliTransformer
-
- DateFormat dateFormat = new SimpleDateFormat("dd.MMMM.yyyy", Locale.ENGLISH)
-
- /**
- * This method performs the transformation of AMALTHEA model to INCHRON model and saves the transformed model in the output directory.
- */
- override m2mTransformation(ResourceSet inputResourceSet, ResourceSet outputResourceSet) {
-
- /*- Associating CacheModel to the transformation.
- * Note: This is a cummulative cache of all the elements from various input AMALTHEA model files.
- */
- var AmltCacheModel cacheModel = new AmltCacheModel
-
- customObjsStore.injectMembers(AmltCacheModel, cacheModel)
-
- var int fileIndex = 1
-
- for (resource : inputResourceSet.resources) {
- for (content : resource.contents) {
-
- logger.info("Processing file : " + resource.URI)
-
- /*- Building INCHRON model from AMALTHEA input model */
- val inchronRoot = transform(content as Amalthea)
-
- val out_uri = URI.createFileURI(
- getProperty("m2m_output_folder") + File.separator + fileIndex++ + ".root")
-
- val out_resource = outputResourceSet.createResource(out_uri)
-
- /*-Attaching a resource to the INCHRON model element */
- out_resource.contents.add(inchronRoot)
-
- }
- }
-
- /*- Saving all the root INCHRON model files*/
- for (resource : outputResourceSet.resources) {
-
- resource.save(null)
-
- logger.info("Transformed model file generated at : " + resource.URI)
- }
-
- logger.info("*********************** Completed : Model to Model transformation **************************")
- }
-
-
- /**
- * This method is used to transform AMALTHEA model to INCHRON model
- */
- def create inchronRootFactory.createRoot transform(Amalthea amalthea){
-
- /*-Step 1: Injecting all the required transformation objects into the CustomObjsStore. Advantage with this approach is, it provides flexibility to access these elements across various transformers */
-
- customObjsStore.injectMembers(SWTransformer , swTransformer)
-
- customObjsStore.injectMembers(HWTransformer , hwTransformer)
-
- customObjsStore.injectMembers(OSTransformer , osTransformer)
-
- customObjsStore.injectMembers(StimuliTransformer , stimuliTransformer)
-
- /* Step 2: Building INCHRON model by invoking various transformers */
- model = createInchronModel(amalthea)
-
-
-
- }
-
- /**
- * This method creates the object of INCHRON Model element, and fills it by invoking various transformations
- */
- def create inchronModelFactory.createModel createInchronModel(Amalthea amalthea) {
-
- setRequiredAttributes(amalthea, it)
-
- transformMetaInfo(amalthea, it)
-
- hwTransformer.transfromHWModel(amalthea.hwModel,it)
-
- }
-
- /**
- * Create and fill the INCHRON model's GeneralInfo with meta information,
- * mainly from the Amalthea customProperties map.
- * @Note: customProperties keys used here are currently informal/not specified.
- */
- public def transformMetaInfo(Amalthea amalthea, Model inchronModel) {
-
- var info = inchronModelFactory.createGeneralInfo()
- info.setCreator(("Amlt2Inchron " + amalthea.getVersion() + " " + new Date()).toString())
- info.setVersion("1")
-
- val value = amalthea.getCustomProperties().get("Date_Last_Modified")
- if (value instanceof StringObject) {
- val date = (value as StringObject).getValue()
- if (date != null)
- info.setModifiedDate(dateFormat.parse(date))
- }
-
- val author = amalthea.getCustomProperties().get("Author")
- if (author instanceof StringObject)
- info.setAuthor((author as StringObject).getValue())
-
- val descr = amalthea.getCustomProperties().get("Description")
- if (descr instanceof StringObject)
- info.setDescription((descr as StringObject).getValue())
-
- inchronModel.setGeneralInfo(info)
- }
-
- /**
- * Each transformation object should be set with the required attributes.
- * At present the required attributes are : amaltheaModel and inchronModel elements. In future this list can grow
- */
- protected def EObject setRequiredAttributes(Amalthea amalthea, Model inchronModel) {
-
- swTransformer.amaltheaModel=amalthea
- swTransformer.inchronModel=inchronModel
-
- hwTransformer.amaltheaModel=amalthea
- hwTransformer.inchronModel=inchronModel
-
- osTransformer.amaltheaModel=amalthea
- osTransformer.inchronModel=inchronModel
-
- stimuliTransformer.amaltheaModel=amalthea
- stimuliTransformer.inchronModel=inchronModel
-
- }
-
- /**
- * Overriding the logger creation method and attaching "ConsoleAppender" to it.
- */
- override protected getLogger() {
- var logger=super.getLogger()
- return logger
-
- }
-
-
-}
diff --git a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/src/templates/CustomHWTransformer.xtend b/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/src/templates/CustomHWTransformer.xtend
deleted file mode 100644
index 91683df..0000000
--- a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/src/templates/CustomHWTransformer.xtend
+++ /dev/null
@@ -1,40 +0,0 @@
-package templates
-
-import com.inchron.realtime.root.model.Model
-import org.eclipse.app4mc.amalthea.model.Frequency
-import org.eclipse.app4mc.amalthea.model.FrequencyDomain
-import org.eclipse.app4mc.amalthea.model.HWModel
-import org.eclipse.app4mc.amalthea.model.HwStructure
-import org.eclipse.app4mc.amalthea.model.Memory
-import org.eclipse.app4mc.amalthea.model.ProcessingUnit
-
-public class CustomHWTransformer extends HWTransformer{
-
-protected var Model inchronModel;
-
- public override transfromHWModel(HWModel amltHWModel, Model inchronModel){
- super.transfromHWModel(amltHWModel,inchronModel)
- }
-
-
- public override create inchronModelFactory.createCpu createCpu(HwStructure amltMicrocontroller){
- super.createCpu(amltMicrocontroller)
- }
-
- override create inchronModelFactory.createClock createClock(FrequencyDomain amltQuartz){
- super.createClock(amltQuartz)
- }
-
- override create inchronModelFactory.createFrequency createFrequency(Frequency amltFrequency){
- super.createFrequency(amltFrequency)
- }
-
- override create inchronModelFactory.createCpuCore createCpuCore(ProcessingUnit core){
-
- super.createCpuCore(core)
- }
-
- override create inchronmemoryFactory.createMemory createMemory(Memory amltMemory){
- super.createMemory(amltMemory)
- }
-}
diff --git a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/src/templates/HWTransformer.xtend b/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/src/templates/HWTransformer.xtend
deleted file mode 100644
index 2a8e16c..0000000
--- a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/src/templates/HWTransformer.xtend
+++ /dev/null
@@ -1,216 +0,0 @@
-package templates
-
-import com.inchron.realtime.root.model.FrequencyUnit
-import com.inchron.realtime.root.model.GenericSystem
-import com.inchron.realtime.root.model.Model
-import com.inchron.realtime.root.model.memory.MemoryType
-import java.util.ArrayList
-import java.util.List
-import org.eclipse.app4mc.amalthea.model.Cache
-import org.eclipse.app4mc.amalthea.model.Frequency
-import org.eclipse.app4mc.amalthea.model.FrequencyDomain
-import org.eclipse.app4mc.amalthea.model.HWModel
-import org.eclipse.app4mc.amalthea.model.HwStructure
-import org.eclipse.app4mc.amalthea.model.Memory
-import org.eclipse.app4mc.amalthea.model.ProcessingUnit
-import org.eclipse.app4mc.amalthea.model.StructureType
-import templates.utils.AmltCacheModel
-
-/**
- * This class is responsible for the transformation of AMALTHEA Hardware Model into corresponding INCHRON mdoel elements and accordingly invoke other transformations
- */
-public class HWTransformer extends AbstractAmaltheaInchronTransformer {
-
-
-
- public def transfromHWModel(HWModel amltHWModel, Model inchronModel) {
-
- this.inchronModel=inchronModel
-
- val AmltCacheModel cacheModel=customObjsStore.getInstance(AmltCacheModel)
-
- /*- Transformation of FrequencyDomain elements to Clock elements in Inchron */
-
- amltHWModel?.domains.filter[it instanceof FrequencyDomain].forEach [ amltQuartz |
-
- val inchronClock = createClock(amltQuartz as FrequencyDomain)
- inchronModel.clocks.add(inchronClock)
- ]
-
- /*- Transformation of each Memory element of SYSTEM to Memory element in Inchron*/
-
- amltHWModel?.structures.filter[it.structureType==StructureType.SYSTEM]?.forEach[st|
- st?.modules.filter[it instanceof Memory].forEach[amltMem|
- val inchronMemory = createMemory(amltMem as Memory)
- inchronModel.memories.add(inchronMemory)
- ]
- ]
-
- /*- Collecting all Amalthea ECU elements */
-
- val amltECUs=new ArrayList
-
- amltHWModel?.structures.filter[it.structureType==StructureType.SYSTEM]?.forEach[it?.structures.filter[it.structureType==StructureType.ECU].forEach[
- ecu|
- amltECUs.add(ecu)
- ]]
-
- /*- Conversion of Amalthea ECU and its sub-elements into corresponding Inchron elements */
-
- for (amaltheaEcu : amltECUs) {
-
- amaltheaEcu?.modules.forEach [ amltMem |
-
- /*- Transformation of each Memory element of ECU to Memory element in Inchron*/
-
- if(amltMem instanceof Memory){
- val inchronMemory = createMemory(amltMem)
- inchronModel.memories.add(inchronMemory)
-
- }
- ]
-
- val List<GenericSystem> allGenericSystems=new ArrayList<GenericSystem>
-
- /*- Transformation of each Structure of type MicroController to correspnding Inchron element*/
-
- for (amaltheaMicroController : amaltheaEcu?.structures.filter[it.structureType==StructureType.MICROCONTROLLER]) {
-
- /*- Each MicroController is created as GenericSystem element in Inchron and corresponding data of sub-elements is transformed accordingly. */
-
- val genericSystem = OSTransformerInstance.createGenericSystem(amaltheaMicroController)
-
- /*-Building Inchron CPU element */
- val inchronCpu = createCpu(amaltheaMicroController);
-
- /*-Adding Inchron CPU and GenericSystem elements to Inchron Model */
-
- inchronModel.cpus.add(inchronCpu)
-
- inchronModel.systems.add(genericSystem)
-
- /*- Transformation of each Memory element of MicroController to Memory element in Inchron*/
-
- amaltheaMicroController?.modules.filter[it instanceof Memory].forEach [ amltMem |
- val inchronMemory = createMemory(amltMem as Memory)
- inchronCpu.memories.add(inchronMemory)
- ]
-
- /*-Adding Amalthea microController and Inchron GenericSystem into the Cache map. */
- cacheModel.cacheMappingAmltMicroController_GenericSystem(amaltheaMicroController, genericSystem)
-
- /*-Collecting all Inchron GenericSystems, so as to process them later */
- allGenericSystems.add(genericSystem)
- }
-
- for (genericSystem : allGenericSystems) {
-
- /*-======================================Process each Inchron GenericSystem and populate the data ======================================*/
-
- OSTransformerInstance.fillGenericSystem(genericSystem, amaltheaModel, inchronModel)
-
- }
- }
-
- /*-Adding Stimulation scenarios to Inchron Model */
- inchronModel.stimulationScenarios.add(stimuliTransformerInstance.createstimulationScenario(amaltheaModel))
- }
-
-/**
- * Creating a Inchron CPU element from AMALTHEA HwStructure of type MicroController
- */
- public def create inchronModelFactory.createCpu createCpu(HwStructure amltMicrocontroller) {
-
- it.name = amltMicrocontroller.name
-
- /*Transformation of Amalthea ProcessingUnit to CpuCore element in Inchron */
-
- for (amltCore : amltMicrocontroller?.modules.filter[it instanceof ProcessingUnit]) {
-
- val inchronCpuCore = createCpuCore(amltCore as ProcessingUnit)
-
- /*- Transformation of each Memory element of ProcessingUnit to Memory element of type CACHE in Inchron*/
-
- (amltCore as ProcessingUnit)?.caches.forEach [ amltMem |
- val inchronMemory = createMemory_CacheType(amltMem)
- inchronMemory.type = MemoryType.CACHE
- it.memories.add(inchronMemory)
- ]
-
- // change in 2.98.2. reference to cpu by CpuCore is removed.
-// inchronCpuCore.cpu = it
-
- it.cores.add(inchronCpuCore)
-
- /*-Transformation of FrequencyDomain of the ProcessingUnit in Amalthea */
- val amltQuartz = amltCore?.frequencyDomain
-
- if (amltQuartz != null) {
- val inchronClock = createClock(amltQuartz)
-
- //TODO:Clarify if this is correct ? as the CpuCore Clock into is set to the CPU level in Inchron
- it.clock = (inchronClock) //TODO: Error : In this case, CPU will only hold the Clock of last CpuCore
- }
-
- }
-
- }
-
-/**
- * Creating Inchron Clock element for FrequencyDomain element of Amalthea
- */
- def create inchronModelFactory.createClock createClock(FrequencyDomain amltQuartz) {
-
- it.name = amltQuartz.name
- it.frequency = createFrequency(amltQuartz.defaultValue)
- }
-
-/**
- * Creating Inchron Frequency element for the corresponding Frequency element of Amalthea
- */
- def create inchronModelFactory.createFrequency createFrequency(Frequency amltFrequency) {
-
- it.unit = FrequencyUnit.getByName(amltFrequency?.unit.getName)
- it.value = amltFrequency?.value.floatValue
- }
-
-/**
- * Creating Inchron CpuCore from ProcessingUnit element of Amalthea
- */
- def create inchronModelFactory.createCpuCore createCpuCore(ProcessingUnit core) {
-
- it.name = core.name
-
- }
-
-/**
- * Creating Inchron Memory element from Memory element of Amalthea.
- * In this method, corresponding FrequencyDomain of the Amalthea element is accordingly converted to Inchron Clock element
- */
- def create inchronmemoryFactory.createMemory createMemory(Memory amltMemory) {
-
- it.name = amltMemory.name
-
- if (amltMemory.frequencyDomain != null) {
- it.clock = createClock(amltMemory.frequencyDomain)
- it.prescaler = amltMemory?.frequencyDomain?.defaultValue?.value
-
- }
-
- }
-
- /** Creating Inchron Memory element from Memory element of Amalthea.
- * In this method, corresponding FrequencyDomain of the Amalthea element is accordingly converted to Inchron Clock element
- */
- def create inchronmemoryFactory.createMemory createMemory_CacheType(Cache amltMemory) {
-
- it.name = amltMemory.name
-
- if (amltMemory.frequencyDomain != null) {
- it.clock = createClock(amltMemory.frequencyDomain)
- it.prescaler = amltMemory?.frequencyDomain?.defaultValue?.value
-
- }
-
- }
-}
diff --git a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/src/templates/OSTransformer.xtend b/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/src/templates/OSTransformer.xtend
deleted file mode 100644
index c184cd7..0000000
--- a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/src/templates/OSTransformer.xtend
+++ /dev/null
@@ -1,436 +0,0 @@
-package templates
-
-import com.inchron.realtime.root.model.GenericSystem
-import com.inchron.realtime.root.model.Model
-import com.inchron.realtime.root.model.SchedulerStrategy
-import org.eclipse.app4mc.amalthea.model.Amalthea
-import org.eclipse.app4mc.amalthea.model.FixedPriorityPreemptive
-import org.eclipse.app4mc.amalthea.model.HwStructure
-import org.eclipse.app4mc.amalthea.model.MappingModel
-import org.eclipse.app4mc.amalthea.model.OSEK
-import org.eclipse.app4mc.amalthea.model.SchedulerAssociation
-import org.eclipse.app4mc.amalthea.model.Semaphore
-import org.eclipse.app4mc.amalthea.model.StructureType
-import org.eclipse.app4mc.amalthea.model.TaskScheduler
-import templates.utils.AmltCacheModel
-
-/**
- * This class is responsible for the transformation of AMALTHEA OS Model into corresponding INCHRON mdoel elements and accordingly invoke other transformations
- */
-public class OSTransformer extends AbstractAmaltheaInchronTransformer {
-
- /**
- * Creating Inchron GenericSystem from HwStructure of type MicroController in Amalthea
- */
- def create inchronModelFactory.createGenericSystem createGenericSystem(HwStructure microController) {
- it.name = "System_" + microController.name
- }
-
- /**
- * Populating Inchron GenericSystem contents based on the Amalthea model data
- */
- public def void fillGenericSystem(GenericSystem genericSystem, Amalthea amalthea, Model inchronModel) {
-
- val AmltCacheModel cacheModel=customObjsStore.getInstance(AmltCacheModel)
-
- /*-Creating RtosConfig element and associating it to the GenericSystem */
-
- var inchronRtosConfig = inchronModelFactory.createRtosConfig
-
- genericSystem.rtosConfig = inchronRtosConfig
-
- /*-Fetching contents of Amalthea OS model */
- if (amalthea.osModel != null) {
-
- /*-Fetching all Amalthea Semaphore elements and creating corresponding Inchron elements */
-
- for (Semaphore amltSemaphore : amalthea.osModel.semaphores) {
-
- val inchronSemaphore = createSemaphore(amltSemaphore)
-
- /*-Caching Inchron Semaphore object */
-
- cacheModel.cacheInchronSemaphore(inchronSemaphore)
-
- /*- Adding Semaphore to RtosConfig object*/
-
- genericSystem.rtosConfig.semaphores.add(inchronSemaphore)
- }
- }
-
- /*-Fetching Amalthea Tasks objects from SwModel and invoking the StimuliTransformer to build corresponding Inchron objects */
-
- if(amalthea.swModel!=null){
-
- stimuliTransformerInstance.createInchronActivationConnections(amalthea.swModel.tasks ,inchronModel )
-
- }
-
-
- // heuristic for Inchron
-
- /*-Creating Dummy Inchron Scheduler */
-
- val dummyISRScheduler = inchronModelFactory.createScheduler
-
- /*-Adding Dummy scheduler to RtosConfig element of Inchron */
-
- genericSystem.rtosConfig.schedulables.add(dummyISRScheduler)
-
- val MappingModel amltMappingModel = amalthea.mappingModel
-
- if (amltMappingModel != null) {
-
- /*-Building cache for TaskScheduler <---> and SchedulerAssociation's */
-
- cacheModel.buildTaskSchedulerAndSchedulerAssociationMap(amltMappingModel)
-
- /*-Building cache for TaskScheduler <---> and TaskAllocation's */
-
- cacheModel.buildTaskSchedulerAndTaskAllocationMap(amltMappingModel)
-
- /*- Collecting all the root TaskScheduler's */
-
- val rootTaskSchedulers = amltMappingModel?.schedulerAllocation?.map [ amltSchedulerAllocation |
-
- if (amltSchedulerAllocation.scheduler instanceof TaskScheduler) {
- return (amltSchedulerAllocation.scheduler as TaskScheduler).rootScheduler
- }
-
- ].toSet.filter[it != null]
-
- /*-Case 1: Fetching all the Amalthea SchedulerAllocation objects from Amalthea */
-
- amltMappingModel?.schedulerAllocation?.forEach [ amltSchAllocation |
-
- /*- Considering only if the associated scheduler is TaskScheduler */
-
- if (amltSchAllocation.scheduler instanceof TaskScheduler) {
-
- /*- getting Root scheduler */
- var rootScheduler = getRootScheduler(amltSchAllocation.scheduler as TaskScheduler)
-
- /*- gettting the ProcessingUnit from the responsibility of SchedulerAllocation*/
-
- if (amltSchAllocation?.responsibility.size > 0) {
-
- /*- Based on the Amalthea model, eContainer of ProcessingUnit is HwStructure of type MicroController */
-
- var amltMicroController = amltSchAllocation?.responsibility?.get(0)?.eContainer
-
- if ((amltMicroController != null) && (amltMicroController instanceof HwStructure) && (amltMicroController as HwStructure).structureType==StructureType.MICROCONTROLLER ){
-
- /*- Based on the extend behaviour, if create method is invoked - with the same parameters again and again -> it does caching and returns back the already created object from cache */
-
- var inchronCpu = HWTransformerInstance.createCpu(amltMicroController as HwStructure)
-
- if (inchronCpu != null) {
-
- if(inchronCpu.eContainer==null){
- inchronModel.cpus.add(inchronCpu)
- }
-
- }
-
- /*-Adding the root scheduler to dummy ISR Scheduler */
-
- dummyISRScheduler.schedulables.add(OSTransformerInstance.createRootScheduler(rootScheduler))
- }
-
- } else {
- logger.info(amltSchAllocation + " " + amltSchAllocation.scheduler)
- }
-
- }
- ]
-
- /*-Case 2: Fetching all the Amalthea ISRAllocation objects from Amalthea */
-
- amltMappingModel?.isrAllocation?.forEach [ amltISRAllocation |
-
- var amltISR = amltISRAllocation.isr
-
- /*-Fetching InterruptController from ISRAllocation element */
-
- var amltInterruptController = amltISRAllocation.controller
-
- if (amltInterruptController != null) {
-
- var AmltCacheModel amltCacheModel = customObjsStore.getInstance(AmltCacheModel)
-
- //TODO: Clarify this .. why to get SchedulerAllocation again when ISRAllocation is already present
- var amltSchedulerAllocation = amltCacheModel.taskScheduler_SchedulerAllocationMap.get(
- amltInterruptController)
-
- if (amltSchedulerAllocation != null) {
-
- if (amltSchedulerAllocation.executingPU != null) {
-
- /*-get executing Core from SchedulerAllocation */
- var amltExecutingCore = amltSchedulerAllocation.executingPU
-
- if(amltExecutingCore!=null){
- val amltMicroController= amltExecutingCore.eContainer
-
- // RootISRScheduler should be unique for each MicroController
- val inchronRootISRScheduler = OSTransformerInstance.createRootISRScheduler(
- amltMicroController as HwStructure)
-
- /*-creating inchron Cpu element from the MicroController element in Amalthea model*/
- var inchronCpu = HWTransformerInstance.createCpu(
- amltExecutingCore.eContainer as HwStructure)
-
- /*-Below check is made, if Inchron CPU object is already associated to Inchron model !! If not associating it explicitly */
- if(inchronCpu.eContainer==null){
- inchronModel.cpus.add(inchronCpu)
- }
-
- // TODO: clarify if Inchron root ISRScheduler can be added in HyperVisorConfig - vmSchedulers list
- dummyISRScheduler.schedulables.add(inchronRootISRScheduler)
-
- var inchronCpuCore = HWTransformerInstance.createCpuCore(
- amltExecutingCore)
-
- /*-Below check is made, if Inchron CpuCore object is already associated to Inchron Cpu !! If not associating it explicitly */
-
- if(inchronCpuCore.eContainer==null){
- inchronCpu.cores.add(inchronCpuCore)
- }
-
- /*- Creating a Process from ISR */
- var inchronProcess = SWTransformerInstance.createProcess(amltISR)
-
- // setting the priority from amlt ISRAllocation
- inchronProcess.priority = amltISRAllocation.priority
-
- /*-Associating CpuCore to Process */
- inchronProcess.cpuCores.add(inchronCpuCore)
-
- // adding all the amlt ISR's as Processes to root ISR scheduler
- inchronRootISRScheduler.schedulables.add(inchronProcess)
- }
-
- }
-
- }
- }
- ]
-
- }
-
-
-
- }
-
-
-/**
- * This method is used to create a Inchron Semaphore object from Amalthea Semaphore
- */
- public def create inchronModelFactory.createSemaphore createSemaphore(Semaphore amltSemaphore) {
- it.initialValue = amltSemaphore.initialValue;
- it.maxValue = amltSemaphore.maxValue;
- it.name = amltSemaphore.name;
- }
-
- /**
- * This method is used to return the root TaskScheduler object
- */
- def TaskScheduler getRootScheduler(TaskScheduler sch) {
-
- if (sch.parentScheduler == null) {
- return sch
- }
- return getRootScheduler(sch.parentScheduler)
- }
-
-/**
- * This method is used to create a Root ISR Scheduler object from Amalthea HwStructure (of type MicroController)
- */
- public def create inchronModelFactory.createScheduler createRootISRScheduler(HwStructure amltMicroController) {
- it.name = "Root-ISR" + "_" + amltMicroController.name
- }
-
-/**
- * This method is used to create Inchron Root Scheduler object from Amalthea TaskScheduler
- * <br>
- * Additional things performed in this method are :
- * <br>1. creation of child Schedulers for corresponding childAssociations to Amalthea Scheduler
- * <br>2. Processing through TaskAllocations of a Amalthea scheduler and creating Inchron Process element
- * <br>3. Processing through SchedulerAssociations of a Amalthea scheduler and creating Inchron CpuCore elements.. and associating them to the the Scheduler object
- *
- */
-
- public def create inchronModelFactory.createScheduler createRootScheduler(TaskScheduler amltTaskScheduler) {
-
- it.name = amltTaskScheduler.name
-
- var amltSchedulingAlgorithm = amltTaskScheduler.schedulingAlgorithm
-
- if (amltSchedulingAlgorithm instanceof FixedPriorityPreemptive) {
- it.strategy = SchedulerStrategy.FIXED_PRIORITY
- }
- if (amltSchedulingAlgorithm instanceof OSEK) {
- it.strategy = SchedulerStrategy.OSEK
- }
-
- /* ============ building Inchron child Scheduler elements ======================== */
-
- amltTaskScheduler.childAssociations.forEach [ amltChildSchedulerAssociation |
-
- if (amltChildSchedulerAssociation.child instanceof TaskScheduler) {
- var amltSchedulingParameters = amltChildSchedulerAssociation.schedulingParameters
-
- var amltSubSchedulerPrio = 0
-
- if (amltSchedulingParameters != null) {
- amltSubSchedulerPrio = amltSchedulingParameters.priority
- }
- schedulables.add(
- createScheduler(amltChildSchedulerAssociation.child as TaskScheduler, amltSubSchedulerPrio))
-
- }
-
- ]
-
- /* ============ building Inchron Process elements and associating to the Scheduler object ======================== */
-
- var AmltCacheModel amltCacheModel = customObjsStore.getInstance(AmltCacheModel)
-
- //fetching all TaskAllocations associated to a specific TaskScheduler
- var taskAllocations = amltCacheModel.taskScheduler_TaskAllocationMap.get(amltTaskScheduler)
-
- if (taskAllocations != null) {
- taskAllocations.forEach [ amltTaskAllocation |
-
- var process = SWTransformerInstance.createProcess(amltTaskAllocation.task)
- // adding a created process inside the schedulables list of inchron scheduler
- it.schedulables.add(process)
-
- if (amltTaskAllocation?.schedulingParameters != null) {
- process.priority = amltTaskAllocation?.schedulingParameters?.priority
-
- }
- ]
- }
- /* ============ building Inchron CpuCore elements and associating to the Scheduler object ======================== */
-
- var amltSchedulerAllocation = amltCacheModel.getTaskScheduler_SchedulerAllocationMap.get(amltTaskScheduler)
-
- if (amltSchedulerAllocation != null) {
-
- amltSchedulerAllocation.responsibility.forEach [ amltcore |
- // associating CpuCore to HyperVisorSystemSchedulable
- it.cpuCores.add(HWTransformerInstance.createCpuCore(amltcore))
- ]
- }
-
- }
-
- @Deprecated
- public def create inchronModelFactory.createScheduler createSubScheduler(
- SchedulerAssociation amltSchedulerAssociation) {
-
- // TODO: create virtual system (use ARSystem instead of OSEK System), create coreMappings, schedulingParameters
- var amltChildScheduler = amltSchedulerAssociation.child
-
- // get the appropriate SchedulerAssociation to identify on which Core this scheduler is mapped
- var AmltCacheModel cacheModel = customObjsStore.getInstance(AmltCacheModel)
-
- var amltChildSchedulerAllocation = cacheModel.getTaskScheduler_SchedulerAllocationMap.get(amltChildScheduler)
-
- if (amltChildSchedulerAllocation != null) {
-
- name = amltChildSchedulerAllocation.scheduler?.name
-
- amltChildSchedulerAllocation.responsibility.forEach [ amltcore |
- // associating CpuCore to HyperVisorSystemSchedulable
- it.cpuCores.add(HWTransformerInstance.createCpuCore(amltcore))
- ]
- }
-
- }
-
-/**
- * This method is used to create Inchron Scheduler object from Amalthea TaskScheduler
- * <br>
- * Additional things performed in this method are :
- * <br>1. creation of child Schedulers for corresponding childAssociations to Amalthea Scheduler
- * <br>2. Processing through TaskAllocations of a Amalthea scheduler and creating Inchron Process element
- * <br>3. Processing through SchedulerAssociations of a Amalthea scheduler and creating Inchron CpuCore elements.. and associating them to the the Scheduler object
- *
- */
- public def create inchronModelFactory.createScheduler createScheduler(TaskScheduler amltTaskScheduler,
- int priority) {
- it.name = amltTaskScheduler.name
-
- it.priority = priority
-
- var amltSchedulingAlgorithm = amltTaskScheduler.schedulingAlgorithm
-
- //TODO: Mostly the same for the root -- point for harmonization?
-
- if (amltSchedulingAlgorithm instanceof FixedPriorityPreemptive) {
- it.strategy = SchedulerStrategy.FIXED_PRIORITY
- }
- if (amltSchedulingAlgorithm instanceof OSEK) {
- it.strategy = SchedulerStrategy.OSEK
- }
-
- /* ============ building Inchron child Scheduler elements ======================== */
-
- // TODO: add if conditions for all the sub classes of TaskSchedulingAlgorithm
- amltTaskScheduler.childAssociations.forEach [ amltChildAssociation |
-
- if (amltChildAssociation.child instanceof TaskScheduler) {
- var amltSchedulingParameters = amltChildAssociation.schedulingParameters
-
- var amltSubSchedulerPrio = 0
-
- if (amltSchedulingParameters != null) {
- amltSubSchedulerPrio = amltSchedulingParameters.priority
- }
- it.schedulables.add(createScheduler(amltChildAssociation.child as TaskScheduler, amltSubSchedulerPrio))
-
- }
-
- ]
-
-
- /* ============ building Inchron Process elements and associating to the Scheduler object ======================== */
-
-
- var AmltCacheModel amltCacheModel = customObjsStore.getInstance(AmltCacheModel)
-
- // fetching all TaskAllocations associated to a specific TaskScheduler
- var taskAllocations = amltCacheModel.taskScheduler_TaskAllocationMap.get(amltTaskScheduler)
-
- if (taskAllocations != null) {
- taskAllocations.forEach [ amltTaskAllocation |
-
- var process = SWTransformerInstance.createProcess(amltTaskAllocation.task)
- // adding a created process inside the schedulables list of inchron scheduler
- it.schedulables.add(process)
-
- if (amltTaskAllocation?.schedulingParameters != null) {
- process.priority = amltTaskAllocation?.schedulingParameters?.priority
-
- }
- ]
- }
-
- /* ============ building Inchron CpuCore elements and associating to the Scheduler object ======================== */
-
- var amltChildSchedulerAllocation = amltCacheModel.getTaskScheduler_SchedulerAllocationMap.get(amltTaskScheduler)
-
- if (amltChildSchedulerAllocation != null) {
-
- name = amltChildSchedulerAllocation.scheduler?.name
-
- amltChildSchedulerAllocation.responsibility.forEach [ amltcore |
- // associating CpuCore to HyperVisorSystemSchedulable
- it.cpuCores.add(HWTransformerInstance.createCpuCore(amltcore))
- ]
- }
- }
-
-}
diff --git a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/src/templates/SWTransformer.xtend b/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/src/templates/SWTransformer.xtend
deleted file mode 100644
index fcaf471..0000000
--- a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/src/templates/SWTransformer.xtend
+++ /dev/null
@@ -1,537 +0,0 @@
-package templates
-
-import com.inchron.realtime.root.model.CallSequenceItem
-import com.inchron.realtime.root.model.GenericSystem
-import com.inchron.realtime.root.model.SemaphoreAccessType
-import com.inchron.realtime.root.model.TimeDistributionType
-import com.inchron.realtime.root.model.TimeUnit
-import java.util.ArrayList
-import java.util.List
-import java.util.Set
-import org.eclipse.app4mc.amalthea.model.Amalthea
-import org.eclipse.app4mc.amalthea.model.AsynchronousServerCall
-import org.eclipse.app4mc.amalthea.model.CallGraph
-import org.eclipse.app4mc.amalthea.model.CallSequence
-import org.eclipse.app4mc.amalthea.model.ChannelReceive
-import org.eclipse.app4mc.amalthea.model.ChannelSend
-import org.eclipse.app4mc.amalthea.model.CustomEventTrigger
-import org.eclipse.app4mc.amalthea.model.ExecutionNeed
-import org.eclipse.app4mc.amalthea.model.Group
-import org.eclipse.app4mc.amalthea.model.HwFeature
-import org.eclipse.app4mc.amalthea.model.ISR
-import org.eclipse.app4mc.amalthea.model.InterProcessTrigger
-import org.eclipse.app4mc.amalthea.model.LabelAccess
-import org.eclipse.app4mc.amalthea.model.ModeLabelAccess
-import org.eclipse.app4mc.amalthea.model.ModeSwitch
-import org.eclipse.app4mc.amalthea.model.Need
-import org.eclipse.app4mc.amalthea.model.NeedConstant
-import org.eclipse.app4mc.amalthea.model.NeedDeviation
-import org.eclipse.app4mc.amalthea.model.Preemption
-import org.eclipse.app4mc.amalthea.model.ProbabilitySwitch
-import org.eclipse.app4mc.amalthea.model.Process
-import org.eclipse.app4mc.amalthea.model.ProcessingUnit
-import org.eclipse.app4mc.amalthea.model.Runnable
-import org.eclipse.app4mc.amalthea.model.RunnableCall
-import org.eclipse.app4mc.amalthea.model.RunnableModeSwitch
-import org.eclipse.app4mc.amalthea.model.RunnableProbabilitySwitch
-import org.eclipse.app4mc.amalthea.model.SemaphoreAccess
-import org.eclipse.app4mc.amalthea.model.SemaphoreAccessEnum
-import org.eclipse.app4mc.amalthea.model.SenderReceiverRead
-import org.eclipse.app4mc.amalthea.model.SenderReceiverWrite
-import org.eclipse.app4mc.amalthea.model.SynchronousServerCall
-import org.eclipse.app4mc.amalthea.model.Task
-import org.eclipse.app4mc.amalthea.model.TaskRunnableCall
-import org.eclipse.app4mc.amalthea.model.Time
-import org.eclipse.app4mc.amalthea.model.util.DeploymentUtil
-import org.eclipse.app4mc.amalthea.model.util.RuntimeUtil
-import org.eclipse.app4mc.amalthea.model.util.RuntimeUtil.TimeType
-import org.eclipse.emf.common.util.EMap
-import org.eclipse.emf.ecore.util.EcoreUtil
-import templates.utils.AmltCacheModel
-
-/**
- * This class is responsible to convert Amalthea SW Model eleemnts to corresponding Inchron elements and invoke other transformation classes
- */
-public class SWTransformer extends AbstractAmaltheaInchronTransformer {
-
- /**
- * Creating a Inchron Process element from Amalthea ISR element
- */
- def create inchronModelFactory.createProcess createProcess(ISR amltISR){
- it.isr = true
- it.name=amltISR.name
- /*-Building a cache of Stimuli name and the "List of Process" elements to which it is associated to */
- val AmltCacheModel amltCache=customObjsStore.getInstance(AmltCacheModel)
- amltISR.stimuli.forEach[stimuli |
- amltCache.cacheAmltStimuliInchronProcessMap(stimuli.getName, it)
- ]
-
- }
-
-
- /**
- * Creating a Inchron Process element from Amalthea Task element
- */
- def create inchronModelFactory.createProcess createProcess(Task amltTask){
- it.isr = false
- it.name=amltTask.name
-
- //TODO: schedule between runnables for co-operative
- if(amltTask.preemption == Preemption.NON_PREEMPTIVE || amltTask.preemption == Preemption.COOPERATIVE){
- it.preemptable=false
- }else{
- it.preemptable=true
- }
-
- if(amltTask.callGraph !=null){
- /*-building a inchron CallGraph element from amalthea CallGraph */
- it.callGraph=createCallGraph(amltTask.callGraph)
- }
-
- /*-Building a cache of Stimuli name and the "List of Process" elements to which it is associated to */
- val AmltCacheModel amltCache=customObjsStore.getInstance(AmltCacheModel)
- amltTask.stimuli.forEach[stimuli |
- amltCache.cacheAmltStimuliInchronProcessMap(stimuli.getName, it)
- ]
-
- }
-
- /**
- * This method is used to create a Inchron CallGraph element from Amalthea CallGraph element
- */
- def create inchronModelFactory.createCallGraph createCallGraph(CallGraph amltCallGraph){
-
- amltCallGraph.graphEntries.forEach[amltGraphEntry|
-
- if(amltGraphEntry instanceof CallSequence){
-
- it.graphEntries.add(createCallSequence(amltGraphEntry as CallSequence))
-
- }else if(amltGraphEntry instanceof ModeSwitch){
- it.graphEntries.add(createModeSwitch(amltGraphEntry as ModeSwitch))
-
- }else if(amltGraphEntry instanceof ProbabilitySwitch){
- it.graphEntries.add(createProbabilitySwitch(amltGraphEntry as ProbabilitySwitch))
-
- }
- ]
-
- }
-
- /**
- * This method is used to create inchron CallSequence object from Amalthea CallSequence element.
- *
- * Below are the CallSequence items are currently supported:
- * <br>1.TaskRunnableCall
- * <br>2.InterProcessTrigger
- *
- */
- def create inchronModelFactory.createCallSequence createCallSequence(CallSequence amltCallSequence){
- it.name=amltCallSequence.name
- amltCallSequence?.calls.forEach[amltCallsequenceItem|
-
- //todo: handle other CallSequenceItem's
-
- if(amltCallsequenceItem instanceof TaskRunnableCall){
-
- it.calls.add(createFunctionCall(amltCallsequenceItem as TaskRunnableCall))
- }
-
- if (amltCallsequenceItem instanceof InterProcessTrigger) {
- it.calls.add(createActivationItem(amltCallsequenceItem as InterProcessTrigger))
- }
- ]
- }
-
- /**
- * This method is used to create inchron InterProcessTrigger element from Amalthea ActivationItem element
- */
- def create inchronModelFactory.createActivationItem createActivationItem(InterProcessTrigger trigger) {
-
- val AmltCacheModel amltCache=customObjsStore.getInstance(AmltCacheModel)
-
- val tasks = amltCache.interProcessTriggerRelationsMap.get(trigger.stimulus.name);
-
- val inchronConnection=amltCache.inchronConnectionElementsMap.get(trigger.stimulus.name)
-
- it.connection =inchronConnection
-
- if(tasks !=null){
- for ( task : tasks) {
- val inchronActivateProcess=createActivateProcess(trigger, task as Task)
- inchronConnection.activations.add(inchronActivateProcess)
- }
-
- }else{
- //Note: This is the case where Stimulus is not InterProcessStimulus or there are no Process elements to which this stimulus is triggering
- }
-
- }
-
- /**
- * This method is used to create inchron ActivateProcess element from Amalthea InterProcessTrigger
- */
- def create inchronModelFactory.createActivateProcess createActivateProcess(InterProcessTrigger trigger, Task amltTask) {
-
- it.target = createProcess(amltTask);
- it.offset = trigger.counter.offset as int
- it.period = trigger.counter.prescaler as int
- }
-
-
- def create inchronModelFactory.createModeSwitch createModeSwitch(ModeSwitch amltModeSwitch){
- //TODO: need to enhance it in near future
- }
-
- def create inchronModelFactory.createProbabilitySwitch createProbabilitySwitch(ProbabilitySwitch amltProbabilitySwitch){
- //TODO: need to enhance it in near future
- }
-
- /**
- * This method is used to create inchron FunctionCall element from RunnableCall element
- */
- def create inchronModelFactory.createFunctionCall createFunctionCall(RunnableCall amltRunnableCall){
-
- var amltProcess=amltRunnableCall.getParentContainer(Process)
-
- var inchronComponent=createComponent(amltProcess)
-
-
- val inchronGenericSystem= getInchronGenericSystem(amltProcess)
-
- if(inchronGenericSystem !=null){
- inchronGenericSystem.components.add(inchronComponent)
-
- }
-
- var inchronFunction=createFunction(amltProcess, amltRunnableCall.runnable)
-
- inchronComponent.functions.add(inchronFunction)
-
- it.function=inchronFunction
- }
-
-
- /**
- * This method is used to create inchron FunctionCall element from TaskRunnableCall element
- */
- def create inchronModelFactory.createFunctionCall createFunctionCall(TaskRunnableCall amltTaskRunnableCall){
-
- var amltProcess=amltTaskRunnableCall.getParentContainer(Process)
-
- var inchronComponent=createComponent(amltProcess)
-
- val inchronGenericSystem= getInchronGenericSystem(amltProcess)
-
- if(inchronGenericSystem !=null){
- inchronGenericSystem.components.add(inchronComponent)
-
- }
-
- var inchronFunction=createFunction(amltProcess, amltTaskRunnableCall.runnable)
-
- it.function=inchronFunction
-
- inchronComponent.functions.add(inchronFunction)
-
- it.offset=amltTaskRunnableCall?.counter?.offset.intValue
-
- it.period=amltTaskRunnableCall?.counter?.prescaler.intValue
- }
-
- /**
- * This method is used to fetch the inchron GenericSystem object for a specific Amalthea Process element
- */
- def GenericSystem getInchronGenericSystem(Process amltProcess) {
-
- val Set<ProcessingUnit> cores=DeploymentUtil.getAssignedCoreForProcess(amltProcess as Process, EcoreUtil.getRootContainer(amltProcess) as Amalthea)
-
- val AmltCacheModel amltCache=customObjsStore.getInstance(AmltCacheModel)
-
- //TODO: write validaiton to assure that only 1 core is present
-
- //TODO: currently taking 1st core
-
- if(cores.size>0){
- //TODO: clarify if this approach is OK !!
- val amltCore=cores.get(0)
-
- val amltMicroController=amltCore.eContainer
-
- val inchronGenericSystem=amltCache.mappingAmltMicroController_GenericSystem.get(amltMicroController)
-
- return inchronGenericSystem
- }
- }
-
-
- def create inchronModelFactory.createComponent createComponent(Process amltProcess){
-
- it.name=amltProcess.name
- }
-
- def create inchronModelFactory.createFunction createFunction(Process amltProcess, Runnable amltRunnable){
-
- it.name=amltRunnable.name
-
- it.callGraph=inchronModelFactory.createCallGraph
-
- val inchronCallSequence=inchronModelFactory.createCallSequence
-
- it.callGraph.graphEntries.add(inchronCallSequence)
-
- amltRunnable?.runnableItems.forEach[amltRunnableItem|
-
- if(amltRunnableItem instanceof AsynchronousServerCall){
-
- }
- else if(amltRunnableItem instanceof ChannelReceive){
-
- }
- else if(amltRunnableItem instanceof ChannelSend){
-
- }
- else if(amltRunnableItem instanceof CustomEventTrigger){
-
- }
- else if(amltRunnableItem instanceof Group){
-
- }
- else if(amltRunnableItem instanceof LabelAccess){
-
- }
- else if(amltRunnableItem instanceof ModeLabelAccess){
-
- }
- else if(amltRunnableItem instanceof RunnableCall){
-
- inchronCallSequence.calls.add(createFunctionCall( amltRunnableItem))
-
-
- }else if(amltRunnableItem instanceof ExecutionNeed){//Earlier it was RunnableInstructions
-
- inchronCallSequence.calls.add(createResourceConsumption(amltProcess, amltRunnableItem))
- }
- else if(amltRunnableItem instanceof RunnableModeSwitch){
-
- }
- else if(amltRunnableItem instanceof RunnableProbabilitySwitch){
-
- }
- else if(amltRunnableItem instanceof SemaphoreAccess){
- inchronCallSequence.calls.addAll(semaphoreInterruptCreation(amltRunnableItem))
- }
-
- else if(amltRunnableItem instanceof SenderReceiverRead){
-
- }
- else if(amltRunnableItem instanceof SenderReceiverWrite){
-
- }
- else if(amltRunnableItem instanceof SynchronousServerCall){
-
- }
- ]
- }
-
- def create inchronModelFactory.createSemaphoreAccess createSemaphoreAccess(SemaphoreAccess amltAccess) {
-
- val AmltCacheModel amltCache=customObjsStore.getInstance(AmltCacheModel)
-
- val amltSemaphoreName=amltAccess?.semaphore?.name
-
- //TODO CREATE THIS THE RIGHT WAY!
- var inchronSemaphore = amltCache.getInchronSemaphoreCacheElement(amltSemaphoreName)// = createSemaphore(amltSemaphore);
- //SemaphoreAccessType.;
- //amltAccess.access;
-
- switch (amltAccess.access) {
- case SemaphoreAccessEnum.RELEASE: {
- it.type = SemaphoreAccessType.RELEASE
- }
- case SemaphoreAccessEnum.EXCLUSIVE: {
- it.type = SemaphoreAccessType.EXCLUSIVE
- }
- case SemaphoreAccessEnum.REQUEST : {
- it.type = SemaphoreAccessType.REQUEST
- }
- }
- it.semaphore = inchronSemaphore;
-
-
- }
-
- def List<CallSequenceItem> semaphoreInterruptCreation(SemaphoreAccess amltAccess){
-
- val List<CallSequenceItem> items=new ArrayList
-
- switch (amltAccess.access) {
-
- case SemaphoreAccessEnum.RELEASE: {
-
- items.add(createSemaphoreAccess(amltAccess))
-
- items.add(createResumeAllInterrupts(amltAccess))
-
- }
- case SemaphoreAccessEnum.EXCLUSIVE: {
- //TODO:check semantics
- items.add(createSuspendAllInterrupts(amltAccess))
- items.add(createSemaphoreAccess(amltAccess))
-
- }
- case SemaphoreAccessEnum.REQUEST : {
-
- items.add(createSuspendAllInterrupts(amltAccess))
- items.add(createSemaphoreAccess(amltAccess))
-
-
- }
- }
- return items
- }
-
- /*
- * LL: SemaphoreAccess object should be mandatorily supplied here, as Xtend caches the elements based on input parameters
- */
- def create inchronModelFactory.createSuspendAllInterrupts createSuspendAllInterrupts(SemaphoreAccess amltAccess) {
- it.offset=0
- it.period=0
- }
-
- /*
- * LL: SemaphoreAccess object should be mandatorily supplied here, as Xtend caches the elements based on input parameters
- */
- def create inchronModelFactory.createResumeAllInterrupts createResumeAllInterrupts(SemaphoreAccess amltAccess) {
- it.offset=0
- it.period=0
- }
-
-
- def create inchronModelFactory.createResourceConsumption createResourceConsumption(Process amltProcess, ExecutionNeed amltRunnableInstructions){
- val AmltCacheModel amltCache=customObjsStore.getInstance(AmltCacheModel)
-
-
- if(amltProcess instanceof Task){
-
-
- var listOfTaskAllocations=amltCache.tasks_TaskAllocationMap.get(amltProcess as Task)
-
- listOfTaskAllocations?.forEach[amltTaskAllocation|
- var amltScheduler=amltTaskAllocation.scheduler
-
- var amltSchedulerAllocation=amltCache.taskScheduler_schedulerAllocationMap.get(amltScheduler)
-
- //TODO: What if affinity is not set and core should be derived from SchedulerMapping?
- var List cores1=amltTaskAllocation.affinity
-
- var List cores2 =(amltSchedulerAllocation.responsibility)
-
- //to obtain only common Core objects across both lists
- cores1.retainAll(cores2)
-
- //TODO: write assumptions about core mapping of tasks (if it is 1 to 1 mapping ?)
-
- if(cores1.size==1){
- var timeDistribution=inchronModelFactory.createTimeDistribution
- //TODO: uniform as a starting point --- more complex distributions need to be simulated
- timeDistribution.type = TimeDistributionType.UNIFORM
- timeDistribution.bcet = getRuntimeForRunnableInstruction(amltRunnableInstructions, TimeType.BCET, cores1.get(0) as ProcessingUnit);
- timeDistribution.wcet = getRuntimeForRunnableInstruction(amltRunnableInstructions, TimeType.WCET, cores1.get(0) as ProcessingUnit);
- timeDistribution.mean = getRuntimeForRunnableInstruction(amltRunnableInstructions, TimeType.ACET, cores1.get(0) as ProcessingUnit);
- it.timeDistribution = timeDistribution
-
- }
- ]
- }
- }
-
-
-
- //TODO: Check if some of this methods can be part of AMALTHEA
- //TODO: set getInstructionCountForInstruction to public in APP4MC UTILS
- def com.inchron.realtime.root.model.Time getRuntimeForRunnableInstruction(ExecutionNeed amltRunnableInstructions, TimeType timeType, ProcessingUnit core) {
- //TODO: handle extended instructions
- var amltInstructions = getInstructionCountForInstruction(amltRunnableInstructions.^default, timeType);
- val hwFeatureFromExecutionNeed = getHwFeatureFromExecutionNeed(amltRunnableInstructions,core)
- var amltTime = RuntimeUtil.getExecutionTimeForExecutionNeedValueCount(amltInstructions, core, hwFeatureFromExecutionNeed,null);
- return getInchronTimeValue(amltTime);
-
- }
-
- def HwFeature getHwFeatureFromExecutionNeed(ExecutionNeed executionNeed, ProcessingUnit processingUnit){
-
- val EMap<String, Need> defaultMap = executionNeed.^default
-
- if(defaultMap.size>0){
- val processingUnitDefinition = processingUnit.definition
- if(processingUnitDefinition!=null){
- for(feature: processingUnitDefinition?.features){
- //TODO:At present supporting only HwFeatureCategory with name "Instructions"
- if(feature.containingCategory?.name.equals("Instructions")){
- return feature
- }
- }
- }
- }
-
- return null
- }
-
- def Long getInstructionCountForInstruction(EMap<String, Need> defaultMap, TimeType execTimeType) {
-
-
- for(need: defaultMap.values){
- if(need instanceof NeedDeviation) {
- var NeedDeviation instDeviation = need as NeedDeviation ;
- switch(execTimeType) {
- case ACET: {
- return RuntimeUtil.getMean(instDeviation.getDeviation().getDistribution(), instDeviation.getDeviation().getLowerBound().getValue(), instDeviation.getDeviation().getUpperBound().getValue())
- }
- case BCET: {
- return instDeviation.getDeviation().getLowerBound().getValue()
- }
- case WCET: {
- return instDeviation.getDeviation().getUpperBound().getValue();
- }
- default:
- return RuntimeUtil.getMean(instDeviation.getDeviation().getDistribution(), instDeviation.getDeviation().getLowerBound().getValue(), instDeviation.getDeviation().getUpperBound().getValue())
-
-
- }
- } else if(need instanceof NeedConstant) {
- return (need as NeedConstant).getValue();
- }
-
- }
-
-
- return 0L;
- }
-
- def com.inchron.realtime.root.model.Time getInchronTimeValue(Time amltTime) {
- var result = inchronModelFactory.createTime
-
- result.value = amltTime.value.longValue;
- switch (amltTime.unit.getName) {
- case "s": {
- result.unit = TimeUnit.S
- }
- case "ms": {
- result.unit = TimeUnit.MS
- }
- case "us": {
- result.unit = TimeUnit.US
- }
- case "ns": {
- result.unit = TimeUnit.NS
- }
- case "ps": {
- result.unit = TimeUnit.PS
- }
- }
- return result;
- }
-
-
-}
diff --git a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/src/templates/StimuliTransformer.xtend b/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/src/templates/StimuliTransformer.xtend
deleted file mode 100644
index 622ef9e..0000000
--- a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/src/templates/StimuliTransformer.xtend
+++ /dev/null
@@ -1,163 +0,0 @@
-package templates
-
-import com.inchron.realtime.root.model.Model
-import com.inchron.realtime.root.model.ModelFactory
-import com.inchron.realtime.root.model.TimeUnit
-import java.util.List
-import java.util.Map
-import org.eclipse.app4mc.amalthea.model.Amalthea
-import org.eclipse.app4mc.amalthea.model.InterProcessStimulus
-import org.eclipse.app4mc.amalthea.model.PeriodicStimulus
-import org.eclipse.app4mc.amalthea.model.Stimulus
-import org.eclipse.app4mc.amalthea.model.Task
-import org.eclipse.app4mc.amalthea.model.Time
-import org.eclipse.emf.common.util.EList
-import templates.utils.AmltCacheModel
-
-public class StimuliTransformer extends AbstractAmaltheaInchronTransformer {
-
- /**
- * This method is used to perform following:
- *
- * <br>1.Build a cache of "InterProcess Stimuli name" and "List of Tasks" which are triggered by it
- * <br>2.Create ActivationConnection for each InterProcessStimulus
- */
- public def void createInchronActivationConnections(EList<Task> amltTasks,Model inchronModel){
-
- val AmltCacheModel amltCache=customObjsStore.getInstance(AmltCacheModel)
-
- for (process : amltTasks) {
- process.stimuli.forEach[stimuli | {
- if(stimuli instanceof InterProcessStimulus){
- amltCache.cacheInterProcessTriggerRelations(stimuli.name, process)
- }
-
- }]
- }
-
- /*-For each InterProcessStimulus, create corresponding ActivationConnection in Inchron and store this info in the cache */
-
- amltCache.interProcessTriggerRelationsMap.keySet.forEach[stimuliName|{
-
- val inchronConnection=ModelFactory.eINSTANCE.createActivationConnection
-
- inchronConnection.name=stimuliName
-
- /*-Adding ActivationConnect object to Inchron Model */
- inchronModel.connections.add(inchronConnection)
-
- /*-Adding ActivationConnect object to Cache */
- amltCache.cacheInchronConnection(stimuliName,inchronConnection)
-
-
- }]
-
- }
- /**
- * This method is used to create SimulationScenario based on Periodic Stimulus objects present in Amalthea model
- */
- public def create inchronStimulationFactory.createStimulationScenario createstimulationScenario(Amalthea amaltheaModel) {
- val AmltCacheModel amltCache=customObjsStore.getInstance(AmltCacheModel)
-
- val Map<String, List<com.inchron.realtime.root.model.Process>> stimuliCache = amltCache.amltStimuliInchronProcessElementsMap;
-
- for (Stimulus stimuli : amaltheaModel?.stimuliModel?.stimuli) {
-
- if (stimuli instanceof PeriodicStimulus) {
-
- val inchronProcessList = stimuliCache.get(stimuli.name)
-
- if (inchronProcessList != null) {
-
- for (com.inchron.realtime.root.model.Process inchronProcess : inchronProcessList) {
-
- it.generators.add(createRandomStimuliGenerator(stimuli, inchronProcess))
- }
-
- }
- }
-
- }
- }
-
- /**
- * This method is used to create RandomStimuliGenerator object, based on the Amalthea PeriodicStimulus object and Inchron Process object
- */
- public def create inchronStimulationFactory.createRandomStimuliGenerator createRandomStimuliGenerator(PeriodicStimulus amltStimuli, com.inchron.realtime.root.model.Process inchronProcess) {
- if (amltStimuli?.minDistance != null)
- it.minInterArrivalTime = getInchronTimeValue(amltStimuli?.minDistance)
- it.period = getInchronTimeValue(amltStimuli.recurrence)
- it.startOffset = getInchronTimeValue(amltStimuli?.offset)
- //it.clock; //need the clock
- it.relative = false; //only for sporadics
- it.iterations = -1 //right?
- //it.startOffsetVariation; //don't know
-
- /**
- * Since 2.98.2 the CallGraph has been adopted for modeling of a
- * StimulationGenerator's target (giving it the same flexibility like in Function
- * and Process).
- * Hence, in order to refer to a process we setup a minimum CallGraph
- * with a single ActivationAction.
- */
-
- var activationAction = inchronModelFactory.createActivateProcess
- activationAction.setTarget( inchronProcess )
-
- var connection = inchronModelFactory.createActivationConnection
- connection.getActivations().add( activationAction )
-
- var activationItem = inchronModelFactory.createActivationItem
- activationItem.setConnection( connection )
-
- var callSequence = inchronModelFactory.createCallSequence
- callSequence.getCalls().add( activationItem )
-
- var callGraph = inchronModelFactory.createCallGraph
- callGraph.getGraphEntries().add( callSequence )
-
- it.getConnections().add( connection )
- it.setTargets( callGraph )
-
- //it.variation
-
- //jitter
- if (amltStimuli?.jitter != null) {
- var timeDistribution=inchronModelFactory.createTimeDistribution
- if (amltStimuli?.jitter?.lowerBound != null) {
- timeDistribution.bcet = getInchronTimeValue(amltStimuli?.jitter?.lowerBound)
- }
- if (amltStimuli?.jitter?.upperBound != null) {
- timeDistribution.wcet = getInchronTimeValue(amltStimuli?.jitter?.upperBound)
- }
-
- //TODO: handle more complex distributions
- it.variation = timeDistribution
- }
- }
-
- def com.inchron.realtime.root.model.Time getInchronTimeValue(Time amltTime) {
- var result = inchronModelFactory.createTime
-
- result.value = amltTime.value.longValue;
- switch (amltTime.unit.getName) {
- case "s": {
- result.unit = TimeUnit.S
- }
- case "ms": {
- result.unit = TimeUnit.MS
- }
- case "us": {
- result.unit = TimeUnit.US
- }
- case "ns": {
- result.unit = TimeUnit.NS
- }
- case "ps": {
- result.unit = TimeUnit.PS
- }
- }
- return result;
- }
-
-}
diff --git a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/src/templates/utils/AmltCacheModel.java b/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/src/templates/utils/AmltCacheModel.java
deleted file mode 100644
index d4d0283..0000000
--- a/eclipse-tools/model-transformation/build/org.eclipse.app4mc.inchron.transformation.installer/examples/org.eclipse.app4mc.transform.to.inchron.m2m/src/templates/utils/AmltCacheModel.java
+++ /dev/null
@@ -1,219 +0,0 @@
- /**
- ********************************************************************************
- * Copyright (c) 2018 Robert Bosch GmbH.
- *
- * This program and the accompanying materials are made
- * available under the terms of the Eclipse Public License 2.0
- * which is available at https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * Robert Bosch GmbH - initial API and implementation
- ********************************************************************************
- */
-package templates.utils;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.app4mc.amalthea.model.HwStructure;
-import org.eclipse.app4mc.amalthea.model.InterruptController;
-import org.eclipse.app4mc.amalthea.model.MappingModel;
-import org.eclipse.app4mc.amalthea.model.Process;
-import org.eclipse.app4mc.amalthea.model.Scheduler;
-import org.eclipse.app4mc.amalthea.model.SchedulerAllocation;
-import org.eclipse.app4mc.amalthea.model.Task;
-import org.eclipse.app4mc.amalthea.model.TaskAllocation;
-import org.eclipse.app4mc.amalthea.model.TaskScheduler;
-import org.eclipse.emf.common.util.EList;
-
-import com.inchron.realtime.root.model.ActivationConnection;
-import com.inchron.realtime.root.model.GenericSystem;
-import com.inchron.realtime.root.model.Semaphore;
-
-
-public class AmltCacheModel {
-
- private Map<HwStructure, GenericSystem> mappingAmltMicroController_GenericSystem = new HashMap<>();
-
- private Map<Scheduler, SchedulerAllocation> taskScheduler_schedulerAllocationMap=new HashMap<Scheduler, SchedulerAllocation>();
-
- private Map<Task, List<TaskAllocation>> tasks_TaskAllocationMap=new HashMap<Task, List<TaskAllocation>>();
-
-// private Map<ISR, SchedulerAllocation> isr_schedulerAllocationMap=new HashMap<ISR, SchedulerAllocation>();
-
- private Map<TaskScheduler, List<TaskAllocation>> taskScheduler_taskAllocationMap=new HashMap<TaskScheduler, List<TaskAllocation>>();
-
- private Map<String, Semaphore> inchronSemaphoresMap=new HashMap<>();
-
- private Map<String, List<org.eclipse.app4mc.amalthea.model.Process>> amltInterProcessStimuli_processActivationsMap=new HashMap<>();
-
- private Map<String, ActivationConnection> inchronConnectionElementsMap=new HashMap<>();
-
- private Map<String, List<com.inchron.realtime.root.model.Process>> amltStimuliInchronProcessMap=new HashMap<>();
-
- public Map<HwStructure, GenericSystem> getMappingAmltMicroController_GenericSystem() {
- return mappingAmltMicroController_GenericSystem;
- }
-
-
- public void cacheMappingAmltMicroController_GenericSystem(HwStructure hwStructure, GenericSystem genericSystem){
- mappingAmltMicroController_GenericSystem.put(hwStructure, genericSystem);
- }
-
- public void cacheAmltStimuliInchronProcessMap(String amltStimuliName, com.inchron.realtime.root.model.Process inchronProcess){
- if(amltStimuliName !=null){
- List<com.inchron.realtime.root.model.Process> processList = amltStimuliInchronProcessMap.get(amltStimuliName);
-
- if(processList==null){
- processList=new ArrayList<>();
- amltStimuliInchronProcessMap.put(amltStimuliName, processList);
- }
- processList.add(inchronProcess);
- }
- }
-
- public Map<String, List<com.inchron.realtime.root.model.Process>> getAmltStimuliInchronProcessElementsMap(){
-
- return amltStimuliInchronProcessMap;
- }
-
-
- public void cacheInchronConnection(String name, ActivationConnection connection){
- if(name !=null){
- inchronConnectionElementsMap.put(name, connection);
- }
- }
-
- public Map<String, ActivationConnection> getInchronConnectionElementsMap(){
- return inchronConnectionElementsMap;
- }
-
-
- public void cacheInterProcessTriggerRelations(String stimuliName, Process amltProcess){
-
- if(stimuliName!=null){
- List<Process> processList = amltInterProcessStimuli_processActivationsMap.get(stimuliName);
-
- if(processList==null){
- processList=new ArrayList<>();
- amltInterProcessStimuli_processActivationsMap.put(stimuliName, processList);
- }
- processList.add(amltProcess);
- }
-
- }
-
- public Map<String, List<Process>> getInterProcessTriggerRelationsMap(){
- return amltInterProcessStimuli_processActivationsMap;
- }
-
-
-
- public void cacheInchronSemaphore(com.inchron.realtime.root.model.Semaphore inchronSemaphore){
-
- if(inchronSemaphore.getName()!=null){
- inchronSemaphoresMap.put(inchronSemaphore.getName(), inchronSemaphore);
- }
- }
-
- public com.inchron.realtime.root.model.Semaphore getInchronSemaphoreCacheElement(String semaphoreName){
- return inchronSemaphoresMap.get(semaphoreName);
- }
-
- public Map<Scheduler, SchedulerAllocation> getTaskScheduler_schedulerAllocationMap() {
- return taskScheduler_schedulerAllocationMap;
- }
-
-
- public Map<Task, List<TaskAllocation>> getTasks_TaskAllocationMap() {
- return tasks_TaskAllocationMap;
- }
-
-
- public Map<TaskScheduler, List<TaskAllocation>> getTaskScheduler_taskAllocationMap() {
- return taskScheduler_taskAllocationMap;
- }
-
-
- public void buildProcesses_SchedulerAllocationMap(MappingModel mappingModel){
-
- EList<SchedulerAllocation> schedulerAllocations = mappingModel.getSchedulerAllocation();
-
- for (SchedulerAllocation schedulerAllocation : schedulerAllocations) {
-
-
- taskScheduler_schedulerAllocationMap.put(schedulerAllocation.getScheduler(), schedulerAllocation);
- }
-
- }
-
-
- public void buildTaskSchedulerAndSchedulerAssociationMap(MappingModel mappingModel){
-
- EList<SchedulerAllocation> schedulerAllocations = mappingModel.getSchedulerAllocation();
-
- for (SchedulerAllocation schedulerAllocation : schedulerAllocations) {
-
-
- Scheduler scheduler = schedulerAllocation.getScheduler();
- if(scheduler instanceof TaskScheduler){
- taskScheduler_schedulerAllocationMap.put(scheduler, schedulerAllocation);
-
- }else if(scheduler instanceof InterruptController){
-// isr_schedulerAllocationMap.put(((InterruptController)scheduler).getISR, schedulerAllocation);
- }
- }
-
- }
-
- public Map<Scheduler, SchedulerAllocation> getTaskScheduler_SchedulerAllocationMap() {
- return taskScheduler_schedulerAllocationMap;
- }
-
- public Map<TaskScheduler, List<TaskAllocation>> getTaskScheduler_TaskAllocationMap() {
- return taskScheduler_taskAllocationMap;
- }
-
- public void buildTaskSchedulerAndTaskAllocationMap(MappingModel mappingModel){
-
- EList<TaskAllocation> taskAllocations = mappingModel.getTaskAllocation();
-
- for (TaskAllocation taskAllocation : taskAllocations) {
-
- List<TaskAllocation> listOfTaskAllocations;
-
- if(taskScheduler_taskAllocationMap.containsKey(taskAllocation.getScheduler())){
- listOfTaskAllocations=taskScheduler_taskAllocationMap.get(taskAllocation.getScheduler());
- }else{
- listOfTaskAllocations=new ArrayList<TaskAllocation>();
- taskScheduler_taskAllocationMap.put(taskAllocation.getScheduler(),listOfTaskAllocations);
- }
-
- listOfTaskAllocations.add(taskAllocation);
-
-
-
- //populating map tasks_TaskAllocationMap
-
- List<TaskAllocation> listOftask_TaskAllocations;
-
- if(tasks_TaskAllocationMap.containsKey(taskAllocation.getTask())){
- listOftask_TaskAllocations=tasks_TaskAllocationMap.get(taskAllocation.getTask());
- }else{
- listOftask_TaskAllocations=new ArrayList<TaskAllocation>();
- tasks_TaskAllocationMap.put(taskAllocation.getTask(),listOftask_TaskAllocations);
- }
-
- listOftask_TaskAllocations.add(taskAllocation);
-
-
- }
-
- }
-
-}