From 6e6931657b7147e31f1f8d77035de3e7911f437f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 8 Jan 2018 21:39:59 +0100 Subject: Add ability to get specific core type from qtmipsmachine --- qtmips_machine/qtmipsmachine.cpp | 8 ++++++++ qtmips_machine/qtmipsmachine.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/qtmips_machine/qtmipsmachine.cpp b/qtmips_machine/qtmipsmachine.cpp index 1d7523c..f2683fb 100644 --- a/qtmips_machine/qtmipsmachine.cpp +++ b/qtmips_machine/qtmipsmachine.cpp @@ -63,6 +63,14 @@ const Core *QtMipsMachine::core() { return cr; } +const CoreSingle *QtMipsMachine::core_singe() { + return mcnf.pipelined() ? nullptr : (const CoreSingle*)cr; +} + +const CorePipelined *QtMipsMachine::core_pipelined() { + return mcnf.pipelined() ? (const CorePipelined*)cr : nullptr; +} + enum QtMipsMachine::Status QtMipsMachine::status() { return stat; } diff --git a/qtmips_machine/qtmipsmachine.h b/qtmips_machine/qtmipsmachine.h index d130225..dba8932 100644 --- a/qtmips_machine/qtmipsmachine.h +++ b/qtmips_machine/qtmipsmachine.h @@ -25,6 +25,8 @@ public: const Memory *memory(); const Cache *cache(); const Core *core(); + const CoreSingle *core_singe(); + const CorePipelined *core_pipelined(); enum Status { ST_READY, // Machine is ready to be started or step to be called -- cgit v1.2.3