Skip to content

A simple RTS (Real-time system) priority-based scheduler simulation library.

Notifications You must be signed in to change notification settings

vedvartak/RTS-Scheduler-SimLib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RTS-Scheduler-SimLib

Introduction

A simple RTS (Real-time system) priority-based scheduler simulation library for periodic tasks in C++.

Features

  1. Task Manager to create and manage task jobs.
  2. Task set generator to generate schedulable task set with zero starting phase.
  3. Inbuilt scheduling algorithms.
## Inbuilt algorithms
  • RMA
  • DMA
  • EDF
  • LST

How to compile

To use this library you only require implimentation files in src and header files in includes. The library can be compiled using any prefered C++ compiler e.g., GCC, MSVC, Clang etc. You just need to compile implimentation files in src along with your project with includes folder added as include folder using compiler options ("-I {folder-path}" for GCC and Clang).

gcc {path-to-src}/* {path-to-your-src-files} -I {path-to-includes}

If required, you can compile the source code into static library that way you will only have to link it with includes folder added as include folder while compiling your project.

How to use

Once you add includes folder as include folder for your compiler simply include header files that you require into your source files. E.g.,

#include <taskmanager.h>
#include <rma.h>

Usage sample

#include <cstdio>
#include <iostream>
#include<taskmanager.h>
#include<taskgenerator.h>
#include<rma.h>

int main()
{
    TaskManager<RMA> manager; //Creating a task manager with RMA as scheduler.
    TaskGenerator<RMA> generator; //Creating a task generator for RMA.
    auto tlist=generator.generate(3); //Generate 3 tasks.
    std::cout<<"Random tasks:\n";
    //Adding generated tasks to task manager.
    for (size_t i = 0; i < tlist.size(); i++)
    {
        manager.addTask(tlist[i].getStartT(),tlist[i].getPeriod(),tlist[i].getExectime(),tlist[i].getRelDeadline());
    }
    std::cout<<"=======================================================================================\n";
    std::cout<<"hp:"<<manager.getScheduleIntervel()<<"\n";
    std::cout<<"utilization :"<<TaskManager<RMA>::calcnetutil(tlist)<<" < "<<RMA::schedulable_util(tlist.size())<<'\n';

    std::cout<<"target tasks:\n";
    manager.printTasks();
    scanf("%*c");
    std::cout<<"=======================================================================================\n";
    manager.run(); //Run simulation for default duration.
    scanf("%*c");
    std::cout<<"history:\n";
    manager.printHistory(); //Print simulation history.

    return 0;
}

About

A simple RTS (Real-time system) priority-based scheduler simulation library.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages