Initial commit for IO tab
MODIFY
resources/icons/icons.qrc
resources/icons/icons.qrc
<file>compass.svg</file>
<file>clear.svg</file>
<file>moon.svg</file>
+ <file>led.svg</file>
</qresource>
</RCC>

ADD
resources/icons/led.svg
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="512"
+ viewBox="0 0 34 60"
+ width="512"
+ version="1.1"
+ id="svg956"
+ sodipodi:docname="led.svg"
+ inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)">
+ <metadata
+ id="metadata962">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs960" />
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1848"
+ inkscape:window-height="1016"
+ id="namedview958"
+ showgrid="false"
+ inkscape:zoom="0.65186406"
+ inkscape:cx="-79.394213"
+ inkscape:cy="408.40491"
+ inkscape:window-x="72"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="Layer_2" />
+ <g
+ id="Page-1"
+ fill="none"
+ fill-rule="evenodd">
+ <g
+ id="003---LED"
+ fill-rule="nonzero">
+ <g
+ id="Icons"
+ transform="translate(1 1)">
+ <path
+ id="Shape"
+ d="m25.19 3.81c-3.7178901-3.71595975-9.3077343-4.8272508-14.1642392-2.8159268-4.85650482 2.01132399-8.02383011 6.74940135-8.0257608 12.0059268v21h26v-21c-.0012666-3.44732956-1.3717364-6.75300325-3.81-9.19z"
+ fill="#f44335"
+ style="fill:#ffc000;fill-opacity:1" />
+ <path
+ id="path933"
+ d="m25.19 3.81c-2.4369968-2.43826363-5.7426704-3.80873335-9.19-3.81-.501205.00447718-1.0018554.03451621-1.5.09 6.5541149.76132883 11.4983902 6.31181527 11.5 12.91v21h3v-21c-.0012666-3.44732956-1.3717364-6.75300325-3.81-9.19z"
+ fill="#c81e1e"
+ style="fill:#ffc000;fill-opacity:1" />
+ <path
+ id="path935"
+ d="m23 29h-6.5l3.5-6h3z"
+ fill="#ff9801" />
+ <path
+ id="path937"
+ d="m11 6.52c-.3326261.00050114-.6437296-.16442118-.83-.44-.1488534-.22002824-.20404171-.49024214-.1533875-.75101771.0506543-.26077556.2029878-.49067947.4233875-.63898229 1.6428144-1.10627761 3.5794281-1.69492459 5.56-1.69.5522847 0 1 .44771525 1 1s-.4477153 1-1 1c-1.5808778.0014218-3.1258954.47119067-4.44 1.35-.1655373.11124285-.3605573.17044534-.56.17z"
+ fill="#f5f5f5" />
+ <path
+ id="path939"
+ d="m7 14c-.55228475 0-1-.4477153-1-1-.01645292-1.5408304.3259105-3.06434765 1-4.45.11808022-.23989731.32731532-.42251479.58097709-.50706872.25366178-.08455392.53062034-.064001.76902291.05706872.23814704.11986533.41856884.32986629.50118701.58335386s.06059152.52947173-.06118701.76664614c-.53548641 1.1059125-.80596835 2.3213694-.79 3.55 0 .2652165-.10535684.5195704-.29289322.7071068s-.44189029.2928932-.70710678.2928932z"
+ fill="#f5f5f5" />
+ <path
+ id="path941"
+ d="m6 39h6v2c0 1.1045695-.8954305 2-2 2h-2c-1.1045695 0-2-.8954305-2-2z"
+ fill="#607d8b" />
+ <path
+ id="path943"
+ d="m20 39h6v2c0 1.1045695-.8954305 2-2 2h-2c-1.1045695 0-2-.8954305-2-2z"
+ fill="#607d8b" />
+ <path
+ id="path945"
+ d="m15.5 23-3.5 6h-3v-6z"
+ fill="#ff9801" />
+ <rect
+ id="Rectangle-path"
+ fill="#7f8e94"
+ height="5"
+ rx="1"
+ width="32"
+ y="34" />
+ <path
+ id="path948"
+ d="m31 34h-3c.5522847 0 1 .4477153 1 1v3c0 .5522847-.4477153 1-1 1h3c.5522847 0 1-.4477153 1-1v-3c0-.5522847-.4477153-1-1-1z"
+ fill="#545c60" />
+ </g>
+ <g
+ id="Layer_2"
+ fill="#000">
+ <path
+ id="path951"
+ d="m2 41h4v1c0 1.6568542 1.34314575 3 3 3v14c0 .5522847.44771525 1 1 1 .5522847 0 1-.4477153 1-1v-14c1.6568542 0 3-1.3431458 3-3v-1h6v1c0 1.6568542 1.3431458 3 3 3v14c0 .5522847.4477153 1 1 1s1-.4477153 1-1v-14c1.6568542 0 3-1.3431458 3-3v-1h4c1.1045695 0 2-.8954305 2-2v-3c0-1.1045695-.8954305-2-2-2h-1v-20c0-7.7319865-6.2680135-14-14-14s-14 6.2680135-14 14v20h-1c-1.1045695 0-2 .8954305-2 2v3c0 1.1045695.8954305 2 2 2zm10 1c0 .5522847-.4477153 1-1 1h-2c-.55228475 0-1-.4477153-1-1v-1h4zm14 0c0 .5522847-.4477153 1-1 1h-2c-.5522847 0-1-.4477153-1-1v-1h4zm-21-28c0-6.627417 5.372583-12 12-12s12 5.372583 12 12v20h-4v-10c0-.5522847-.4477153-1-1-1h-3c-.3551111.0021435-.6824477.1924555-.86.5l-3.5 6c-.178104.3084703-.1786812.6883921-.0015155.9974022.1771658.3090101.5053269.5004553.8615155.5025978h5.5v3h-12v-3h2c.3551111-.0021435.6824477-.1924555.86-.5l3.5-6c.178104-.3084703.1786812-.6883921.0015155-.9974022-.1771658-.3090101-.5053269-.5004553-.8615155-.5025978h-6.5c-.55228475 0-1 .4477153-1 1v10h-4zm18 15h-3.76l2.33-4h1.43zm-12 0v-4h3.76l-2.33 4zm-9 7h30v3h-30z" />
+ </g>
+ </g>
+ </g>
+</svg>

