diff options
Diffstat (limited to 'qtmips_gui/cacheview.h')
-rw-r--r-- | qtmips_gui/cacheview.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/qtmips_gui/cacheview.h b/qtmips_gui/cacheview.h new file mode 100644 index 0000000..1fb224f --- /dev/null +++ b/qtmips_gui/cacheview.h @@ -0,0 +1,39 @@ +#ifndef CACHEVIEW_H +#define CACHEVIEW_H + +#include <QGraphicsView> +#include <QGraphicsScene> +#include <QGraphicsObject> +#include "graphicsview.h" +#include "qtmipsmachine.h" + +class CacheViewBlock : public QGraphicsObject { + Q_OBJECT +public: + CacheViewBlock(const machine::Cache *cache, unsigned block); + ~CacheViewBlock(); + + QRectF boundingRect() const; + + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); + +private slots: + void cache_update(unsigned associat, unsigned set, bool valid, bool dirty, std::uint32_t tag, const std::uint32_t *data); + +private: + unsigned block; + unsigned rows, columns; + QGraphicsSimpleTextItem **validity, **dirty, **tag, ***data; +}; + +class CacheViewScene : public QGraphicsScene { + Q_OBJECT +public: + CacheViewScene(const machine::Cache *cache); + +private: + unsigned associativity; + CacheViewBlock **block; +}; + +#endif // CACHEVIEW_H |