Remove unused ReqProcessorReset signal from ProcessorHandler
MODIFY
src/io/iomanager.cpp
src/io/iomanager.cpp
@@ -14,7 +14,7 @@ IOManager::IOManager() : QObject(nullptr) {
// Always re-register the currently active peripherals when the processor changes
connect(ProcessorHandler::get(), &ProcessorHandler::processorChanged, this,
&IOManager::refreshAllPeriphsToProcessor);
- connect(ProcessorHandler::get(), &ProcessorHandler::reqProcessorReset, this, &IOManager::refreshMemoryMap);
+ connect(ProcessorHandler::get(), &ProcessorHandler::processorReset, this, &IOManager::refreshMemoryMap);
refreshMemoryMap();
}

MODIFY
src/processorhandler.h
src/processorhandler.h
@@ -149,13 +149,6 @@ signals:
*/
void processorChanged();
- /**
- * @brief reqProcessorReset
- * Emitted whenever changes to the internal state of the processor has been made, and a reset of any depending
- * widgets is required
- */
- void reqProcessorReset();
-
/**
* @brief exit
* end the current simulation, disallowing further clocking of the processor unless the processor is reset.

MODIFY
test/tst_cosimulate.cpp
test/tst_cosimulate.cpp
#include "processorregistry.h"
#include "edittab.h"
+#include "ripessettings.h"
/**
* Ripes co-simulation
@@ -249,14 +250,16 @@ const Trace& tst_Cosimulate::generateReferenceTrace(const QStringList& extension
* once in Ripes, due to the static nature of the ProcessorHandler.
*/
void tst_Cosimulate::cosimulate(const ProcessorID& id, const QStringList& extensions) {
+ // Connect the global reset request signal to directly resetting the processor
+ connect(RipesSettings::getObserver(RIPES_GLOBALSIGNAL_REQRESET), &SettingObserver::modified,
+ [=] { ProcessorHandler::get()->getProcessorNonConst()->reset(); });
+
m_loader = new EditTab(new QToolBar(), nullptr);
connect(m_loader, &EditTab::programChanged, ProcessorHandler::get(), &ProcessorHandler::loadProgram);
for (const auto& test : s_testFiles) {
m_currentTest = test;
- connect(ProcessorHandler::get(), &ProcessorHandler::reqProcessorReset,
- [=] { ProcessorHandler::get()->getProcessorNonConst()->reset(); });
// Override the ProcessorHandler's ECALL handling. In doing so, we verify whether the correct test value was
// reached.
ProcessorHandler::get()->getProcessorNonConst()->handleSysCall.Connect(this, &tst_Cosimulate::handleSysCall);
@@ -264,6 +267,7 @@ void tst_Cosimulate::cosimulate(const ProcessorID& id, const QStringList& extens
std::cout << test.filepath.toStdString() << std::endl;
auto referenceTrace = generateReferenceTrace(extensions);
ProcessorHandler::get()->selectProcessor(id, extensions);
+ RipesSettings::getObserver(RIPES_GLOBALSIGNAL_REQRESET)->trigger();
Trace trace;
std::cout << "Cosimulating... " << std::flush;

MODIFY
test/tst_riscv.cpp
test/tst_riscv.cpp
#include "processorhandler.h"
#include "processorregistry.h"
+#include "ripessettings.h"
#include "assembler/rv32i_assembler.h"
@@ -143,6 +144,10 @@ QString tst_RISCV::executeSimulator() {
}
void tst_RISCV::runTests(const ProcessorID& id) {
+ // Connect the global reset request signal to directly resetting the processor
+ connect(RipesSettings::getObserver(RIPES_GLOBALSIGNAL_REQRESET), &SettingObserver::modified,
+ [=] { ProcessorHandler::get()->getProcessorNonConst()->reset(); });
+
const auto dir = QDir(s_testdir);
const auto testFiles = dir.entryList({"*.s"});
const auto extensions = QStringList("M");
@@ -172,14 +177,12 @@ void tst_RISCV::runTests(const ProcessorID& id) {
}
auto spProgram = std::make_shared<Program>(program.program);
- connect(ProcessorHandler::get(), &ProcessorHandler::reqProcessorReset,
- [=] { ProcessorHandler::getProcessorNonConst()->reset(); });
-
ProcessorHandler::selectProcessor(id, extensions);
// Override the ProcessorHandler's ECALL handling. In doing so, we verify whether the correct test value was
// reached.
ProcessorHandler::getProcessorNonConst()->handleSysCall.Connect(this, &tst_RISCV::handleSysCall);
ProcessorHandler::get()->loadProgram(spProgram);
+ RipesSettings::getObserver(RIPES_GLOBALSIGNAL_REQRESET)->trigger();
const QString err = executeSimulator();
if (!err.isNull()) {

Remove unused ReqProcessorReset signal from ProcessorHandler