Please, help us to better know about our user community by answering the following short survey: https://forms.gle/wpyrxWi18ox9Z5ae9
scqSimulator.h
1 
5  /* @author János Végh (jvegh)
6  * @bug No known bugs.
7  */
8 
9 #ifndef scqSimulator_h
10 #define scqSimulator_h
11 #include <systemc.h>
12 #include <map> // For the aliases
13 #include <QSettings>
14 #include <QDebug>
15 #include <QDir>
16 #include <QScopedPointer>
17 #include <QDate>
18 #include <QTime>
19 #include <QSettings>
20 #include <QCoreApplication>
21 #include <QTextEdit> // Not used in CLI. but must be present
22 #include <QTreeWidget>
23 
24 class scProcessor;
25 class scGridPoint;
26 class scHThread;
27 using namespace sc_core; using namespace std;
28 
29 //Submodule forward class declarations
34 {
35  string Home; // The nominal home directory of user
36  string Config; // Where the config directory is
37  string Work; // Where the work files go
38  string Temp; // For temporary files
39  string Install; // Where the system is installed
40  string SystemData; // for important data
41  string SystemDocs; // for documentation
42  string UserData; // User-provided data
43  string UserOutput; // User-provided data
44  string LogFile; // The log messages
45  bool SystemDataFound; // If system data are available
46  bool SystemDocsFound; // If system docs are available
47 };
48 
49 SystemDirectories* SystemDirectories_Get(void);
50 
58 class scqSimulator : public sc_core::sc_module {
59  //Port declarations
60  // channels
61  public:
62  // Constructor declaration:
63  SC_HAS_PROCESS(scqSimulator); // Contructor implemented in .cpp
64  static QTextEdit *s_LogWindow; // This will display log file, if any
65  QTreeWidget*
66  HierarchyWidget; // Show hierarchy of modules here
67  scqSimulator(sc_core::sc_module_name nm,int argc, char* argv[]);
68  virtual
69  ~scqSimulator();
70 /* string
71  PrologText_Get(void);
72 
73  void Setup(void); // Belongs to the constructor
74  void writeSettings(void); // Write settings to the project directory
75 */
76 
77  void
78  SetupSystemDirectories(QWidget* parent);
79  void
80  SetupLogging(QWidget* parent);
81  void
82  SetupSettings(void);
83 /* void
84  SInitialize_method(void); ///< This initializes the simulator
85  bool
86  StepwiseMode_Get(void){ return msStepwiseMode;}
87  void
88  StepwiseMode_Set(bool b){msStepwiseMode = b;}
89  void
90  SSTART_thread(void);
91  void
92  SHALT_thread(void);
93  struct{
94  sc_core::sc_event
95  START,
96  STOP;
97  }EVENT_SIMULATOR;
98  //virtual
99  */
100  scProcessor*
101  Processor_Get(){ return msProcessor;}
131  virtual void
132  readSettings(void);
133  /*
134  * \brief writeSettings
135  * Write the !Changed! settings back at project level
136  */
137  virtual void
138  writeSettings(void);
139  string
140  SimulationName_Get(void) {return simulation_name;}
141  int64_t
142  SimulationPartTime_Get(void);
143  int64_t
144  SimulationSumTime_Get(void); //6< return actual benchmark duration since last reset
145  bool
146  IsKeywordInList(const QString Keyword, QStringList KeywordList);
147  string
148  PrologString_Get(void);
149 
150  protected:
151 
152 
153  /*
154  void
155  PrintFinalReport(scProcessor *Proc);
156  */
157  scProcessor*
159 /* void
160  HandleSpecials(void); /// Handle the exceptional points
161  vector<scGridPoint*>
162  mSpecials; /// Stores the special points
163 */ bool
166  static SystemDirectories Directories;
167  string mSettingsFileName;
169  QScopedPointer<QFile> m_logFile;
170  chrono::steady_clock::time_point
171  m_running_time; // A work variable, do not touch outside the macros
172  std::chrono::duration< int64_t, nano>
173  m_part_time, m_sum_time; // Work variables, contain actual benchmark duration and their sum
174 }; // of scqSimulator
175 
176 #endif // scqSimulator_h
scqSimulator::msStepwiseMode
bool msStepwiseMode
If to process stepwise.
Definition: scqSimulator.h:164
scHThread
The scHThread class.
Definition: scHThread.h:138
scqSimulator::simulation_name
string simulation_name
The filename of the config files.
Definition: scqSimulator.h:168
scProcessor
Implements a module-name alias facility (i.e., user-provided names. Given that the basic units is scH...
Definition: scProcessor.h:130
scqSimulator::msSuspended
bool msSuspended
If running simulation is suspended.
Definition: scqSimulator.h:165
scGridPoint
This class implements the autonomous grid point functionality: it is a communicating GridPoint....
Definition: scGridPoint.h:127
scqSimulator
The anchestor of all ScQt-based simulators The simulator manipulates scModules etc....
Definition: scqSimulator.h:58
scqSimulator::msProcessor
scProcessor * msProcessor
My topology, I am handling.
Definition: scqSimulator.h:158
SystemDirectories
The SystemDirectories contains names of some system-wide subdirectories.
Definition: scqSimulator.h:33