diff options
author | bd <bdunaisky@umass.edu> | 2025-04-16 15:56:32 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-16 15:56:32 +0000 |
commit | b778ccc3e7c2f2ac3c4892a87f5269f342fd895f (patch) | |
tree | 481b94886edf89f3bf08d06b96092298d1cdbf8c /src | |
parent | 561f7a6e6c24b05383b6db86b48125ee80a8355f (diff) | |
parent | f9e5214e87a935e1311b886e44bdfe1f8bfbdf56 (diff) |
Merge pull request #51 from bdunahu/dev-sid
[WIP] Added pipeline to GUI
Diffstat (limited to 'src')
-rw-r--r-- | src/sim/id.cc | 9 | ||||
-rw-r--r-- | src/sim/if.cc | 9 | ||||
-rw-r--r-- | src/sim/stage.cc | 12 |
3 files changed, 30 insertions, 0 deletions
diff --git a/src/sim/id.cc b/src/sim/id.cc index 0c0be91..46694ad 100644 --- a/src/sim/id.cc +++ b/src/sim/id.cc @@ -142,3 +142,12 @@ void ID::decode_J_type(signed int &s1, signed int &s2, signed int &s3) this->status = this->read_guard(*&s1); } + +std::vector<int> ID::stage_info() { + std::vector<int> info; + if(this->curr_instr){ + info.push_back(this->curr_instr->get_pc()); + info.push_back(this->curr_instr->get_instr_bits()); + } + return info; +} diff --git a/src/sim/if.cc b/src/sim/if.cc index 4ab7f3e..fb49749 100644 --- a/src/sim/if.cc +++ b/src/sim/if.cc @@ -23,6 +23,15 @@ InstrDTO *IF::advance(Response p) return r; } +std::vector<int> IF::stage_info() { + std::vector<int> info; + if(this->curr_instr){ + info.push_back(this->curr_instr->get_pc()); + info.push_back(this->curr_instr->get_instr_bits()); + } + return info; +} + void IF::advance_helper() { Response r; diff --git a/src/sim/stage.cc b/src/sim/stage.cc index 2857e1f..8a570f0 100644 --- a/src/sim/stage.cc +++ b/src/sim/stage.cc @@ -53,6 +53,18 @@ InstrDTO *Stage::advance(Response p) return r; } +std::vector<int> Stage::stage_info() { + std::vector<int> info; + if(this->curr_instr){ + info.push_back(this->curr_instr->get_mnemonic()); + info.push_back(this->curr_instr->get_pc()); + info.push_back(this->curr_instr->get_s1()); + info.push_back(this->curr_instr->get_s2()); + info.push_back(this->curr_instr->get_s3()); + } + return info; + } + void Stage::set_condition(CC c, bool v) { if (v) |