summaryrefslogtreecommitdiff
path: root/src/sim/stage.cc
diff options
context:
space:
mode:
authorSiddarth Suresh <155843085+SiddarthSuresh98@users.noreply.github.com>2025-03-30 21:30:17 -0400
committerGitHub <noreply@github.com>2025-03-30 21:30:17 -0400
commit52e1ca72925444b8e5a9bb5b240a4063a4d7b958 (patch)
treebfd8e383eedbd40f5c9067e04734f62ed6ccab23 /src/sim/stage.cc
parent12a9e93f913c0057f2ef32f5894931c8b4bd3a85 (diff)
parent6a15f66bef28de9e1b982c3adda4d9b75c818852 (diff)
Merge pull request #42 from bdunahu/bdunahu
Add tests for EX, rest of (non-vector) instructions
Diffstat (limited to 'src/sim/stage.cc')
-rw-r--r--src/sim/stage.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/sim/stage.cc b/src/sim/stage.cc
index 929a4b9..2c03741 100644
--- a/src/sim/stage.cc
+++ b/src/sim/stage.cc
@@ -21,6 +21,14 @@ Storage *Stage::storage;
bool Stage::is_pipelined;
int Stage::clock_cycle;
+bool Stage::get_condition(CC c) {
+ return (this->gprs[3] >> c) & 1;
+}
+
+void Stage::set_pc(unsigned int pc) {
+ this->pc = pc;
+}
+
InstrDTO *Stage::advance(Response p)
{
InstrDTO *r = nullptr;
@@ -45,15 +53,11 @@ InstrDTO *Stage::advance(Response p)
void Stage::set_condition(CC c, bool v)
{
if (v)
- this->gprs[3] = this->gprs[3] & 1 << c;
+ this->gprs[3] = this->gprs[3] | 1 << c;
else
this->gprs[3] = this->gprs[3] & ~(1 << c);
}
-bool Stage::get_condition(CC c) {
- return (this->gprs[3] >> c) & 1;
-}
-
signed int Stage::dereference_register(signed int v)
{
signed int r;