diff options
author | Siddarth Suresh <155843085+SiddarthSuresh98@users.noreply.github.com> | 2025-04-29 20:44:17 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-29 20:44:17 -0400 |
commit | be6b637d564e20608f7d96a039462951c3ca7f61 (patch) | |
tree | 4e00862339df317100ce5e9e66e2cb199146bf96 | |
parent | 32a1762b3b9091f6e2d553601f3e3a3a5d87b889 (diff) | |
parent | de05860b750f00e6f9c16144d8949add66f1a785 (diff) |
Merge pull request #77 from bdunahu/bdunahu
Fix vector register display from accessing oobs, REM instr display
-rw-r--r-- | gui/gui.h | 47 | ||||
-rw-r--r-- | gui/registerview.cc | 4 |
2 files changed, 27 insertions, 24 deletions
@@ -72,7 +72,9 @@ class GUI : public QMainWindow void onWorkerShowStorage(const QVector<QVector<int>> &data, int i); - void onWorkerShowRegisters(const QVector<signed int> &gprs, const QVector<QVector<signed int>> &vrs); + void onWorkerShowRegisters( + const QVector<signed int> &gprs, + const QVector<QVector<signed int>> &vrs); void on_upload_intructions_btn_clicked(); @@ -140,32 +142,35 @@ class GUI : public QMainWindow /** * The possible step slider values. */ - QVector<long> step_values = {1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000, 10000000000}; + QVector<long> step_values = {1, 10, 100, 1000, + 10000, 100000, 1000000, 10000000, + 100000000, 1000000000, 10000000000}; QThread workerThread; Worker *worker; const std::map<Mnemonic, QString> mnemonicNameMap = { - {Mnemonic::ADD, "ADD"}, {Mnemonic::SUB, "SUB"}, - {Mnemonic::MUL, "MUL"}, {Mnemonic::QUOT, "QUOT"}, - {Mnemonic::SFTR, "SFTR"}, {Mnemonic::SFTL, "SFTL"}, - {Mnemonic::AND, "AND"}, {Mnemonic::OR, "OR"}, - {Mnemonic::NOT, "NOT"}, {Mnemonic::XOR, "XOR"}, - {Mnemonic::ADDV, "ADDV"}, {Mnemonic::SUBV, "SUBV"}, - {Mnemonic::MULV, "MULV"}, {Mnemonic::DIVV, "DIVV"}, - {Mnemonic::CMP, "CMP"}, {Mnemonic::CEV, "CEV"}, - {Mnemonic::LOAD, "LOAD"}, {Mnemonic::LOADV, "LOADV"}, - {Mnemonic::ADDI, "ADDI"}, {Mnemonic::SUBI, "SUBI"}, - {Mnemonic::SFTRI, "SFTRI"}, {Mnemonic::SFTLI, "SFTLI"}, - {Mnemonic::ANDI, "ANDI"}, {Mnemonic::ORI, "ORI"}, - {Mnemonic::XORI, "XORI"}, {Mnemonic::STORE, "STORE"}, - {Mnemonic::STOREV, "STOREV"}, {Mnemonic::JMP, "JMP"}, - {Mnemonic::JRL, "JRL"}, {Mnemonic::JAL, "JAL"}, - {Mnemonic::BEQ, "BEQ"}, {Mnemonic::BGT, "BGT"}, - {Mnemonic::BUF, "BUF"}, {Mnemonic::BOF, "BOF"}, - {Mnemonic::PUSH, "PUSH"}, {Mnemonic::POP, "POP"}, - {Mnemonic::NOP, "NOP"}, {Mnemonic::RET, "RET"}, + {Mnemonic::ADD, "ADD"}, {Mnemonic::SUB, "SUB"}, + {Mnemonic::MUL, "MUL"}, {Mnemonic::QUOT, "QUOT"}, + {Mnemonic::REM, "REM"}, {Mnemonic::SFTR, "SFTR"}, + {Mnemonic::SFTL, "SFTL"}, {Mnemonic::AND, "AND"}, + {Mnemonic::OR, "OR"}, {Mnemonic::NOT, "NOT"}, + {Mnemonic::XOR, "XOR"}, {Mnemonic::ADDV, "ADDV"}, + {Mnemonic::SUBV, "SUBV"}, {Mnemonic::MULV, "MULV"}, + {Mnemonic::DIVV, "DIVV"}, {Mnemonic::CMP, "CMP"}, + {Mnemonic::CEV, "CEV"}, {Mnemonic::LOAD, "LOAD"}, + {Mnemonic::LOADV, "LOADV"}, {Mnemonic::ADDI, "ADDI"}, + {Mnemonic::SUBI, "SUBI"}, {Mnemonic::SFTRI, "SFTRI"}, + {Mnemonic::SFTLI, "SFTLI"}, {Mnemonic::ANDI, "ANDI"}, + {Mnemonic::ORI, "ORI"}, {Mnemonic::XORI, "XORI"}, + {Mnemonic::STORE, "STORE"}, {Mnemonic::STOREV, "STOREV"}, + {Mnemonic::JMP, "JMP"}, {Mnemonic::JRL, "JRL"}, + {Mnemonic::JAL, "JAL"}, {Mnemonic::BEQ, "BEQ"}, + {Mnemonic::BGT, "BGT"}, {Mnemonic::BUF, "BUF"}, + {Mnemonic::BOF, "BOF"}, {Mnemonic::PUSH, "PUSH"}, + {Mnemonic::POP, "POP"}, {Mnemonic::NOP, "NOP"}, + {Mnemonic::RET, "RET"}, }; QString mnemonicToString(Mnemonic mnemonic) { diff --git a/gui/registerview.cc b/gui/registerview.cc index b4fdefc..b8251ac 100644 --- a/gui/registerview.cc +++ b/gui/registerview.cc @@ -40,7 +40,7 @@ QVariant RegisterView::data(const QModelIndex &i, int role) const return QVariant(); } - return this->vrs[i.row() - GPR_NUM][i.column() - GPR_NUM]; + return this->vrs[i.row() - GPR_NUM][i.column()]; } QVariant @@ -69,5 +69,3 @@ void RegisterView::set_data(const QVector<int> &gprs, const QVector<QVector<int> this->vrs = vrs; endResetModel(); } - - |