Example SPAK code for finding the factor by which the WCET of each task, taken separately, must be scaled to make the set feasible:
  struct task_set *ts;
  int i;
  
  max_resp = 1000000;

  ts = create_task_set (18, 10, 500, 0,
                        "audsley93_t3", 
                        1000, 0, 0, 0,
                        "Tindell92_restricted");

  //                       C       T      D  J  B  name
  new_simple_task (ts,  3500, 200000,  5000, 0, 0, "t1");
  new_simple_task (ts,  2000,  25000, 25000, 0, 0, "t2");
  new_simple_task (ts,  5000,  25000, 25000, 0, 0, "t3");
  new_simple_task (ts,  1000,  40000, 40000, 0, 0, "t4");
  new_simple_task (ts,  9000,  50000, 50000, 0, 0, "t5");
  new_simple_task (ts,  5000,  50000, 50000, 0, 0, "t6");
  new_simple_task (ts,  8000,  59000, 59000, 0, 0, "t7");
  new_simple_task (ts, 12000,  80000, 80000, 0, 0, "t8");
  new_simple_task (ts,  2000,  80000, 80000, 0, 0, "t9");

  make_all_preemptible (ts);
  set_priorities (ts, DM);

  for (i=0; i<=9; i++) {
    time_value orig = get_wcet (ts, i);
    double scale;

    for (scale = 1.0; scale > 0; scale -= 0.001) {
      set_wcet (ts, i, orig * scale);
      if (feasible (ts, FALSE) == num_tasks (ts)) {
        printf ("task %d : WCET must be scaled by %f to make the set feasible\n",
        i, scale);
        goto out;
      }
    }
    printf ("task %d : no scaling of this task can make the set feasible!\n", i);

   out:
    set_wcet (ts, i, orig);
  }



Back to the main SPAK page.