diff options
Diffstat (limited to 'qtmips_gui/cacheview.h')
-rw-r--r-- | qtmips_gui/cacheview.h | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/qtmips_gui/cacheview.h b/qtmips_gui/cacheview.h index 1fb224f..d99bff4 100644 --- a/qtmips_gui/cacheview.h +++ b/qtmips_gui/cacheview.h @@ -7,10 +7,29 @@ #include "graphicsview.h" #include "qtmipsmachine.h" + +class CacheAddressBlock : public QGraphicsObject { + Q_OBJECT +public: + CacheAddressBlock(const machine::Cache *cache, unsigned width); + + 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 tag, row, col; + unsigned s_tag, s_row, s_col; + unsigned width; +}; + class CacheViewBlock : public QGraphicsObject { Q_OBJECT public: - CacheViewBlock(const machine::Cache *cache, unsigned block); + CacheViewBlock(const machine::Cache *cache, unsigned block, bool last); ~CacheViewBlock(); QRectF boundingRect() const; @@ -21,9 +40,11 @@ private slots: void cache_update(unsigned associat, unsigned set, bool valid, bool dirty, std::uint32_t tag, const std::uint32_t *data); private: + bool islast; unsigned block; unsigned rows, columns; QGraphicsSimpleTextItem **validity, **dirty, **tag, ***data; + unsigned curr_row; }; class CacheViewScene : public QGraphicsScene { @@ -34,6 +55,7 @@ public: private: unsigned associativity; CacheViewBlock **block; + CacheAddressBlock *ablock; }; #endif // CACHEVIEW_H |