RecoSim  1.0
 All Classes Files Functions Variables Enumerations
reconfigurable_zone.h
Go to the documentation of this file.
1 
21 #ifndef RECONFIGURABLE_ZONE_H
22 #define RECONFIGURABLE_ZONE_H
23 
24 #define SC_INCLUDE_DYNAMIC_PROCESSES
25 
26 #include <iostream>
27 #include <string>
28 #include <map>
29 #include <vector>
30 #include <list>
31 #include <systemc.h>
32 #include "pe_implementation.h"
33 #include "resources.h"
34 #include "simulation_controller.h"
35 #include "task_implementation.h"
36 #include "simulation_controller.h"
37 #include "window_function.h"
38 #include "rz_config.h"
39 
40 using namespace std;
41 
42  /*
43 
44  faire une table qui contient (atteignable du Reconfiguration_manager, user_scheduling et user_monitoring) :
45 
46  instName : ConfigRZ (equ. de ConfigProcessor)
47 
48  avec dans ConfigRZ :
49 
50  ConfigProcessorName cfgProcessorName;
51  ConfigPowerGroup cfgPowerGroup;
52 
53  comment l'atteindre ?
54 
55  - avec le nom de l'instance d'une RZ (sw ou hw)
56 
57  ConfigRZ cfgRZ = getConfigRZ(inst_name)
58 
59  */
60 
61 
62 class RZ {
63 
64 private:
65  // instance processor_name (or rz_name)
66  string name;
67 
68  // Current Fct Point
69  string groupDomainName;
70  Config_fct_point *current_cfg_fct_point;
71 
72  vector<TaskImplementation> taskImplementationVector;
73  PEImplementation implementation;
74  Resources resources;
75 
76  map<RZState, sc_time> occupationTimes;
77  sc_time lastModificationTime;
78 
79  RZState state;
80 
81  int currentImplementationID;
82 
83  // Analog trace stuff
84  sc_time requestTime;
85  sc_time last_window_reset;
86 
87  WindowFunction window_function[NB_RZ_STATES];
88  sc_time stateTimeOnLastCall[NB_RZ_STATES];
89 
90 public:
91  RZ(string n, vector<TaskImplementation> vec, PEImplementation impl) : name(n), taskImplementationVector(vec), implementation(impl) {
92 
93  current_cfg_fct_point = new Config_fct_point();
94  groupDomainName = "";
95 
96  if(impl == HARD) Simulation_controller::get_logfile() << "RZ " << name << " can host: " << endl;
97  else if(impl == SOFT) Simulation_controller::get_logfile() << "Processor " << name << " can host: " << endl;
98 
99  for(int i = 0; i < (int) taskImplementationVector.size(); i++) {
100  Simulation_controller::get_logfile() << "Implementation " << taskImplementationVector.at(i).getImplementationName() << " of task " << taskImplementationVector.at(i).getTaskName()
101  << " (" << taskImplementationVector.at(i).getCompressedReconfigurationTime() << ", " << taskImplementationVector.at(i).getPreloadReconfigurationTime() << ") " << endl;
102  }
103 
104  // Init table
105  occupationTimes[RZ_BLANK] = SC_ZERO_TIME;
106  occupationTimes[RZ_RECONFIG] = SC_ZERO_TIME;
107  occupationTimes[RZ_MAPPED] = SC_ZERO_TIME;
108  occupationTimes[RZ_ACTIVE] = SC_ZERO_TIME;
109 
110  state = RZ_BLANK;
111 
112  currentImplementationID = 0;
113  }
114 
115  string getName(void) const;
116  PEImplementation get_implementation_type(void) const;
117  vector<TaskImplementation> getTaskImplementationVector(void) const;
118  vector<TaskImplementation>* getTaskImplementationVectorPtr(void);
119  Resources* get_resources_ptr(void);
120 
121  sc_time getOccupationTime(RZState state);
122  RZState getRZState(void);
123  void setRZState(RZState);
124  void setCurrentImplementationID(int);
125  TaskImplementation getCurrentImplementation(void);
126 
127  void setResources(map<string, int> &res);
128 
129  Config_fct_point& getConfigFctPoint();
130  void setConfigFctPoint(Config_fct_point*);
131  void RZ::setGroupDomainName(string domainName);
132  string RZ::getGroupDomainName();
133 
134  double getStateOccupationRateOverLastWindow(RZState);
135  void resetWindow(void);
136 
137 };
138 
139 #endif
const int NB_RZ_STATES
Definition: task_implementation.h:35
Definition: config_fct_point.h:31
Definition: reconfigurable_zone.h:62
Definition: window_function.h:29
Definition: resources.h:28
Definition: task_implementation.h:46