pkrc267 / MLLF-with-EDF

Working code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MLLF-with-EDF


Directory structure:

├── README.txt
├── dataStructures.h
├── getters.c
├── getters.h
├── helper.c
├── helper.h
├── main.c
├── makefile
├── mllf
├── mllf_schedule.txt
├── schedule_analysis.txt
├── scheduler.c
├── scheduler.h
├── scheduler_helper.c
└── taskset.txt


Instructions to compile:

  • navigate to the project directory and type command
     make

  • this generates executable named 'mllf'

  • feed input file as a paramenter while executing the output file
     ./mllf taskset.txt

  • this generates two text files as described below:

  • required schedule is available in file

    mllf_schedule.txt

  • parameters can be viewed in file

    schedule_analysis.txt


Input file is organised as follows:

No of tasks
Arrival,WCET,period,deadline

What has been tried:

(in order mentioned below)

  • taskset read
  • utilization calculated
  • hyper-period calculated
  • job-list created
  • scheduling performed
  • parameter calculations: Absolute Response Jitter, Relative Response Jitter

What works:

  • hyper-period computation
  • utilization computation
  • scheduling

What does not work:

  • scheduler not getting invoked when out-of-phase job get's released

What approach?

  • instead of making a queue of ready jobs, we have tried to simulate the same using: ---- getNextEDFJob() ---- getNextArrival() functions in getters.c file.

  • job's arrival is checked while on the run, instead of making a list of jobs before hand; and admitted accordingly.


Function description:

scheduler.c

void mllfScheduler() : It schedules the taskset read and writes it to the mllf_schedule.txt. It calculates number of preemptions and context switches to the schedule_analysis.txt.

scheduler_helper.c

task* initializeTaskAttributes() : ionitializes the tasks and makes a taskset

job* jobInitialization() : initializes parameters of the job that arrives in the system

void slackUpdation() : updates slack time of the ready jobs

arrivalsCheck(): it adds job that arrives at or before the current time

getters.c

int getRandomNumber() : It generates random number between given lower_bound and upper_bound. (between 50 to 100)

int getGCD() : It returns Greatest Common Divisor(GCD) of two numbers.

int getHyperperiod() : It returns Hyper-Period of the taskset read.

float getMinimumLaxity() : It returns minimum laxity/slack value of the job from the ready queue.

int getMinimumLaxity_procs() : It returns minimum laxity/slack value job index.

int getNextEDFJob(): It returns index of job having least deadline.

float getNextArrival() : It returns the next arrival time of the task i.e. when a new job arrives.

helper.c

void getTasksfromFile() : It reads taskset from the taskset.txt file. It also initializes task as well as job.

static void getARJ() : It calculates and writes Absolute Response Jitter time in schedule_analysis.txt.

static void getRRJ() : It writes Relative Response Jitter time in schedule_analysis.txt.

void calculateTaskParameters() : It calls static void getARJ() and getRRJ().

About

Working code

License:MIT License


Languages

Language:C 99.5%Language:Makefile 0.5%