RecoSim  1.0
 All Classes Files Functions Variables Enumerations
config_processor.h
Go to the documentation of this file.
1 
21 #ifndef CONFIG_PROCESSOR_H
22 #define CONFIG_PROCESSOR_H
23 
24 #include <string>
25 #include <set>
26 #include <map>
27 #include "config_processor_name.h"
28 
29 using namespace std;
30 
32 
33  string instName; // instance (Core_0)
34  Config_processor_name* cfg_proc_name;
35  string powerGroupName;
36  float contextSwitchTime;
37  string interfaces;
38 
39 public:
40 
41  Config_processor(string instName_, Config_processor_name* cfg_proc_name_, float contextSwitchTime_, string interfaces_, string powerGroupName_) {
42  instName = instName_;
43  cfg_proc_name = cfg_proc_name_;
44  powerGroupName = powerGroupName_;
45  contextSwitchTime = contextSwitchTime_;
46  interfaces = interfaces_;
47  }
48 
49  Config_processor(string instName_, Config_processor_name* cfg_proc_name_, string powerGroupName_) {
50  instName = instName_;
51  cfg_proc_name = cfg_proc_name_;
52  powerGroupName = powerGroupName_;
53  contextSwitchTime = 0;
54  interfaces = "";
55  }
56 
57  Config_processor(Config_processor cfgProc, string instName) {
58  Config_processor(instName, new Config_processor_name(cfgProc.cfg_proc_name), cfgProc.contextSwitchTime, cfgProc.interfaces, cfgProc.powerGroupName);
59  }
60 
61  string toString() {
62  string act = "";
63  if (hasInterfaces() == true)
64  return instName + " " + act + " [ Processor: " + cfg_proc_name->getProcessorName() + ", Power Domain: " + powerGroupName + ", Context Switch Time = " + Utils::ftoa(contextSwitchTime) + " us, Interfaces = " + interfaces + " ]";
65  else
66  return instName + " " + act + " [ Processor: " + cfg_proc_name->getProcessorName() + ", Power Domain: " + powerGroupName + ", Context Switch Time = " + Utils::ftoa(contextSwitchTime) + " us ]";
67  }
68 
69  bool hasInterfaces() {
70  return interfaces.length() > 0;
71  }
72 
73  bool equals(Config_processor cp) {
74  return (instName.compare(cp.getInstanceName()) == 0);
75  }
76 
77  bool identical(Config_processor cp) {
78  return instName.compare(cp.getInstanceName()) == 0 &&
79  cfg_proc_name->getProcessorName().compare(cp.cfg_proc_name->getProcessorName()) == 0 &&
80  contextSwitchTime == cp.getContextSwitchTime() &&
81  interfaces.compare(cp.getInterfaces()) == 0;
82  }
83 
84  void setInstanceName(string val) {
85  instName = val;
86  }
87 
88  string getInstanceName() {
89  return instName;
90  }
91 
92  void setType(Config_processor_name* val) {
93  cfg_proc_name = val;
94  }
95 
96  Config_processor_name* getType() {
97  return cfg_proc_name;
98  }
99 
100  void setContextSwitchTime(float val) {
101  contextSwitchTime = val;
102  }
103 
104  float getContextSwitchTime() {
105  return contextSwitchTime;
106  }
107 
108  void setInterfaces(string val) {
109  interfaces = val;
110  }
111 
112  string getInterfaces() {
113  return interfaces;
114  }
115 
116  void setPowerGroupName(string val) {
117  powerGroupName = val;
118  }
119 
120  string getPowerGroupName() {
121  return powerGroupName;
122  }
123 
124 };
125 
126 #endif
Definition: config_processor.h:31
Definition: config_processor_name.h:30