diff options
author | bd <bdunahu@operationnull.com> | 2025-04-25 21:19:10 -0400 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2025-04-25 21:19:10 -0400 |
commit | f3e6d5ed8acdeb3f5eccffb5aeeab2e7b040908c (patch) | |
tree | 347eca77379539a027ebec9ed206a45031c9e371 /gui/worker.cc | |
parent | a3528b83dd10fa9cdf7ef5635f615c1b295f3f4c (diff) |
Separate update method for worker into its own method
Diffstat (limited to 'gui/worker.cc')
-rw-r--r-- | gui/worker.cc | 16 |
1 files changed, 10 insertions, 6 deletions
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()); |