diff options
author | Julian T <julian@jtle.dk> | 2020-06-06 18:14:58 +0200 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2020-06-06 18:14:58 +0200 |
commit | 94d3cbfcc66c276206d405075c5966fdb0450959 (patch) | |
tree | c2b2b3a2d7ea48545273eb58d8eabbb8c6d345a3 /sem4/embedded/eksamnen | |
parent | f6818586ba2e29375560f58c216f043e4f320cbf (diff) |
Progressed in embedded assignments
Diffstat (limited to 'sem4/embedded/eksamnen')
-rw-r--r-- | sem4/embedded/eksamnen/M7opg.adoc | 18 | ||||
-rwxr-xr-x | sem4/embedded/eksamnen/schedsolver.rb | 10 |
2 files changed, 24 insertions, 4 deletions
diff --git a/sem4/embedded/eksamnen/M7opg.adoc b/sem4/embedded/eksamnen/M7opg.adoc index cd560cc..7bb41c5 100644 --- a/sem4/embedded/eksamnen/M7opg.adoc +++ b/sem4/embedded/eksamnen/M7opg.adoc @@ -15,3 +15,21 @@ schedulability criterion. ____ _Does utilization guarantee feasibility of an RMA schedule?_ ____ + +Ved at køre RMA fra 0 til 400, kan man se at der er schedulable. + + + +Først regner jeg utilization ud. + +---- +U = 20/50 + 20/80 = 0.65 +---- + +Derefter kan man regne utilization critereon ud. + +---- +\overline{U} = 2 * (2^(1/2) - 1) = 0.82 +---- + +Her kan man garantere at RMA er schedulable. diff --git a/sem4/embedded/eksamnen/schedsolver.rb b/sem4/embedded/eksamnen/schedsolver.rb index ca2e619..bf9c467 100755 --- a/sem4/embedded/eksamnen/schedsolver.rb +++ b/sem4/embedded/eksamnen/schedsolver.rb @@ -78,12 +78,14 @@ class Scheduler curtask = nextTask(index) new = {:task => curtask, :remain => []} @tasks.each_with_index do |task, i| + # Check for deadline miss + intoperiod = index % task[:period] + if intoperiod >= task[:deadline] && @states.last[:remain][i] > 0 + puts "Deadline missed in task #{i}" + exit + end # Check if start of new period if index % task[:period] == 0 - if @states.last and @states.last[:remain][i] > 0 - puts "Deadline missed in task #{i}" - exit - end new[:remain] << task[:complete] else new[:remain] << @states.last[:remain][i] |