From f0ad502e4651243d6a96194b3393bd460c0f7fc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sun, 19 Nov 2017 21:23:04 +0100 Subject: Another huge pile of work for about two months Well I should commit every change instead of this madness. I am not documenting changes as all this is just improvements and implementation progression. --- qtmips_gui/CacheContent.ui | 22 ++- qtmips_gui/CacheStatistics.ui | 10 +- qtmips_gui/MainWindow.ui | 99 +++++++++- qtmips_gui/NewDialog.ui | 344 ++++++++++++++++++++++++++++------ qtmips_gui/cachecontent.cpp | 10 +- qtmips_gui/cachecontent.h | 17 +- qtmips_gui/cachestatistics.cpp | 8 +- qtmips_gui/cachestatistics.h | 15 +- qtmips_gui/coreview.cpp | 33 +++- qtmips_gui/coreview.h | 43 ++++- qtmips_gui/icons.qrc | 16 +- qtmips_gui/icons/application-exit.png | Bin 2633 -> 2525 bytes qtmips_gui/main.cpp | 15 +- qtmips_gui/mainwindow.cpp | 93 ++++++++- qtmips_gui/mainwindow.h | 44 ++++- qtmips_gui/newdialog.cpp | 153 ++++++++++++++- qtmips_gui/newdialog.h | 33 +++- qtmips_gui/qtmips_gui.pro | 23 ++- qtmips_gui/registersdock.cpp | 10 +- qtmips_gui/registersdock.h | 18 +- qtmips_gui/registersdock.ui | 18 +- 21 files changed, 885 insertions(+), 139 deletions(-) (limited to 'qtmips_gui') diff --git a/qtmips_gui/CacheContent.ui b/qtmips_gui/CacheContent.ui index ac2f263..372dee1 100644 --- a/qtmips_gui/CacheContent.ui +++ b/qtmips_gui/CacheContent.ui @@ -1,7 +1,7 @@ - + - DockWidget - + CacheContent + 0 @@ -11,8 +11,20 @@ - DockWidget + Cache content - + + + + + + TODO + + + + + + + diff --git a/qtmips_gui/CacheStatistics.ui b/qtmips_gui/CacheStatistics.ui index ac2f263..5bb8b72 100644 --- a/qtmips_gui/CacheStatistics.ui +++ b/qtmips_gui/CacheStatistics.ui @@ -1,7 +1,7 @@ - + - DockWidget - + CacheStatistics + 0 @@ -11,8 +11,10 @@ - DockWidget + Cache statistics + + diff --git a/qtmips_gui/MainWindow.ui b/qtmips_gui/MainWindow.ui index 0f69613..56f5319 100644 --- a/qtmips_gui/MainWindow.ui +++ b/qtmips_gui/MainWindow.ui @@ -6,20 +6,47 @@ 0 0 - 400 - 300 + 957 + 651 MainWindow - + + false + + + true + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 0 - 400 + 957 20 @@ -27,7 +54,8 @@ File - + + @@ -85,16 +113,39 @@ false + + + + + + - + + + + :/icons/document-import.png:/icons/document-import.png + - Load binary... + New simulation... + + + Ctrl+O, Ctrl+N + + + :/icons/application-exit.png:/icons/application-exit.png + Exit + + Exit program + + + Ctrl+Q + @@ -102,19 +153,40 @@ + + + :/icons/play.png:/icons/play.png + Run + + Ctrl+R + + + + :/icons/next.png:/icons/next.png + Step + + Ctrl+S + + + + :/icons/pause.png:/icons/pause.png + Pause + + Ctrl+P + @@ -184,8 +256,19 @@ Assembler + + + + :/icons/reload.png:/icons/reload.png + + + Reload existing + + - + + + diff --git a/qtmips_gui/NewDialog.ui b/qtmips_gui/NewDialog.ui index 18d31ab..e39edbf 100644 --- a/qtmips_gui/NewDialog.ui +++ b/qtmips_gui/NewDialog.ui @@ -1,71 +1,299 @@ - - - - - Dialog - - + + + NewDialog + + 0 0 - 400 - 300 + 558 + 306 - + Dialog - - - - 30 - 240 - 341 - 32 - + + true + + + + 0 - - Qt::Horizontal + + 0 - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + 0 - + + + + 2 + + + + Basic + + + + + + Preset + + + + + + No pipeline no cache + + + + + + + Pipelined and cache + + + + + + + Custom + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Horizontal + + + + + + + + + Elf executable: + + + + + + + + + + Browse + + + + + + + + + + Core + + + + QLayout::SetDefaultConstraint + + + + + Pipelined + + + + + + + Hazard unit + + + + + + + Flush pipeline on jump + + + + + + + Jump prediction + + + false + + + true + + + false + + + + + + Static + + + true + + + + + + + One level dynamic + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Memory + + + + + + Program memory write protection + + + + + + + Data memory executable protection + + + + + + + Cache (for both program and data) + + + true + + + false + + + + + + Associative + + + true + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + 9 + + + 0 + + + 9 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Load machine + + + + + + + Cancel + + + + + + - - - - buttonBox - accepted() - Dialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - Dialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - + diff --git a/qtmips_gui/cachecontent.cpp b/qtmips_gui/cachecontent.cpp index c651b7b..1dd4693 100644 --- a/qtmips_gui/cachecontent.cpp +++ b/qtmips_gui/cachecontent.cpp @@ -1,6 +1,10 @@ -#include "cache_content.h" +#include "cachecontent.h" -cache_content::cache_content() -{ +CacheContentDock::CacheContentDock(QWidget *parent) : QDockWidget(parent) { + ui = new Ui::CacheContent(); + ui->setupUi(this); +} +CacheContentDock::~CacheContentDock() { + delete ui; } diff --git a/qtmips_gui/cachecontent.h b/qtmips_gui/cachecontent.h index 09b8734..3b028b5 100644 --- a/qtmips_gui/cachecontent.h +++ b/qtmips_gui/cachecontent.h @@ -1,11 +1,16 @@ -#ifndef CACHE_CONTENT_H -#define CACHE_CONTENT_H +#ifndef CACHECONTENT_H +#define CACHECONTENT_H +#include +#include "ui_CacheContent.h" -class cache_content -{ +class CacheContentDock : public QDockWidget { public: - cache_content(); + CacheContentDock(QWidget *parent); + ~CacheContentDock(); + +private: + Ui::CacheContent *ui; }; -#endif // CACHE_CONTENT_H \ No newline at end of file +#endif // CACHECONTENT_H diff --git a/qtmips_gui/cachestatistics.cpp b/qtmips_gui/cachestatistics.cpp index ade92c6..dd78a8c 100644 --- a/qtmips_gui/cachestatistics.cpp +++ b/qtmips_gui/cachestatistics.cpp @@ -1,6 +1,10 @@ #include "cachestatistics.h" -CacheStatistics::CacheStatistics() -{ +CacheStatisticsDock::CacheStatisticsDock(QWidget *parent) : QDockWidget(parent) { + ui = new Ui::CacheStatistics(); + ui->setupUi(this); +} +CacheStatisticsDock::~CacheStatisticsDock() { + delete ui; } diff --git a/qtmips_gui/cachestatistics.h b/qtmips_gui/cachestatistics.h index 4fa77a6..a92d125 100644 --- a/qtmips_gui/cachestatistics.h +++ b/qtmips_gui/cachestatistics.h @@ -1,11 +1,18 @@ #ifndef CACHESTATISTICS_H #define CACHESTATISTICS_H +#include +#include "ui_CacheStatistics.h" -class CacheStatistics -{ +class CacheStatisticsDock : public QDockWidget { + Q_OBJECT public: - CacheStatistics(); + CacheStatisticsDock(QWidget *parent); + ~CacheStatisticsDock(); + +private: + Ui::CacheStatistics *ui; + }; -#endif // CACHESTATISTICS_H \ No newline at end of file +#endif // CACHESTATISTICS_H diff --git a/qtmips_gui/coreview.cpp b/qtmips_gui/coreview.cpp index de8a637..4d23bd8 100644 --- a/qtmips_gui/coreview.cpp +++ b/qtmips_gui/coreview.cpp @@ -1,6 +1,35 @@ #include "coreview.h" -CoreView::CoreView() -{ +CoreView::CoreView(QWidget *parent) : QGraphicsView(parent) { } + +/* +CoreViewBlock::CoreViewBlock() { +} + +CoreViewLine::CoreViewLine() { + +} + +CoreViewLine::CoreViewLine(struct point start, struct point end, QList axis) { + +} + +CoreViewLine::~CoreViewLine() { + +} + +void CoreViewLine::set_start(struct point p) { + +} + +void CoreViewLine::set_end(struct point p) { + +} + +void CoreViewLine::set_axis(QList axs) { + +} + +*/ diff --git a/qtmips_gui/coreview.h b/qtmips_gui/coreview.h index 6e7407f..a2772fb 100644 --- a/qtmips_gui/coreview.h +++ b/qtmips_gui/coreview.h @@ -1,11 +1,46 @@ #ifndef COREVIEW_H #define COREVIEW_H +#include +#include +#include +#include "machineconfig.h" -class CoreView -{ +class CoreView : public QGraphicsView { + Q_OBJECT public: - CoreView(); + CoreView(QWidget *parent); + +private: + +}; + +/* +class CoreViewBlock : public QGraphicsItem { + Q_OBJECT +public: + CoreViewBlock(); +}; + +class CoreViewLine : public QGraphicsItem { + Q_OBJECT +public: + struct point { + int x1, y1, x2, y2; + }; + + CoreViewLine(); + CoreViewLine(struct point start, struct point end, QList axis); + ~CoreViewLine(); + + void set_start(struct point); + void set_end(struct point); + void set_axis(QList); + +protected: + struct point start, end; + QList axis; }; +*/ -#endif // COREVIEW_H \ No newline at end of file +#endif // COREVIEW_H diff --git a/qtmips_gui/icons.qrc b/qtmips_gui/icons.qrc index 90f4a83..08542ee 100644 --- a/qtmips_gui/icons.qrc +++ b/qtmips_gui/icons.qrc @@ -1,2 +1,14 @@ - - + + + icons/application-exit.png + icons/reload.png + icons/document-import.png + icons/finish.png + icons/forward.png + icons/next.png + icons/pause.png + icons/refresh.png + icons/play.png + icons/stop.png + + diff --git a/qtmips_gui/icons/application-exit.png b/qtmips_gui/icons/application-exit.png index 2d0cd61..79ee79c 100644 Binary files a/qtmips_gui/icons/application-exit.png and b/qtmips_gui/icons/application-exit.png differ diff --git a/qtmips_gui/main.cpp b/qtmips_gui/main.cpp index b48f94e..1c03f3f 100644 --- a/qtmips_gui/main.cpp +++ b/qtmips_gui/main.cpp @@ -1,11 +1,14 @@ -#include "mainwindow.h" #include +#include +#include "mainwindow.h" + +int main(int argc, char *argv[]) { + QApplication app(argc, argv); + app.setApplicationName("qtmips_gui"); + app.setApplicationVersion("0.1"); -int main(int argc, char *argv[]) -{ - QApplication a(argc, argv); MainWindow w; - w.show(); + w.start(); - return a.exec(); + return app.exec(); } diff --git a/qtmips_gui/mainwindow.cpp b/qtmips_gui/mainwindow.cpp index 49d64fc..ea48736 100644 --- a/qtmips_gui/mainwindow.cpp +++ b/qtmips_gui/mainwindow.cpp @@ -1,14 +1,93 @@ #include "mainwindow.h" -#include "ui_mainwindow.h" -MainWindow::MainWindow(QWidget *parent) : - QMainWindow(parent), - ui(new Ui::MainWindow) -{ +MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { + settings = new QSettings("CTU", "QtMips"); + coreview = nullptr; + + ui = new Ui::MainWindow(); ui->setupUi(this); + setWindowTitle("QtMips"); + + // Create/prepare other widgets + ndialog = new NewDialog(this, settings); + cache_content = new CacheContentDock(this); + cache_content->hide(); + cache_statictics = new CacheStatisticsDock(this); + cache_statictics->hide(); + registers = new RegistersDock(this); + registers->hide(); + + // Connect signals from menu + QObject::connect(ui->actionExit, SIGNAL(triggered(bool)), this, SLOT(close())); + QObject::connect(ui->actionNew, SIGNAL(triggered(bool)), this, SLOT(new_machine())); + QObject::connect(ui->actionCache, SIGNAL(triggered(bool)), this, SLOT(show_cache_content())); + QObject::connect(ui->actionCache_statistics, SIGNAL(triggered(bool)), this, SLOT(show_cache_statictics())); + QObject::connect(ui->actionRegisters, SIGNAL(triggered(bool)), this, SLOT(show_registers())); + + // Restore application state from settings + restoreState(settings->value("windowState").toByteArray()); + restoreGeometry(settings->value("windowGeometry").toByteArray()); } -MainWindow::~MainWindow() -{ +MainWindow::~MainWindow() { + settings->sync(); + delete settings; + if (coreview != nullptr) + delete coreview; + delete ndialog; + delete cache_content; + delete cache_statictics; + delete registers; delete ui; } + +void MainWindow::start() { + this->show(); + ndialog->show(); +} + +void MainWindow::create_core(MachineConfig *config) { + // Create machine + machine = new QtMipsMachine(config); + // Create machine view + coreview = new CoreView(this); + this->setCentralWidget(coreview); + // TODO connect signals +} + +void MainWindow::new_machine() { + ndialog->show(); +} + +void MainWindow::show_cache_content() { + show_dockwidget(cache_content); +} + +void MainWindow::show_cache_statictics() { + show_dockwidget(cache_statictics); +} + +void MainWindow::show_registers() { + show_dockwidget(registers); +} + +bool MainWindow::configured() { + return (machine != nullptr); +} + +void MainWindow::closeEvent(QCloseEvent *event) { + settings->setValue("windowGeometry", saveGeometry()); + settings->setValue("windowState", saveState()); + settings->sync(); + QMainWindow::closeEvent(event); +} + +void MainWindow::show_dockwidget(QDockWidget *dw) { + if (dw->isHidden()) { + dw->show(); + addDockWidget(Qt::RightDockWidgetArea, dw); + } else { + dw->raise(); + dw->setFocus(); + } +} diff --git a/qtmips_gui/mainwindow.h b/qtmips_gui/mainwindow.h index a3948a9..bba1cb7 100644 --- a/qtmips_gui/mainwindow.h +++ b/qtmips_gui/mainwindow.h @@ -2,21 +2,55 @@ #define MAINWINDOW_H #include +#include +#include "ui_MainWindow.h" +#include "newdialog.h" +#include "coreview.h" +#include "cachecontent.h" +#include "cachestatistics.h" +#include "registersdock.h" -namespace Ui { -class MainWindow; -} +#include "qtmipsmachine.h" +#include "machineconfig.h" -class MainWindow : public QMainWindow -{ +class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); + void start(); + void create_core(MachineConfig *config); + +public slots: + void new_machine(); + + void show_cache_content(); + void show_cache_statictics(); + void show_registers(); + + bool configured(); + +protected: + void closeEvent(QCloseEvent *event); + private: Ui::MainWindow *ui; + + NewDialog *ndialog; + + CoreView *coreview; + + CacheContentDock *cache_content; + CacheStatisticsDock *cache_statictics; + RegistersDock *registers; + + QSettings *settings; + + QtMipsMachine *machine; // Current simulated machine + + void show_dockwidget(QDockWidget *w); }; #endif // MAINWINDOW_H diff --git a/qtmips_gui/newdialog.cpp b/qtmips_gui/newdialog.cpp index b2d24a8..31f4bb8 100644 --- a/qtmips_gui/newdialog.cpp +++ b/qtmips_gui/newdialog.cpp @@ -1,6 +1,155 @@ #include "newdialog.h" +#include "mainwindow.h" -newdialog::newdialog() -{ +NewDialog::NewDialog(QWidget *parent, QSettings *settings) : QDialog(parent) { + ui = new Ui::NewDialog(); + ui->setupUi(this); + setWindowTitle("New machine"); + this->settings = settings; + + QObject::connect(ui->pushButton_load, SIGNAL(clicked(bool)), this, SLOT(create())); + QObject::connect(ui->pushButton_cancel, SIGNAL(clicked(bool)), this, SLOT(cancel())); + // Signals on Base tab + QObject::connect(ui->preset_no_pipeline, SIGNAL(toggled(bool)), this, SLOT(preset(bool))); + QObject::connect(ui->preset_pipelined, SIGNAL(toggled(bool)), this, SLOT(preset(bool))); + QObject::connect(ui->pushButton_browse, SIGNAL(clicked(bool)), this, SLOT(browse_elf())); +#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); + CUSTOM_PRESET(ui->flush_jump); + CUSTOM_PRESET(ui->prediction); + CUSTOM_PRESET(ui->prediction_static); + CUSTOM_PRESET(ui->prediction_one_dynamic); + // 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 + load_settings(); +} + +NewDialog::~NewDialog() { + delete ui; + // Settings is freed by parent + delete elf_dialog; +} + +void NewDialog::cancel() { + this->close(); +} + +void NewDialog::create() { + MainWindow *prnt = (MainWindow*)parent(); + + MachineConfig *mc = new MachineConfig(); + mc->set_elf(ui->elf_file->text()); + mc->set_pipelined(ui->pipelined->isChecked()); + // TODO other settings + + try { + prnt->create_core(mc); + } catch (const QtMipsExceptionInput &e) { + QMessageBox msg(this); + msg.setText(e.msg(false)); + msg.setIcon(QMessageBox::Critical); + msg.setToolTip("Please check that ELF executable realy exists and is in correct format."); + msg.setDetailedText(e.msg(true)); + msg.setWindowTitle("Error while initializing new machine"); + msg.exec(); + goto cleanup; + } + + store_settings(); // Save to settings + this->close(); + +cleanup: + delete mc; +} + +void NewDialog::browse_elf() { + QFileDialog elf_dialog(this); + elf_dialog.setFileMode(QFileDialog::ExistingFile); + if (elf_dialog.exec()) + ui->elf_file->setText(elf_dialog.selectedFiles()[0]); +} + +void NewDialog::preset(bool value) { + if (value) { + bool pip = ui->preset_pipelined->isChecked(); + // Core settings + ui->pipelined->setChecked(pip); + ui->hazard->setChecked(pip); + ui->flush_jump->setChecked(pip); + ui->prediction->setChecked(pip); + ui->prediction_one_dynamic->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 +} + +void NewDialog::set_custom_preset() { + ui->preset_custom->setChecked(true); +} + +void NewDialog::closeEvent(QCloseEvent *) { + load_settings(); // Reset from settings + // Close main window if not already configured + MainWindow *prnt = (MainWindow*)parent(); + if (!prnt->configured()) + prnt->close(); +} + +#define LOAD_BUTTON(NAME, DEF) ui->NAME->setChecked(settings->value(#NAME, DEF).toBool()) +#define LOAD_LINE(NAME, DEF) ui->NAME->setText(settings->value(#NAME, DEF).toString()) + +#define STORE_BUTTON(NAME) settings->setValue(#NAME, ui->NAME->isChecked()) +#define STORE_LINE(NAME) settings->setValue(#NAME, ui->NAME->text()) + +void NewDialog::load_settings() { + // Core tab + LOAD_BUTTON(pipelined, false); + LOAD_BUTTON(hazard, false); + LOAD_BUTTON(flush_jump, false); + LOAD_BUTTON(prediction, false); + LOAD_BUTTON(prediction_static, true); + LOAD_BUTTON(prediction_one_dynamic, 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); + LOAD_BUTTON(preset_pipelined, false); + LOAD_BUTTON(preset_custom, false); + LOAD_LINE(elf_file, ""); +} + +void NewDialog::store_settings() { + // Core tab + STORE_BUTTON(pipelined); + STORE_BUTTON(hazard); + STORE_BUTTON(flush_jump); + STORE_BUTTON(prediction); + STORE_BUTTON(prediction_static); + STORE_BUTTON(prediction_one_dynamic); + // 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); + STORE_BUTTON(preset_custom); + STORE_LINE(elf_file); } diff --git a/qtmips_gui/newdialog.h b/qtmips_gui/newdialog.h index d37c9c0..d9e850e 100644 --- a/qtmips_gui/newdialog.h +++ b/qtmips_gui/newdialog.h @@ -1,11 +1,36 @@ #ifndef NEWDIALOG_H #define NEWDIALOG_H +#include +#include +#include +#include +#include "ui_NewDialog.h" +#include "qtmipsexception.h" -class newdialog -{ +class NewDialog : public QDialog { + Q_OBJECT public: - newdialog(); + NewDialog(QWidget *parent, QSettings *settings); + ~NewDialog(); + +public slots: + void cancel(); + void create(); + void browse_elf(); + void preset(bool); + void set_custom_preset(); + +protected: + void closeEvent(QCloseEvent *); + +private: + Ui::NewDialog *ui; + QSettings *settings; + QFileDialog *elf_dialog; + + void load_settings(); + void store_settings(); }; -#endif // NEWDIALOG_H \ No newline at end of file +#endif // NEWDIALOG_H diff --git a/qtmips_gui/qtmips_gui.pro b/qtmips_gui/qtmips_gui.pro index 7dfb53c..ee2bd6e 100644 --- a/qtmips_gui/qtmips_gui.pro +++ b/qtmips_gui/qtmips_gui.pro @@ -14,10 +14,27 @@ DEFINES += QT_DEPRECATED_WARNINGS SOURCES += \ main.cpp \ - mainwindow.cpp + mainwindow.cpp \ + newdialog.cpp \ + coreview.cpp \ + registersdock.cpp \ + cachestatistics.cpp \ + cachecontent.cpp HEADERS += \ - mainwindow.h + mainwindow.h \ + newdialog.h \ + coreview.h \ + registersdock.h \ + cachestatistics.h \ + cachecontent.h FORMS += \ - mainwindow.ui + NewDialog.ui \ + MainWindow.ui \ + CacheContent.ui \ + registersdock.ui \ + CacheStatistics.ui + +RESOURCES += \ + icons.qrc diff --git a/qtmips_gui/registersdock.cpp b/qtmips_gui/registersdock.cpp index bf82725..e8a5907 100644 --- a/qtmips_gui/registersdock.cpp +++ b/qtmips_gui/registersdock.cpp @@ -1,6 +1,10 @@ -#include "registers.h" +#include "registersdock.h" -Registers::Registers() -{ +RegistersDock::RegistersDock(QWidget *parent) : QDockWidget(parent) { + ui = new Ui::RegistersDock(); + ui->setupUi(this); +} +RegistersDock::~RegistersDock() { + delete ui; } diff --git a/qtmips_gui/registersdock.h b/qtmips_gui/registersdock.h index 0fb60eb..338edc3 100644 --- a/qtmips_gui/registersdock.h +++ b/qtmips_gui/registersdock.h @@ -1,11 +1,17 @@ -#ifndef REGISTERS_H -#define REGISTERS_H +#ifndef REGISTERSDOCK_H +#define REGISTERSDOCK_H +#include +#include "ui_registersdock.h" -class Registers -{ +class RegistersDock : public QDockWidget { public: - Registers(); + RegistersDock(QWidget *parent); + ~RegistersDock(); + +private: + Ui::RegistersDock *ui; + }; -#endif // REGISTERS_H \ No newline at end of file +#endif // REGISTERSDOCK_H diff --git a/qtmips_gui/registersdock.ui b/qtmips_gui/registersdock.ui index ac2f263..9b51505 100644 --- a/qtmips_gui/registersdock.ui +++ b/qtmips_gui/registersdock.ui @@ -1,7 +1,7 @@ - + - DockWidget - + RegistersDock + 0 @@ -11,8 +11,16 @@ - DockWidget + Registers - + + + + + + + + + -- cgit v1.2.3