aboutsummaryrefslogtreecommitdiff
path: root/qtmips_gui/coreview/memory.h
blob: 0f0d40d664cb7acc0d91334d127767f0afedec95 (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
#ifndef COREVIEW_MEMORY_H
#define COREVIEW_MEMORY_H

#include <QGraphicsObject>
#include <QPainter>
#include <qtmipsmachine.h>
#include "../coreview.h"
#include "connection.h"

namespace coreview{

class Memory : public QGraphicsObject  {
    Q_OBJECT
public:
    Memory(machine::QtMipsMachine *machine);

    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;
    // TODO integrate cache

private:
    struct {
        Connector *in, *out, *read, *write;
    } con_program, con_data;
};

}

#else

namespace coreview {
    class Memory;
}

#endif // MEMORY_H