'Run' processor through ProcessorHandler
Removes another level of dependency on VSRTLWidget
MODIFY
src/processorhandler.cpp
src/processorhandler.cpp
@@ -146,19 +146,6 @@ void ProcessorHandler::_clock() {
void ProcessorHandler::_run() {
ProcessorStatusManager::setStatus("Running...");
emit runStarted();
- /** 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;
- stopRunning |= _checkBreakpoint() || m_currentProcessor->finished() || m_stopRunningFlag;
-
- if (stopRunning) {
- m_vsrtlWidget->stop();
- }
- };
// Start running through the VSRTL Widget interface
connect(&m_runWatcher, &QFutureWatcher<void>::finished, [=] {
@@ -167,7 +154,22 @@ void ProcessorHandler::_run() {
});
connect(&m_runWatcher, &QFutureWatcher<void>::finished, [=] { ProcessorStatusManager::clearStatus(); });
- m_runWatcher.setFuture(m_vsrtlWidget->run(cycleFunctor));
+ m_runWatcher.setFuture(QtConcurrent::run([=] {
+ auto* vsrtl_proc = dynamic_cast<vsrtl::SimDesign*>(m_currentProcessor.get());
+
+ if (vsrtl_proc) {
+ vsrtl_proc->setEnableSignals(false);
+ }
+
+ while (!(_checkBreakpoint() || m_currentProcessor->finished() || m_stopRunningFlag)) {
+ m_currentProcessor->clockProcessor();
+ }
+
+ if (vsrtl_proc) {
+ vsrtl_proc->setEnableSignals(true);
+ }
+ emit runFinished();
+ }));
}
void ProcessorHandler::_setBreakpoint(const AInt address, bool enabled) {

'Run' processor through ProcessorHandler

Removes another level of dependency on VSRTLWidget