23 #ifndef MODULE_IMPLEMENTATION_H
24 #define MODULE_IMPLEMENTATION_H
30 #include "pe_implementation.h"
35 typedef void (*algorithm_thread_type)(
void *);
41 string algorithm_name;
42 PEImplementation implementation_type;
43 sc_time worst_case_execution_time;
44 sc_time best_case_execution_time;
46 double energy_consumption;
47 bool enable_implementation;
48 int nb_preemption_points;
49 bool use_context_switch;
57 map<string, int> physical_channels;
60 algorithm_thread_type algorithm_thread_ptr;
62 ModuleImplementation(
string _name, PEImplementation impl, algorithm_thread_type algo, sc_time wcet, sc_time bcet = SC_ZERO_TIME,
double freq = 0,
double pidle = 0,
double prun = 0)
63 : name(_name), implementation_type(impl), algorithm_thread_ptr(algo), worst_case_execution_time(wcet), best_case_execution_time(bcet), frequency(freq), p_idle(pidle), p_run(prun) {
65 enable_implementation =
true;
66 if(bcet == SC_ZERO_TIME) best_case_execution_time = worst_case_execution_time;
67 nb_preemption_points = 0;
68 use_context_switch =
false;
69 energy_consumption = 0;
72 ModuleImplementation(
string _name, PEImplementation impl, algorithm_thread_type algo) : name(_name), implementation_type(impl), algorithm_thread_ptr(algo) {
74 enable_implementation =
true;
75 best_case_execution_time = SC_ZERO_TIME;
76 worst_case_execution_time = SC_ZERO_TIME;
78 energy_consumption = 0;
79 nb_preemption_points = 0;
80 use_context_switch =
false;
85 string get_name(
void);
86 PEImplementation get_implementation_type(
void);
87 sc_time get_worst_case_execution_time(
void)
const;
88 sc_time get_best_case_execution_time(
void)
const;
89 double get_frequency(
void)
const;
91 double get_p_idle(
void)
const;
92 double get_p_run(
void)
const;
93 string get_netlist_name(
void)
const;
94 string get_algorithm_name(
void)
const;
96 void activate_implementation(
void);
97 void deactivate_implementation(
void);
98 bool is_implementation_enabled(
void)
const;
100 void info(ostream &st)
const;
102 void add_physical_channels(
string connection,
int n = 1);
103 map<string, int> get_physical_channel_map(
void);
106 void set_worst_case_execution_time(sc_time t);
107 void set_best_case_execution_time(sc_time t);
108 void set_frequency(
double f);
110 void set_p_idle(
double e);
111 void set_p_run(
double e);
112 void set_netlist_name(
string n);
113 void set_algorithm_name(
string n);
115 algorithm_thread_type get_algorithm_thread_ptr(
void);
117 void set_nb_preemption_points(
int n);
118 int get_nb_preemption_points(
void);
120 void set_use_context_switch_mode(
bool);
121 bool use_context_switch_mode(
void);
Definition: module_implementation.h:37