OpenASIP 2.2
Loading...
Searching...
No Matches
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
SimulatorSettingsDialog Class Reference

#include <SimulatorSettingsDialog.hh>

Inheritance diagram for SimulatorSettingsDialog:
Inheritance graph
Collaboration diagram for SimulatorSettingsDialog:
Collaboration graph

Public Member Functions

 SimulatorSettingsDialog (wxWindow *parent, wxWindowID id, SimulatorFrontend &simulator, ProximLineReader &lineReader)
 
virtual ~SimulatorSettingsDialog ()
 

Private Types

enum  {
  ID_EXEC_TRACE = 10000 , ID_BUS_TRACE , ID_PT_TRACKING , ID_RF_TRACKING ,
  ID_FU_CONFLICT_DETECTION , ID_LABEL_HISTORY_SIZE , ID_PROFILE_DATA_SAVING , ID_UTILIZATION_DATA_SAVING ,
  ID_NEXT_INSTRUCTION_PRINTING , ID_SIMULATION_TIME_STATISTICS , ID_HISTORY_SIZE , ID_SAVE_HISTORY ,
  ID_HISTORY_FILE , ID_LINE
}
 Widget IDs. More...
 

Private Member Functions

virtual bool TransferDataToWindow ()
 
wxSizer * createContents (wxWindow *parent, bool set_sizer, bool call_fit)
 
void onOK (wxCommandEvent &event)
 

Private Attributes

SimulatorFrontendsimulator_
 Frontend of the simulator to configure.
 
ProximLineReaderlineReader_
 Line reader to configure.
 
bool execTrace_
 Execution trace enabled/disabled.
 
bool busTrace_
 Bus trace enabled/disabled.
 
bool ptTrace_
 Procedure transfer tracing enabled/disabled.
 
bool rfTrace_
 Register file access tracing enabled/disabled.
 
bool fuConflictDetection_
 FU conflict detection enabled/disabled.
 
bool profileDataSaving_
 Profile data saving enabled/disabled.
 
bool utilizationDataSaving_
 Utilization data saving enabled/disabled.
 
bool nextInstructionPrinting_
 Next instruction printing enabled/disabled.
 
bool simulationTimeStatistics_
 Profile data saving enabled/disabled.
 
bool historySave_
 Input history log file enabled/disabled.
 
int historySize_
 History log max size.
 
wxString historyFile_
 History log file name.
 

Detailed Description

Dialog for modifying simulator settings.

Definition at line 44 of file SimulatorSettingsDialog.hh.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private

Widget IDs.

Enumerator
ID_EXEC_TRACE 
ID_BUS_TRACE 
ID_PT_TRACKING 
ID_RF_TRACKING 
ID_FU_CONFLICT_DETECTION 
ID_LABEL_HISTORY_SIZE 
ID_PROFILE_DATA_SAVING 
ID_UTILIZATION_DATA_SAVING 
ID_NEXT_INSTRUCTION_PRINTING 
ID_SIMULATION_TIME_STATISTICS 
ID_HISTORY_SIZE 
ID_SAVE_HISTORY 
ID_HISTORY_FILE 
ID_LINE 

Definition at line 59 of file SimulatorSettingsDialog.hh.

59 {
60 ID_EXEC_TRACE = 10000,
74 };

Constructor & Destructor Documentation

◆ SimulatorSettingsDialog()

SimulatorSettingsDialog::SimulatorSettingsDialog ( wxWindow *  parent,
wxWindowID  id,
SimulatorFrontend simulator,
ProximLineReader lineReader 
)

The Constructor.

Parameters
parentParent window of the dialog.
idDialog window identifier.
simulatorSimulator frontend to configure.

Definition at line 54 of file SimulatorSettingsDialog.cc.

