diff options
author | Namhoon Kim <namhoonk@ludwig.cs.unc.edu> | 2013-11-25 17:23:23 -0500 |
---|---|---|
committer | Namhoon Kim <namhoonk@ludwig.cs.unc.edu> | 2013-11-25 17:23:23 -0500 |
commit | 52006dedc0a2ba4d8a1901e8940eb80f8c02033e (patch) | |
tree | 8560e8b25ad03f59ffecb7b624e36da0147f5133 | |
parent | f4d43d7b7d23c6445f099c28e156f0cffdaae000 (diff) |
First draft of C-FL-split factor supportwip-pgm-split
1) added -n option in rtspin to specify split factor
-rw-r--r-- | README | 2 | ||||
-rw-r--r-- | bin/rt_launch.c | 9 | ||||
-rw-r--r-- | bin/rtspin.c | 11 | ||||
-rw-r--r-- | include/litmus.h | 4 | ||||
-rw-r--r-- | src/task.c | 7 |
5 files changed, 23 insertions, 10 deletions
@@ -33,7 +33,7 @@ Tools and Programs | |||
33 | worst-case execution time and priod. Any additional parameters are passed on | 33 | worst-case execution time and priod. Any additional parameters are passed on |
34 | to the real-time task. | 34 | to the real-time task. |
35 | 35 | ||
36 | * rtspin [-w] [-p <PARTITION>] [-c CLASS] WCET PERIOD DURATION | 36 | * rtspin [-w] [-n SPLIT] [-p <PARTITION>] [-c CLASS] WCET PERIOD DURATION |
37 | rtspin -l | 37 | rtspin -l |
38 | A simple spin loop for emulating purely CPU-bound workloads. | 38 | A simple spin loop for emulating purely CPU-bound workloads. |
39 | Not very realistic, but a good tool for debugging. | 39 | Not very realistic, but a good tool for debugging. |
diff --git a/bin/rt_launch.c b/bin/rt_launch.c index 93f10d5..209ff15 100644 --- a/bin/rt_launch.c +++ b/bin/rt_launch.c | |||
@@ -32,6 +32,7 @@ void usage(char *error) { | |||
32 | fprintf(stderr, "%s\nUsage: rt_launch [-w][-v][-p partition/cluster [-z cluster size]][-q prio][-c hrt | srt | be] wcet period program [arg1 arg2 ...]\n" | 32 | fprintf(stderr, "%s\nUsage: rt_launch [-w][-v][-p partition/cluster [-z cluster size]][-q prio][-c hrt | srt | be] wcet period program [arg1 arg2 ...]\n" |
33 | "\t-w\tSynchronous release\n" | 33 | "\t-w\tSynchronous release\n" |
34 | "\t-v\tVerbose\n" | 34 | "\t-v\tVerbose\n" |
35 | "\t-n\tSplit factor\n" | ||
35 | "\t-p\tpartition or cluster\n" | 36 | "\t-p\tpartition or cluster\n" |
36 | "\t-z\tsize of cluster (default = 1 for partitioned)\n" | 37 | "\t-z\tsize of cluster (default = 1 for partitioned)\n" |
37 | "\t-c\tClass\n" | 38 | "\t-c\tClass\n" |
@@ -42,7 +43,7 @@ void usage(char *error) { | |||
42 | } | 43 | } |
43 | 44 | ||
44 | 45 | ||
45 | #define OPTSTR "p:z:c:vwq:" | 46 | #define OPTSTR "p:z:c:vwq:n:" |
46 | 47 | ||
47 | int main(int argc, char** argv) | 48 | int main(int argc, char** argv) |
48 | { | 49 | { |
@@ -50,6 +51,7 @@ int main(int argc, char** argv) | |||
50 | lt_t wcet; | 51 | lt_t wcet; |
51 | lt_t period; | 52 | lt_t period; |
52 | int migrate = 0; | 53 | int migrate = 0; |
54 | int split = 1; | ||
53 | int cluster = 0; | 55 | int cluster = 0; |
54 | int cluster_size = 1; | 56 | int cluster_size = 1; |
55 | int opt; | 57 | int opt; |
@@ -67,6 +69,9 @@ int main(int argc, char** argv) | |||
67 | case 'v': | 69 | case 'v': |
68 | verbose = 1; | 70 | verbose = 1; |
69 | break; | 71 | break; |
72 | case 'n': | ||
73 | split = atoi(optarg); | ||
74 | break; | ||
70 | case 'p': | 75 | case 'p': |
71 | cluster = atoi(optarg); | 76 | cluster = atoi(optarg); |
72 | migrate = 1; | 77 | migrate = 1; |
@@ -118,7 +123,7 @@ int main(int argc, char** argv) | |||
118 | if (ret < 0) | 123 | if (ret < 0) |
119 | bail_out("could not migrate to target partition or cluster"); | 124 | bail_out("could not migrate to target partition or cluster"); |
120 | } | 125 | } |
121 | ret = __create_rt_task(launch, &info, cluster, cluster_size, wcet, period, | 126 | ret = __create_rt_task(launch, &info, split, cluster, cluster_size, wcet, period, |
122 | priority, class); | 127 | priority, class); |
123 | 128 | ||
124 | 129 | ||
diff --git a/bin/rtspin.c b/bin/rtspin.c index 167741d..5de9035 100644 --- a/bin/rtspin.c +++ b/bin/rtspin.c | |||
@@ -21,7 +21,7 @@ static void usage(char *error) { | |||
21 | " rt_spin [COMMON-OPTS] -f FILE [-o COLUMN] WCET PERIOD\n" | 21 | " rt_spin [COMMON-OPTS] -f FILE [-o COLUMN] WCET PERIOD\n" |
22 | " rt_spin -l\n" | 22 | " rt_spin -l\n" |
23 | "\n" | 23 | "\n" |
24 | "COMMON-OPTS = [-w] [-s SCALE]\n" | 24 | "COMMON-OPTS = [-w] [-s SCALE] [-n SPLIT]\n" |
25 | " [-p PARTITION/CLUSTER [-z CLUSTER SIZE]] [-c CLASS]\n" | 25 | " [-p PARTITION/CLUSTER [-z CLUSTER SIZE]] [-c CLASS]\n" |
26 | " [-X LOCKING-PROTOCOL] [-L CRITICAL SECTION LENGTH] [-Q RESOURCE-ID]" | 26 | " [-X LOCKING-PROTOCOL] [-L CRITICAL SECTION LENGTH] [-Q RESOURCE-ID]" |
27 | "\n" | 27 | "\n" |
@@ -184,7 +184,7 @@ static int job(double exec_time, double program_end, int lock_od, double cs_leng | |||
184 | } | 184 | } |
185 | } | 185 | } |
186 | 186 | ||
187 | #define OPTSTR "p:z:c:wlveo:f:s:q:X:L:Q:" | 187 | #define OPTSTR "p:z:c:wlveo:f:s:q:X:L:Q:n:" |
188 | int main(int argc, char** argv) | 188 | int main(int argc, char** argv) |
189 | { | 189 | { |
190 | int ret; | 190 | int ret; |
@@ -199,6 +199,7 @@ int main(int argc, char** argv) | |||
199 | int wait = 0; | 199 | int wait = 0; |
200 | int test_loop = 0; | 200 | int test_loop = 0; |
201 | int column = 1; | 201 | int column = 1; |
202 | int split = 1; | ||
202 | const char *file = NULL; | 203 | const char *file = NULL; |
203 | int want_enforcement = 0; | 204 | int want_enforcement = 0; |
204 | double duration = 0, start = 0; | 205 | double duration = 0, start = 0; |
@@ -222,6 +223,9 @@ int main(int argc, char** argv) | |||
222 | case 'w': | 223 | case 'w': |
223 | wait = 1; | 224 | wait = 1; |
224 | break; | 225 | break; |
226 | case 'n': | ||
227 | split = atoi(optarg); | ||
228 | break; | ||
225 | case 'p': | 229 | case 'p': |
226 | cluster = atoi(optarg); | 230 | cluster = atoi(optarg); |
227 | migrate = 1; | 231 | migrate = 1; |
@@ -315,6 +319,8 @@ int main(int argc, char** argv) | |||
315 | "positive number."); | 319 | "positive number."); |
316 | if (period <= 0) | 320 | if (period <= 0) |
317 | usage("The period must be a positive number."); | 321 | usage("The period must be a positive number."); |
322 | if (split <= 0) | ||
323 | usage("The split factor must be a positive number, if specified."); | ||
318 | if (!file && wcet > period) { | 324 | if (!file && wcet > period) { |
319 | usage("The worst-case execution time must not " | 325 | usage("The worst-case execution time must not " |
320 | "exceed the period."); | 326 | "exceed the period."); |
@@ -334,6 +340,7 @@ int main(int argc, char** argv) | |||
334 | init_rt_task_param(¶m); | 340 | init_rt_task_param(¶m); |
335 | param.exec_cost = wcet; | 341 | param.exec_cost = wcet; |
336 | param.period = period; | 342 | param.period = period; |
343 | param.split = split; | ||
337 | param.priority = priority; | 344 | param.priority = priority; |
338 | param.cls = class; | 345 | param.cls = class; |
339 | param.budget_policy = (want_enforcement) ? | 346 | param.budget_policy = (want_enforcement) ? |
diff --git a/include/litmus.h b/include/litmus.h index dde5469..ad72eb7 100644 --- a/include/litmus.h +++ b/include/litmus.h | |||
@@ -96,9 +96,9 @@ typedef int (*rt_fn_t)(void*); | |||
96 | * Partitioned scheduling: cluster = desired partition, cluster_size = 1 | 96 | * Partitioned scheduling: cluster = desired partition, cluster_size = 1 |
97 | * Global scheduling: cluster = 0, cluster_size = 0 | 97 | * Global scheduling: cluster = 0, cluster_size = 0 |
98 | */ | 98 | */ |
99 | int create_rt_task(rt_fn_t rt_prog, void *arg, int cluster, int cluster_size, | 99 | int create_rt_task(rt_fn_t rt_prog, void *arg, int split, int cluster, int cluster_size, |
100 | lt_t wcet, lt_t period, unsigned int prio); | 100 | lt_t wcet, lt_t period, unsigned int prio); |
101 | int __create_rt_task(rt_fn_t rt_prog, void *arg, int cluster, int cluster_size, | 101 | int __create_rt_task(rt_fn_t rt_prog, void *arg, int split, int cluster, int cluster_size, |
102 | lt_t wcet, lt_t period, unsigned int prio, task_class_t cls); | 102 | lt_t wcet, lt_t period, unsigned int prio, task_class_t cls); |
103 | 103 | ||
104 | /* per-task modes */ | 104 | /* per-task modes */ |
@@ -40,10 +40,11 @@ int __launch_rt_task(rt_fn_t rt_prog, void *rt_arg, rt_setup_fn_t setup, | |||
40 | return rt_task; | 40 | return rt_task; |
41 | } | 41 | } |
42 | 42 | ||
43 | int __create_rt_task(rt_fn_t rt_prog, void *arg, int cluster, int cluster_size, | 43 | int __create_rt_task(rt_fn_t rt_prog, void *arg, int split, int cluster, int cluster_size, |
44 | lt_t wcet, lt_t period, unsigned int priority, task_class_t class) | 44 | lt_t wcet, lt_t period, unsigned int priority, task_class_t class) |
45 | { | 45 | { |
46 | struct rt_task params; | 46 | struct rt_task params; |
47 | params.split = split; | ||
47 | params.cpu = cluster_to_first_cpu(cluster, cluster_size); | 48 | params.cpu = cluster_to_first_cpu(cluster, cluster_size); |
48 | params.period = period; | 49 | params.period = period; |
49 | params.exec_cost = wcet; | 50 | params.exec_cost = wcet; |
@@ -57,10 +58,10 @@ int __create_rt_task(rt_fn_t rt_prog, void *arg, int cluster, int cluster_size, | |||
57 | (rt_setup_fn_t) set_rt_task_param, ¶ms); | 58 | (rt_setup_fn_t) set_rt_task_param, ¶ms); |
58 | } | 59 | } |
59 | 60 | ||
60 | int create_rt_task(rt_fn_t rt_prog, void *arg, int cluster, int cluster_size, | 61 | int create_rt_task(rt_fn_t rt_prog, void *arg, int split, int cluster, int cluster_size, |
61 | lt_t wcet, lt_t period, unsigned int prio) | 62 | lt_t wcet, lt_t period, unsigned int prio) |
62 | { | 63 | { |
63 | return __create_rt_task(rt_prog, arg, cluster, cluster_size, wcet, period, | 64 | return __create_rt_task(rt_prog, arg, split, cluster, cluster_size, wcet, period, |
64 | prio, RT_CLASS_HARD); | 65 | prio, RT_CLASS_HARD); |
65 | } | 66 | } |
66 | 67 | ||