diff options
Diffstat (limited to 'qtmips_gui')
-rw-r--r-- | qtmips_gui/NewDialog.ui | 69 | ||||
-rw-r--r-- | qtmips_gui/NewDialogCache.ui | 71 | ||||
-rw-r--r-- | qtmips_gui/newdialog.cpp | 23 | ||||
-rw-r--r-- | qtmips_gui/newdialog.h | 3 | ||||
-rw-r--r-- | qtmips_gui/qtmips_gui.pro | 1 |
5 files changed, 127 insertions, 40 deletions
diff --git a/qtmips_gui/NewDialog.ui b/qtmips_gui/NewDialog.ui index c1ec66c..a39a014 100644 --- a/qtmips_gui/NewDialog.ui +++ b/qtmips_gui/NewDialog.ui @@ -125,10 +125,42 @@ </widget> </item> <item> - <widget class="QCheckBox" name="hazard"> + <widget class="QCheckBox" name="delay_slot"> <property name="text"> + <string>Delay slot</string> + </property> + </widget> + </item> + <item> + <widget class="QGroupBox" name="hazard_unit"> + <property name="title"> <string>Hazard unit</string> </property> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="checked"> + <bool>false</bool> + </property> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <item> + <widget class="QRadioButton" name="hazard_stall"> + <property name="text"> + <string>Stall when hazard is detected</string> + </property> + </widget> + </item> + <item> + <widget class="QRadioButton" name="hazard_stall_forward"> + <property name="text"> + <string>Stall or forward when hazard is detected</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> + </layout> </widget> </item> <item> @@ -166,31 +198,6 @@ </widget> </item> <item> - <widget class="QGroupBox" name="cache"> - <property name="title"> - <string>Cache (for both program and data)</string> - </property> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="checked"> - <bool>false</bool> - </property> - <layout class="QVBoxLayout" name="verticalLayout_7"> - <item> - <widget class="QRadioButton" name="cache_associative"> - <property name="text"> - <string>Associative</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> <spacer name="verticalSpacer_2"> <property name="orientation"> <enum>Qt::Vertical</enum> @@ -205,6 +212,16 @@ </item> </layout> </widget> + <widget class="QWidget" name="tab_cache_program"> + <attribute name="title"> + <string>Program cache</string> + </attribute> + </widget> + <widget class="QWidget" name="tab_cache_data"> + <attribute name="title"> + <string>Data cache</string> + </attribute> + </widget> </widget> </item> <item> diff --git a/qtmips_gui/NewDialogCache.ui b/qtmips_gui/NewDialogCache.ui new file mode 100644 index 0000000..3c91824 --- /dev/null +++ b/qtmips_gui/NewDialogCache.ui @@ -0,0 +1,71 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>NewDialogCache</class> + <widget class="QWidget" name="NewDialogCache"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>339</width> + <height>167</height> + </rect> + </property> + <property name="windowTitle"> + <string>Form</string> + </property> + <layout class="QFormLayout" name="formLayout_2"> + <item row="0" column="0"> + <widget class="QLabel" name="label"> + <property name="text"> + <string>Capacity:</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QSpinBox" name="spinBox"/> + </item> + <item row="1" column="0"> + <widget class="QLabel" name="label_2"> + <property name="text"> + <string>Number of sets:</string> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="label_3"> + <property name="text"> + <string>Block size:</string> + </property> + </widget> + </item> + <item row="3" column="0"> + <widget class="QLabel" name="label_4"> + <property name="text"> + <string>Number of blocks:</string> + </property> + </widget> + </item> + <item row="4" column="0"> + <widget class="QLabel" name="label_5"> + <property name="text"> + <string>Degree of associativity:</string> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QSpinBox" name="spinBox_2"/> + </item> + <item row="2" column="1"> + <widget class="QSpinBox" name="spinBox_3"/> + </item> + <item row="3" column="1"> + <widget class="QSpinBox" name="spinBox_4"/> + </item> + <item row="4" column="1"> + <widget class="QSpinBox" name="spinBox_5"/> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> diff --git a/qtmips_gui/newdialog.cpp b/qtmips_gui/newdialog.cpp index d17d0c4..6aec98a 100644 --- a/qtmips_gui/newdialog.cpp +++ b/qtmips_gui/newdialog.cpp @@ -1,10 +1,17 @@ #include "newdialog.h" #include "mainwindow.h" +#include "qtmipsexception.h" NewDialog::NewDialog(QWidget *parent, QSettings *settings) : QDialog(parent) { + setWindowTitle("New machine"); + ui = new Ui::NewDialog(); ui->setupUi(this); - setWindowTitle("New machine"); + ui_cache_p = new Ui::NewDialogCache(); + ui_cache_p->setupUi(ui->tab_cache_program); + ui_cache_d = new Ui::NewDialogCache(); + ui_cache_d->setupUi(ui->tab_cache_data); + // TODO setup more? settings and configuration pull this->settings = settings; @@ -17,12 +24,9 @@ NewDialog::NewDialog(QWidget *parent, QSettings *settings) : QDialog(parent) { #define CUSTOM_PRESET(UI) QObject::connect(UI, SIGNAL(clicked(bool)), this, SLOT(set_custom_preset())) // Signals on Core tab CUSTOM_PRESET(ui->pipelined); - CUSTOM_PRESET(ui->hazard); // Signals on Memory tab CUSTOM_PRESET(ui->mem_protec_write); CUSTOM_PRESET(ui->mem_protec_exec); - CUSTOM_PRESET(ui->cache); - CUSTOM_PRESET(ui->cache_associative); #undef CUSTOM_PRESET // Load setting after signals are configured so that we can have correct settings @@ -30,6 +34,8 @@ NewDialog::NewDialog(QWidget *parent, QSettings *settings) : QDialog(parent) { } NewDialog::~NewDialog() { + delete ui_cache_d; + delete ui_cache_p; delete ui; // Settings is freed by parent } @@ -83,12 +89,9 @@ void NewDialog::preset(bool value) { bool pip = ui->preset_pipelined->isChecked(); // Core settings ui->pipelined->setChecked(pip); - ui->hazard->setChecked(pip); // Memory settings ui->mem_protec_write->setChecked(true); ui->mem_protec_exec->setChecked(true); - ui->cache->setChecked(pip); - ui->cache_associative->setChecked(true); } // Else custom so do no changes } @@ -105,12 +108,9 @@ void NewDialog::set_custom_preset() { void NewDialog::load_settings() { // Core tab LOAD_BUTTON(pipelined, false); - LOAD_BUTTON(hazard, false); // Memory tab LOAD_BUTTON(mem_protec_write, true); LOAD_BUTTON(mem_protec_exec, true); - LOAD_BUTTON(cache, false); - LOAD_BUTTON(cache_associative, true); // Base tab // We are doing this last so presets can reset previous configuration to somethin valid LOAD_BUTTON(preset_no_pipeline, true); @@ -122,12 +122,9 @@ void NewDialog::load_settings() { void NewDialog::store_settings() { // Core tab STORE_BUTTON(pipelined); - STORE_BUTTON(hazard); // Memory tab STORE_BUTTON(mem_protec_write); STORE_BUTTON(mem_protec_exec); - STORE_BUTTON(cache); - STORE_BUTTON(cache_associative); // Base tab STORE_BUTTON(preset_no_pipeline); STORE_BUTTON(preset_pipelined); diff --git a/qtmips_gui/newdialog.h b/qtmips_gui/newdialog.h index f69bea1..a088777 100644 --- a/qtmips_gui/newdialog.h +++ b/qtmips_gui/newdialog.h @@ -6,7 +6,7 @@ #include <QFileDialog> #include <QMessageBox> #include "ui_NewDialog.h" -#include "qtmipsexception.h" +#include "ui_NewDialogCache.h" class NewDialog : public QDialog { Q_OBJECT @@ -26,6 +26,7 @@ private slots: private: Ui::NewDialog *ui; + Ui::NewDialogCache *ui_cache_p, *ui_cache_d; QSettings *settings; void load_settings(); diff --git a/qtmips_gui/qtmips_gui.pro b/qtmips_gui/qtmips_gui.pro index 5283ced..921bb2d 100644 --- a/qtmips_gui/qtmips_gui.pro +++ b/qtmips_gui/qtmips_gui.pro @@ -55,6 +55,7 @@ HEADERS += \ FORMS += \ NewDialog.ui \ + NewDialogCache.ui \ MainWindow.ui RESOURCES += \ |