diff options
author | Karel Kočí <cynerd@email.cz> | 2018-04-17 12:44:44 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2018-04-17 12:44:44 +0200 |
commit | 95956a7457a1237385a314212c4e106bed88f05d (patch) | |
tree | 0ab000468c9e281c0a59fc5991252a87e115d154 /qtmips_gui/cacheview.h | |
parent | 6c360d8e42053d9045bbe2fc78c23143f8a334b7 (diff) | |
download | qtmips-95956a7457a1237385a314212c4e106bed88f05d.tar.gz qtmips-95956a7457a1237385a314212c4e106bed88f05d.tar.bz2 qtmips-95956a7457a1237385a314212c4e106bed88f05d.zip |
Initial implementation of cache view
It needs some more work to look nice but it already works.
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 |