def test_dedicated(self): self.o.ipi_latency = const(100) self.assertEqual(jlfp.charge_scheduling_overheads(self.o, 4, True, self.ts), self.ts) self.assertEqual(self.ts[0].cost, 10100) self.assertEqual(self.ts[1].cost, 5100) self.unchanged_period() self.unchanged_deadline() self.o.release = const(133) self.assertEqual(jlfp.charge_scheduling_overheads(self.o, 4, True, self.ts), self.ts) self.assertEqual(jlfp.quantize_params(self.ts), self.ts) self.assertEqual(self.ts[0].cost, 10333) self.assertEqual(self.ts[1].cost, 5333) self.unchanged_period() self.unchanged_deadline()
def test_release(self): self.o.release = const(1) self.assertEqual(jlfp.charge_scheduling_overheads(self.o, 4, False, self.ts), self.ts) self.assertEqual(jlfp.quantize_params(self.ts), self.ts) self.assertEqual(self.ts[0].cost, 10005) self.assertEqual(self.ts[1].cost, 5005) self.unchanged_period() self.unchanged_deadline()
def test_cache_affinity_loss(self): self.o.cache_affinity_loss = const(1) self.assertEqual(jlfp.charge_scheduling_overheads(self.o, 4, False, self.ts), self.ts) self.assertEqual(jlfp.quantize_params(self.ts), self.ts) self.assertEqual(self.ts[0].cost, 10001) self.assertEqual(self.ts[1].cost, 5001) self.unchanged_period() self.unchanged_deadline()
def test_release_latency(self): self.o.release_latency = const(1) self.assertEqual(jlfp.charge_scheduling_overheads(self.o, 4, False, self.ts), self.ts) self.assertEqual(jlfp.quantize_params(self.ts), self.ts) self.unchanged_cost() self.assertEqual(self.ts[0].period, 99999) self.assertEqual(self.ts[1].period, 49999) self.assertEqual(self.ts[0].deadline, 99999) self.assertEqual(self.ts[1].deadline, 49999)
def test_release(self): self.o.release = const(1) self.assertEqual( jlfp.charge_scheduling_overheads(self.o, 4, False, self.ts), self.ts) self.assertEqual(jlfp.quantize_params(self.ts), self.ts) self.assertEqual(self.ts[0].cost, 10005) self.assertEqual(self.ts[1].cost, 5005) self.unchanged_period() self.unchanged_deadline()
def test_cache_affinity_loss(self): self.o.cache_affinity_loss = const(1) self.assertEqual( jlfp.charge_scheduling_overheads(self.o, 4, False, self.ts), self.ts) self.assertEqual(jlfp.quantize_params(self.ts), self.ts) self.assertEqual(self.ts[0].cost, 10001) self.assertEqual(self.ts[1].cost, 5001) self.unchanged_period() self.unchanged_deadline()
def bound_cfl_with_oh(oheads, dedicated_irq, clusts): for clust in clusts: success = charge_scheduling_overheads(oheads, clust.cpus, dedicated_irq, clust) quantize_params(clust) if (success and has_bounded_tardiness(clust.cpus, clust)): bound_gfl_response_times(clust.cpus, clust, 15) else: return False return True
def post_blocking_term_oh_inflation(oheads, clusts): for clust in clusts: inflation = oheads.syscall_in(len(clust)) for t in clust: if t.arrival_blocked: t.cost += inflation t.arrival_blocked += inflation if not charge_scheduling_overheads(oheads, clust.cpus, True, clust): return False quantize_params(clust) return True
def test_dedicated(self): self.o.ipi_latency = const(100) self.assertEqual( jlfp.charge_scheduling_overheads(self.o, 4, True, self.ts), self.ts) self.assertEqual(self.ts[0].cost, 10100) self.assertEqual(self.ts[1].cost, 5100) self.unchanged_period() self.unchanged_deadline() self.o.release = const(133) self.assertEqual( jlfp.charge_scheduling_overheads(self.o, 4, True, self.ts), self.ts) self.assertEqual(jlfp.quantize_params(self.ts), self.ts) self.assertEqual(self.ts[0].cost, 10333) self.assertEqual(self.ts[1].cost, 5333) self.unchanged_period() self.unchanged_deadline()
def test_release_latency(self): self.o.release_latency = const(1) self.assertEqual( jlfp.charge_scheduling_overheads(self.o, 4, False, self.ts), self.ts) self.assertEqual(jlfp.quantize_params(self.ts), self.ts) self.unchanged_cost() self.assertEqual(self.ts[0].period, 99999) self.assertEqual(self.ts[1].period, 49999) self.assertEqual(self.ts[0].deadline, 99999) self.assertEqual(self.ts[1].deadline, 49999)
def test_tick_example(self): e1 = 2000 e2 = 3000 Q = 5000 tck = 2000 self.ts[0].cost = e1 self.ts[1].cost = e2 self.o.tick = const(tck) self.o.quantum_length = Q self.assertEqual(jlfp.charge_scheduling_overheads(self.o, 1, False, self.ts), self.ts) self.assertEqual(jlfp.quantize_params(self.ts), self.ts) self.assertEqual(self.ts[0].cost, int(ceil(30000 / 3))) self.assertEqual(self.ts[1].cost, 5000 + int(ceil(20000 / 3)))
def test_tick_example(self): e1 = 2000 e2 = 3000 Q = 5000 tck = 2000 self.ts[0].cost = e1 self.ts[1].cost = e2 self.o.tick = const(tck) self.o.quantum_length = Q self.assertEqual( jlfp.charge_scheduling_overheads(self.o, 1, False, self.ts), self.ts) self.assertEqual(jlfp.quantize_params(self.ts), self.ts) self.assertEqual(self.ts[0].cost, int(ceil(30000 / 3))) self.assertEqual(self.ts[1].cost, 5000 + int(ceil(20000 / 3)))
def test_none(self): self.assertEqual(jlfp.charge_scheduling_overheads(None, 4, False, self.ts), self.ts) self.unchanged_cost() self.unchanged_period() self.unchanged_deadline()
def test_none(self): self.assertEqual( jlfp.charge_scheduling_overheads(None, 4, False, self.ts), self.ts) self.unchanged_cost() self.unchanged_period() self.unchanged_deadline()