aboutsummaryrefslogtreecommitdiff
path: root/fesvr
diff options
context:
space:
mode:
authorAbraham Gonzalez <abe.j.gonza@gmail.com>2023-10-09 21:42:11 -0700
committerGitHub <noreply@github.com>2023-10-09 21:42:11 -0700
commitc5eee7426d7c1eb987544ad03671173d228ca69a (patch)
tree7db35c06ca249c7dfd3bb5e788c57abd207fe39c /fesvr
parentd1efcdffffee57bab0fdbd2b377c6132b37556fd (diff)
downloadriscv-isa-sim-c5eee7426d7c1eb987544ad03671173d228ca69a.zip
riscv-isa-sim-c5eee7426d7c1eb987544ad03671173d228ca69a.tar.gz
riscv-isa-sim-c5eee7426d7c1eb987544ad03671173d228ca69a.tar.bz2
Update dtm.h with switch_to_* functions
Signed-off-by: Abraham Gonzalez <abe.j.gonza@gmail.com>
Diffstat (limited to 'fesvr')
-rw-r--r--fesvr/dtm.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/fesvr/dtm.h b/fesvr/dtm.h
index 1f5ee3e..f47b648 100644
--- a/fesvr/dtm.h
+++ b/fesvr/dtm.h
@@ -55,6 +55,12 @@ class dtm_t : public htif_t
void producer_thread();
+ void switch_to_host() {
+ // update the target with the current context
+ target = context_t::current();
+ host.switch_to();
+ }
+
protected:
virtual void read_chunk(addr_t taddr, size_t len, void* dst) override;
virtual void write_chunk(addr_t taddr, size_t len, const void* src) override;
@@ -74,6 +80,10 @@ class dtm_t : public htif_t
void resume(int);
uint32_t get_data_base() { return data_base; };
+ void switch_to_target() {
+ target->switch_to();
+ }
+
private:
context_t host;
context_t* target;