diff options
author | Karel Kočí <cynerd@email.cz> | 2018-01-08 21:43:58 +0100 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2018-01-08 21:43:58 +0100 |
commit | 506174a8266eb9842ff9e50a89ddf86cb975be30 (patch) | |
tree | cd1c2905d48c172d2b83e4230b1f76dc46e8f3d3 /qtmips_gui/coreview/memory.h | |
parent | bcdd7c87b1eda7dc6b294cfa0796ce7e36f12b23 (diff) | |
download | qtmips-506174a8266eb9842ff9e50a89ddf86cb975be30.tar.gz qtmips-506174a8266eb9842ff9e50a89ddf86cb975be30.tar.bz2 qtmips-506174a8266eb9842ff9e50a89ddf86cb975be30.zip |
Add coreview progress
Diffstat (limited to 'qtmips_gui/coreview/memory.h')
-rw-r--r-- | qtmips_gui/coreview/memory.h | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/qtmips_gui/coreview/memory.h b/qtmips_gui/coreview/memory.h index 0f0d40d..067d62f 100644 --- a/qtmips_gui/coreview/memory.h +++ b/qtmips_gui/coreview/memory.h @@ -3,39 +3,48 @@ #include <QGraphicsObject> #include <QPainter> +#include <QGraphicsSceneMouseEvent> +#include <QGraphicsSimpleTextItem> #include <qtmipsmachine.h> -#include "../coreview.h" #include "connection.h" -namespace coreview{ +namespace coreview { class Memory : public QGraphicsObject { Q_OBJECT public: Memory(machine::QtMipsMachine *machine); + ~Memory(); 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; + 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 -private: - struct { - Connector *in, *out, *read, *write; - } con_program, con_data; -}; +signals: + void open_data_mem(); + void open_program_mem(); -} +protected: + void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event); -#else +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; +}; -namespace coreview { - class Memory; } #endif // MEMORY_H |