From f3e6d5ed8acdeb3f5eccffb5aeeab2e7b040908c Mon Sep 17 00:00:00 2001 From: bd Date: Fri, 25 Apr 2025 21:19:10 -0400 Subject: Separate update method for worker into its own method --- gui/worker.cc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'gui/worker.cc') diff --git a/gui/worker.cc b/gui/worker.cc index 203f907..22f8738 100644 --- a/gui/worker.cc +++ b/gui/worker.cc @@ -69,24 +69,28 @@ void Worker::configure( delete old; this->ct_mutex.unlock(); - emit clock_cycles(this->ct->get_clock_cycle(), this->ct->get_pc()); + this->update(); } void Worker::runSteps(int steps) { - unsigned long i; - - this->ct_mutex.lock(); qDebug() << "Running for " << steps << "steps"; this->ct->run_for(steps); + this->update(); +} - // TODO move these to separate functions +void Worker::update() +{ + unsigned long i; + + this->ct_mutex.lock(); emit register_storage(this->ct->get_gprs()); emit storage(this->s.at(0)->view(0, 255), 1); for (i = 1; i < s.size(); ++i) - emit storage(this->s.at(i - 1)->view(0, 1 << this->size_inc * i), i + 1); + emit storage( + this->s.at(i - 1)->view(0, 1 << this->size_inc * i), i + 1); emit clock_cycles(this->ct->get_clock_cycle(), this->ct->get_pc()); emit if_info(this->if_stage->get_instr()); -- cgit v1.2.3