Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
target/
.DS_Store
2 changes: 1 addition & 1 deletion analyses/org.osate.analysis.flows.tests/.classpath
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?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.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src">
<attributes>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
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.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Import-Package: org.apache.commons.logging,
org.junit.runner.notification;version="4.5.0",
org.junit.runners;version="4.5.0",
org.junit.runners.model;version="4.5.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-Activator: org.osate.xtext.aadl2.ui.internal.Aadl2Activator
Bundle-ActivationPolicy: lazy
Automatic-Module-Name: org.osate.analysis.flows.tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.aadlbin-gen/
instances/
/.settings/
18 changes: 18 additions & 0 deletions analyses/org.osate.analysis.flows.tests/models/issue2885/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Issue2885</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.osate.core.aadlnature</nature>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package Issue2885
public
feature group FG
end FG;

system A
end A;

system implementation A.impl
subcomponents
c: abstract C;
m: system M;
s: system S;
connections
m_to_c: feature group m.p1 -> c.p1;
s_to_m: feature group s.p2 -> m.p2;
flows
Sensor_Flow: end to end flow
s.flowSource ->
s_to_m ->
m.flowPath ->
m_to_c ->
c.flowSink;
properties
Latency => 100 ms .. 200 ms applies to Sensor_Flow;
end A.impl;

abstract C
features
p1: feature group inverse of FG;
flows
flowSink: flow sink p1;
properties
Latency => 0 ms .. 25 ms applies to flowSink;
end C;

system M
features
p1: feature group FG;
p2: feature group inverse of FG;
flows
flowPath: flow path p2 -> p1;
properties
Latency => 100 ms .. 100 ms applies to flowPath;
end M;

system S
features
p2: feature group FG;
flows
flowSource: flow source p2;
properties
Latency => 0 ms .. 25 ms applies to flowSource;
end S;
end Issue2885;
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/**
* Copyright (c) 2004-2023 Carnegie Mellon University and others. (see Contributors file).
* All Rights Reserved.
*
* NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY
* KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE
* OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT
* MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT.
*
* 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
*
* Created, in part, with funding and support from the United States Government. (see Acknowledgments file).
*
* This program includes and/or can make use of certain third party source code, object code, documentation and other
* files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system
* configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and
* conditions contained in any such Third Party Software or separate license file distributed with such Third Party
* Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party benefici-
* aries to this license with respect to the terms applicable to their Third Party Software. Third Party Software li-
* censes only apply to the Third Party Software and not any other portion of this program or this program as a whole.
*/
package org.osate.analysis.flows.tests;

import java.util.Optional;

import org.eclipse.xtext.testing.InjectWith;
import org.eclipse.xtext.testing.XtextRunner;
import org.eclipse.xtext.testing.validation.ValidationTestHelper;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.osate.aadl2.AadlPackage;
import org.osate.aadl2.Classifier;
import org.osate.aadl2.ComponentImplementation;
import org.osate.aadl2.instance.SystemInstance;
import org.osate.aadl2.instantiation.InstantiateModel;
import org.osate.analysis.flows.FlowLatencyAnalysisSwitch;
import org.osate.testsupport.Aadl2InjectorProvider;
import org.osate.testsupport.TestHelper;

import com.google.inject.Inject;
import com.itemis.xtext.testing.XtextTest;

