Example #1
0
 def setUp(self):
     self.ts = tasks.TaskSystem([
         tasks.SporadicTask(10000, 100000),
         tasks.SporadicTask(5000, 50000),
     ])
     for t in self.ts:
         t.wss = 0
     self.o = m.Overheads()
Example #2
0
 def setUp(self):
     self.ts = tasks.TaskSystem([
         tasks.SporadicTask(9995, 100000),
         tasks.SporadicTask(4995, 50000),
     ])
     for t in self.ts:
         t.wss = 0
     self.o = m.Overheads()
     self.o.quantum_length = 500
Example #3
0
    def setUp(self):
        self.ts = tasks.TaskSystem([
            tasks.SporadicTask(10000, 100000),
            tasks.SporadicTask(5000, 50000),
        ])
        for t in self.ts:
            t.wss = 0
        res.initialize_resource_model(self.ts)
        self.ts[0].resmodel[0].add_request(11)
        self.ts[0].resmodel[0].add_request(7)
        self.ts[1].resmodel[0].add_request(17)

        self.ts[0].resmodel[1].add_read_request(11)
        self.ts[0].resmodel[1].add_read_request(1)
        self.ts[1].resmodel[1].add_read_request(17)

        self.ts[0].resmodel[2].add_read_request(11)
        self.ts[0].resmodel[2].add_read_request(1)
        self.ts[1].resmodel[2].add_write_request(17)
        self.ts[1].resmodel[2].add_write_request(1)

        self.o = m.Overheads()
Example #4
0
def ts_test(ts):
    global b
    global b_lp
    global b_np
    #global b_np_qpa
    global avg_np
    global max_np
    global avg_lp
    global max_lp
    global avg_p
    global max_p
    global printed_example
    
    o_np_avg = m.Overheads()
    o_np_avg.zero_overheads()
    o_np_avg.ctx_switch = const(27)
    
    o_np_max = m.Overheads()
    o_np_max.zero_overheads()
    o_np_max.ctx_switch = const(44)
    
    o_p_avg = m.Overheads()
    o_p_avg.zero_overheads()
    o_p_avg.ctx_switch = const(263)
    
    o_p_max = m.Overheads()
    o_p_max.zero_overheads()
    o_p_max.ctx_switch = const(434)
    
    for t in ts:
        t.wss = 0
    
    ts_np = make_np(ts.copy())
    ts_lp = make_lp(ts.copy())
    ts_np_avg = charge_sched_overheads_np(o_np_avg, ts_np.copy())
    ts_np_max = charge_sched_overheads_np(o_np_max, ts_np.copy())
    ts_lp_avg = fp.charge_scheduling_overheads(o_np_avg, 1,  False, ts_lp.copy())
    ts_lp_max = fp.charge_scheduling_overheads(o_np_max, 1,  False, ts_lp.copy())
    ts_p_avg = fp.charge_scheduling_overheads(o_p_avg, 1,  False, ts.copy())
    ts_p_max = fp.charge_scheduling_overheads(o_p_max, 1,  False, ts.copy())
    
    if edf.is_schedulable(1, ts):
        b += 1
    #if edf.is_schedulable(1, ts, preemptive=False):
    #    b_np += 1
    if edf.is_schedulable(1, ts_lp):
        b_lp += 1
    if edf.is_schedulable(1, ts_np):
        b_np += 1
    if edf.is_schedulable(1, ts_np_avg):
        avg_np += 1
    if edf.is_schedulable(1, ts_np_max):
        max_np += 1
    if edf.is_schedulable(1, ts_lp_avg):
        avg_lp += 1
    if edf.is_schedulable(1, ts_lp_max):
        max_lp += 1
    if edf.is_schedulable(1, ts_p_avg):
        avg_p += 1
    if edf.is_schedulable(1, ts_p_max):
        max_p += 1
Example #5
0
 def test_init(self):
     o = m.Overheads()
     self.assertEqual(o.schedule(10), 0)
     self.assertEqual(o.ctx_switch(10), 0)
     self.assertEqual(o.quantum_length, 1000)
Example #6
0
        while x < stop:
            my_list.append(x)
            x += step
    else: # should really be if step < 0 with an extra check for step == 0 
        while x > stop:
            my_list.append(x)
            x += step
    return my_list

def custom_range():
    my_list = range(2,10)+range(10,60,10)+range(60,201,20)
    print my_list
    return my_list

#main
o_np_avg = m.Overheads()
o_np_avg.zero_overheads()
o_np_avg.ctx_switch = const(27)

o_np_max = m.Overheads()
o_np_max.zero_overheads()
o_np_max.ctx_switch = const(44)

for wgs in custom_range():
    global u
    u_no = 0.0
    u_avg = 0.0
    u_max = 0.0
    u_no_99 = 0.0
    u_avg_99 = 0.0
    u_max_99 = 0.0