aboutsummaryrefslogtreecommitdiff
path: root/qtmips_gui
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2018-05-24 02:51:23 +0200
committerKarel Kočí <cynerd@email.cz>2018-05-24 02:51:23 +0200
commit4893bddb5b3629db08a6de065dc8136df016664f (patch)
treee0e9a22d79e6df0070ad92531947ccbaf77fb12d /qtmips_gui
parent6edf8edb8899c81b297aad3fde31bbc6f036d262 (diff)
downloadqtmips-4893bddb5b3629db08a6de065dc8136df016664f.tar.gz
qtmips-4893bddb5b3629db08a6de065dc8136df016664f.tar.bz2
qtmips-4893bddb5b3629db08a6de065dc8136df016664f.zip
Add few additional labels
Diffstat (limited to 'qtmips_gui')
-rw-r--r--qtmips_gui/coreview.cpp20
-rw-r--r--qtmips_gui/coreview.h1
2 files changed, 21 insertions, 0 deletions
diff --git a/qtmips_gui/coreview.cpp b/qtmips_gui/coreview.cpp
index b2d9b7d..d91def6 100644
--- a/qtmips_gui/coreview.cpp
+++ b/qtmips_gui/coreview.cpp
@@ -96,6 +96,16 @@ CoreViewScene::CoreViewScene(machine::QtMipsMachine *machine) : QGraphicsScene()
con = new_bus(wb.mem_or_reg->connector_out(), regs->connector_write());
con->setAxes({CON_AXIS_Y(710), CON_AXIS_X(510), CON_AXIS_Y(172)});
+ // Control unit labels
+ new_label("RegWrite", 300, 99);
+ new_label("MemToReg", 300, 106);
+ new_label("MemWrite", 300, 112);
+ new_label("MemRead", 300, 119);
+ new_label("AluCtrl", 300, 125);
+ new_label("AluSrc", 300, 132);
+ new_label("RegDest", 300, 138);
+ new_label("Branch", 300, 145);
+
// Decode stage values
NEW_V(200, 200); // Instruction
connect(machine->core(), SIGNAL(decode_instruction_value(std::uint32_t)), val, SLOT(value_update(std::uint32_t)));
@@ -160,6 +170,16 @@ coreview::Signal *CoreViewScene::new_signal(const coreview::Connector *a, const
return c;
}
+QGraphicsSimpleTextItem *CoreViewScene::new_label(const QString &str, qreal x, qreal y) {
+ QGraphicsSimpleTextItem *i= new QGraphicsSimpleTextItem(str);
+ QFont f;
+ f.setPointSize(5);
+ i->setFont(f);
+ addItem(i);
+ i->setPos(x, y);
+ return i;
+}
+
CoreViewSceneSimple::CoreViewSceneSimple(machine::QtMipsMachine *machine) : CoreViewScene(machine) {
NEW_I(instr_prim, 230, 60, instruction_fetched(const machine::Instruction&));
if (machine->config().delay_slot()) {
diff --git a/qtmips_gui/coreview.h b/qtmips_gui/coreview.h
index e4885d8..7197134 100644
--- a/qtmips_gui/coreview.h
+++ b/qtmips_gui/coreview.h
@@ -69,6 +69,7 @@ protected:
coreview::Connection *new_connection(const coreview::Connector*, const coreview::Connector*);
coreview::Bus *new_bus(const coreview::Connector*, const coreview::Connector*, unsigned width = 4);
coreview::Signal *new_signal(const coreview::Connector*, const coreview::Connector*);
+ QGraphicsSimpleTextItem *new_label(const QString &str, qreal x, qreal y);
coreview::Connection *pc2pc_latch;
coreview::Connection *pc_latch2pc_joint, *pc_joint2pc_adder, *pc_joint2mem;
coreview::Connection *pc_multiplexer2pc;