@RunWith(XtextRunner.class)
@InjectWith(Aadl2InjectorProvider.class)
public class Issue2885Test extends XtextTest {

private static final String FILE = "org.osate.analysis.flows.tests/models/issue2885/Issue2885.aadl";

@Inject
TestHelper<AadlPackage> testHelper;

@Inject
private ValidationTestHelper validationHelper;

@Test
public void testAnalysis() throws Exception {
AadlPackage pkg = testHelper.parseFile(FILE);

validationHelper.assertNoIssues(pkg);

Optional<Classifier> impl = pkg.getOwnedPublicSection()
.getOwnedClassifiers()
.stream()
.filter(c -> c.getName().equals("A.impl"))
.findFirst();

SystemInstance instance = InstantiateModel.instantiate((ComponentImplementation) impl.get());
Assert.assertEquals("A_impl_Instance", instance.getName());

// check flow latency
var som = instance.getSystemOperationModes().get(0);
var checker = new FlowLatencyAnalysisSwitch();
checker.invoke(instance, som, true, true, true, true, false);
}

}
2 changes: 1 addition & 1 deletion analyses/org.osate.analysis.flows/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.osate.analysis.flows;singleton:=true
Bundle-Version: 5.0.5.qualifier
Bundle-Version: 5.0.6.qualifier
Bundle-Activator: org.osate.analysis.flows.FlowanalysisPlugin
Bundle-Vendor: CMU/SEI
Bundle-Localization: plugin
Expand Down
2 changes: 1 addition & 1 deletion analyses/org.osate.analysis.flows/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>org.osate</groupId>
<artifactId>org.osate.analysis.flows</artifactId>
<version>5.0.5-SNAPSHOT</version>
<version>5.0.6-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -539,8 +539,7 @@ private void mapConnectionInstance(final EndToEndFlowInstance etef, final FlowEl
report.isMajorFrameDelay());

processActualConnectionBindingsSampling(connectionInstance, latencyContributor);
ComponentClassifier relatedConnectionData = (ComponentClassifier) FlowLatencyUtil
.getConnectionData(connectionInstance);
ComponentClassifier relatedConnectionData = FlowLatencyUtil.getConnectionData(connectionInstance);
processActualConnectionBindingsTransmission(connectionInstance,
relatedConnectionData == null ? 0.0
: AadlContribUtils.getDataSize(relatedConnectionData, SizeUnits.BYTES),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.ui.statushandlers.StatusManager;
import org.osate.aadl2.Classifier;
import org.osate.aadl2.ComponentCategory;
import org.osate.aadl2.ComponentClassifier;
import org.osate.aadl2.ComponentType;
Expand All @@ -50,6 +49,7 @@
import org.osate.aadl2.instance.ConnectionInstanceEnd;
import org.osate.aadl2.instance.ConnectionKind;
import org.osate.aadl2.instance.EndToEndFlowInstance;
import org.osate.aadl2.instance.FeatureCategory;
import org.osate.aadl2.instance.FeatureInstance;
import org.osate.aadl2.instance.FlowElementInstance;
import org.osate.aadl2.instance.FlowSpecificationInstance;
Expand Down Expand Up @@ -236,14 +236,17 @@ public static double getPartitionPeriod(final ComponentInstance part) {
return result;
}

public static Classifier getConnectionData(ConnectionInstance connectionInstance) {
public static ComponentClassifier getConnectionData(ConnectionInstance connectionInstance) {
ConnectionInstanceEnd cei;
FeatureInstance fi;
cei = connectionInstance.getSource();

if (cei instanceof FeatureInstance) {
fi = (FeatureInstance) cei;
return fi.getFeature().getAllClassifier();
if (fi.getCategory() == FeatureCategory.FEATURE_GROUP) {
return null;
}
return (ComponentClassifier) fi.getFeature().getAllClassifier();
}

return null;
Expand Down
2 changes: 1 addition & 1 deletion analyses/org.osate.plugins.feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<feature
id="org.osate.plugins.feature"
label="Open Source AADL Tool Environment Analysis Plug-ins"
version="6.1.6.qualifier"
version="6.1.7.qualifier"
provider-name="CMU-SEI"
plugin="org.osate.branding"
image="icons/osateupdate_120.jpg"
Expand Down
2 changes: 1 addition & 1 deletion analyses/org.osate.plugins.feature/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>org.osate</groupId>
<artifactId>org.osate.plugins.feature</artifactId>
<version>6.1.6-SNAPSHOT</version>
<version>6.1.7-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>

<build>
Expand Down
2 changes: 1 addition & 1 deletion core/org.osate.build.coverage.report/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
<dependency>
<groupId>org.osate</groupId>
<artifactId>org.osate.analysis.flows</artifactId>
<version>5.0.5-SNAPSHOT</version>
<version>5.0.6-SNAPSHOT</version>
<optional>true</optional>
<scope>compile</scope>
</dependency>
Expand Down