aboutsummaryrefslogtreecommitdiff
path: root/qtmips_gui/coreview/memory.h
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2018-01-18 19:54:00 +0100
committerKarel Kočí <cynerd@email.cz>2018-01-18 19:54:00 +0100
commit507e81b60af88721780a1eb5591d884d1667c4b4 (patch)
tree3a99b46ac8a7314391434b9c168793a60da1aa38 /qtmips_gui/coreview/memory.h
parent4b409c4b684a0e418e648ecaca375af6e1cdd68c (diff)
downloadqtmips-507e81b60af88721780a1eb5591d884d1667c4b4.tar.gz
qtmips-507e81b60af88721780a1eb5591d884d1667c4b4.tar.bz2
qtmips-507e81b60af88721780a1eb5591d884d1667c4b4.zip
More work on coreview
Diffstat (limited to 'qtmips_gui/coreview/memory.h')
-rw-r--r--qtmips_gui/coreview/memory.h53
1 files changed, 37 insertions, 16 deletions
diff --git a/qtmips_gui/coreview/memory.h b/qtmips_gui/coreview/memory.h
index 067d62f..177dc6d 100644
--- a/qtmips_gui/coreview/memory.h
+++ b/qtmips_gui/coreview/memory.h
@@ -14,35 +14,56 @@ class Memory : public QGraphicsObject {
Q_OBJECT
public:
Memory(machine::QtMipsMachine *machine);
- ~Memory();
QRectF boundingRect() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
+signals:
+ void open_mem();
+ void open_cache();
+
+protected:
+ void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
+
+ void set_type(const QString&);
+
+ bool cache;
+
+private:
+ QGraphicsSimpleTextItem name, type;
+};
+
+class ProgramMemory : public Memory {
+ Q_OBJECT
+public:
+ ProgramMemory(machine::QtMipsMachine *machine);
+ ~ProgramMemory();
+
+ void setPos(qreal x, qreal y);
+
+ const Connector *connector_address() const;
+ const Connector *connector_instruction() const;
+
+private:
+ Connector *con_address, *con_inst;
+};
+
+class DataMemory : public Memory {
+ Q_OBJECT
+public:
+ DataMemory(machine::QtMipsMachine *machine);
+ ~DataMemory();
+
void setPos(qreal x, qreal y);
- const Connector *connector_pc() const;
- const Connector *connector_inst() const;
+
const Connector *connector_address() const;
const Connector *connector_data_out() const;
const Connector *connector_data_in() const;
const Connector *connector_req_write() const;
const Connector *connector_req_read() const;
- // TODO integrate cache
-
-signals:
- void open_data_mem();
- void open_program_mem();
-
-protected:
- void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
private:
- // Connectors for instruction memory
- Connector *con_pc, *con_inst;
- // Connectors for data memory
Connector *con_address, *con_data_out, *con_data_in, *con_req_write, *con_req_read;
-
- QGraphicsSimpleTextItem *name, *name_program, *name_data;
};
}