From 48c22ab751d2c0778611147e801d58c491231243 Mon Sep 17 00:00:00 2001 From: Tim Hutt Date: Thu, 19 Dec 2024 17:00:03 +0000 Subject: [PATCH] Remove obsolete z_set_Misa functions This appears to be an obsolete and unused mechanism of disabling extensions by calling into the model to modify `misa`. Now it is done by `sys_enable_` callbacks. --- Makefile | 6 ++---- c_emulator/riscv_sail.h | 4 ---- c_emulator/riscv_sim.c | 4 ---- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 607d3eee8..3d353ab59 100644 --- a/Makefile +++ b/Makefile @@ -242,11 +242,9 @@ cloc: gcovr: gcovr -r . --html --html-detail -o index.html -c_preserve_fns=-c_preserve _set_Misa_C - generated_definitions/c/riscv_model_$(ARCH).c: $(SAIL_SRCS) model/main.sail Makefile mkdir -p generated_definitions/c - $(SAIL) $(SAIL_FLAGS) $(c_preserve_fns) -O -Oconstant_fold -memo_z3 -c -c_include riscv_prelude.h -c_include riscv_platform.h -c_no_main $(SAIL_SRCS) model/main.sail -o $(basename $@) + $(SAIL) $(SAIL_FLAGS) -O -Oconstant_fold -memo_z3 -c -c_include riscv_prelude.h -c_include riscv_platform.h -c_no_main $(SAIL_SRCS) model/main.sail -o $(basename $@) generated_definitions/c2/riscv_model_$(ARCH).c: $(SAIL_SRCS) model/main.sail Makefile mkdir -p generated_definitions/c2 @@ -282,7 +280,7 @@ rvfi_preserve_fns=-c_preserve rvfi_set_instr_packet \ # sed -i isn't posix compliant, unfortunately generated_definitions/c/riscv_rvfi_model_$(ARCH).c: $(SAIL_RVFI_SRCS) model/main.sail Makefile mkdir -p generated_definitions/c - $(SAIL) $(c_preserve_fns) $(rvfi_preserve_fns) $(SAIL_FLAGS) -O -Oconstant_fold -memo_z3 -c -c_include riscv_prelude.h -c_include riscv_platform.h -c_no_main $(SAIL_RVFI_SRCS) model/main.sail -o $(basename $@) + $(SAIL) $(rvfi_preserve_fns) $(SAIL_FLAGS) -O -Oconstant_fold -memo_z3 -c -c_include riscv_prelude.h -c_include riscv_platform.h -c_no_main $(SAIL_RVFI_SRCS) model/main.sail -o $(basename $@) sed -e '/^[[:space:]]*$$/d' $@ > $@.new mv $@.new $@ diff --git a/c_emulator/riscv_sail.h b/c_emulator/riscv_sail.h index da29c2ba9..abaad4e6d 100644 --- a/c_emulator/riscv_sail.h +++ b/c_emulator/riscv_sail.h @@ -19,10 +19,6 @@ bool zstep(sail_int); unit ztick_clock(unit); unit ztick_platform(unit); -unit z_set_Misa_C(struct zMisa *, mach_bits); -unit z_set_Misa_D(struct zMisa *, mach_bits); -unit z_set_Misa_F(struct zMisa *, mach_bits); - #ifdef RVFI_DII unit zext_rvfi_init(unit); unit zrvfi_set_instr_packet(mach_bits); diff --git a/c_emulator/riscv_sim.c b/c_emulator/riscv_sim.c index 8ffe60026..f394588e8 100644 --- a/c_emulator/riscv_sim.c +++ b/c_emulator/riscv_sim.c @@ -680,10 +680,6 @@ void init_sail(uint64_t elf_entry) } else #endif init_sail_reset_vector(elf_entry); - - // this is probably unnecessary now; remove - if (!rv_enable_rvc) - z_set_Misa_C(&zmisa, 0); } /* reinitialize to clear state and memory, typically across tests runs */