aboutsummaryrefslogtreecommitdiff
path: root/qtmips_gui/coreview/memory.h
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2018-01-03 19:19:06 +0100
committerKarel Kočí <cynerd@email.cz>2018-01-03 19:19:06 +0100
commit1473699d8e204d9bf8b00c160b097b4adf85a66b (patch)
tree204fe38be7511764310053f05b198de6c18c30b8 /qtmips_gui/coreview/memory.h
parent615060bc4017a3db864568ee3bb7bfb3ec18d2e7 (diff)
downloadqtmips-1473699d8e204d9bf8b00c160b097b4adf85a66b.tar.gz
qtmips-1473699d8e204d9bf8b00c160b097b4adf85a66b.tar.bz2
qtmips-1473699d8e204d9bf8b00c160b097b4adf85a66b.zip
Add memory template for gui coreview
Diffstat (limited to 'qtmips_gui/coreview/memory.h')
-rw-r--r--qtmips_gui/coreview/memory.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/qtmips_gui/coreview/memory.h b/qtmips_gui/coreview/memory.h
new file mode 100644
index 0000000..0f0d40d
--- /dev/null
+++ b/qtmips_gui/coreview/memory.h
@@ -0,0 +1,41 @@
+#ifndef COREVIEW_MEMORY_H
+#define COREVIEW_MEMORY_H
+
+#include <QGraphicsObject>
+#include <QPainter>
+#include <qtmipsmachine.h>
+#include "../coreview.h"
+#include "connection.h"
+
+namespace coreview{
+
+class Memory : public QGraphicsObject {
+ Q_OBJECT
+public:
+ Memory(machine::QtMipsMachine *machine);
+
+ QRectF boundingRect() const;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
+
+ void setPos(qreal x, qreal y);
+ const Connector *connector_in(bool program) const;
+ const Connector *connector_out(bool program) const;
+ const Connector *connector_read(bool program) const;
+ const Connector *connector_write(bool program) const;
+ // TODO integrate cache
+
+private:
+ struct {
+ Connector *in, *out, *read, *write;
+ } con_program, con_data;
+};
+
+}
+
+#else
+
+namespace coreview {
+ class Memory;
+}
+
+#endif // MEMORY_H