Exemplo n.º 1
0
def generate_cs_se_taskset(n, wcets, utils, se_names):
    """ Returns SE takset (a list of n SE task) """

    # utils = TGEN.get_utils(n, total_se_util)
    periods = [ci / ui for ci, ui in zip(wcets, utils)]

    # periods = TGEN.get_periods(n, PARAMS.CS_SE_PERIOD_MIN, PARAMS.CS_SE_PERIOD_MAX)
    # utils = [ci / ti for ci, ti in zip(wcets, periods)]

    # print periods
    # shorter index higher priority
    # periods_sorted = np.sort(periods)
    # argp = np.argsort(periods)
    # wcets_sorted = []
    #
    # for i in range(0, n):
    #     wcets_sorted.append(wcets[argp[i]])

    # print wcets_sorted
    se_taskset = []
    for i in range(0, n):
        se_taskset.append(
            TASK.SE_Task(wcet=wcets[i],
                         period=periods[i],
                         period_des=periods[i],
                         period_max=periods[i] * PARAMS.SE_PERIOD_MAX_FACTOR,
                         util=utils[i],
                         deadline=periods[i],
                         tid=se_names[i]))

    return se_taskset
Exemplo n.º 2
0
def get_rover_se_taskset():

    n_se_task = 3

    # task order: tw_roverlogscan, cus_kmlog, tw_onwbin

    se_task_tid = ['tw_roverlogscan', 'cus_kmlog', 'tw_onwbin']

    wcets = [5342.0, 223.0, 5845.0]
    periods_max = [10000, 10000, 15000]
    utils = [wcet / period for wcet, period in zip(wcets, periods_max)]

    print "== SE TASK STAT =="
    print "WCET:", wcets
    print "PERIOD_MAX:", periods_max
    print "(Min) UTIL:", utils
    print "Total SE Min Util:", sum(utils)
    print "==================="

    se_taskset = []
    for i in range(0, n_se_task):
        se_taskset.append(
            tsk.SE_Task(wcet=wcets[i],
                        period=periods_max[i],
                        period_max=periods_max[i],
                        util=utils[i],
                        deadline=periods_max[i],
                        tid=se_task_tid[i]))

    return se_taskset, utils
Exemplo n.º 3
0
def get_se_taskset(n, total_se_util):
    """ Returns SE takset (a list of n SE task) """

    periods = get_periods(n, PARAMS.SE_PERIOD_MAX_LO, PARAMS.SE_PERIOD_MAX_HI)
    utils = get_utils(n, total_se_util)
    wcets = get_wcets(utils, periods)

    se_taskset = []
    for i in range(0, n):
        se_taskset.append(tsk.SE_Task(wcet=wcets[i],
                                       period=periods[i],
                                       period_max=periods[i],
                                       util=utils[i],
                                       deadline=periods[i], tid=i))

    return se_taskset