56 :
57 wxDialog(parent, id, _T("Simulator Settings"), wxDefaultPosition),
58 simulator_(simulator), lineReader_(lineReader) {
59
60 createContents(this, true, true);
61
62 FindWindow(ID_EXEC_TRACE)->SetValidator(wxGenericValidator(&execTrace_));
63 FindWindow(ID_BUS_TRACE)->SetValidator(wxGenericValidator(&busTrace_));
64 FindWindow(ID_PT_TRACKING)->SetValidator(wxGenericValidator(&ptTrace_));
65 FindWindow(ID_RF_TRACKING)->SetValidator(wxGenericValidator(&rfTrace_));
67 wxGenericValidator(&fuConflictDetection_));
68
70 wxGenericValidator(&profileDataSaving_));
72 wxGenericValidator(&utilizationDataSaving_));
74 wxGenericValidator(&nextInstructionPrinting_));
76 wxGenericValidator(&simulationTimeStatistics_));
77
78 FindWindow(ID_SAVE_HISTORY)->SetValidator(
79 wxGenericValidator(&historySave_));
80
81 FindWindow(ID_HISTORY_FILE)->SetValidator(
82 wxGenericValidator(&historyFile_));
83
84 FindWindow(ID_HISTORY_SIZE)->SetValidator(
85 wxGenericValidator(&historySize_));
86}
SimulatorFrontend & simulator_
Frontend of the simulator to configure.
bool execTrace_
Execution trace enabled/disabled.
bool historySave_
Input history log file enabled/disabled.
bool rfTrace_
Register file access tracing enabled/disabled.
ProximLineReader & lineReader_
Line reader to configure.
bool nextInstructionPrinting_
Next instruction printing enabled/disabled.
wxString historyFile_
History log file name.
bool fuConflictDetection_
FU conflict detection enabled/disabled.
bool ptTrace_
Procedure transfer tracing enabled/disabled.
bool simulationTimeStatistics_
Profile data saving enabled/disabled.
wxSizer * createContents(wxWindow *parent, bool set_sizer, bool call_fit)
bool busTrace_
Bus trace enabled/disabled.
bool profileDataSaving_
Profile data saving enabled/disabled.
int historySize_
History log max size.
bool utilizationDataSaving_
Utilization data saving enabled/disabled.

◆ ~SimulatorSettingsDialog()

SimulatorSettingsDialog::~SimulatorSettingsDialog ( )
virtual

The Destructor.

Definition at line 91 of file SimulatorSettingsDialog.cc.

91 {
92}

Member Function Documentation

◆ createContents()

wxSizer * SimulatorSettingsDialog::createContents ( wxWindow *  parent,
bool  call_fit,
bool  set_sizer 
)
private

Creates the dialog widgets.

Source code generated by wxDesigner. Do not modify by hand!

Parameters
parentParent dialog of the widgets.
call_fitIf true, resize the dialog to fit the widgets.
set_sizerIf true, set the created widgets as the dialog contents.
Returns
Top level sizer of the dialog contents.

Definition at line 237 of file SimulatorSettingsDialog.cc.

