Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
1574820
initial attempt to restructure power requirement analysis
asazonova Dec 8, 2020
acb5f8c
link new handler to UI. verify that it gets called
asazonova Dec 9, 2020
e122f93
carry over code from old analysis file
asazonova Dec 9, 2020
ad92495
start on the model
asazonova Dec 10, 2020
df3fc77
build up a model for power requirements analysis
asazonova Dec 10, 2020
06e43e8
Add in a visitor to build up results
asazonova Dec 10, 2020
f2d689c
changing how the visitor is called
asazonova Dec 11, 2020
ecdd602
add system and som name to results
asazonova Dec 11, 2020
13fbf0c
finish up analysisResult object and add an excel report for Power
asazonova Dec 14, 2020
253e764
add description of returned object. clean up unused functions
asazonova Dec 14, 2020
063f732
Add in markers. Move and add to power analysis markdown. Add JUnit test
asazonova Dec 15, 2020
9cf4660
add 2 more tests
asazonova Dec 15, 2020
11dc0f2
Correct no supply test: since EPSU system is set to 0 power supply, it
asazonova Jan 4, 2021
a2a61a8
rename folder to match path in test
asazonova Jan 4, 2021
96e399f
add html file for power analysis
asazonova Jan 14, 2021
73bfe6d
Revert "add html file for power analysis"
asazonova Jan 14, 2021
f471ac9
Reverted org.osate.results to match the master branch. This shouldn't
AaronGreenhouse Feb 17, 2021
2e02a77
Fixed plugin support version depedencies
AaronGreenhouse Feb 17, 2021
8c33daa
Fixed versionsing problem
AaronGreenhouse Feb 17, 2021
5d3edfd
add EMF model for power requirements analysis
asazonova Mar 4, 2021
5a0f29d
new ecore model and generated code for power requirement analysis
asazonova Jul 12, 2021
cc3b672
Merge remote-tracking branch 'origin/master' into 1383_update_analysi…
asazonova Jul 13, 2021
e9e1423
fix versions
asazonova Jul 13, 2021
2360fd5
revert manifests
asazonova Jul 13, 2021
8c6b2f5
Merge branch 'master' into 1383_use_AnalysisResult_in_power_requireme…
asazonova Oct 6, 2021
2c173ee
Merge branch '1383_use_AnalysisResult_in_power_requirements_analysis' of
asazonova Oct 7, 2021
c56a978
Merge branch 'master' into 1383_use_AnalysisResult_in_power_requireme…
asazonova Oct 11, 2021
7d234a0
Merge branch 'master' into 1383_use_AnalysisResult_in_power_requireme…
asazonova Nov 23, 2021
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
2 changes: 1 addition & 1 deletion alisa/org.osate.verify/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Require-Bundle: org.eclipse.xtext;bundle-version="[2.20.0,3.0.0)";visibility:=re
org.junit;bundle-version="[4.11.0,5.0.0)",
org.osate.analysis.architecture;bundle-version="[2.0.0,3.0.0)",
org.osate.analysis.flows;bundle-version="[5.0.0,6.0.0)",
org.osate.analysis.resource.budgets;bundle-version="[4.0.0,5.0.0)",
org.osate.analysis.resource.budgets;bundle-version="[4.1.0,5.0.0)",
org.osate.analysis.resource.management;bundle-version="[4.0.0,5.0.0)",
org.eclipse.core.runtime;bundle-version="[3.10.0,4.0.0)",
org.eclipse.core.resources;bundle-version="[3.9.1,4.0.0)",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/**
* Copyright (c) 2004-2021 Carnegie Mellon University and others. (see Contributors file).
* Copyright (c) 2004-2021 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
Expand All @@ -28,8 +28,6 @@
import org.osate.aadl2.EnumerationLiteral;
import org.osate.aadl2.NamedElement;
import org.osate.aadl2.RecordValue;
import org.osate.aadl2.contrib.aadlproject.SizeUnits;
import org.osate.aadl2.contrib.util.AadlContribUtils;
import org.osate.aadl2.instance.ConnectionInstance;
import org.osate.aadl2.instance.ConnectionInstanceEnd;
import org.osate.aadl2.instance.FeatureInstance;
Expand Down Expand Up @@ -82,8 +80,8 @@ public void doHeaders() {
}

public void checkPortConsistency(FeatureInstance srcFI, FeatureInstance dstFI, ConnectionInstance conni) {
double srcDataSize = AadlContribUtils.getDataSize(srcFI, SizeUnits.BYTES);
double dstDataSize = AadlContribUtils.getDataSize(dstFI, SizeUnits.BYTES);
double srcDataSize = GetProperties.getSourceDataSizeInBytes(srcFI);
double dstDataSize = GetProperties.getSourceDataSizeInBytes(dstFI);

RecordValue srcRate = GetProperties.getOutPutRate(srcFI);
RecordValue dstRate = GetProperties.getInPutRate(dstFI);
Expand Down Expand Up @@ -119,12 +117,10 @@ public void checkPortConsistency(FeatureInstance srcFI, FeatureInstance dstFI, C
+ " Bytes differ");
}
} else {
if (srcDataSize == 0 && dstDataSize > 0) {
if (srcDataSize == 0 && dstDataSize > 0)
error(conni, "Source data size is missing or zero");
}
if (dstDataSize == 0 && srcDataSize > 0) {
if (dstDataSize == 0 && srcDataSize > 0)
error(conni, "Destination data size is missing or zero");
}
}

if (srcRU != null && dstRU != null && srcRU != dstRU) {
Expand Down Expand Up @@ -153,12 +149,10 @@ public void checkPortConsistency(FeatureInstance srcFI, FeatureInstance dstFI, C
"Source data rate " + srcRateValue + " and destination data rate " + dstRateValue + " differ");
}
} else {
if (srcRateValue == 0 && dstRateValue > 0) {
if (srcRateValue == 0 && dstRateValue > 0)
error(conni, "Source data rate is missing or zero");
}
if (dstRateValue == 0 && srcRateValue > 0) {
if (dstRateValue == 0 && srcRateValue > 0)
error(conni, "Destination data rate is missing or zero");
}
}

if (srcC != null && dstC != null) {
Expand All @@ -167,12 +161,10 @@ public void checkPortConsistency(FeatureInstance srcFI, FeatureInstance dstFI, C
+ " differ");
}
} else {
if (srcC == null && dstC != null) {
if (srcC == null && dstC != null)
error(conni, "Source base type is missing");
}
if (dstC == null && srcC != null) {
if (dstC == null && srcC != null)
error(conni, "Destination base type is missing");
}
}

if (srcS.length() > 0 && dstS.length() > 0) {
Expand All @@ -181,12 +173,10 @@ public void checkPortConsistency(FeatureInstance srcFI, FeatureInstance dstFI, C
"Source measurement unit " + srcS + " and destination measurement unit " + dstS + " differ");
}
} else {
if (srcS.length() == 0 && dstS.length() > 0) {
if (srcS.length() == 0 && dstS.length() > 0)
error(conni, "Source measurement unit is missing");
}
if (dstS.length() == 0 && srcS.length() > 0) {
if (dstS.length() == 0 && srcS.length() > 0)
error(conni, "Destination measurement unit is missing");
}
}
}

Expand All @@ -195,9 +185,8 @@ public void checkPortConsistency(FeatureInstance srcFI, FeatureInstance dstFI, C
protected void error(NamedElement el, String s) {
super.error(el, s);
if (previousNE == null || previousNE != el) {
if (previousNE != null) {
if (previousNE != null)
handler.logInfo("");
}
handler.logInfo(el.getName() + "," + s);
} else {
handler.logInfo("," + s);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/**
* Copyright (c) 2004-2021 Carnegie Mellon University and others. (see Contributors file).
* Copyright (c) 2004-2021 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
Expand All @@ -23,22 +23,16 @@
*/
package org.osate.analysis.architecture;

