Ejemplo n.º 1
0
def runLPVSearch(tasksets):
    nbFullLPV = 0
    nbNoLPV = 0
    total = 0
    nbLPVTasks = 0
    nbTasks = 0
    for taskset in tasksets:
        lpvTasks = list(genLpViableTasks(taskset))
        nbLpv = len(lpvTasks)
        nbLPVTasks += nbLpv
        nbTasks += len(taskset)
        total += 1
        if nbLpv > 0:
            if nbLpv == len(taskset):
                nbFullLPV += 1
            print('{}/{} LPV Tasks {} \n'
                  'for taskset {}'.format(len(lpvTasks), len(taskset),
                                          lpvTasks, taskset))
            policy = rmLaxityPromotions(taskset)
            print('Policy {}'.format(policy))
        else:
            nbNoLPV += 1
            print('No LPV')
    print('Nb full LPV: {}'.format(nbFullLPV))
    print('Nb no LPV: {}'.format(nbNoLPV))
    print('Total: {}'.format(total))

    print('Fraction of LPV tasks: {}'.format(nbLPVTasks / nbTasks))
Ejemplo n.º 2
0
def rmlSetups(*tasksets):
    for taskset in tasksets:
        policy = rmLaxityPromotions(taskset)
        setup = SimulationSetup(taskset,
                                taskset.hyperperiod,
                                schedulingPolicy=policy)
        yield setup
Ejemplo n.º 3
0
def execFunction(taskset, lpvPrep):
    policy = rmLaxityPromotions(taskset, lpvPrep=lpvPrep)
    if len(policy.promotedTasks()) > 0:
        setup = SimulationSetup(taskset,
                                taskset.hyperperiod,
                                schedulingPolicy=policy,
                                trackHistory=False,
                                trackPreemptions=False)
        result = SimulationRun(setup).result()
        history = result.history
    else:
        history = True
    return history, policy, taskset
Ejemplo n.º 4
0
def test_laurent1():
    t1 = Task(2, 11, displayName='t1')
    t2 = Task(9, 19, displayName='t2')
    t3 = Task(7, 21, displayName='t3')
    taskset = Taskset(t1, t2, t3)

    policy = rmLaxityPromotions(taskset)
    setup = SimulationSetup(taskset,
                            taskset.hyperperiod,
                            schedulingPolicy=policy,
                            trackHistory=True,
                            trackPreemptions=False)
    result = SimulationRun(setup).result()
    history = result.history
    assert not history.hasDeadlineMiss()
Ejemplo n.º 5
0
def test_example7():
    t1 = Task(1, 5)
    t2 = Task(6, 39)
    t3 = Task(16, 39)
    taskset = Taskset(t1, t2, t3)

    policy = rmLaxityPromotions(taskset)
    setup = SimulationSetup(taskset,
                            taskset.hyperperiod,
                            schedulingPolicy=policy,
                            trackHistory=True,
                            trackPreemptions=False)
    result = SimulationRun(setup).result()
    history = result.history
    assert not history.hasDeadlineMiss()
Ejemplo n.º 6
0
def test_example6():
    t1 = Task(22, 87)
    t2 = Task(131, 237)
    t3 = Task(53, 280)
    taskset = Taskset(t1, t2, t3)

    policy = rmLaxityPromotions(taskset)
    setup = SimulationSetup(taskset,
                            taskset.hyperperiod,
                            schedulingPolicy=policy,
                            trackHistory=False,
                            trackPreemptions=False)
    result = SimulationRun(setup).result()
    history = result.history
    assert history.hasDeadlineMiss()
Ejemplo n.º 7
0
def test_damien1():
    t1 = Task(1, 4, displayName='t1')
    t2 = Task(2, 15, displayName='t2')
    t3 = Task(14, 23, displayName='t3')
    t4 = Task(1, 1380, displayName='t4')
    taskset = Taskset(t1, t2, t3, t4)

    policy = rmLaxityPromotions(taskset)
    setup = SimulationSetup(taskset,
                            taskset.hyperperiod,
                            schedulingPolicy=policy,
                            trackHistory=True,
                            trackPreemptions=False)
    result = SimulationRun(setup).result()
    history = result.history
    assert not history.hasDeadlineMiss()