summaryrefslogtreecommitdiff
path: root/gui/worker.cc
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-04-26 03:06:14 -0400
committerbd <bdunahu@operationnull.com>2025-04-26 03:06:14 -0400
commitc98a0c26c4ccb5c4ae0e9f5810be910a7b299037 (patch)
tree25ee156ab0922694fa795ba6085749bcfcc157e7 /gui/worker.cc
parent858a682d11cef5b7695050967b1c6b184eda3c6a (diff)
Add proper tables display for storage devices
Diffstat (limited to 'gui/worker.cc')
-rw-r--r--gui/worker.cc20
1 files changed, 17 insertions, 3 deletions
diff --git a/gui/worker.cc b/gui/worker.cc
index a0e21f6..6419b73 100644
--- a/gui/worker.cc
+++ b/gui/worker.cc
@@ -83,11 +83,10 @@ void Worker::update()
this->ct_mutex.lock();
emit register_storage(this->ct->get_gprs());
- emit storage(this->s.at(0)->view(0, 255), 1);
+ emit storage(this->data_to_QT(this->s.at(0)->get_data()), 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->data_to_QT(this->s.at(i - 1)->get_data()), i + 1);
emit clock_cycles(this->ct->get_clock_cycle(), this->ct->get_pc());
emit if_info(this->if_stage->get_instr());
@@ -97,3 +96,18 @@ void Worker::update()
emit wb_info(this->wb_stage->get_instr());
this->ct_mutex.unlock();
}
+
+QVector<QVector<int>>
+Worker::data_to_QT(std::vector<std::array<signed int, LINE_SIZE>> data)
+{
+ QVector<QVector<int>> r;
+ QVector<int> tmp;
+
+ r.reserve(static_cast<int>(data.size()));
+
+ for (const auto &line : data) {
+ tmp = QVector<int>(line.begin(), line.end());
+ r.append(tmp);
+ }
+ return r;
+}