import java.util.EnumSet;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.emf.common.util.EList;
import org.osate.aadl2.ComponentCategory;
import org.osate.aadl2.instance.ComponentInstance;
import org.osate.aadl2.instance.ConnectionInstance;
import org.osate.aadl2.instance.ConnectionInstanceEnd;
import org.osate.aadl2.instance.ConnectionKind;
import org.osate.aadl2.instance.FeatureCategory;
import org.osate.aadl2.instance.FeatureInstance;
import org.osate.aadl2.modelsupport.modeltraversal.AadlProcessingSwitchWithProgress;
import org.osate.contribution.sei.sei.Sei;
import org.osate.contribution.sei.sei.Weightunits;
import org.osate.pluginsupport.properties.PropertyUtils;
import org.osate.result.AnalysisResult;
import org.osate.result.Diagnostic;
import org.osate.result.DiagnosticType;
Expand All @@ -47,6 +41,7 @@
import org.osate.result.ResultFactory;
import org.osate.result.util.ResultUtil;
import org.osate.ui.handlers.AbstractAaxlHandler;
import org.osate.xtext.aadl2.properties.util.GetProperties;

/**
* @author phf
Expand Down Expand Up @@ -79,7 +74,7 @@ private double calcPrice(ComponentInstance ci) {
for (ComponentInstance subi : cil) {
price += calcPrice(subi);
}
price += Sei.getPrice(ci).orElse(0.0);
price += GetProperties.getPrice(ci, 0.0);
return price;
}

Expand Down Expand Up @@ -143,19 +138,13 @@ public static AnalysisResult invoke(ComponentInstance ci) {
return result;
}

private static final EnumSet<ComponentCategory> hasWeight = EnumSet.of(ComponentCategory.SYSTEM,
ComponentCategory.PROCESSOR, ComponentCategory.MEMORY, ComponentCategory.BUS, ComponentCategory.DEVICE,
ComponentCategory.ABSTRACT);

private static Result calcWeight(ComponentInstance ci, boolean needWeight) {
Result result = ResultFactory.eINSTANCE.createResult();
result.setModelElement(ci);

final boolean getWeight = hasWeight.contains(ci.getCategory());
final double net = getWeight ? PropertyUtils.getScaled(Sei::getNetweight, ci, Weightunits.KG).orElse(0.0) : 0.0;
final double net = GetProperties.getNetWeight(ci, 0.0);
double weight = 0.0;
final double gross = getWeight ? PropertyUtils.getScaled(Sei::getGrossweight, ci, Weightunits.KG).orElse(0.0)
: 0.0;
final double gross = GetProperties.getGrossWeight(ci, 0.0);
double sublimit = 0.0;
EList<ComponentInstance> cil = ci.getComponentInstances();
for (ComponentInstance subi : cil) {
Expand All @@ -166,9 +155,7 @@ private static Result calcWeight(ComponentInstance ci, boolean needWeight) {
result.getSubResults().add(subresult);
double subweight = ResultUtil.getReal(subresult, 0);
weight += subweight;
sublimit += hasWeight.contains(subi.getCategory())
? PropertyUtils.getScaled(Sei::getWeightlimit, subi, Weightunits.KG).orElse(0.0)
: 0.0;
sublimit += GetProperties.getWeightLimit(subi, 0.0);
}
}
EList<ConnectionInstance> connl = ci.getConnectionInstances();
Expand All @@ -179,20 +166,16 @@ private static Result calcWeight(ComponentInstance ci, boolean needWeight) {
&& ((FeatureInstance) source).getCategory() == FeatureCategory.BUS_ACCESS)
|| (destination instanceof FeatureInstance
&& ((FeatureInstance) destination).getCategory() == FeatureCategory.BUS_ACCESS)) {
double netconn = PropertyUtils.getScaled(Sei::getNetweight, connectionInstance, Weightunits.KG)
.orElse(0.0);
double grossconn = PropertyUtils.getScaled(Sei::getGrossweight, connectionInstance, Weightunits.KG)
.orElse(0.0);
double netconn = GetProperties.getNetWeight(connectionInstance, 0.0);
double grossconn = GetProperties.getGrossWeight(connectionInstance, 0.0);
weight += netconn > 0 ? netconn : grossconn;
if (netconn > 0 || grossconn > 0) {
String ResultMsg = String.format(
connectionInstance.getName() + ": Weight of access connection is %.3f kg",
netconn > 0 ? netconn : grossconn);
result.getDiagnostics().add(ResultUtil.createInfoDiagnostic(ResultMsg, connectionInstance));
}
sublimit += connectionInstance.getKind() == ConnectionKind.ACCESS_CONNECTION
? PropertyUtils.getScaled(Sei::getWeightlimit, connectionInstance, Weightunits.KG).orElse(0.0)
: 0.0;
sublimit += GetProperties.getWeightLimit(connectionInstance, 0.0);
}
}
if (weight == 0.0 && cil.isEmpty()) {
Expand Down Expand Up @@ -223,8 +206,7 @@ private static Result calcWeight(ComponentInstance ci, boolean needWeight) {
weight = gross;
}
}
final double limit = getWeight ? PropertyUtils.getScaled(Sei::getWeightlimit, ci, Weightunits.KG).orElse(0.0)
: 0.0;
final double limit = GetProperties.getWeightLimit(ci, 0.0);
if (limit > 0.0) {
if (weight > limit) {
// problem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
import org.osate.aadl2.Element;
import org.osate.aadl2.EnumerationLiteral;
import org.osate.aadl2.NamedElement;
import org.osate.aadl2.contrib.deployment.DeploymentProperties;
import org.osate.aadl2.instance.ComponentInstance;
import org.osate.aadl2.instance.ConnectionInstance;
import org.osate.aadl2.instance.FeatureCategory;
Expand Down Expand Up @@ -264,10 +263,9 @@ private static <T> List<Issue> checkRequiredAndProvided(Stream<InstanceObject> b
return bindingElements.flatMap(element -> {
Set<T> required = Collections.unmodifiableSet(new HashSet<>(getRequired.apply(element)));
if (!required.isEmpty()) {
return DeploymentProperties.getActualConnectionBinding(element).orElse(Collections.emptyList()).stream()
.flatMap(boundElement -> {
return GetProperties.getActualConnectionBinding(element).stream().flatMap(boundElement -> {
Set<T> missingSet = new HashSet<>(required);
missingSet.removeAll(getProvided.apply((ComponentInstance) boundElement));
missingSet.removeAll(getProvided.apply(boundElement));
return missingSet.stream().map(missing -> {
StringBuilder message = new StringBuilder(getTitle(element));
message.append(" '");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/**
* Copyright (c) 2004-2021 Carnegie Mellon University and others. (see Contributors file).
* Copyright (c) 2004-2021 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
Expand All @@ -34,10 +34,6 @@
import org.osate.contribution.sei.names.SEI;
import org.osate.xtext.aadl2.properties.util.GetProperties;

/**
* @deprecated Will be removed in 2.10.0. Dead code. If you are using this for some reason, replace it with {@link SEI#getStreammissrate}.
*/
@Deprecated
public class MissRateProperties {

public static double getStreamMissRate(final NamedElement ph) throws InvalidModelException,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ class ReferenceProcessorScalingTest extends XtextTest {
var checker = new FlowLatencyAnalysisSwitch()
var latencyresult = checker.invoke(instance, som,true,true,false,true, false)
val resab = latencyresult.results.get(0)
assertEquals(200.0, (resab.values.get(1) as RealValue).value, 0.0)
assertEquals(400.0, (resab.values.get(2) as RealValue).value, 0.0)
assertTrue((resab.values.get(1) as RealValue).value == (200.0))
assertTrue((resab.values.get(2) as RealValue).value == (400.0))

// instantiate
val sysImplu = cls.findFirst[name == 'top.iu'] as SystemImplementation
Expand All @@ -80,8 +80,8 @@ class ReferenceProcessorScalingTest extends XtextTest {
checker = new FlowLatencyAnalysisSwitch()
latencyresult = checker.invoke(instanceu, som,true,true,false,true, false)
val rescd = latencyresult.results.get(0)
assertEquals(50.0, (rescd.values.get(1) as RealValue).value, 0.0)
assertEquals(100.0, (rescd.values.get(2) as RealValue).value, 0.0)
assertTrue((rescd.values.get(1) as RealValue).value == (50.0))
assertTrue((rescd.values.get(2) as RealValue).value == (100.0))
}

}
4 changes: 2 additions & 2 deletions analyses/org.osate.analysis.flows/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Export-Package: org.osate.analysis.flows,
org.osate.analysis.flows.reporting.model
Require-Bundle: org.osate.aadl2;bundle-version="[4.0.0,5.0.0)",
org.osate.aadl2.modelsupport;bundle-version="[6.0.0,7.0.0)",
org.osate.ui;bundle-version="[6.2.0,7.0.0)",
org.osate.xtext.aadl2.properties;bundle-version="[3.1.0,4.0.0)",
org.osate.ui;bundle-version="[6.1.0,7.0.0)",
org.osate.xtext.aadl2.properties;bundle-version="[3.0.0,4.0.0)",
org.osate.contribution.sei;bundle-version="[1.2.0,3.0.0)",
org.osate.pluginsupport;bundle-version="[7.1.0,8.0.0)",
org.osate.aadl2.contrib;bundle-version="[1.1.0,2.0.0)",
Expand Down
Loading