file name: globals.hpp, globals.cpp
classification: simulation
contents: contains a global list variable needed in pure and
hardware-based simulation, plus several functions which have to be called
after the start of the program or before its end
use: the list stores pointers to supervisors, the functions
implement startup and tidy-up code that has to be executed
global items used:
CAlgorithmManager
algorithmManager: the manager object that returns the creation function
of a given clock synchronization class.
int *g_masterArea:
the area of the master clock (see below). Its initial value in this file
is NoAccount (because it is not needed in pure
simulation), and you must set it to a value within [0, NumberOfAreas-1]
if you want to create a master clock in hardware based simulation. Note
that the user may not start an application on the area occupied by the
master clock.
CClock *g_masterClock:
this is the clock that is used for obtaining the global time in hardware
based simulation. The clock is dedicated and is driven by an external oscillator.
Its initial value in this file is NULL (because it is not needed in pure
simulation), and you must set it to a value different from NULL to use
function GetGlobalTime() in hardware based simulation.
CSupervisorList
listOfSupervisors: A list of all supervisors. Supervisors are accessed
with the key (nodeID, area). The list is needed by the controller to obtain
a certain supervisor object.
global functions:
void CheckAssumptions():
checks several system assumptions (like the existence of some global variables).
The function must be called in main() before the simulation controller
is created.
void DeleteTemplates():
deletes the template objects and sets them to NULL. The function is called
by the destructor of ACController.
void InstallAlgorithms():
installs all clock synchronization algorithms that are known in the simulation.
The function must be called in main() before the simulation controller
is created.