Skip to content

Commit

Permalink
refactor: Move halt out of dcsr
Browse files Browse the repository at this point in the history
Suggested in #1816 (review).
  • Loading branch information
YenHaoChen committed Sep 27, 2024
1 parent 666da33 commit 871d945
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion riscv/csrs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1345,7 +1345,6 @@ dcsr_csr_t::dcsr_csr_t(processor_t* const proc, const reg_t addr):
ebreaku(false),
ebreakvs(false),
ebreakvu(false),
halt(false),
v(false),
cause(0),
ext_cause(0),
Expand Down
1 change: 0 additions & 1 deletion riscv/csrs.h
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,6 @@ class dcsr_csr_t: public csr_t {
bool ebreaku;
bool ebreakvs;
bool ebreakvu;
bool halt;
bool v;
uint8_t cause;
uint8_t ext_cause;
Expand Down
4 changes: 2 additions & 2 deletions riscv/execute.cc
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ void processor_t::step(size_t n)
enter_debug_mode(DCSR_CAUSE_DEBUGINT, 0);
} else if (halt_request == HR_GROUP) {
enter_debug_mode(DCSR_CAUSE_GROUP, 0);
} else if (state.dcsr->halt) {
state.dcsr->halt = false;
} else if (halt) {
halt = false;
enter_debug_mode(DCSR_CAUSE_HALT, 0);
}
}
Expand Down
2 changes: 1 addition & 1 deletion riscv/processor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ void processor_t::reset()
{
xlen = isa.get_max_xlen();
state.reset(this, isa.get_max_isa());
state.dcsr->halt = halt_on_reset;
halt = halt_on_reset;
halt_on_reset = false;
if (any_vector_extensions())
VU.reset();
Expand Down
1 change: 1 addition & 0 deletions riscv/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ class processor_t : public abstract_device_t
FILE *log_file;
std::ostream sout_; // needed for socket command interface -s, also used for -d and -l, but not for --log
bool halt_on_reset;
bool halt;
bool in_wfi;
bool check_triggers_icount;
std::vector<bool> impl_table;
Expand Down

0 comments on commit 871d945

Please sign in to comment.