MODIFY
src/CMakeLists.txt
src/CMakeLists.txt
@@ -9,7 +9,8 @@ file(GLOB LIB_SOURCES
editor/*.cpp
syscall/*.cpp
version/version.cpp
- assembler/*.cpp)
+ assembler/*.cpp
+ io/*.cpp)
file(GLOB LIB_HEADERS
*.h
isa/*.h
@@ -17,11 +18,13 @@ file(GLOB LIB_HEADERS
editor/*.h
syscall/*.h
graphics/*.h
- assembler/*.h)
+ assembler/*.h
+ io/*.h)
file(GLOB LIB_UIS
*.ui
cachesim/*.ui
syscall/*.ui
+ io/*.ui
)
set(RIPES_LIB ripes_lib)

ADD
src/iotab.cpp
+#include "iotab.h"
+#include "ui_iotab.h"
+
+#include <QDockWidget>
+#include <QGraphicsItem>
+#include <QToolBar>
+
+#include "processorhandler.h"
+
+namespace Ripes {
+
+IOTab::IOTab(QToolBar* toolbar, QWidget* parent) : RipesTab(toolbar, parent), m_ui(new Ui::IOTab) {
+ m_ui->setupUi(this);
+}
+
+IOTab::~IOTab() {
+ delete m_ui;
+}
+} // namespace Ripes

ADD
src/iotab.h
+#pragma once
+
+#include "defines.h"
+
+#include <QWidget>
+
+#include <unordered_map>
+
+#include "memorymodel.h"
+#include "processorhandler.h"
+#include "ripestab.h"
+
+namespace Ripes {
+
+namespace Ui {
+class IOTab;
+}
+
+class IOTab : public RipesTab {
+ Q_OBJECT
+
+public:
+ IOTab(QToolBar* toolbar, QWidget* parent = nullptr);
+ ~IOTab() override;
+
+private:
+ Ui::IOTab* m_ui = nullptr;
+};
+} // namespace Ripes

ADD
src/iotab.ui
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Ripes::IOTab</class>
+ <widget class="QWidget" name="Ripes::IOTab">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QSplitter" name="splitter">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <widget class="QTabWidget" name="tabWidget">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="currentIndex">
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="peripherals">
+ <attribute name="title">
+ <string>Peripherals</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout_2">
+ <item row="0" column="1">
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QTreeView" name="treeView"/>
+ </item>
+ <item>
+ <widget class="QTabWidget" name="tabWidget_2">
+ <widget class="QWidget" name="tab">
+ <attribute name="title">
+ <string>Tab 1</string>
+ </attribute>
+ </widget>
+ <widget class="QWidget" name="tab_2">
+ <attribute name="title">
+ <string>Tab 2</string>
+ </attribute>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="mmap">
+ <attribute name="title">
+ <string>Memory Map</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout_3">
+ <item row="0" column="0">
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>TODO: Config</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QTableView" name="tableView"/>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ <widget class="QMdiArea" name="mdiArea">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

MODIFY
src/mainwindow.cpp
src/mainwindow.cpp
#include "defines.h"
#include "edittab.h"
+#include "iotab.h"
#include "loaddialog.h"
#include "memorytab.h"
#include "processorhandler.h"
@@ -67,10 +68,16 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), m_ui(new Ui::Main
m_memoryTab = new MemoryTab(m_memoryToolbar, this);
m_stackedTabs->insertWidget(2, m_memoryTab);
+ m_IOToolbar = addToolBar("I/O");
+ m_IOToolbar->setVisible(false);
+ m_IOTab = new IOTab(m_controlToolbar, this);
+ m_stackedTabs->insertWidget(3, m_IOTab);
+
// Setup tab bar
m_ui->tabbar->addFancyTab(QIcon(":/icons/binary-code.svg"), "Editor");
m_ui->tabbar->addFancyTab(QIcon(":/icons/cpu.svg"), "Processor");
m_ui->tabbar->addFancyTab(QIcon(":/icons/ram-memory.svg"), "Memory");
+ m_ui->tabbar->addFancyTab(QIcon(":/icons/led.svg"), "I/O");
connect(m_ui->tabbar, &FancyTabBar::activeIndexChanged, this, &MainWindow::tabChanged);
connect(m_ui->tabbar, &FancyTabBar::activeIndexChanged, m_stackedTabs, &QStackedWidget::setCurrentIndex);
connect(m_ui->tabbar, &FancyTabBar::activeIndexChanged, m_editTab, &EditTab::updateProgramViewerHighlighting);
@@ -136,6 +143,7 @@ void MainWindow::tabChanged(int index) {
m_editToolbar->setVisible(index == 0);
m_processorToolbar->setVisible(index == 1);
m_memoryToolbar->setVisible(index == 2);
+ m_IOTab->setVisible(index == 3);
}
void MainWindow::fitToView() {

MODIFY
src/mainwindow.h
src/mainwindow.h
@@ -17,6 +17,7 @@ class MainWindow;
class EditTab;
class MemoryTab;
class ProcessorTab;
+class IOTab;
class ProcessorHandler;
struct LoadFileParams;
@@ -67,10 +68,12 @@ private:
ProcessorTab* m_processorTab = nullptr;
EditTab* m_editTab = nullptr;
MemoryTab* m_memoryTab = nullptr;
+ IOTab* m_IOTab = nullptr;
QToolBar* m_controlToolbar = nullptr;
QToolBar* m_processorToolbar = nullptr;
QToolBar* m_editToolbar = nullptr;
QToolBar* m_memoryToolbar = nullptr;
+ QToolBar* m_IOToolbar = nullptr;
};
} // namespace Ripes

Initial commit for IO tab