Commit 05025046 authored by Marco Perronet's avatar Marco Perronet
Browse files

Fix trace generator, update example traces

parent 0674f5c5
Pipeline #58194 failed with stages
in 43 seconds
......@@ -5,4 +5,6 @@ __pycache__/*
*.py[cod]
*$py.class
_local/*
# Output
debug/output
\ No newline at end of file
all:
python3 trace_generator.py -o debug/output/1-periodic_one_perfect.yaml -u 1000 debug/1-periodic_one_perfect.yaml
python3 trace_generator.py -o debug/output/1-periodic_one_perfect.yaml -u 10000000000 debug/1-periodic_one_perfect.yaml
python3 trace_generator.py -o debug/output/2-periodic_one_jitter.yaml -u 2000 debug/2-periodic_one_jitter.yaml
python3 trace_generator.py -o debug/output/3-periodic_one_variable_job_cost.yaml -u 3000 debug/3-periodic_one_variable_job_cost.yaml
python3 trace_generator.py -o debug/output/4-periodic_one_variable_job_cost_jitter -u 4000 debug/4-periodic_one_variable_job_cost_jitter.yaml
\ No newline at end of file
python3 trace_generator.py -o debug/output/4-periodic_one_variable_job_cost_jitter -u 4000 debug/4-periodic_one_variable_job_cost_jitter.yaml
clean:
rm debug/output/*
rmdir debug/output
......@@ -2,8 +2,8 @@
task set:
- id: 1
period: 100
best-case execution time: 50
worst-case execution time: 50
period: 1000000000
best-case execution time: 100000000
worst-case execution time: 100000000
priority: 1
...
\ No newline at end of file
import random as rnd
FIRST_TS = 10_000_000
class TraceEvent:
def __init__(self, instant, etype, pid):
self.etype = etype
......@@ -20,10 +22,11 @@ def generate_trace(problem_instance, horizon):
assert t.jitter + t.wcet < t.period, "Self-interference not supported"
trace = []
time = 0
while time < horizon:
time = FIRST_TS
while time < horizon + FIRST_TS:
arrival = time+rnd.randint(0,t.jitter)
trace += [TraceEvent(arrival, "Activation", t.id)]
trace += [TraceEvent(arrival, "Resume", t.id)]
trace += [TraceEvent(arrival+rnd.randint(t.bcet,t.wcet), "Deactivation", t.id)]
assert trace[-1].instant > trace[-2].instant
......
---
- etype: Activation
pid: 1
instant: 0
instant: 10000000
- etype: Resume
pid: 1
instant: 10000000
- etype: Deactivation
pid: 1
instant: 50
instant: 110000000
- etype: Activation
pid: 1
instant: 100
instant: 1010000000
- etype: Resume
pid: 1
instant: 1010000000
- etype: Deactivation
pid: 1
instant: 150
instant: 1110000000
- etype: Activation
pid: 1
instant: 200
instant: 2010000000
- etype: Resume
pid: 1
instant: 2010000000
- etype: Deactivation
pid: 1
instant: 250
instant: 2110000000
- etype: Activation
pid: 1
instant: 300
instant: 3010000000
- etype: Resume
pid: 1
instant: 3010000000
- etype: Deactivation
pid: 1
instant: 350
instant: 3110000000
- etype: Activation
pid: 1
instant: 400
instant: 4010000000
- etype: Resume
pid: 1
instant: 4010000000
- etype: Deactivation
pid: 1
instant: 450
instant: 4110000000
- etype: Activation
pid: 1
instant: 500
instant: 5010000000
- etype: Resume
pid: 1
instant: 5010000000
- etype: Deactivation
pid: 1
instant: 550
instant: 5110000000
- etype: Activation
pid: 1
instant: 600
instant: 6010000000
- etype: Resume
pid: 1
instant: 6010000000
- etype: Deactivation
pid: 1
instant: 650
instant: 6110000000
- etype: Activation
pid: 1
instant: 700
instant: 7010000000
- etype: Resume
pid: 1
instant: 7010000000
- etype: Deactivation
pid: 1
instant: 750
instant: 7110000000
- etype: Activation
pid: 1
instant: 800
instant: 8010000000
- etype: Resume
pid: 1
instant: 8010000000
- etype: Deactivation
pid: 1
instant: 850
instant: 8110000000
- etype: Activation
pid: 1
instant: 900
instant: 9010000000
- etype: Resume
pid: 1
instant: 9010000000
- etype: Deactivation
pid: 1
instant: 950
instant: 9110000000
...
---
- etype: Activation
pid: 1
instant: 12
instant: 10000016
- etype: Resume
pid: 1
instant: 10000016
- etype: Deactivation
pid: 1
instant: 62
instant: 10000066
- etype: Activation
pid: 1
instant: 110
instant: 10000101
- etype: Resume
pid: 1
instant: 10000101
- etype: Deactivation
pid: 1
instant: 160
instant: 10000151
- etype: Activation
pid: 1
instant: 203
instant: 10000216
- etype: Resume
pid: 1
instant: 10000216
- etype: Deactivation
pid: 1
instant: 253
instant: 10000266
- etype: Activation
pid: 1
instant: 307
instant: 10000304
- etype: Resume
pid: 1
instant: 10000304
- etype: Deactivation
pid: 1
instant: 357
instant: 10000354
- etype: Activation
pid: 1
instant: 418
instant: 10000404
- etype: Resume
pid: 1
instant: 10000404
- etype: Deactivation
pid: 1
instant: 468
instant: 10000454
- etype: Activation
pid: 1
instant: 500
instant: 10000501
- etype: Resume
pid: 1
instant: 10000501
- etype: Deactivation
pid: 1
instant: 550
instant: 10000551
- etype: Activation
pid: 1
instant: 602
instant: 10000607
- etype: Resume
pid: 1
instant: 10000607
- etype: Deactivation
pid: 1
instant: 652
instant: 10000657
- etype: Activation
pid: 1
instant: 717
instant: 10000703
- etype: Resume
pid: 1
instant: 10000703
- etype: Deactivation
pid: 1
instant: 767
instant: 10000753
- etype: Activation
pid: 1
instant: 815
instant: 10000811
- etype: Resume
pid: 1
instant: 10000811
- etype: Deactivation
pid: 1
instant: 865
instant: 10000861
- etype: Activation
pid: 1
instant: 914
instant: 10000901
- etype: Resume
pid: 1
instant: 10000901
- etype: Deactivation
pid: 1
instant: 964
instant: 10000951
- etype: Activation
pid: 1
instant: 1020
instant: 10001010
- etype: Resume
pid: 1
instant: 10001010
- etype: Deactivation
pid: 1
instant: 1070
instant: 10001060
- etype: Activation
pid: 1
instant: 1108
instant: 10001119
- etype: Resume
pid: 1
instant: 10001119
- etype: Deactivation
pid: 1
instant: 1158
instant: 10001169
- etype: Activation
pid: 1
instant: 1216
instant: 10001203
- etype: Resume
pid: 1
instant: 10001203
- etype: Deactivation
pid: 1
instant: 1266
instant: 10001253
- etype: Activation
pid: 1
instant: 1307
instant: 10001315
- etype: Resume
pid: 1
instant: 10001315
- etype: Deactivation
pid: 1
instant: 1357
instant: 10001365
- etype: Activation
pid: 1
instant: 1410
instant: 10001407
- etype: Resume
pid: 1
instant: 10001407
- etype: Deactivation
pid: 1
instant: 1460
instant: 10001457
- etype: Activation
pid: 1
instant: 1506
instant: 10001509
- etype: Resume
pid: 1
instant: 10001509
- etype: Deactivation
pid: 1
instant: 1556
instant: 10001559
- etype: Activation
pid: 1
instant: 1603
instant: 10001614
- etype: Resume
pid: 1
instant: 10001614
- etype: Deactivation
pid: 1
instant: 1653
instant: 10001664
- etype: Activation
pid: 1
instant: 1710
instant: 10001704
- etype: Resume
pid: 1
instant: 10001704
- etype: Deactivation
pid: 1
instant: 1760
instant: 10001754
- etype: Activation
pid: 1
instant: 1800
instant: 10001800
- etype: Resume
pid: 1
instant: 10001800
- etype: Deactivation
pid: 1
instant: 1850
instant: 10001850
- etype: Activation
pid: 1
instant: 1907
instant: 10001905
- etype: Resume
pid: 1
instant: 10001905
- etype: Deactivation
pid: 1
instant: 1957
instant: 10001955
...
---
- etype: Activation
pid: 1
instant: 0
instant: 10000000
- etype: Resume
pid: 1
instant: 10000000
- etype: Deactivation
pid: 1
instant: 21
instant: 10000050
- etype: Activation
pid: 1
instant: 100
instant: 10000100
- etype: Resume
pid: 1
instant: 10000100
- etype: Deactivation
pid: 1
instant: 121
instant: 10000119
- etype: Activation
pid: 1
instant: 200
instant: 10000200
- etype: Resume
pid: 1
instant: 10000200
- etype: Deactivation
pid: 1
instant: 204
instant: 10000202
- etype: Activation
pid: 1
instant: 300
instant: 10000300
- etype: Resume
pid: 1
instant: 10000300
- etype: Deactivation
pid: 1
instant: 347
instant: 10000321
- etype: Activation
pid: 1
instant: 400
instant: 10000400
- etype: Resume
pid: 1
instant: 10000400
- etype: Deactivation
pid: 1
instant: 436
instant: 10000424
- etype: Activation
pid: 1
instant: 500
instant: 10000500
- etype: Resume
pid: 1
instant: 10000500
- etype: Deactivation
pid: 1
instant: 543
instant: 10000542
- etype: Activation
pid: 1
instant: 600
instant: 10000600
- etype: Resume
pid: 1
instant: 10000600
- etype: Deactivation
pid: 1
instant: 605
instant: 10000602
- etype: Activation
pid: 1
instant: 700
instant: 10000700
- etype: Resume
pid: 1
instant: 10000700
- etype: Deactivation
pid: 1
instant: 701
instant: 10000701
- etype: Activation
pid: 1
instant: 800
instant: 10000800
- etype: Resume
pid: 1
instant: 10000800
- etype: Deactivation
pid: 1
instant: 806
instant: 10000850
- etype: Activation
pid: 1
instant: 900
instant: 10000900
- etype: Resume
pid: 1
instant: 10000900
- etype: Deactivation
pid: 1
instant: 946
instant: 10000929
- etype: Activation
pid: 1
instant: 1000
instant: 10001000
- etype: Resume
pid: 1
instant: 10001000
- etype: Deactivation
pid: 1
instant: 1037
instant: 10001043
- etype: Activation
pid: 1
instant: 1100
instant: 10001100
- etype: Resume
pid: 1
instant: 10001100
- etype: Deactivation
pid: 1
instant: 1142
instant: 10001143
- etype: Activation
pid: 1
instant: 1200
instant: 10001200
- etype: Resume
pid: 1
instant: 10001200
- etype: Deactivation
pid: 1
instant: 1210
instant: 10001215
- etype: Activation
pid: 1
instant: 1300
instant: 10001300
- etype: Resume
pid: 1
instant: 10001300
- etype: Deactivation
pid: 1
instant: 1311
instant: 10001322
- etype: Activation
pid: 1
instant: 1400
instant: 10001400
- etype: Resume
pid: 1
instant: 10001400
- etype: Deactivation
pid: 1
instant: 1407
instant: 10001412
- etype: Activation
pid: 1
instant: 1500
instant: 10001500
- etype: Resume
pid: 1
instant: 10001500
- etype: Deactivation
pid: 1
instant: 1524
instant: 10001518
- etype: Activation
pid: 1
instant: 1600
instant: 10001600
- etype: Resume
pid: 1
instant: 10001600
- etype: Deactivation
pid: 1
instant: 1617
instant: 10001647
- etype: Activation
pid: 1
instant: 1700
instant: 10001700
- etype: Resume
pid: 1
instant: 10001700
- etype: Deactivation
pid: 1
instant: 1716
instant: 10001729
- etype: Activation
pid: 1
instant: 1800
instant: 10001800
- etype: Resume