Beispiel #1
0
 def test_none(self):
     ts = fp.charge_scheduling_overheads(None, 4,  False, self.ts)
     self.assertIsNot(ts, False)
     self.assertIsNot(ts, self.ts)
     self.unchanged_cost()
     self.unchanged_period()
     self.unchanged_deadline()
Beispiel #2
0
 def test_none(self):
     ts = fp.charge_scheduling_overheads(None, 4, False, self.ts)
     self.assertIsNot(ts, False)
     self.assertIsNot(ts, self.ts)
     self.unchanged_cost()
     self.unchanged_period()
     self.unchanged_deadline()
Beispiel #3
0
 def test_release_latency(self):
     self.o.release_latency = const(1)
     ts = fp.charge_scheduling_overheads(self.o, 4,  False, self.ts)
     self.assertEqual(fp.quantize_params(ts), ts)
     self.assertIsNot(ts, False)
     self.assertIsNot(ts, self.ts)
     self.unchanged_cost()
     self.unchanged_period()
     self.unchanged_deadline()
     self.assertEqual(self.ts[0].jitter, 1)
     self.assertEqual(self.ts[1].jitter, 1)
Beispiel #4
0
 def test_cache_affinity_loss(self):
     self.o.cache_affinity_loss = const(1)
     ts = fp.charge_scheduling_overheads(self.o, 4,  False, self.ts)
     self.assertEqual(fp.quantize_params(ts), ts)
     self.assertIsNot(ts, False)
     self.assertIsNot(ts, self.ts)
     self.assertEqual(self.ts[0].cost, 10001)
     self.assertEqual(self.ts[1].cost,  5001)
     self.unchanged_period()
     self.unchanged_deadline()
     self.no_jitter()
Beispiel #5
0
 def test_release_latency(self):
     self.o.release_latency = const(1)
     ts = fp.charge_scheduling_overheads(self.o, 4, False, self.ts)
     self.assertEqual(fp.quantize_params(ts), ts)
     self.assertIsNot(ts, False)
     self.assertIsNot(ts, self.ts)
     self.unchanged_cost()
     self.unchanged_period()
     self.unchanged_deadline()
     self.assertEqual(self.ts[0].jitter, 1)
     self.assertEqual(self.ts[1].jitter, 1)
Beispiel #6
0
 def test_cache_affinity_loss(self):
     self.o.cache_affinity_loss = const(1)
     ts = fp.charge_scheduling_overheads(self.o, 4, False, self.ts)
     self.assertEqual(fp.quantize_params(ts), ts)
     self.assertIsNot(ts, False)
     self.assertIsNot(ts, self.ts)
     self.assertEqual(self.ts[0].cost, 10001)
     self.assertEqual(self.ts[1].cost, 5001)
     self.unchanged_period()
     self.unchanged_deadline()
     self.no_jitter()
Beispiel #7
0
 def test_tick(self):
     self.o.tick = const(123)
     self.o.quantum_length = 777
     ts = fp.charge_scheduling_overheads(self.o, 4,  False, self.ts)
     self.assertEqual(fp.quantize_params(ts), ts)
     self.assertIsNot(ts, False)
     self.assertIsNot(ts, self.ts)
     self.unchanged_cost()
     self.unchanged_period()
     self.unchanged_deadline()
     self.no_jitter()
     self.assertEqual(ts[0].cost, 123)
     self.assertEqual(ts[0].period, 777)
Beispiel #8
0
 def test_tick(self):
     self.o.tick = const(123)
     self.o.quantum_length = 777
     ts = fp.charge_scheduling_overheads(self.o, 4, False, self.ts)
     self.assertEqual(fp.quantize_params(ts), ts)
     self.assertIsNot(ts, False)
     self.assertIsNot(ts, self.ts)
     self.unchanged_cost()
     self.unchanged_period()
     self.unchanged_deadline()
     self.no_jitter()
     self.assertEqual(ts[0].cost, 123)
     self.assertEqual(ts[0].period, 777)
Beispiel #9
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
Beispiel #10
0
    u_avg_99 = 0.0
    u_max_99 = 0.0
    
    for u in float_range(0.2, 1.01, 0.01):
        b_lp = 0
        b_lp_avg = 0
        b_lp_max = 0
        
        for i in range(0, 50000):
            ts = ts_random(3, u, wgs);
            
            if u_no == 0.0:
                b_lp += ts_test(ts)
            
            if u_avg == 0.0:
                ts_lp_avg = fp.charge_scheduling_overheads(o_np_avg, 1,  False, ts.copy())
                b_lp_avg += ts_test(ts_lp_avg)
            
            if u_max == 0.0:
                ts_lp_max = fp.charge_scheduling_overheads(o_np_max, 1,  False, ts.copy())
                b_lp_max += ts_test(ts_lp_max)
        # endfor       
        
        if u_no == 0.0 and b_lp < 45000:
            u_no = u - 0.01
            
        if u_no_99 == 0.0 and b_lp < 49500:
            u_no_99 = u - 0.01

        if u_avg == 0.0 and b_lp_avg < 45000:
            u_avg = u - 0.01