def test_dedicated_irq_pfrw_blocking(self): cluster_size = 2 dedicated_cpu = 0 res = cpp.phase_fair_rw_bounds(self.rsi, cluster_size, dedicated_cpu) self.assertEqual(0, res.get_arrival_blocking(15)) self.assertEqual(6, res.get_blocking_count(15)) self.assertEqual(1 + 6 + 10 + 7, res.get_blocking_term(15)) arrival = 1 + 6 + 10 + 14 self.assertEqual(arrival, res.get_arrival_blocking(0)) self.assertEqual(7 + 6, res.get_blocking_count(0)) self.assertEqual(arrival + 6 + 10 + 14, res.get_blocking_term(0)) res = cpp.phase_fair_rw_bounds(self.rsi_rw, cluster_size, dedicated_cpu) self.assertEqual(0, res.get_arrival_blocking(15)) self.assertEqual(2, res.get_blocking_count(15)) self.assertEqual(1 + 7, res.get_blocking_term(15)) arrival = 1 + 7 self.assertEqual(arrival, res.get_arrival_blocking(0)) self.assertEqual(3, res.get_blocking_count(0)) # pessimism self.assertEqual(arrival + 7, res.get_blocking_term(0))
def apply_phase_fair_rw_bounds(all_tasks, procs_per_cluster, dedicated_irq=cpp.NO_CPU): model = get_cpp_model_rw(all_tasks) res = cpp.phase_fair_rw_bounds(model, procs_per_cluster, dedicated_irq) apply_suspension_oblivious(all_tasks, res) return res
def apply_phase_fair_rw_bounds(all_tasks, procs_per_cluster, dedicated_irq=cpp.NO_CPU, pi_aware=False): model = get_cpp_model_rw(all_tasks) res = cpp.phase_fair_rw_bounds(model, procs_per_cluster, dedicated_irq) if pi_aware: apply_pi_aware_spin_inflation(all_tasks, res) else: apply_suspension_oblivious(all_tasks, res) return res
def test_arrival_blocking_pf(self): c = 1 res = cpp.phase_fair_rw_bounds(self.rsi1, c) self.assertEqual(6 + 7 + 7, res.get_arrival_blocking(0)) self.assertEqual(5 + 7 + 7, res.get_arrival_blocking(1)) self.assertEqual(0, res.get_arrival_blocking(2)) self.assertEqual(0, res.get_arrival_blocking(3)) self.assertEqual(7 + 7 + 77, res.get_arrival_blocking(4)) self.assertEqual(0, res.get_arrival_blocking(5))