aboutsummaryrefslogtreecommitdiff
path: root/qtmips_gui/coreview.h
diff options
context:
space:
mode:
Diffstat (limited to 'qtmips_gui/coreview.h')
-rw-r--r--qtmips_gui/coreview.h52
1 files changed, 46 insertions, 6 deletions
diff --git a/qtmips_gui/coreview.h b/qtmips_gui/coreview.h
index 52b98ee..7439888 100644
--- a/qtmips_gui/coreview.h
+++ b/qtmips_gui/coreview.h
@@ -9,15 +9,22 @@
#include "coreview/multiplexer.h"
#include "coreview/latch.h"
#include "coreview/alu.h"
+#include "coreview/adder.h"
+#include "coreview/memory.h"
+#include "coreview/registers.h"
+#include "coreview/instructionview.h"
+#include "coreview/junction.h"
+#include "coreview/constant.h"
class CoreView : public QGraphicsView {
public:
CoreView(QWidget *parent);
+ void setScene(QGraphicsScene *scene);
+
protected:
void resizeEvent(QResizeEvent *event);
private:
- const int scene_width = 800, scene_height = 800;
void update_scale();
};
@@ -25,20 +32,53 @@ class CoreViewScene : public QGraphicsScene {
Q_OBJECT
public:
CoreViewScene(CoreView *view, machine::QtMipsMachine *machine);
+ ~CoreViewScene();
-private:
- machine::QtMipsMachine *machine;
+signals:
+ void request_registers();
+ void request_data_memory();
+ void request_program_memory();
+private:
coreview::ProgramCounter *pc;
+ coreview::Latch *pc_latch;
+ coreview::Adder *pc_adder;
+ coreview::Constant *pc_adder_4;
+ coreview::Junction *pc_junction;
coreview::Alu *alu;
- coreview::Multiplexer *pc_multiplexer;
- coreview::Connection *pc2pc;
- coreview::Latch *testlatch;
+ coreview::Memory *mem;
+ coreview::Registers *regs;
+ coreview::Multiplexer *pc_multiplexer, *mem_or_reg;
+
+ coreview::Connection *pc2pc_latch;
+ coreview::Connection *pc_latch2pc_joint, *pc_joint2pc_adder, *pc_joint2mem;
+ coreview::Connection *pc_multiplexer2pc;
+};
+
+class CoreViewSceneSimple : public CoreViewScene {
+public:
+ CoreViewSceneSimple(CoreView *view, machine::QtMipsMachine *machine);
+ ~CoreViewSceneSimple();
+
+private:
+ coreview::Latch *delay_slot_latch;
+};
+
+class CoreViewScenePipelined : public CoreViewScene {
+public:
+ CoreViewScenePipelined(CoreView *view, machine::QtMipsMachine *machine);
+ ~CoreViewScenePipelined();
+
+private:
+ coreview::Latch *latch_if_id, *latch_id_ex, *latch_ex_mem, *latch_mem_wb;
+ // TODO forwarding unit
};
#else
class CoreView;
class CoreViewScene;
+class CoreViewSceneSimple;
+class CoreViewScenePipelined;
#endif // COREVIEW_H