aboutsummaryrefslogtreecommitdiff
path: root/qtmips_gui/coreview.h
blob: 52b98eed6dd674131c10a0828e67124ddde1eaea (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
#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"

class CoreView : public QGraphicsView {
public:
    CoreView(QWidget *parent);

protected:
    void resizeEvent(QResizeEvent *event);
private:
    const int scene_width = 800, scene_height = 800;
    void update_scale();
};

class CoreViewScene : public QGraphicsScene {
    Q_OBJECT
public:
    CoreViewScene(CoreView *view, machine::QtMipsMachine *machine);

private:
    machine::QtMipsMachine *machine;

    coreview::ProgramCounter *pc;
    coreview::Alu *alu;
    coreview::Multiplexer *pc_multiplexer;
    coreview::Connection *pc2pc;
    coreview::Latch *testlatch;
};

#else

class CoreView;
class CoreViewScene;

#endif // COREVIEW_H