From ad5503385740638632380437e6f6b5166fff5c33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 15 Jan 2018 13:18:08 +0100 Subject: Update new dialog for new configuration For now no settings and no direct machine configuration but graphics is there. --- qtmips_gui/NewDialog.ui | 69 ++++++++++++++++++++++++++---------------- qtmips_gui/NewDialogCache.ui | 71 ++++++++++++++++++++++++++++++++++++++++++++ qtmips_gui/newdialog.cpp | 23 +++++++------- qtmips_gui/newdialog.h | 3 +- qtmips_gui/qtmips_gui.pro | 1 + 5 files changed, 127 insertions(+), 40 deletions(-) create mode 100644 qtmips_gui/NewDialogCache.ui 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 @@ - + + Delay slot + + + + + + Hazard unit + + true + + + false + + + + + + Stall when hazard is detected + + + + + + + Stall or forward when hazard is detected + + + true + + + + @@ -165,31 +197,6 @@ - - - - Cache (for both program and data) - - - true - - - false - - - - - - Associative - - - true - - - - - - @@ -205,6 +212,16 @@ + + + Program cache + + + + + Data cache + + 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 @@ + + + NewDialogCache + + + + 0 + 0 + 339 + 167 + + + + Form + + + + + + Capacity: + + + + + + + + + + Number of sets: + + + + + + + Block size: + + + + + + + Number of blocks: + + + + + + + Degree of associativity: + + + + + + + + + + + + + + + + + + + + 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 #include #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 += \ -- cgit v1.2.3