From 56f2eb3108911e4d6f561898710e9f6789b61394 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Wed, 18 Oct 2023 18:24:31 +0300 Subject: [PATCH] isa/caller: introduce use_syscall_emu parameter --- src/openpower/decoder/isa/caller.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/openpower/decoder/isa/caller.py b/src/openpower/decoder/isa/caller.py index 880f9eef..5a72880f 100644 --- a/src/openpower/decoder/isa/caller.py +++ b/src/openpower/decoder/isa/caller.py @@ -1167,10 +1167,11 @@ class ISACaller(ISACallerHelper, ISAFPHelpers, StepLoop): icachemmu=False, initial_fpscr=0, insnlog=None, - use_mmap_mem=False): + use_mmap_mem=False, + use_syscall_emu=False): + self.syscall = SyscallEmulator(isacaller=self) # trace log file for model output. if None do nothing - self.syscall = SyscallEmulator(isacaller=self) self.insnlog = insnlog self.insnlog_is_file = hasattr(insnlog, "write") if not self.insnlog_is_file and self.insnlog: @@ -1951,12 +1952,16 @@ class ISACaller(ISACallerHelper, ISAFPHelpers, StepLoop): kind=LogKind.InstrInOuts) if asmop in ("sc", "scv"): - identifier = self.gpr(0) - arguments = map(self.gpr, range(3, 9)) - result = self.syscall(identifier, *arguments) - self.gpr.write(3, result, False, self.namespace["XLEN"]) - self.update_pc_next() - return + if self.syscall is not None: + identifier = self.gpr(0) + arguments = map(self.gpr, range(3, 9)) + result = self.syscall(identifier, *arguments) + self.gpr.write(3, result, False, self.namespace["XLEN"]) + self.update_pc_next() + return + else: + self.call_trap(0x700, PIb.ILLEG) + return # sv.setvl is *not* a loop-function. sigh log("is_svp64_mode", self.is_svp64_mode, asmop) -- 2.30.2