From 9a3b0dccb3dcb958b6a5c0cd72e8684887b4c4bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 11 Jan 2018 22:44:27 +0100 Subject: Allow instruction trace from any stage In reality this internally allows us to see stages even it we are not using pipelining but that is hidden from outside simply to not confuse user. --- qtmips_cli/tracer.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'qtmips_cli/tracer.h') diff --git a/qtmips_cli/tracer.h b/qtmips_cli/tracer.h index 913687c..53fd3e7 100644 --- a/qtmips_cli/tracer.h +++ b/qtmips_cli/tracer.h @@ -9,8 +9,12 @@ class Tracer : public QObject { public: Tracer(machine::QtMipsMachine *machine); - // Trace fetched instruction + // Trace instructions in different stages/sections void fetch(); + void decode(); + void execute(); + void memory(); + void writeback(); // Trace registers void reg_pc(); void reg_gp(std::uint8_t i); @@ -18,8 +22,12 @@ public: void reg_hi(); private slots: - void instruction_fetch(machine::Instruction &inst); - // TODO fetch + void instruction_fetch(const machine::Instruction &inst); + void instruction_decode(const machine::Instruction &inst); + void instruction_execute(const machine::Instruction &inst); + void instruction_memory(const machine::Instruction &inst); + void instruction_writeback(const machine::Instruction &inst); + void regs_pc_update(std::uint32_t val); void regs_gp_update(std::uint8_t i, std::uint32_t val); void regs_hi_lo_update(bool hi, std::uint32_t val); -- cgit v1.2.3