238 {
239
240 wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL );
241
242 wxStaticBox *item2 = new wxStaticBox( parent, -1, wxT("Tracing:") );
243 wxStaticBoxSizer *item1 = new wxStaticBoxSizer( item2, wxVERTICAL );
244
245 wxCheckBox *item3 = new wxCheckBox( parent, ID_EXEC_TRACE, wxT("Write basic execution trace."), wxDefaultPosition, wxDefaultSize, 0 );
246 item1->Add( item3, 0, wxALL, 5 );
247
248 wxCheckBox *item4 = new wxCheckBox( parent, ID_BUS_TRACE, wxT("Write bus trace."), wxDefaultPosition, wxDefaultSize, 0 );
249 item1->Add( item4, 0, wxALL, 5 );
250
251 wxCheckBox *item19 = new wxCheckBox( parent, ID_PT_TRACKING, wxT("Procedure transfer tracking."), wxDefaultPosition, wxDefaultSize, 0 );
252 item1->Add( item19, 0, wxALL, 5 );
253
254 wxCheckBox *item5 = new wxCheckBox( parent, ID_RF_TRACKING, wxT("Concurrent register file access tracking."), wxDefaultPosition, wxDefaultSize, 0 );
255 item1->Add( item5, 0, wxALL, 5 );
256
257 wxCheckBox *item6 = new wxCheckBox( parent, ID_FU_CONFLICT_DETECTION, wxT("Function unit resouce conflict detection."), wxDefaultPosition, wxDefaultSize, 0 );
258 item1->Add( item6, 0, wxALL, 5 );
259
260 wxCheckBox *profiledata = new wxCheckBox( parent, ID_PROFILE_DATA_SAVING, wxT("Profile data saving."), wxDefaultPosition, wxDefaultSize, 0 );
261 item1->Add( profiledata, 0, wxALL, 5 );
262
263 wxCheckBox *utildata = new wxCheckBox( parent, ID_UTILIZATION_DATA_SAVING, wxT("Utilization data saving."), wxDefaultPosition, wxDefaultSize, 0 );
264 item1->Add( utildata, 0, wxALL, 5 );
265
266 wxCheckBox *nextinstr = new wxCheckBox( parent, ID_NEXT_INSTRUCTION_PRINTING, wxT("Next instruction printing."), wxDefaultPosition, wxDefaultSize, 0 );
267 item1->Add( nextinstr, 0, wxALL, 5 );
268
269 wxCheckBox *timestat = new wxCheckBox( parent, ID_SIMULATION_TIME_STATISTICS, wxT("Simulation time statistics."), wxDefaultPosition, wxDefaultSize, 0 );
270 item1->Add( timestat, 0, wxALL, 5 );
271
272 item0->Add( item1, 0, wxGROW|wxALL, 5 );
273
274 wxStaticBox *item8 = new wxStaticBox( parent, -1, wxT("Command history:") );
275 wxStaticBoxSizer *item7 = new wxStaticBoxSizer( item8, wxVERTICAL );
276
277 wxBoxSizer *item9 = new wxBoxSizer( wxHORIZONTAL );
278
279 wxStaticText *item10 = new wxStaticText( parent, ID_LABEL_HISTORY_SIZE, wxT("Maximum size of command history:"), wxDefaultPosition, wxDefaultSize, 0 );
280 item9->Add( item10, 0, wxALIGN_CENTER|wxALL, 5 );
281
282 wxSpinCtrl *item11 = new wxSpinCtrl( parent, ID_HISTORY_SIZE, wxT("0"), wxDefaultPosition, wxSize(-1,-1), 0, 0, 10000, 0 );
283 item9->Add( item11, 0, wxALIGN_CENTER|wxALL, 5 );
284
285 item7->Add( item9, 0, wxGROW|wxALL, 5 );
286
287 wxBoxSizer *item12 = new wxBoxSizer( wxVERTICAL );
288
289 wxCheckBox *item13 = new wxCheckBox( parent, ID_SAVE_HISTORY, wxT("Save command history to file:"), wxDefaultPosition, wxDefaultSize, 0 );
290 item12->Add( item13, 0, wxALL, 5 );
291
292 wxTextCtrl *item14 = new wxTextCtrl( parent, ID_HISTORY_FILE, wxT(""), wxDefaultPosition, wxSize(300,-1), 0 );
293 item12->Add( item14, 0, wxALIGN_CENTER|wxALL, 5 );
294
295 item7->Add( item12, 0, wxGROW|wxALL, 5 );
296
297 item0->Add( item7, 0, wxGROW|wxALL, 5 );
298
299 wxStaticLine *item15 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(20,-1), wxLI_HORIZONTAL );
300 item0->Add( item15, 0, wxGROW|wxALL, 5 );
301
302 wxBoxSizer *item16 = new wxBoxSizer( wxHORIZONTAL );
303
304 wxButton *item17 = new wxButton( parent, wxID_CANCEL, wxT("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
305 item16->Add( item17, 0, wxALL, 5 );
306
307 wxButton *item18 = new wxButton( parent, wxID_OK, wxT("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
308 item16->Add( item18, 0, wxALIGN_CENTER|wxALL, 5 );
309
310 item0->Add( item16, 0, 0, 5 );
311
312 if (set_sizer)
313 {
314 parent->SetSizer( item0 );
315 if (call_fit)
316 item0->SetSizeHints( parent );
317 }
318
319 return item0;
320}

References ID_BUS_TRACE, ID_EXEC_TRACE, ID_FU_CONFLICT_DETECTION, ID_HISTORY_FILE, ID_HISTORY_SIZE, ID_LABEL_HISTORY_SIZE, ID_LINE, ID_NEXT_INSTRUCTION_PRINTING, ID_PROFILE_DATA_SAVING, ID_PT_TRACKING, ID_RF_TRACKING, ID_SAVE_HISTORY, ID_SIMULATION_TIME_STATISTICS, and ID_UTILIZATION_DATA_SAVING.

◆ onOK()

void SimulatorSettingsDialog::onOK ( wxCommandEvent &  event)
private

Updates the simulator settings and closes the dialog when the OK-button is pressed.

Definition at line 127 of file SimulatorSettingsDialog.cc.

127 {
128
129 TransferDataFromWindow();
130
131 std::string command;
132 std::string historyFile =
133 WxConversion::toString(historyFile_.Trim(false).Trim(true));
134
136 command += ProximConstants::SCL_SET + " ";
140 }
141
143 command += ProximConstants::SCL_SET + " ";
147 }
148
150 command += ProximConstants::SCL_SET + " ";
152 command += Conversion::toString(ptTrace_);
154 }
155
157 command += ProximConstants::SCL_SET + " ";
159 command += Conversion::toString(rfTrace_);
161 }
162
164 command += ProximConstants::SCL_SET + " ";
168 }
169
171 command += ProximConstants::SCL_SET + " ";
175 }
176
178 command += ProximConstants::SCL_SET + " ";
182
183 }
184
185 if (lineReader_.inputHistoryFilename() != historyFile) {
186 command += ProximConstants::SCL_SET + " ";
188 command += historyFile;
190 }
191
193 command += ProximConstants::SCL_SET + " ";
197 }
198
200 command += ProximConstants::SCL_SET + " ";
204 }
205
207 command += ProximConstants::SCL_SET + " ";
211 }
212
214 command += ProximConstants::SCL_SET + " ";
218 }
219
220 lineReader_.input(command);
221
222 EndModal(wxID_OK);
223}
static std::string toString(const T &source)
virtual size_t inputHistoryMaxLength() const
virtual bool saveInputHistoryToFile() const
static const std::string SCL_SETTING_SIMULATION_TIME_STATISTICS
Name of the simulation time statistics setting.
static const std::string SCL_SETTING_FU_CONFLICT_DETECTION
Name of the fu conflict detection setting.
static const std::string SCL_SETTING_HISTORY_SIZE
Name of the input history size setting.
static const std::string SCL_SETTING_HISTORY_FILE
Name of the input history file name setting.
static const std::string SCL_SETTING_RF_TRACE
Name of the rf access trace setting.
static const std::string SCL_SETTING_EXEC_TRACE
Name of the execution trace setting.
static const std::string SCL_SETTING_UTILIZATION_DATA_SAVING
Name of the utilization data saving setting.
static const std::string SCL_SETTING_HISTORY_SAVE
Name of the input history saving setting,.
static const std::string SCL_SETTING_BUS_TRACE
Name of the bus trace setting.
static const std::string SCL_SETTING_NEXT_INSTRUCTION_PRINTING
Name of the fu next insturction printing setting.
static const std::string SCL_SET
Command for configuring simulator settings.
static const std::string SCL_DELIM
Command delimeter for the simulator commands.
static const std::string SCL_SETTING_PROCEDURE_TRANSFER_TRACE
Name of the procedure transfer trace setting.
static const std::string SCL_SETTING_PROFILE_DATA_SAVING
Name of the profile data saving setting.
void input(std::string command)
std::string inputHistoryFilename() const
bool simulationTimeStatistics() const
bool utilizationDataSaving() const
bool fuResourceConflictDetection() const
bool profileDataSaving() const
bool executionTracing() const
bool procedureTransferTracing() const
bool nextInstructionPrinting() const
static std::string toString(const wxString &source)

