aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--qtmips_gui/MainWindow.ui10
-rw-r--r--qtmips_gui/mainwindow.cpp28
-rw-r--r--qtmips_gui/mainwindow.h3
-rw-r--r--qtmips_gui/memorydock.cpp21
-rw-r--r--qtmips_gui/memorydock.h19
-rw-r--r--qtmips_gui/programdock.cpp2
-rw-r--r--qtmips_gui/qtmips_gui.pro6
7 files changed, 70 insertions, 19 deletions
diff --git a/qtmips_gui/MainWindow.ui b/qtmips_gui/MainWindow.ui
index 0ab35d1..e21d22e 100644
--- a/qtmips_gui/MainWindow.ui
+++ b/qtmips_gui/MainWindow.ui
@@ -230,12 +230,18 @@
</action>
<action name="actionMemory">
<property name="text">
- <string>Data Memory</string>
+ <string>Memory</string>
+ </property>
+ <property name="toolTip">
+ <string>Data memory view</string>
</property>
</action>
<action name="actionProgram_memory">
<property name="text">
- <string>Program memory</string>
+ <string>Program</string>
+ </property>
+ <property name="toolTip">
+ <string>Program memory view</string>
</property>
</action>
<action name="actionCache">
diff --git a/qtmips_gui/mainwindow.cpp b/qtmips_gui/mainwindow.cpp
index 6b8d19b..a286f0d 100644
--- a/qtmips_gui/mainwindow.cpp
+++ b/qtmips_gui/mainwindow.cpp
@@ -18,6 +18,8 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
registers->hide();
program = new ProgramDock(this);
program->hide();
+ memory = new MemoryDock(this);
+ memory->hide();
cache_content = new CacheContentDock(this);
cache_content->hide();
cache_statictics = new CacheStatisticsDock(this);
@@ -36,6 +38,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
connect(ui->actionNew, SIGNAL(triggered(bool)), this, SLOT(new_machine()));
connect(ui->actionRegisters, SIGNAL(triggered(bool)), this, SLOT(show_registers()));
connect(ui->actionProgram_memory, SIGNAL(triggered(bool)), this, SLOT(show_program()));
+ connect(ui->actionMemory, SIGNAL(triggered(bool)), this, SLOT(show_memory()));
connect(ui->actionCache, SIGNAL(triggered(bool)), this, SLOT(show_cache_content()));
connect(ui->actionCache_statistics, SIGNAL(triggered(bool)), this, SLOT(show_cache_statictics()));
connect(ui->ips1, SIGNAL(toggled(bool)), this, SLOT(set_speed()));
@@ -59,6 +62,8 @@ MainWindow::~MainWindow() {
delete cache_content;
delete cache_statictics;
delete registers;
+ delete program;
+ delete memory;
delete ui;
if (machine != nullptr)
delete machine;
@@ -104,21 +109,16 @@ void MainWindow::new_machine() {
ndialog->show();
}
-void MainWindow::show_cache_content() {
- show_dockwidget(cache_content);
-}
-
-void MainWindow::show_cache_statictics() {
- show_dockwidget(cache_statictics);
-}
+#define SHOW_HANDLER(NAME) void MainWindow::show_##NAME() { \
+ show_dockwidget(NAME); \
+ } \
-void MainWindow::show_registers() {
- show_dockwidget(registers);
-}
-
-void MainWindow::show_program() {
- show_dockwidget(program);
-}
+SHOW_HANDLER(registers)
+SHOW_HANDLER(program)
+SHOW_HANDLER(memory)
+SHOW_HANDLER(cache_content)
+SHOW_HANDLER(cache_statictics)
+#undef SHOW_HANDLER
void MainWindow::set_speed() {
if (machine == nullptr)
diff --git a/qtmips_gui/mainwindow.h b/qtmips_gui/mainwindow.h
index 1afe137..9431515 100644
--- a/qtmips_gui/mainwindow.h
+++ b/qtmips_gui/mainwindow.h
@@ -10,6 +10,7 @@
#include "cachestatistics.h"
#include "registersdock.h"
#include "programdock.h"
+#include "memorydock.h"
#include "qtmipsmachine.h"
#include "machineconfig.h"
@@ -31,6 +32,7 @@ public slots:
void new_machine();
void show_registers();
void show_program();
+ void show_memory();
void show_cache_content();
void show_cache_statictics();
// Actions - execution speed
@@ -53,6 +55,7 @@ private:
RegistersDock *registers;
ProgramDock *program;
+ MemoryDock *memory;
// TODO implement cahce docks
CacheContentDock *cache_content;
CacheStatisticsDock *cache_statictics;
diff --git a/qtmips_gui/memorydock.cpp b/qtmips_gui/memorydock.cpp
new file mode 100644
index 0000000..0ccca3f
--- /dev/null
+++ b/qtmips_gui/memorydock.cpp
@@ -0,0 +1,21 @@
+#include "memorydock.h"
+
+MemoryDock::MemoryDock(QWidget *parent) : QDockWidget(parent) {
+ // TODO setup memory view
+
+ setObjectName("Memory");
+ setWindowTitle("Memory");
+}
+
+MemoryDock::~MemoryDock() {
+
+}
+
+void MemoryDock::setup(machine::QtMipsMachine *machine) {
+ if (machine == nullptr)
+ // TODO reset memory view
+ return;
+
+ // TODO setup memory view
+
+}
diff --git a/qtmips_gui/memorydock.h b/qtmips_gui/memorydock.h
new file mode 100644
index 0000000..bec8a62
--- /dev/null
+++ b/qtmips_gui/memorydock.h
@@ -0,0 +1,19 @@
+#ifndef MEMORYDOCK_H
+#define MEMORYDOCK_H
+
+#include <QDockWidget>
+#include "qtmipsmachine.h"
+
+class MemoryDock : public QDockWidget {
+ Q_OBJECT
+public:
+ MemoryDock(QWidget *parent);
+ ~MemoryDock();
+
+ void setup(machine::QtMipsMachine *machine);
+
+private:
+ // TODO memory view
+};
+
+#endif // MEMORYDOCK_H
diff --git a/qtmips_gui/programdock.cpp b/qtmips_gui/programdock.cpp
index 240fb0a..0f2b166 100644
--- a/qtmips_gui/programdock.cpp
+++ b/qtmips_gui/programdock.cpp
@@ -43,7 +43,7 @@ ProgramDock::ProgramDock(QWidget *parent) : QDockWidget(parent) {
setWidget(widg);
setObjectName("Program");
- setWindowTitle("Program memory");
+ setWindowTitle("Program");
}
ProgramDock::~ProgramDock() {
diff --git a/qtmips_gui/qtmips_gui.pro b/qtmips_gui/qtmips_gui.pro
index c4bff75..74a5f05 100644
--- a/qtmips_gui/qtmips_gui.pro
+++ b/qtmips_gui/qtmips_gui.pro
@@ -26,7 +26,8 @@ SOURCES += \
coreview/latch.cpp \
coreview/alu.cpp \
coreview/memory.cpp \
- programdock.cpp
+ programdock.cpp \
+ memorydock.cpp
HEADERS += \
mainwindow.h \
@@ -41,7 +42,8 @@ HEADERS += \
coreview/latch.h \
coreview/alu.h \
coreview/memory.h \
- programdock.h
+ programdock.h \
+ memorydock.h
FORMS += \
NewDialog.ui \