Implement rewind functionality in Ripes gui
MODIFY
src/processors/ss/riscv_ss.h
src/processors/ss/riscv_ss.h
@@ -172,6 +172,12 @@ public:
}
}
+ void rewind() override {
+ Design::rewind();
+ // Ensure that rewinds performed when we expected to finish in the following cycle, clears this expectation.
+ m_finishInNextCycle = false;
+ }
+
void reset() override {
Design::reset();
m_finishInNextCycle = false;
@@ -179,6 +185,7 @@ public:
private:
bool m_finishInNextCycle = false;
-}; // namespace RISCV
+};
+
} // namespace RISCV
} // namespace vsrtl

MODIFY
src/processortab.cpp
src/processortab.cpp
@@ -74,6 +74,7 @@ void ProcessorTab::setupSimulatorActions() {
const QIcon reverseIcon = QIcon(":/icons/rewind.svg");
m_reverseAction = new QAction(reverseIcon, "Rewind (F5)", this);
+ connect(m_reverseAction, &QAction::triggered, this, &ProcessorTab::rewind);
m_reverseAction->setShortcut(QKeySequence("F5"));
m_toolbar->addAction(m_reverseAction);
@@ -246,6 +247,11 @@ void ProcessorTab::setCurrentInstruction(int row) {
}
}
+void ProcessorTab::rewind() {
+ m_vsrtlWidget->rewind();
+ enableSimulatorControls();
+}
+
void ProcessorTab::clock() {
m_vsrtlWidget->clock();
m_handler.checkValidExecutionRange();
@@ -261,9 +267,11 @@ void ProcessorTab::clock() {
emit update();
// Pipeline has finished executing
+ /*
if (pipeline->isFinished() || (state == 1 && ecallVal.first == Pipeline::ECALL::exit)) {
enableSimulatorControls();
}
+ */
}
bool ProcessorTab::handleEcall(const std::pair<Pipeline::ECALL, int32_t>& ecall_val) {

MODIFY
src/processortab.h
src/processortab.h
@@ -45,6 +45,7 @@ signals:
public slots:
void restart();
void reset();
+ void rewind();
void run();
void printToLog(const QString&);
void processorFinished();

Implement rewind functionality in Ripes gui