Beispiel #1
0
    def __init__(self, debug=False):
        self._debug = debug
        self.logger = logging.getLogger("tgff_parser")

        self.quantity_dict = {}
        self.std_link_dict = {}
        self.prim_link_dict = {}
        self.task_graph_dict = {}
        self.processor_list = []

        self.common_components = {
            "comment": expr.comment(),
            "new_line": expr.new_line(),
            "scope_limiter": expr.scope_limiter(),
        }

        self.data_components = {
            "task_graph": expr.task_graph(),
            "commun_quant": expr.commun_quant(),
            "hw_component": expr.hw_component(),
            "hyperperiod": expr.hyperperiod(),
        }

        self.task_graph_components = {
            "period": expr.period(),
            "task": expr.task(),
            "channel": expr.channel(),
            "hard_deadline": expr.hard_deadline(),
            "soft_deadline": expr.soft_deadline(),
        }

        self.hw_components = {
            "properties": expr.properties(),
            "operation": expr.operation(),
            "std_link_value": expr.std_link_value(),
            "prim_link_value": expr.prim_link_value(),
        }

        self.commun_quant_components = {
            "commun_value": expr.commun_value(),
        }

        self.unused_components = {
            "unused_statement": expr.unused_statement(),
            "unused_scope": expr.unused_scope(),
        }
Beispiel #2
0
# Copyright (C) 2017 TU Dresden
# Licensed under the ISC license (see LICENSE.txt)
#
# Authors: Christian Menard


from mocasin.util import logging
from mocasin.simulate.channel import RuntimeChannel
from mocasin.simulate.process import RuntimeDataflowProcess
from mocasin.simulate.adapter import SimulateLoggerAdapter


log = logging.getLogger(__name__)


class RuntimeApplication(object):
    """Represents the runtime instance of an application.

    Attributes:
        name (str): the application name
        system (System): the system the application is supposed to be
            executed on
    """

    def __init__(self, name, system):
        """Initialize a RuntimeApplication

        Args:
            name (str): the application name
            system (System): the system the application is supposed to be
                executed on
Beispiel #3
0
# Copyright (C) 2016 TU Dresden
# Licensed under the ISC license (see LICENSE.txt)
#
# Authors: Andrés Goens

import functools
import time
from itertools import product
from mocasin.util.logging import getLogger

log = getLogger(__name__)

total_time = 0


def timeit(func):
    @functools.wraps(func)
    def newfunc(*args, **kwargs):
        global total_time
        start_time = time.time()
        ret = func(*args, **kwargs)
        elapsed_time = time.time() - start_time
        total_time += elapsed_time
        return ret

    return newfunc


# important! permutations start with 0
class Permutation(list):
    @classmethod
Beispiel #4
0
# Copyright (C) 2019 TU Dresden
# Licensed under the ISC license (see LICENSE.txt)
#
# Authors: Felix Teweleit

import pytest
from mocasin.util import logging
from mocasin.tgff.tgffParser.parser import Parser

logger = logging.getLogger("tgff_parser_test")


@pytest.fixture
def graph_dict():
    parser = Parser()
    data = parser.parse_file("examples/tgff/e3s-0.9/auto-indust-cords.tgff",
                             [])
    return data[0]


@pytest.fixture
def processor_list():
    parser = Parser()
    data = parser.parse_file("examples/tgff/e3s-0.9/auto-indust-cowls.tgff",
                             [])
    return data[1]


@pytest.fixture
def link_dict():
    parser = Parser()