Ajeitado o problema de relatar a melhor configuraĆ§Ć£o
[smartenum.git] / include / analysis.h
blobb2fccb2f0b3f066d54ec26015265aa410935080e
1 /*
2 * include/analysis.h
4 * Copyright (C) 2008 Eduardo Valentin <edubezval@gmail.com>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
11 #ifndef ANALYSIS_H
12 #define ANALYSIS_H
14 #define NTRIES 1000
15 /* Task data */
16 struct task {
17 double deadline;
18 double wcec;
19 double computation;
20 double Ip;
21 double Ib;
22 double Ij;
23 double *resources;
26 #define task_res_use(t, i) (t.resources[i] * t.computation)
27 #define precedence_influency(t, w) (ceil((w + t.Ij) / t.deadline) * \
28 t.computation)
29 #define response(t) (t.Ip + t.Ij)
31 /* Sets */
32 struct task_set {
33 int ntasks;
34 struct task *tasks;
37 struct freq_set {
38 int nfrequencies;
39 double *frequencies;
40 double *voltages;
43 struct res_set {
44 int nresources;
45 int *resource_priorities;
48 /* Runtime data */
49 struct run_info {
50 int summary:1; /* print a summary in the end */
51 int tabular:1; /* print a summary in one line */
52 int verbose:1; /* verbose execution */
53 int list:1; /* list samples */
54 int best_start:1; /* comput best start point */
55 int jump_samples:1; /* jump useless samples */
56 int best_initial_limits:1; /* compute best initial freq limits */
59 /* Results */
60 struct results {
61 struct timeval s;
62 struct timeval e;
63 int success;
64 int total;
65 double best;
66 int *best_index;
69 int compute_initial_limits(struct task_set tset, struct freq_set freqs,
70 struct run_info runtime, int **start_limits);
71 void compute_sample_analysis(struct task_set tset, struct res_set *res,
72 struct run_info runtime);
73 int enumerate_samples(struct task_set tset, struct freq_set freqs,
74 struct res_set *res, int *limits,
75 struct run_info runtime, struct results *stat);
76 int enumeration_init(struct task_set *tset, struct freq_set *freqs,
77 struct results *stat,
78 struct res_set *res,
79 int **limits);
80 int enumeration_cleanup(struct task_set *tset, struct freq_set *freqs,
81 struct results *stat,
82 struct res_set *res,
83 int *limits);
84 #endif