diff options
author | Pavel Pisa <pisa@cmp.felk.cvut.cz> | 2019-02-18 20:49:08 +0100 |
---|---|---|
committer | Pavel Pisa <pisa@cmp.felk.cvut.cz> | 2019-02-18 20:49:08 +0100 |
commit | 0ccd55c011f72b5bb7d11a1f683e5ac949702417 (patch) | |
tree | 16d004557afeb5b023c902fddc3acdcf6d5bc453 /qtmips_gui/coreview | |
parent | 1ef78a15bdac490cf5e0b74fcde8539719f4bfe6 (diff) | |
download | qtmips-0ccd55c011f72b5bb7d11a1f683e5ac949702417.tar.gz qtmips-0ccd55c011f72b5bb7d11a1f683e5ac949702417.tar.bz2 qtmips-0ccd55c011f72b5bb7d11a1f683e5ac949702417.zip |
Report forward and stall for branches and add forward to execution phase.
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'qtmips_gui/coreview')
-rw-r--r-- | qtmips_gui/coreview/multitext.cpp | 9 | ||||
-rw-r--r-- | qtmips_gui/coreview/multitext.h | 3 |
2 files changed, 9 insertions, 3 deletions
diff --git a/qtmips_gui/coreview/multitext.cpp b/qtmips_gui/coreview/multitext.cpp index d28b5be..1658b55 100644 --- a/qtmips_gui/coreview/multitext.cpp +++ b/qtmips_gui/coreview/multitext.cpp @@ -47,13 +47,14 @@ using namespace coreview; #define PENW 1 ////////////////////// -MultiText::MultiText(QMap<std::uint32_t, QString> value_map) : +MultiText::MultiText(QMap<std::uint32_t, QString> value_map, bool nonzero_red) : QGraphicsObject(nullptr), text(this) { QFont f; f.setPointSize(6); text.setFont(f); this->value_map = value_map; + this->nonzero_red = nonzero_red; multitext_update(0); } @@ -64,7 +65,11 @@ QRectF MultiText::boundingRect() const { void MultiText::paint(QPainter *painter, const QStyleOptionGraphicsItem *option __attribute__((unused)), QWidget *widget __attribute__((unused))) { painter->setPen(QPen(QColor(240, 240, 240))); - painter->setBrush(QBrush(QColor(240, 240, 240))); + if (value != 0 && nonzero_red) + painter->setBrush(QBrush(QColor(255, 100, 100))); + else + painter->setBrush(QBrush(QColor(240, 240, 240))); + painter->drawRoundRect(-WIDTH/2, 0, WIDTH, HEIGHT, ROUND, ROUND); } diff --git a/qtmips_gui/coreview/multitext.h b/qtmips_gui/coreview/multitext.h index 9d1f0ab..48c9652 100644 --- a/qtmips_gui/coreview/multitext.h +++ b/qtmips_gui/coreview/multitext.h @@ -46,7 +46,7 @@ namespace coreview { class MultiText : public QGraphicsObject { Q_OBJECT public: - MultiText(QMap<std::uint32_t, QString> value_map); + MultiText(QMap<std::uint32_t, QString> value_map, bool nonzero_red = false); QRectF boundingRect() const; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); @@ -58,6 +58,7 @@ private: QGraphicsSimpleTextItem text; std::uint32_t value; QMap<std::uint32_t, QString> value_map; + std::uint32_t nonzero_red; }; } |