项目作者: egk696

项目描述 :
A simple SMT-based schedule generator for cyclic executives of real-time tasks
高级语言: Python
项目地址: git://github.com/egk696/SimpleSMTScheduler.git
创建时间: 2019-10-21T15:01:53Z
项目社区:https://github.com/egk696/SimpleSMTScheduler

开源协议:GNU Lesser General Public License v3.0

下载


SimpleSMTScheduler

A simple SMT-based schedule generator for cyclic executives real-time tasks

To quickly use the application online please visit us at: Simple Cyclic Scheduler Online

Usage

The application can run in two modes, either interactive or via command-line.
When the application is started with no arguments it implicitly enters interactive mode.
Tasks are defined in a CSV file as shown in the examples/simple_tasks.csv

Interactive Mode

In the interactive mode the application generates a schedule based on the provided task definitions and displays
a plot of the first N hyperperiods.

Start the application by running:

  1. python3 SimpleSMTScheduler.py

Proceed to enter the path to the desired CSV file as requested in the command prompt and hit enter.
Enter the desired number of hyperperiods to be plotted and hit enter.
After the schedule is generated the applications will report in the command prompt the calculated activations times
as shown in the example below:

  1. ~/SimpleSMTScheduler$ python3 SimpleSMTScheduler.py
  2. Welcome to this simple SMT scheduler (SSMTS)...
  3.  
  4. Enter the csv file for the tasks to be scheduled: examples/simple_tasks.csv
  5. Enter the WCET allocation gap between activations: 50
  6. Enter the number of hyper periods to be plotted: 2
  7. Enable statistics (Yes/No)? No
  8. Importing task set from file source...
  9.  
  10. Task_T1 {
  11. T=20000.0,
  12. C=1500.0,
  13. D=20000.0,
  14. O=0.0,
  15. J=0.0,
  16. };
  17. Task_T2 {
  18. T=5000.0,
  19. C=750.0,
  20. D=5000.0,
  21. O=0.0,
  22. J=0.0,
  23. };
  24. Task_T3 {
  25. T=10000.0,
  26. C=500.0,
  27. D=10000.0,
  28. O=0.0,
  29. J=0.0,
  30. };
  31. Task_T4 {
  32. T=100000.0,
  33. C=1500.0,
  34. D=100000.0,
  35. O=0.0,
  36. J=0.0,
  37. };
  38. Task_T5 {
  39. T=2500.0,
  40. C=500.0,
  41. D=2500.0,
  42. O=0.0,
  43. J=0.0,
  44. };
  45. Task_T6 {
  46. T=1000.0,
  47. C=10.0,
  48. D=1000.0,
  49. O=0.0,
  50. J=2000.0,
  51. };
  52.  
  53. Utilization = 50.0 %
  54. Schedule hyper period = 100000
  55.  
  56. Solver completed in 1475.8541584014893 ms
  57.  
  58. Schedule plotted for 2 hyper-periods
  59.  
  60. Name Activation Instances
  61. T5 [0, 2500, 5000, 7500, 10000, 12500, 15000, 17500, 20000, 22500, 25000, 27500, 30000, 32500, 35000, 37500, 40000, 42500, 45000, 47500, 50000, 52500, 55000, 57500, 60000, 62500, 65000, 67500, 70000, 72500, 75000, 77500, 80000, 82500, 85000, 87500, 90000, 92500, 95000, 97500]
  62. T4 [890]
  63. T6 [2440, 3600, 3600, 5550, 5550, 7440, 8600, 9460, 10990, 11990, 12440, 13600, 14460, 15550, 15550, 15550, 18550, 19460, 20990, 21990, 22440, 23600, 24460, 25550, 25550, 27440, 28600, 29460, 30990, 31930, 32440, 33600, 34460, 35550, 35550, 35550, 38550, 39460, 40990, 41990, 42440, 43600, 44460, 45550, 45550, 47440, 48550, 49460, 50990, 51990, 52440, 53600, 54460, 55550, 55550, 55550, 58550, 59460, 60990, 61990, 62440, 63600, 64460, 65550, 65550, 65550, 68550, 69460, 70990, 71990, 72440, 73600, 74460, 75550, 75550, 75550, 78550, 79460, 80990, 81990, 82440, 83600, 84460, 85550, 85550, 85550, 88050, 89460, 90990, 91990, 92440, 93600, 94460, 95550, 95550, 95600, 98600, 99460, 99460, 99460]
  64. T3 [3050, 13050, 23050, 33050, 43050, 53050, 63050, 73050, 83050, 93050]
  65. T2 [3660, 8660, 13660, 18660, 23660, 28660, 33660, 38660, 43660, 48660, 53660, 58660, 63660, 68660, 73660, 78660, 83660, 88660, 93660, 98660]
  66. T1 [5890, 25890, 45890, 65890, 85890]

