From 6579f7272905d1e25b43ef051da6c2180e60ca2b Mon Sep 17 00:00:00 2001 From: bd Date: Tue, 1 Apr 2025 00:49:52 -0400 Subject: Ensure all stages only do work if they are not 'OK' --- src/sim/id.cc | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'src/sim/id.cc') diff --git a/src/sim/id.cc b/src/sim/id.cc index 0b75b64..4a55d04 100644 --- a/src/sim/id.cc +++ b/src/sim/id.cc @@ -48,22 +48,19 @@ void ID::advance_helper() Mnemonic m; Type t; - // it may be good to ensure we are not doing - // work that has already been done - if (this->curr_instr && this->curr_instr->get_mnemonic() == NONE) { - s1 = curr_instr->get_instr_bits(); - get_instr_fields(s1, s2, s3, m ,t); - if (this->status == OK) { - curr_instr->set_s1(s1); - curr_instr->set_s2(s2); - curr_instr->set_s3(s3); - curr_instr->set_mnemonic(m); - curr_instr->set_type(t); - } + s1 = curr_instr->get_instr_bits(); + get_instr_fields(s1, s2, s3, m, t); + if (this->status == OK) { + curr_instr->set_s1(s1); + curr_instr->set_s2(s2); + curr_instr->set_s3(s3); + curr_instr->set_mnemonic(m); + curr_instr->set_type(t); } } -void ID::get_instr_fields(signed int &s1, signed int &s2, signed int &s3, Mnemonic &m, Type &t) +void ID::get_instr_fields( + signed int &s1, signed int &s2, signed int &s3, Mnemonic &m, Type &t) { unsigned int type; this->split_instr(s1, type, m); -- cgit v1.2.3