Show current processor and ISA info in mainwindow status bar
MODIFY
external/VSRTL
external/VSRTL
-Subproject commit aa5b63e83adec1797a5b25e453cc8a6235e07649
+Subproject commit 7f928ad3519a838c1b386e84e1135e0df099361c

MODIFY
src/isa/rv32isainfo.h
src/isa/rv32isainfo.h
@@ -19,7 +19,6 @@ public:
}
}
- QString name() const override { return "RV32I"; }
ISA isaID() const override { return ISA::RV32I; }
unsigned int bits() const override { return 32; }

MODIFY
src/isa/rv64isainfo.h
src/isa/rv64isainfo.h
@@ -19,7 +19,6 @@ public:
}
}
- QString name() const override { return "RV64I"; }
ISA isaID() const override { return ISA::RV64I; }
unsigned int bits() const override { return 64; }

MODIFY
src/isa/rvisainfo_common.h
src/isa/rvisainfo_common.h
@@ -70,6 +70,7 @@ public:
QString regInfo(unsigned i) const override {
return RVISA::RegDescs.size() > static_cast<int>(i) ? RVISA::RegDescs.at(static_cast<int>(i)) : QString();
}
+ QString name() const override { return CCmarch().toUpper(); }
bool regIsReadOnly(unsigned i) const override { return i == 0; }
int spReg() const override { return 2; }
int gpReg() const override { return 3; }

MODIFY
src/mainwindow.cpp
src/mainwindow.cpp
@@ -126,15 +126,30 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), m_ui(new Ui::Main
m_ui->tabbar->setActiveIndex(m_currentTabID);
}
-#define setupStatusWidget(name) \
+#define _setupStatusWidget(name, _permanent) \
auto* name##StatusLabel = new QLabel(this); \
- statusBar()->addWidget(name##StatusLabel); \
+ statusBar()->add##_permanent##Widget(name##StatusLabel); \
connect(&name##StatusManager::get().emitter, &StatusEmitter::statusChanged, name##StatusLabel, &QLabel::setText); \
connect(&name##StatusManager::get().emitter, &StatusEmitter::clear, name##StatusLabel, &QLabel::clear);
+#define setupPermanentStatusWidget(name) _setupStatusWidget(name, Permanent)
+
+#define setupStatusWidget(name) _setupStatusWidget(name, )
+
void MainWindow::setupStatusBar() {
statusBar()->showMessage("");
+ // Setup selected processor & ISA info status widget (right-aligned => permanent)
+ setupPermanentStatusWidget(ProcessorInfo);
+ auto updateProcessorInfo = [=] {
+ const auto& desc = ProcessorRegistry::getDescription(ProcessorHandler::getID());
+ QString status =
+ "Processor: " + desc.name + " ISA: " + ProcessorHandler::getProcessor()->implementsISA()->name();
+ ProcessorInfoStatusManager::get().setStatus(status);
+ };
+ connect(ProcessorHandler::get(), &ProcessorHandler::processorChanged, updateProcessorInfo);
+ updateProcessorInfo();
+
// Setup processorhandler status widget
setupStatusWidget(Processor);

MODIFY
src/mainwindow.h
src/mainwindow.h
@@ -12,6 +12,7 @@ QT_FORWARD_DECLARE_CLASS(QActionGroup)
namespace Ripes {
StatusManager(General);
+StatusManager(ProcessorInfo);
namespace Ui {
class MainWindow;

Show current processor and ISA info in mainwindow status bar