Update processor run-mode to use VSRTLWidget running
VSRTLWidget now has support for asynchronously running a design.
Furthermore, VSRTLWidget running adds aditional logic for ensuring that
the VSRTL View is up to date with the simulated design after finishing a
run.
MODIFY
external/VSRTL
external/VSRTL
-Subproject commit 6f33e49337f01fffbad78a83718c5222ac27fb37
+Subproject commit 7078fcfaa4746ecce1c70eac559103a73fe4394c

MODIFY
src/processorhandler.cpp
src/processorhandler.cpp
@@ -67,19 +67,25 @@ const vsrtl::core::SparseArray& ProcessorHandler::getRegisters() const {
void ProcessorHandler::run() {
emit runStarted();
- auto future = QtConcurrent::run([=] {
- m_currentProcessor->setEnableSignals(false);
+ /** We create a cycleFunctor for running the design which will stop further running of the design when:
+ * - The user has stopped running the processor (m_stopRunningFlag)
+ * - the processor has finished executing
+ * - the processor has hit a breakpoint
+ */
+ const auto& cycleFunctor = [=] {
bool stopRunning = m_stopRunningFlag;
- while (!stopRunning) {
- m_currentProcessor->clock();
ProcessorHandler::get()->checkValidExecutionRange();
stopRunning |=
ProcessorHandler::get()->checkBreakpoint() || m_currentProcessor->finished() || m_stopRunningFlag;
+
+ if (stopRunning) {
+ m_vsrtlWidget->stop();
}
- m_currentProcessor->setEnableSignals(true);
- });
- m_runWatcher.setFuture(future);
+ };
+
+ // Start running through the VSRTL Widget interface
connect(&m_runWatcher, &QFutureWatcher<void>::finished, this, &ProcessorHandler::runFinished);
+ m_runWatcher.setFuture(m_vsrtlWidget->run(cycleFunctor));
}
void ProcessorHandler::setBreakpoint(const uint32_t address, bool enabled) {
@@ -91,6 +97,7 @@ void ProcessorHandler::setBreakpoint(const uint32_t address, bool enabled) {
}
void ProcessorHandler::loadProcessorToWidget(vsrtl::VSRTLWidget* widget) {
+ m_vsrtlWidget = widget;
widget->setDesign(m_currentProcessor.get());
}

MODIFY
src/processorhandler.h
src/processorhandler.h
@@ -166,6 +166,12 @@ private:
ProcessorID m_currentID = ProcessorID::RV5S;
std::unique_ptr<vsrtl::core::RipesProcessor> m_currentProcessor;
+ /**
+ * @brief m_vsrtlWidget
+ * The VSRTL Widget associated which the processor models will be loaded to
+ */
+ vsrtl::VSRTLWidget* m_vsrtlWidget = nullptr;
+
std::set<uint32_t> m_breakpoints;
const Program* m_program = nullptr;

Update processor run-mode to use VSRTLWidget running

VSRTLWidget now has support for asynchronously running a design.
Furthermore, VSRTLWidget running adds aditional logic for ensuring that
the VSRTL View is up to date with the simulated design after finishing a
run.