A window should open displaying the plotted schedule for the first N hyperperiods as shown in the example Figure below:

Example Tasks Schedule

Command-line Mode

In the command-line mode the application executes according to the provided arguments. To see the available commands
run:

  1. python3 SimpleSMTScheduler.py -h

The available arguments are the following:

-h (--help) displays the available arguments

-i (--itasks) accepts as input the path to the tasks CSV file

-w (--wcet) accepts as input WCET gap to be allocated between tasks

-p (--plot) accepts as input the path for the generated schedule plot

-n (--nperiods) controls the plotted number of hyper periods

-o (--optimize) enables optimization

-v (--verbose) enables display of generated constraints and statistics

-c (--code) enables C header file code generation

A typical example of six tasks with WCET inter-task allocation gap 50 is shown below:

  1. ~/SimpleSMTScheduler$ python3 SimpleSMTScheduler.py -w 50 -p examples/simple_tasks.csv
  2.  
  3. Welcome to this simple SMT scheduler (SSMTS)...
  4. Importing task set from file source...
  5.  
  6. Task_T1 {
  7. T=20000.0,
  8. C=1500.0,
  9. D=20000.0,
  10. O=0.0,
  11. J=0.0,
  12. };
  13. Task_T2 {
  14. T=5000.0,
  15. C=750.0,
  16. D=5000.0,
  17. O=0.0,
  18. J=0.0,
  19. };
  20. Task_T3 {
  21. T=10000.0,
  22. C=500.0,
  23. D=10000.0,
  24. O=0.0,
  25. J=0.0,
  26. };
  27. Task_T4 {
  28. T=100000.0,
  29. C=1500.0,
  30. D=100000.0,
  31. O=0.0,
  32. J=0.0,
  33. };
  34. Task_T5 {
  35. T=2500.0,
  36. C=500.0,
  37. D=2500.0,
  38. O=0.0,
  39. J=0.0,
  40. };
  41. Task_T6 {
  42. T=1000.0,
  43. C=10.0,
  44. D=1000.0,
  45. O=0.0,
  46. J=2000.0,
  47. };
  48.  
  49. Utilization = 50.0 %
  50. Schedule hyper period = 100000
  51.  
  52. Solver completed in 1477.623462677002 ms
  53.  
  54. Name Activation Instances
  55. T5 [0, 2500, 5000, 7500, 10000, 12500, 15000, 17500, 20000, 22500, 25000, 27500, 30000, 32500, 35000, 37500, 40000, 42500, 45000, 47500, 50000, 52500, 55000, 57500, 60000, 62500, 65000, 67500, 70000, 72500, 75000, 77500, 80000, 82500, 85000, 87500, 90000, 92500, 95000, 97500]
  56. T4 [890]
  57. T6 [2440, 3600, 3600, 5550, 5550, 7440, 8600, 9460, 10990, 11990, 12440, 13600, 14460, 15550, 15550, 15550, 18550, 19460, 20990, 21990, 22440, 23600, 24460, 25550, 25550, 27440, 28600, 29460, 30990, 31930, 32440, 33600, 34460, 35550, 35550, 35550, 38550, 39460, 40990, 41990, 42440, 43600, 44460, 45550, 45550, 47440, 48550, 49460, 50990, 51990, 52440, 53600, 54460, 55550, 55550, 55550, 58550, 59460, 60990, 61990, 62440, 63600, 64460, 65550, 65550, 65550, 68550, 69460, 70990, 71990, 72440, 73600, 74460, 75550, 75550, 75550, 78550, 79460, 80990, 81990, 82440, 83600, 84460, 85550, 85550, 85550, 88050, 89460, 90990, 91990, 92440, 93600, 94460, 95550, 95550, 95600, 98600, 99460, 99460, 99460]
  58. T3 [3050, 13050, 23050, 33050, 43050, 53050, 63050, 73050, 83050, 93050]
  59. T2 [3660, 8660, 13660, 18660, 23660, 28660, 33660, 38660, 43660, 48660, 53660, 58660, 63660, 68660, 73660, 78660, 83660, 88660, 93660, 98660]
  60. T1 [5890, 25890, 45890, 65890, 85890]