summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gui/gui.cc35
-rw-r--r--gui/gui.h27
-rw-r--r--gui/gui.ui458
-rw-r--r--gui/main.cc6
4 files changed, 442 insertions, 84 deletions
diff --git a/gui/gui.cc b/gui/gui.cc
index 9f2405d..5a4c779 100644
--- a/gui/gui.cc
+++ b/gui/gui.cc
@@ -1,39 +1,14 @@
#include "gui.h"
-#include "ui_gui.h"
-#include <QFile>
-#include <QTextStream>
+#include "./ui_gui.h"
-Gui::Gui(QWidget *parent)
- : QWidget(parent)
- , ui(new Ui::gui)
+GUI::GUI(QWidget *parent)
+ : QMainWindow(parent)
+ , ui(new Ui::GUI)
{
ui->setupUi(this);
- loadTxtFile();
}
-Gui::~Gui()
+GUI::~GUI()
{
delete ui;
}
-
-void Gui::loadTxtFile(){
- QFile inputFile(":/resources/input.txt");
- inputFile.open(QIODevice::ReadOnly);
-
- QTextStream in(&inputFile);
- QString line = in.readAll();
- inputFile.close();
-
- ui->textEdit->setPlainText(line);
- QTextCursor cursor = ui->textEdit->textCursor();
- cursor.movePosition(QTextCursor::Start, QTextCursor::MoveAnchor, 1);
-}
-
-void Gui::on_pushButton_clicked()
-{
- QString searchString = ui->lineEdit->text();
- ui->textEdit->find(searchString, QTextDocument::FindWholeWords);
-}
-
-
-
diff --git a/gui/gui.h b/gui/gui.h
index 668fafa..1b700cc 100644
--- a/gui/gui.h
+++ b/gui/gui.h
@@ -1,26 +1,23 @@
#ifndef GUI_H
#define GUI_H
-#include <QWidget>
-namespace Ui
-{
-class gui;
+#include <QMainWindow>
+
+QT_BEGIN_NAMESPACE
+namespace Ui {
+class GUI;
}
QT_END_NAMESPACE
-class Gui : public QWidget
+class GUI : public QMainWindow
{
- Q_OBJECT
-
- public:
- Gui(QWidget *parent = nullptr);
- ~Gui();
+ Q_OBJECT
- private slots:
- void on_pushButton_clicked();
+public:
+ GUI(QWidget *parent = nullptr);
+ ~GUI();
- private:
- Ui::gui *ui;
- void loadTxtFile();
+private:
+ Ui::GUI *ui;
};
#endif // GUI_H
diff --git a/gui/gui.ui b/gui/gui.ui
index 5f71c91..e32cf48 100644
--- a/gui/gui.ui
+++ b/gui/gui.ui
@@ -1,54 +1,440 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
- <class>gui</class>
- <widget class="QWidget" name="gui">
+ <class>GUI</class>
+ <widget class="QMainWindow" name="GUI">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
- <width>800</width>
- <height>600</height>
+ <width>1359</width>
+ <height>606</height>
</rect>
</property>
<property name="windowTitle">
- <string>gui</string>
+ <string>RISC V[ECTOR]</string>
</property>
- <widget class="QWidget" name="">
+ <widget class="QWidget" name="centralwidget">
+ <widget class="QWidget" name="">
+ <property name="geometry">
+ <rect>
+ <x>50</x>
+ <y>10</y>
+ <width>1202</width>
+ <height>491</height>
+ </rect>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="1" column="6" rowspan="2">
+ <widget class="Line" name="line_14">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" rowspan="2">
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="font">
+ <font>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Instructions</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="Line" name="line">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QTextEdit" name="textEdit"/>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="3" rowspan="2">
+ <layout class="QVBoxLayout" name="verticalLayout_13">
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <item>
+ <widget class="QLabel" name="label_2">
+ <property name="font">
+ <font>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Registers</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="Line" name="line_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QTextEdit" name="textEdit_2"/>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="Line" name="line_13">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_5">
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QLabel" name="label_4">
+ <property name="font">
+ <font>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Cache</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="Line" name="line_4">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QTextEdit" name="textEdit_4"/>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="Line" name="line_19">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_4">
+ <item>
+ <widget class="QLabel" name="label_3">
+ <property name="font">
+ <font>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>DRAM</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="Line" name="line_3">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QTextEdit" name="textEdit_3"/>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="2" rowspan="2">
+ <widget class="Line" name="line_17">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" colspan="5">
+ <widget class="Line" name="line_10">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" colspan="5">
+ <widget class="Line" name="line_11">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="5" rowspan="2">
+ <layout class="QVBoxLayout" name="verticalLayout_12">
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_8">
+ <item>
+ <widget class="QLabel" name="label_7">
+ <property name="font">
+ <font>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Upload Files</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="Line" name="line_5">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_6">
+ <item>
+ <widget class="QPushButton" name="pushButton_5">
+ <property name="text">
+ <string>Upload Instruction File</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <widget class="QPushButton" name="pushButton_6">
+ <property name="text">
+ <string>Upload Program State File</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="Line" name="line_7">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_9">
+ <item>
+ <widget class="QLabel" name="label_8">
+ <property name="font">
+ <font>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Controls</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="Line" name="line_8">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_5">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QPushButton" name="pushButton_4">
+ <property name="text">
+ <string>Refresh DRAM</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButton_2">
+ <property name="text">
+ <string>Refresh Cache</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButton">
+ <property name="text">
+ <string>Refresh Registers</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QCheckBox" name="checkBox">
+ <property name="text">
+ <string>Enable Pipeline</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="checkBox_2">
+ <property name="text">
+ <string>Enable Cache</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_10">
+ <item>
+ <widget class="Line" name="line_15">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_9">
+ <property name="font">
+ <font>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Run</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="Line" name="line_9">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_7">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_4">
+ <item>
+ <widget class="QLineEdit" name="lineEdit">
+ <property name="placeholderText">
+ <string># Steps</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButton_7">
+ <property name="text">
+ <string>Run Steps</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButton_8">
+ <property name="text">
+ <string>Step</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="Line" name="line_16">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_11">
+ <item>
+ <widget class="QLabel" name="label_11">
+ <property name="font">
+ <font>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Program State</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="Line" name="line_6">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_6">
+ <property name="text">
+ <string>Clock Cycles</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButton_3">
+ <property name="text">
+ <string>Save Current Program State</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ <item row="0" column="0" rowspan="3">
+ <widget class="Line" name="line_12">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="4" rowspan="2">
+ <widget class="Line" name="line_18">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ <widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
- <x>60</x>
- <y>30</y>
- <width>317</width>
- <height>232</height>
+ <x>0</x>
+ <y>0</y>
+ <width>1359</width>
+ <height>26</height>
</rect>
</property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <widget class="QLabel" name="label">
- <property name="text">
- <string>keyword</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="lineEdit"/>
- </item>
- <item>
- <widget class="QPushButton" name="pushButton">
- <property name="text">
- <string>find</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QTextEdit" name="textEdit"/>
- </item>
- </layout>
</widget>
+ <widget class="QStatusBar" name="statusbar"/>
</widget>
<resources/>
<connections/>
diff --git a/gui/main.cc b/gui/main.cc
index 4c14fbe..e08eab7 100644
--- a/gui/main.cc
+++ b/gui/main.cc
@@ -78,9 +78,9 @@ int main(int argc, char **argv)
} else {
global_log->log(INFO, "Starting QT...");
QApplication a(argc, argv);
- Gui w;
- w.show();
- a.exec();
+ GUI w;
+ w.show();
+ return a.exec();
}
global_log->log(INFO, "Cleaning up...");