summaryrefslogtreecommitdiff
path: root/src/sim/stage.cc
diff options
context:
space:
mode:
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;