Search in sources :

Example 86 with SystemInstance

use of org.osate.aadl2.instance.SystemInstance in project osate2 by osate.

the class Schedule method analyzeInstanceModel.

@Override
protected void analyzeInstanceModel(final IProgressMonitor monitor, final AnalysisErrorReporterManager errManager, final SystemInstance root, final SystemOperationMode som) {
    monitor.beginTask(getActionName(), IProgressMonitor.UNKNOWN);
    logInfo("Processor Utilization/Scheduling Results");
    try {
        ForAllElement processProcessor = new ForAllElement(errManager) {

            @Override
            public void process(Element obj) {
                ComponentInstance processor = (ComponentInstance) obj;
                String protocol = GetProperties.getSchedulingProtocol(processor);
                if (protocol == null || protocol.equalsIgnoreCase("EDF")) {
                    doUtilization(processor);
                } else {
                    timingSchedulabilityAnalysis(processor);
                }
            }
        };
        processProcessor.processPreOrderComponentInstance(root, ComponentCategory.PROCESSOR);
    } catch (InvalidModelException e) {
        error(e.getElement(), e.getMessage());
    }
    // now report thread bindings
    logInfo("\nThread binding report");
    ForAllElement processThread = new ForAllElement(errManager) {

        @Override
        public void process(Element obj) {
            reportProcessorBinding((ComponentInstance) obj);
            return;
        }
    };
    processThread.processPreOrderComponentInstance(root, ComponentCategory.THREAD);
    monitor.done();
}
Also used : InvalidModelException(org.osate.aadl2.properties.InvalidModelException) ForAllElement(org.osate.aadl2.modelsupport.modeltraversal.ForAllElement) Element(org.osate.aadl2.Element) ForAllElement(org.osate.aadl2.modelsupport.modeltraversal.ForAllElement) NamedElement(org.osate.aadl2.NamedElement) ComponentInstance(org.osate.aadl2.instance.ComponentInstance)

Example 87 with SystemInstance

use of org.osate.aadl2.instance.SystemInstance in project osate2 by osate.

the class NotBoundResourceAnalysisHandler method doAaxlAction.

@Override
public void doAaxlAction(IProgressMonitor monitor, Element obj) {
    // Get the system instance (if any)
    final SystemInstance si = (obj instanceof InstanceObject) ? ((InstanceObject) obj).getSystemInstance() : null;
    if (si != null) {
        monitor.beginTask(getActionName(), IProgressMonitor.UNKNOWN);
        NotBoundResourceAnalysis logic = null;
        logic = new NotBoundResourceAnalysis(this);
        final SOMIterator soms = new SOMIterator(si);
        while (soms.hasNext()) {
            logic.analyzeResourceBudget(si, soms.next());
        }
        monitor.done();
    }
}
Also used : InstanceObject(org.osate.aadl2.instance.InstanceObject) SOMIterator(org.osate.aadl2.modelsupport.modeltraversal.SOMIterator) SystemInstance(org.osate.aadl2.instance.SystemInstance) NotBoundResourceAnalysis(org.osate.analysis.resource.budgets.logic.NotBoundResourceAnalysis)

Example 88 with SystemInstance

use of org.osate.aadl2.instance.SystemInstance in project osate2 by osate.

the class BoundResourceAnalysis method checkProcessorLoads.

