26 System *System::instance =
nullptr;
30 assert (instance !=
nullptr);
38 if (instance ==
nullptr)
44 instance->governor = instance->conf->getFreqGovernorFromFile();
45 assert(instance->governor !=
nullptr);
48 log << Utils::Log::Color::green <<
"Using frequency governor ";
49 log << instance->governor->
getName() << Utils::Log::Color::normal <<
"\n";
51 instance->reportsFolder = c->getStringValue(
"global",
"reportsFolder");
82 void System::printReports()
91 for (
size_t i = 0;
i < staticTaskSet.size();
i++)
93 std::shared_ptr<Process> p = staticTaskSet[
i];
95 file.open((conf->getFilePrefix() +
"processes.txt"), std::ios_base::app);
112 assert(conf !=
nullptr);
113 if (scheduler ==
nullptr)
122 scheduler->
end(reportsFolder);
129 staticTaskSet.push_back(p);
135 return staticTaskSet;
141 return jobsArrivalCount;
static void buildSystem(std::shared_ptr< SchedulerConfiguration > conf)
void updateTemperature(double timeInterval)
updates and logs the temperature of the processor. This function has to be called at least every time...
void addRealTimeTask(std::shared_ptr< Process > p)
add a real-time task to the system's list
This class implements the ready queue and the wait queue. Those queues contain processes ready to run...
void end(std::string reportsFolder)
cleanup and print reports
virtual void printReport(std::string)
static System * getInstance()
long long int getJobsArrivalCount()
returns the number of jobs issued since the beginning of the simulation
static Queue * getReadyQueue()
get a pointer to the system's ready queue
void printProcessesReport()
TaskScheduler * getScheduler()
returns the task scheduler object
void incrementJobsArrivalCount()
increments the number of jobs issued since the beginning of simulation
void updateTemperature(double timeInterval)
bool powered() const
return true if the processor is powered on
Processor * getProc()
return the processor
std::vector< std::shared_ptr< Process > > getStaticTaskSet()
get the list of real-time tasks in the system
virtual std::string getName()=0
virtual void updateFreq(Processor *proc, Queue *readyQueue)=0
void printReports(std::string folder) const
void setTemperatureModel(TemperatureModel *)
void updateFreq()
invokes the frequency governor to changes the frequency of the processor