blob: 7439888cff23ead597be6621e68ef077c88e2187 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
#ifndef COREVIEW_H
#define COREVIEW_H
#include <QGraphicsView>
#include <QGraphicsScene>
#include "qtmipsmachine.h"
#include "coreview/connection.h"
#include "coreview/programcounter.h"
#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:
void update_scale();
};
class CoreViewScene : public QGraphicsScene {
Q_OBJECT
public:
CoreViewScene(CoreView *view, machine::QtMipsMachine *machine);
~CoreViewScene();
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::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
|