diff options
author | Christopher Kenna <cjk@cs.unc.edu> | 2011-10-13 19:40:32 -0400 |
---|---|---|
committer | Christopher Kenna <cjk@cs.unc.edu> | 2011-10-13 19:40:32 -0400 |
commit | ca3db2d5972f66c6dfc20b3f6a21a66dc0308a28 (patch) | |
tree | 68c6f3a585e22c5d117f18510a9d971a2a14bc79 | |
parent | a24a2200a047776737f9629f41a28c0d3027476b (diff) |
RTSpin.beta scaled properly now.
-rw-r--r-- | bin/rtspin.beta.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/bin/rtspin.beta.c b/bin/rtspin.beta.c index f7f9e0e..13fd365 100644 --- a/bin/rtspin.beta.c +++ b/bin/rtspin.beta.c | |||
@@ -20,7 +20,7 @@ static void usage(char *error) { | |||
20 | fprintf(stderr, "Error: %s\n", error); | 20 | fprintf(stderr, "Error: %s\n", error); |
21 | fprintf(stderr, | 21 | fprintf(stderr, |
22 | "Usage:\n" | 22 | "Usage:\n" |
23 | " rt_spin [COMMON-OPTS] WCET PERIOD DURATION\n" | 23 | " rt_spin [COMMON-OPTS] LVL_C_TIME WCET PERIOD DURATION\n" |
24 | " rt_spin -l\n" | 24 | " rt_spin -l\n" |
25 | "\n" | 25 | "\n" |
26 | "COMMON-OPTS = [-w] [-p PARTITION] [-c CLASS] [-s SCALE]\n" | 26 | "COMMON-OPTS = [-w] [-p PARTITION] [-c CLASS] [-s SCALE]\n" |
@@ -127,6 +127,7 @@ int main(int argc, char** argv) | |||
127 | int ret; | 127 | int ret; |
128 | lt_t wcet; | 128 | lt_t wcet; |
129 | lt_t period; | 129 | lt_t period; |
130 | lt_t lvl_c_time; | ||
130 | int migrate = 0; | 131 | int migrate = 0; |
131 | int cpu = 0; | 132 | int cpu = 0; |
132 | int opt; | 133 | int opt; |
@@ -197,11 +198,12 @@ int main(int argc, char** argv) | |||
197 | return 0; | 198 | return 0; |
198 | } | 199 | } |
199 | 200 | ||
200 | if (argc - optind < 3) | 201 | if (argc - optind < 4) |
201 | usage("Arguments missing."); | 202 | usage("Arguments missing."); |
202 | 203 | ||
203 | wcet = atoi(argv[optind + 0]); | 204 | lvl_c_time = atoi(argv[optind + 0]); |
204 | period = atoi(argv[optind + 1]); | 205 | wcet = atoi(argv[optind + 1]); |
206 | period = atoi(argv[optind + 2]); | ||
205 | 207 | ||
206 | if (seed < 1) | 208 | if (seed < 1) |
207 | usage("Seed < 1 not allowed."); | 209 | usage("Seed < 1 not allowed."); |
@@ -256,7 +258,7 @@ int main(int argc, char** argv) | |||
256 | 258 | ||
257 | do { | 259 | do { |
258 | beta_sample = gsl_ran_beta(beta_rng, alpha, beta); | 260 | beta_sample = gsl_ran_beta(beta_rng, alpha, beta); |
259 | exec_time = wcet * beta_sample * scale; | 261 | exec_time = lvl_c_time * 10.0 * beta_sample * scale; |
260 | /* convert to seconds */ | 262 | /* convert to seconds */ |
261 | exec_time = exec_time * 0.000000001; | 263 | exec_time = exec_time * 0.000000001; |
262 | } while(job(exec_time, start + duration)); | 264 | } while(job(exec_time, start + duration)); |