-
Notifications
You must be signed in to change notification settings - Fork 0
/
gastask.h
69 lines (54 loc) · 1.68 KB
/
gastask.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef _GASTASK_H_
#define _GASTASK_H_
#include "common.h"
#define MAX_TASKS 200
#define MAX_CPU_FREQS 5
#define MAX_MEMS 5
#define MAX_ATTRTYPES 5
typedef struct {
unsigned char attrs[MAX_TASKS];
unsigned n_tasks_per_type[MAX_ATTRTYPES];
unsigned max_type;
} taskattrs_t;
typedef struct {
taskattrs_t taskattrs_mem;
taskattrs_t taskattrs_cpufreq;
double util, power, score;
struct list_head list_util;
struct list_head list_power;
struct list_head list_score;
} gene_t;
typedef struct {
unsigned no;
unsigned wcet;
unsigned period;
unsigned memreq;
double mem_active_ratio;
} task_t;
typedef struct {
double wcet_scale;
double power_active, power_idle; /* per tick */
} cpufreq_t;
extern unsigned max_gen;
extern unsigned n_tasks;
extern unsigned n_cpufreqs;
extern unsigned n_pops;
extern struct list_head genes_by_util;
extern struct list_head genes_by_power;
extern gene_t *genes;
extern cpufreq_t cpufreqs[];
extern double cutoff, penalty;
extern double power_consumed_cpu_active;
extern double power_consumed_mem_active;
extern double power_consumed_cpu_idle;
extern double power_consumed_mem_idle;
void add_mem(const char *typestr, unsigned max_capacity, double wcet_scale, double power_active, double power_idle);
void add_cpufreq(double wcet_scale, double power_active, double power_idle);
void add_task(unsigned wcet, unsigned period, unsigned memreq, double mem_active_ratio);
void get_task_utilpower(unsigned no_task, unsigned char mem_type, unsigned char cpufreq_type, double *putil, double *ppower_cpu, double *ppower_mem);
unsigned get_task_memreq(unsigned no_task);
void init_report(void);
void close_report(void);
void add_report(unsigned gen);
void run_GA(void);
#endif