References busTrace_, SimulatorFrontend::busTracing(), execTrace_, SimulatorFrontend::executionTracing(), fuConflictDetection_, SimulatorFrontend::fuResourceConflictDetection(), historyFile_, historySave_, historySize_, ProximLineReader::input(), ProximLineReader::inputHistoryFilename(), LineReader::inputHistoryMaxLength(), lineReader_, SimulatorFrontend::nextInstructionPrinting(), nextInstructionPrinting_, SimulatorFrontend::procedureTransferTracing(), SimulatorFrontend::profileDataSaving(), profileDataSaving_, ptTrace_, SimulatorFrontend::rfAccessTracing(), rfTrace_, LineReader::saveInputHistoryToFile(), ProximConstants::SCL_DELIM, ProximConstants::SCL_SET, ProximConstants::SCL_SETTING_BUS_TRACE, ProximConstants::SCL_SETTING_EXEC_TRACE, ProximConstants::SCL_SETTING_FU_CONFLICT_DETECTION, ProximConstants::SCL_SETTING_HISTORY_FILE, ProximConstants::SCL_SETTING_HISTORY_SAVE, ProximConstants::SCL_SETTING_HISTORY_SIZE, ProximConstants::SCL_SETTING_NEXT_INSTRUCTION_PRINTING, ProximConstants::SCL_SETTING_PROCEDURE_TRANSFER_TRACE, ProximConstants::SCL_SETTING_PROFILE_DATA_SAVING, ProximConstants::SCL_SETTING_RF_TRACE, ProximConstants::SCL_SETTING_SIMULATION_TIME_STATISTICS, ProximConstants::SCL_SETTING_UTILIZATION_DATA_SAVING, SimulatorFrontend::simulationTimeStatistics(), simulationTimeStatistics_, simulator_, Conversion::toString(), WxConversion::toString(), SimulatorFrontend::utilizationDataSaving(), and utilizationDataSaving_.

Here is the call graph for this function:

◆ TransferDataToWindow()

bool SimulatorSettingsDialog::TransferDataToWindow ( )
privatevirtual

