aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtul Khare <atulkhare@rivosinc.com>2023-05-17 12:58:27 -0700
committerAtul Khare <atulkhare@rivosinc.com>2023-05-17 12:58:27 -0700
commitba1c96472293576c851d37dfeb9adb38fa2e2983 (patch)
tree293da8d2523b4552b9f08319ad653c24fcf4088f
parentd61addf174f9448b44237b02dbe36252908ad422 (diff)
downloadspike-ba1c96472293576c851d37dfeb9adb38fa2e2983.zip
spike-ba1c96472293576c851d37dfeb9adb38fa2e2983.tar.gz
spike-ba1c96472293576c851d37dfeb9adb38fa2e2983.tar.bz2
Add last_v to processor state
This adds the last_v field to track the previous virtual mode state. It will be used in a forthcoming patch for trigger matching.
-rw-r--r--riscv/execute.cc1
-rw-r--r--riscv/processor.cc1
-rw-r--r--riscv/processor.h1
3 files changed, 3 insertions, 0 deletions
diff --git a/riscv/execute.cc b/riscv/execute.cc
index 4284198..81e031b 100644
--- a/riscv/execute.cc
+++ b/riscv/execute.cc
@@ -20,6 +20,7 @@ static void commit_log_stash_privilege(processor_t* p)
state->last_inst_priv = state->prv;
state->last_inst_xlen = p->get_xlen();
state->last_inst_flen = p->get_flen();
+ state->last_v = state->v;
}
static void commit_log_print_value(FILE *log_file, int width, const void *data)
diff --git a/riscv/processor.cc b/riscv/processor.cc
index 74a0b8f..984b9e5 100644
--- a/riscv/processor.cc
+++ b/riscv/processor.cc
@@ -527,6 +527,7 @@ void state_t::reset(processor_t* const proc, reg_t max_isa)
last_inst_priv = 0;
last_inst_xlen = 0;
last_inst_flen = 0;
+ last_v = false;
}
void processor_t::set_debug(bool value)
diff --git a/riscv/processor.h b/riscv/processor.h
index 1b74cc2..914bd45 100644
--- a/riscv/processor.h
+++ b/riscv/processor.h
@@ -175,6 +175,7 @@ struct state_t
reg_t last_inst_priv;
int last_inst_xlen;
int last_inst_flen;
+ bool last_v;
};
// this class represents one processor in a RISC-V machine.