private void checkProcessorLoads(SystemInstance si, final SystemOperationMode som) {
    count = 0;
    ForAllElement countme = new ForAllElement() {

        @Override
        protected void process(Element obj) {
            count = count + 1;
        }
    };
    countme.processPreOrderComponentInstance(si, ComponentCategory.PROCESSOR);
    if (count > 0) {
        errManager.infoSummaryReportOnly(si, null, "\nProcessor Summary Report: " + Aadl2Util.getPrintableSOMName(som));
    } else {
        errManager.infoSummaryReportOnly(si, null, "\nProcessor Summary Report: " + Aadl2Util.getPrintableSOMName(som) + "\n  ** No processors");
    }
    ForAllElement mal = new ForAllElement() {

        @Override
        protected void process(Element obj) {
            checkProcessorLoad((ComponentInstance) obj, som);
        }
    };
    mal.processPreOrderComponentInstance(si, ComponentCategory.PROCESSOR);
}
Also used : ForAllElement(org.osate.aadl2.modelsupport.modeltraversal.ForAllElement) Element(org.osate.aadl2.Element) ForAllElement(org.osate.aadl2.modelsupport.modeltraversal.ForAllElement)

Example 89 with SystemInstance

use of org.osate.aadl2.instance.SystemInstance in project osate2 by osate.

the class PriorityInversion method checkSystemPriorityInversion.

public void checkSystemPriorityInversion(SystemInstance si) {
    ForAllElement mal = new ForAllElement() {

        @Override
        protected void process(Element obj) {
            checkPriorityInversion((ComponentInstance) obj);
        }
    };
    mal.processPreOrderComponentInstance(si, ComponentCategory.PROCESSOR);
}
Also used : ForAllElement(org.osate.aadl2.modelsupport.modeltraversal.ForAllElement) Element(org.osate.aadl2.Element) ForAllElement(org.osate.aadl2.modelsupport.modeltraversal.ForAllElement)

Example 90 with SystemInstance

use of org.osate.aadl2.instance.SystemInstance in project osate2 by osate.

the class CheckA429PortConnectionConsistency method doAaxlAction.

@Override
public void doAaxlAction(final IProgressMonitor monitor, final Element obj) {
    if (!(obj instanceof ComponentInstance)) {
        Dialog.showWarning(getActionName(), "Please invoke command on an instance model");
        monitor.done();
        return;
    }
    // Get the system instance (if any)
    SystemInstance si = ((ComponentInstance) obj).getSystemInstance();
    monitor.beginTask(getActionName(), IProgressMonitor.UNKNOWN);
    ARINC429ConnectionConsistency pcc = new ARINC429ConnectionConsistency(monitor, this);
    pcc.doHeaders();
    pcc.processPreOrderAll(si);
    if (pcc.cancelled()) {
        throw new OperationCanceledException();
    }
    monitor.done();
}
Also used : ARINC429ConnectionConsistency(org.osate.analysis.architecture.ARINC429ConnectionConsistency) SystemInstance(org.osate.aadl2.instance.SystemInstance) OperationCanceledException(org.eclipse.core.runtime.OperationCanceledException) ComponentInstance(org.osate.aadl2.instance.ComponentInstance)

Aggregations

SystemInstance (org.osate.aadl2.instance.SystemInstance)100 ComponentInstance (org.osate.aadl2.instance.ComponentInstance)52 InstanceObject (org.osate.aadl2.instance.InstanceObject)26 ComponentImplementation (org.osate.aadl2.ComponentImplementation)25 Element (org.osate.aadl2.Element)25 SystemOperationMode (org.osate.aadl2.instance.SystemOperationMode)22 ConnectionInstance (org.osate.aadl2.instance.ConnectionInstance)21 Classifier (org.osate.aadl2.Classifier)18 ForAllElement (org.osate.aadl2.modelsupport.modeltraversal.ForAllElement)18 ComponentCategory (org.osate.aadl2.ComponentCategory)17 NamedElement (org.osate.aadl2.NamedElement)16 List (java.util.List)14 Resource (org.eclipse.emf.ecore.resource.Resource)14 AadlPackage (org.osate.aadl2.AadlPackage)14 FeatureInstance (org.osate.aadl2.instance.FeatureInstance)14 ArrayList (java.util.ArrayList)13 EList (org.eclipse.emf.common.util.EList)13 IOException (java.io.IOException)12 IStatus (org.eclipse.core.runtime.IStatus)12 Optional (java.util.Optional)10