diff options
author | bd <bdunaisky@umass.edu> | 2025-04-28 03:44:42 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-28 03:44:42 +0000 |
commit | 013a79547aa465872d0262b2f5c24e73f9556869 (patch) | |
tree | 28cc8f2ea6e5aa1a74f328de8594b0ad5995fa66 /gui/worker.h | |
parent | 5653b2a033e7a4173d2f178b5ce52384666d3d7b (diff) | |
parent | 336faf3fd701aaf962613abd1ff0a69cbdf021ce (diff) |
Merge pull request #69 from bdunahu/vector_ext
Vector ext
Diffstat (limited to 'gui/worker.h')
-rw-r--r-- | gui/worker.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/gui/worker.h b/gui/worker.h index c62f4ed..2a362a4 100644 --- a/gui/worker.h +++ b/gui/worker.h @@ -64,14 +64,15 @@ class Worker : public QObject signals: void clock_cycles(int value, int pc); - void - storage(QVector<QVector<int>> data, int i); - void register_storage(const std::array<int, GPR_NUM> data); + void storage(QVector<QVector<int>> data, int i); + void register_storage( + QVector<signed int> gprs, QVector<QVector<signed int>> vrs); void if_info(const InstrDTO *); void id_info(const InstrDTO *); void ex_info(const InstrDTO *); void mm_info(const InstrDTO *); void wb_info(const InstrDTO *); + void steps_done(); void finished(); private: @@ -80,8 +81,21 @@ class Worker : public QObject * @param the original data * @return a less universal version of the same thing */ + template <size_t N> QVector<QVector<int>> - data_to_QT(std::vector<std::array<signed int, LINE_SIZE>> data); + data_to_QT(const std::vector<std::array<signed int, N>> &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; + } /** * Sets the GUI signals to update the storage, clock cycle, and stage * displays. |