Transfers settings data from the simulator frontend to the dialog widgets.

Definition at line 99 of file SimulatorSettingsDialog.cc.

References busTrace_, SimulatorFrontend::busTracing(), execTrace_, SimulatorFrontend::executionTracing(), fuConflictDetection_, SimulatorFrontend::fuResourceConflictDetection(), historyFile_, historySave_, historySize_, ProximLineReader::inputHistoryFilename(), LineReader::inputHistoryMaxLength(), lineReader_, SimulatorFrontend::nextInstructionPrinting(), nextInstructionPrinting_, SimulatorFrontend::procedureTransferTracing(), SimulatorFrontend::profileDataSaving(), profileDataSaving_, ptTrace_, SimulatorFrontend::rfAccessTracing(), rfTrace_, LineReader::saveInputHistoryToFile(), SimulatorFrontend::simulationTimeStatistics(), simulationTimeStatistics_, simulator_, WxConversion::toWxString(), SimulatorFrontend::utilizationDataSaving(), and utilizationDataSaving_.

Here is the call graph for this function:

Member Data Documentation

◆ busTrace_

bool SimulatorSettingsDialog::busTrace_
private

Bus trace enabled/disabled.

Definition at line 84 of file SimulatorSettingsDialog.hh.

Referenced by onOK(), and TransferDataToWindow().

◆ execTrace_

bool SimulatorSettingsDialog::execTrace_
private

Execution trace enabled/disabled.

Definition at line 82 of file SimulatorSettingsDialog.hh.

Referenced by onOK(), and TransferDataToWindow().

◆ fuConflictDetection_

bool SimulatorSettingsDialog::fuConflictDetection_
private

FU conflict detection enabled/disabled.

Definition at line 90 of file SimulatorSettingsDialog.hh.

Referenced by onOK(), and TransferDataToWindow().

◆ historyFile_

wxString SimulatorSettingsDialog::historyFile_
private

History log file name.

Definition at line 106 of file SimulatorSettingsDialog.hh.

Referenced by onOK(), and TransferDataToWindow().

◆ historySave_

bool SimulatorSettingsDialog::historySave_
private

Input history log file enabled/disabled.

Definition at line 102 of file SimulatorSettingsDialog.hh.

Referenced by onOK(), and TransferDataToWindow().

◆ historySize_

int SimulatorSettingsDialog::historySize_
private

History log max size.

Definition at line 104 of file SimulatorSettingsDialog.hh.

Referenced by onOK(), and TransferDataToWindow().

◆ lineReader_

ProximLineReader& SimulatorSettingsDialog::lineReader_
private

Line reader to configure.

Definition at line 79 of file SimulatorSettingsDialog.hh.

Referenced by onOK(), and TransferDataToWindow().

◆ nextInstructionPrinting_

bool SimulatorSettingsDialog::nextInstructionPrinting_
private

Next instruction printing enabled/disabled.

Definition at line 97 of file SimulatorSettingsDialog.hh.

Referenced by onOK(), and TransferDataToWindow().

◆ profileDataSaving_

bool SimulatorSettingsDialog::profileDataSaving_
private

Profile data saving enabled/disabled.

Definition at line 93 of file SimulatorSettingsDialog.hh.

Referenced by onOK(), and TransferDataToWindow().

◆ ptTrace_

bool SimulatorSettingsDialog::ptTrace_
private

Procedure transfer tracing enabled/disabled.

Definition at line 86 of file SimulatorSettingsDialog.hh.

Referenced by onOK(), and TransferDataToWindow().

◆ rfTrace_

bool SimulatorSettingsDialog::rfTrace_
private

Register file access tracing enabled/disabled.

Definition at line 88 of file SimulatorSettingsDialog.hh.

Referenced by onOK(), and TransferDataToWindow().

◆ simulationTimeStatistics_

bool SimulatorSettingsDialog::simulationTimeStatistics_
private

Profile data saving enabled/disabled.

Definition at line 99 of file SimulatorSettingsDialog.hh.

Referenced by onOK(), and TransferDataToWindow().

◆ simulator_

SimulatorFrontend& SimulatorSettingsDialog::simulator_
private

Frontend of the simulator to configure.

Definition at line 77 of file SimulatorSettingsDialog.hh.

Referenced by onOK(), and TransferDataToWindow().

◆ utilizationDataSaving_

bool SimulatorSettingsDialog::utilizationDataSaving_
private

Utilization data saving enabled/disabled.

Definition at line 95 of file SimulatorSettingsDialog.hh.

Referenced by onOK(), and TransferDataToWindow().


The documentation for this class was generated from the following files: