summaryrefslogtreecommitdiffstats
path: root/extra.h
diff options
context:
space:
mode:
authorleochanj105 <leochanj@live.unc.edu>2021-10-26 13:22:32 -0400
committerleochanj105 <leochanj@live.unc.edu>2021-10-26 13:22:32 -0400
commit14c854543b1a3cf344a371a5b45595657f95786b (patch)
tree70f752880522e5e44669af365754ac0f649dce81 /extra.h
parent5e2ccfae0532ddd89bcc04bf14aad451e9c79785 (diff)
add deadlines and costs
Diffstat (limited to 'extra.h')
-rw-r--r--extra.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/extra.h b/extra.h
index 7bcc8f5..fce8c3f 100644
--- a/extra.h
+++ b/extra.h
@@ -79,16 +79,18 @@ char _rt_shm_name[_ID_SZ] = "/_libextra_barrier-";
79#if LITMUS 79#if LITMUS
80lt_t _rt_period; 80lt_t _rt_period;
81lt_t _rt_phase; 81lt_t _rt_phase;
82lt_t _rt_cost;
83lt_t _rt_deadline;
82int _rt_crit; 84int _rt_crit;
83struct control_page *_rt_cp; 85struct control_page *_rt_cp;
84#endif 86#endif
85 87
86static void _rt_load_params_itrl(int argc, char **argv) { 88static void _rt_load_params_itrl(int argc, char **argv) {
87#ifdef PAIRED 89#ifdef PAIRED
88 if (argc != (8 + LITMUS*3) && argc != (9 + LITMUS*3)) { 90 if (argc != (8 + LITMUS*5) && argc != (9 + LITMUS*5)) {
89 fprintf(stderr, "Usage: %s <name> <loops> <my core> <other core> <other name> <runID> <save results?> <pairID>\n", argv[0]); 91 fprintf(stderr, "Usage: %s <name> <loops> <my core> <other core> <other name> <runID> <save results?> <pairID>\n", argv[0]);
90#else 92#else
91 if (argc != (6 + LITMUS*3)) { 93 if (argc != (6 + LITMUS*5)) {
92 fprintf(stderr, "Usage: %s <name> <loops> <my core> <runID> <save results?>\n", argv[0]); 94 fprintf(stderr, "Usage: %s <name> <loops> <my core> <runID> <save results?>\n", argv[0]);
93#endif /* PAIRED */ 95#endif /* PAIRED */
94 fprintf(stderr, " <name> string for logging. Name of this task.\n"); 96 fprintf(stderr, " <name> string for logging. Name of this task.\n");
@@ -107,6 +109,8 @@ static void _rt_load_params_itrl(int argc, char **argv) {
107 fprintf(stderr, " <task period> in ms\n"); 109 fprintf(stderr, " <task period> in ms\n");
108 fprintf(stderr, " <task criticality level> 0 for Level-A, 1 for Level-B, 2 for Level-C\n"); 110 fprintf(stderr, " <task criticality level> 0 for Level-A, 1 for Level-B, 2 for Level-C\n");
109 fprintf(stderr, " <task phase> in ms\n"); 111 fprintf(stderr, " <task phase> in ms\n");
112 fprintf(stderr, " <task cost> in ms\n");
113 fprintf(stderr, " <task deadline> in ms\n");
110#endif /* LITMUS */ 114#endif /* LITMUS */
111 exit(1); 115 exit(1);
112 } 116 }
@@ -212,6 +216,8 @@ static void _rt_load_params_itrl(int argc, char **argv) {
212 _rt_period = ms2ns(strtoul(argv[end], NULL, 10)); 216 _rt_period = ms2ns(strtoul(argv[end], NULL, 10));
213 _rt_crit = atoi(argv[end+1]); 217 _rt_crit = atoi(argv[end+1]);
214 _rt_phase = ms2ns(strtoul(argv[end+2], NULL, 10)); 218 _rt_phase = ms2ns(strtoul(argv[end+2], NULL, 10));
219 _rt_cost = ms2ns(strtoul(argv[end+3], NULL, 10));
220 _rt_deadline = ms2ns(strtoul(argv[end+4], NULL, 10));
215 // _rt_phase = 0; 221 // _rt_phase = 0;
216 unsigned int wait = 1; 222 unsigned int wait = 1;
217 if (be_migrate_to_domain(_rt_core) < 0) { 223 if (be_migrate_to_domain(_rt_core) < 0) {
@@ -221,9 +227,9 @@ static void _rt_load_params_itrl(int argc, char **argv) {
221 struct rt_task rt_param; 227 struct rt_task rt_param;
222 init_rt_task_param(&rt_param); 228 init_rt_task_param(&rt_param);
223 // Fake exec cost - this value ignored by the MC^2 scheduler 229 // Fake exec cost - this value ignored by the MC^2 scheduler
224 rt_param.exec_cost = _rt_period; 230 rt_param.exec_cost = _rt_cost;
225 rt_param.period = _rt_period; 231 rt_param.period = _rt_period;
226 rt_param.relative_deadline = 0; 232 rt_param.relative_deadline = _rt_deadline;
227 rt_param.phase = _rt_phase; 233 rt_param.phase = _rt_phase;
228 rt_param.priority = LITMUS_LOWEST_PRIORITY; 234 rt_param.priority = LITMUS_LOWEST_PRIORITY;
229 // rt_param.priority = ns2ms(_rt_phase); 235 // rt_param.priority = ns2ms(_rt_phase);