diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/id.cc | 16 | ||||
-rw-r--r-- | src/if.cc | 9 | ||||
-rw-r--r-- | src/stage.cc | 27 |
3 files changed, 14 insertions, 38 deletions
@@ -65,7 +65,7 @@ void ID::write_vec_guard(signed int v, std::array<signed int, V_R_LIMIT> &vrs){ // keep track in the instrDTO for displaying to user and writeback // keep track in checked_out so we can still access this information! this->checked_out.push_back(v); - this->curr_instr->checked_out = v; + this->curr_instr->checked_out = v; } vrs = this->dereference_register<std::array<signed int, V_R_LIMIT>>(v); } @@ -131,7 +131,7 @@ Response ID::set_vlen(){ this->curr_instr->slot_A = V_R_LIMIT; } else { this->curr_instr->slot_A = vlen_reg; - } + } } return r; } @@ -223,7 +223,7 @@ void ID::decode_I_type(signed int &s1) // vector value to be stored r2 = this->read_vec_guard(s2,this->curr_instr->operands.load_store_vector.vector_register); r3 = this->set_vlen(); - + this->status = (r1 == OK && r2 == OK && r3 == OK) ? OK : STALLED; return; case LOADV: @@ -306,13 +306,3 @@ void ID::decode_J_type(signed int &s1) } } - -std::vector<int> ID::stage_info() -{ - std::vector<int> info; - if (this->curr_instr) { - info.push_back(this->curr_instr->is_squashed); - info.push_back(this->curr_instr->slot_A); - } - return info; -} @@ -37,15 +37,6 @@ 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->is_squashed); - info.push_back(this->curr_instr->slot_A); - } - return info; -} - void IF::advance_helper() { Response r; diff --git a/src/stage.cc b/src/stage.cc index 47e7e32..ac688d8 100644 --- a/src/stage.cc +++ b/src/stage.cc @@ -66,27 +66,22 @@ InstrDTO *Stage::advance(Response p) return r; } -bool Stage::is_vector_type(Mnemonic m){ - return (m == ADDV || m == SUBV || m == MULV || m == DIVV || m == CEV || m == LOADV || m == STOREV); -} - -bool Stage::is_logical(Mnemonic m){ - return (m == ANDI || m == ORI || m == XORI || m == AND || m == OR || m == XOR || m== NOT); +bool Stage::is_vector_type(Mnemonic m) +{ + return ( + m == ADDV || m == SUBV || m == MULV || m == DIVV || m == CEV || + m == LOADV || m == STOREV); } -std::vector<int> Stage::stage_info() +bool Stage::is_logical(Mnemonic m) { - std::vector<int> info; - if (this->curr_instr) { - info.push_back(this->curr_instr->mnemonic); - info.push_back(this->curr_instr->is_squashed); - info.push_back(this->curr_instr->operands.integer.slot_one); - info.push_back(this->curr_instr->operands.integer.slot_two); - info.push_back(this->curr_instr->operands.integer.slot_three); - } - return info; + return ( + m == ANDI || m == ORI || m == XORI || m == AND || m == OR || m == XOR || + m == NOT); } +InstrDTO *Stage::get_instr() { return this->curr_instr; } + void Stage::set_condition(CC c, bool v) { if (v) |